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プロパティ指定