From fde66aa48082dd103122edbf42ad438c3f0dac37 Mon Sep 17 00:00:00 2001 From: kanarutsuda <–Kanaru.Tsuda@jp.ricoh.com> Date: Wed, 17 Jul 2024 14:00:18 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=8D=8A=E8=A7=92=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=AE=E7=82=BA=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E5=86=8D?= =?UTF-8?q?=E6=A7=8B=E7=AF=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/actions/validation-fullwidth.ts | 12 ++++++------ .../src/actions/validation-halfwidth.ts | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/plugin/kintone-addins/src/actions/validation-fullwidth.ts b/plugin/kintone-addins/src/actions/validation-fullwidth.ts index a24bb4b..633efab 100644 --- a/plugin/kintone-addins/src/actions/validation-fullwidth.ts +++ b/plugin/kintone-addins/src/actions/validation-fullwidth.ts @@ -1,12 +1,10 @@ import { actionAddins } from "."; import { IAction,IActionResult, IActionNode, IActionProperty, IField, IContext } from "../types/ActionTypes"; -//クラス名を設計書に揃える /** * アクションの属性定義 */ interface FullWidthProps{ - //checkOption:Array, field:IField } /** @@ -20,7 +18,6 @@ export class FullWidthAction implements IAction{ this.name="全角チェック"; /* pgadminのnameと同様 */ this.actionProps=[]; this.props={ - //checkOption:[], field:{code:''} } //アクションを登録する @@ -50,15 +47,17 @@ export class FullWidthAction implements IAction{ //条件分岐 //未入力時は何も処理をせず終了 if(value===undefined || value===''){ - return result; + record[this.props.field.code].error=null; } //半角が含まれていた場合resultがfalse - if(!this.containsFullWidthChars(value)){ + if(!this.containsFullWidthChars(value) && !(value === undefined || value ==='')){ //エラー時に出力される文字設定 record[this.props.field.code].error="半角が含まれています"; //次の処理を中止する値設定 result.canNext=false; - return result; + } + else{ + record[this.props.field.code].error=null; } //resultプロパティ指定 result= { @@ -79,6 +78,7 @@ export class FullWidthAction implements IAction{ containsFullWidthChars(text: string): boolean { // 半角英数字カナ記号を除外 + //全角かどうか const checkRegex="^[^\x01-\x7E\uFF61-\uFF9F]+$"; //正規表現オブジェクト生成 diff --git a/plugin/kintone-addins/src/actions/validation-halfwidth.ts b/plugin/kintone-addins/src/actions/validation-halfwidth.ts index a2d34c2..9a42c57 100644 --- a/plugin/kintone-addins/src/actions/validation-halfwidth.ts +++ b/plugin/kintone-addins/src/actions/validation-halfwidth.ts @@ -47,7 +47,7 @@ export class HalfWidthAction implements IAction{ //条件分岐 //未入力時は何も処理をせず終了 if(value===undefined || value===''){ - return result; + record[this.props.field.code].error=null; } //全角が含まれていた場合保存処理中止(エラー処理) if(!this.containsHalfWidthChars(value)){ @@ -55,7 +55,9 @@ export class HalfWidthAction implements IAction{ record[this.props.field.code].error="全角が含まれています"; //次の処理を中止する値設定 result.canNext=false; - return result; + } + else{ + record[this.props.field.code].error=null; } //半角の場合問題なく実行 //resultプロパティ指定