From 98fcd2eb470861e9d289ccbb91e616e145a47134 Mon Sep 17 00:00:00 2001 From: wtl Date: Mon, 27 May 2024 17:24:03 +0900 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E5=AD=97=E6=95=B0=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/kintone-addins/src/actions/counter-check.ts | 12 +++++------- plugin/kintone-addins/src/actions/mail-check.ts | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/plugin/kintone-addins/src/actions/counter-check.ts b/plugin/kintone-addins/src/actions/counter-check.ts index a2ca1ef..d5ebae1 100644 --- a/plugin/kintone-addins/src/actions/counter-check.ts +++ b/plugin/kintone-addins/src/actions/counter-check.ts @@ -43,18 +43,16 @@ export class StrCountCheckAciton implements IAction{ if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !('strExpression'in actionNode.ActionValue)) { return result } - - console.log(123); this.props = actionNode.ActionValue as IStrCountCheckProps; //条件式の計算結果を取得 const record = event.record; const value = record[this.props.field.code].value; - let str = value.length - record.count.value = str - const regex = new RegExp(this.props.strExpression); - if(!regex.test(value)){ - record[this.props.field.code].error > this.props.message.length ; + const strCheck = this.props.strExpression; + if(value === undefined || value === '' ){ + return result; + }else if(strCheck < value.length){ + record[this.props.field.code].error = this.props.message; }else{ result= { canNext:true, diff --git a/plugin/kintone-addins/src/actions/mail-check.ts b/plugin/kintone-addins/src/actions/mail-check.ts index 161421c..aadd553 100644 --- a/plugin/kintone-addins/src/actions/mail-check.ts +++ b/plugin/kintone-addins/src/actions/mail-check.ts @@ -55,12 +55,12 @@ export class MailCheckAction implements IAction { const value = record[this.props.field.code].value; if (emailAction?.props.modelValue === '厳格') { - if (!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value)) { + if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value)) { console.log('厳格'); record[this.props.field.code].error = this.props.message; } } else if (emailAction?.props.modelValue === 'ゆるめ') { - if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value)) { + if (!/^[^@]+@[^@]+$/.test(value)) { console.log('ゆるめ'); record[this.props.field.code].error = this.props.message;