addNewEmailCheck

This commit is contained in:
wtl
2024-05-21 16:12:40 +09:00
parent 5663c313ea
commit dda9b7adad
7 changed files with 26 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@@ -13,7 +13,7 @@ API_V1_AUTH_KEY = "X-Cybozu-Authorization"
DEPLOY_MODE = "DEV" #DEV,PROD DEPLOY_MODE = "DEV" #DEV,PROD
#DEPLOY_JS_URL = "https://ka-addin.azurewebsites.net/alc_runtime.js" #DEPLOY_JS_URL = "https://ka-addin.azurewebsites.net/alc_runtime.js"
DEPLOY_JS_URL = "https://3634-133-139-70-141.ngrok-free.app/alc_runtime.js" DEPLOY_JS_URL = "https://92dc-133-139-109-57.ngrok-free.app/alc_runtime.js"
KINTONE_FIELD_TYPE=["GROUP","GROUP_SELECT","CHECK_BOX","SUBTABLE","DROP_DOWN","USER_SELECT","RADIO_BUTTON","RICH_TEXT","LINK","REFERENCE_TABLE","CALC","TIME","NUMBER","ORGANIZATION_SELECT","FILE","DATETIME","DATE","MULTI_SELECT","SINGLE_LINE_TEXT","MULTI_LINE_TEXT"] KINTONE_FIELD_TYPE=["GROUP","GROUP_SELECT","CHECK_BOX","SUBTABLE","DROP_DOWN","USER_SELECT","RADIO_BUTTON","RICH_TEXT","LINK","REFERENCE_TABLE","CALC","TIME","NUMBER","ORGANIZATION_SELECT","FILE","DATETIME","DATE","MULTI_SELECT","SINGLE_LINE_TEXT","MULTI_LINE_TEXT"]

View File

@@ -1,3 +1,2 @@
# KAB_BACKEND_URL="https://kab-backend.azurewebsites.net/" # KAB_BACKEND_URL="https://kab-backend.azurewebsites.net/"
KAB_BACKEND_URL="http://127.0.0.1:8000/" KAB_BACKEND_URL="http://127.0.0.1:8000/"

View File

@@ -43,12 +43,15 @@ export class StrCountCheckAciton implements IAction{
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !('strExpression'in actionNode.ActionValue)) { if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !('strExpression'in actionNode.ActionValue)) {
return result return result
} }
console.log(123);
this.props = actionNode.ActionValue as IStrCountCheckProps; this.props = actionNode.ActionValue as IStrCountCheckProps;
//条件式の計算結果を取得 //条件式の計算結果を取得
const record = event.record; const record = event.record;
const value = record[this.props.field.code].value; const value = record[this.props.field.code].value;
let st = value.length let str = value.length
record.count.value = st record.count.value = str
const regex = new RegExp(this.props.strExpression); const regex = new RegExp(this.props.strExpression);
if(!regex.test(value)){ if(!regex.test(value)){
record[this.props.field.code].error > this.props.message.length ; record[this.props.field.code].error > this.props.message.length ;

View File

@@ -36,6 +36,8 @@ export class MailCheckAction implements IAction {
canNext: true, canNext: true,
result: false result: false
}; };
try { try {
//属性設定を取得する //属性設定を取得する
this.actionProps = actionNode.actionProps; this.actionProps = actionNode.actionProps;
@@ -45,6 +47,7 @@ export class MailCheckAction implements IAction {
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !!!emailAction) { if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !!!emailAction) {
return result return result
} }
console.log(actionNode);
this.props = actionNode.ActionValue as IMailCheckProps; this.props = actionNode.ActionValue as IMailCheckProps;
//条件式の計算結果を取得 //条件式の計算結果を取得
@@ -52,12 +55,16 @@ export class MailCheckAction implements IAction {
const value = record[this.props.field.code].value; const value = record[this.props.field.code].value;
if (emailAction?.props.modelValue === '厳格') { if (emailAction?.props.modelValue === '厳格') {
if (!new RegExp('^(([^<>()\[\]\\.,;:\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 (!/^(([^<>()[\]\\.,;:\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)) {
console.log('厳格');
record[this.props.field.code].error = this.props.message; record[this.props.field.code].error = this.props.message;
} }
} else if (emailAction?.props.modelValue === 'ゆるめ') { } else if (emailAction?.props.modelValue === 'ゆるめ') {
if (!new RegExp('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$').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; record[this.props.field.code].error = this.props.message;
} }
} else { } else {
result = { result = {
@@ -65,6 +72,7 @@ export class MailCheckAction implements IAction {
result: true result: true
} }
} }
console.log(record[this.props.field.code]);
return result; return result;
} catch (error) { } catch (error) {
event.error = error; event.error = error;

View File

@@ -8,7 +8,7 @@ import '../actions/button-add';
import '../actions/condition-action'; import '../actions/condition-action';
import '../actions/regular-check'; import '../actions/regular-check';
import '../actions/mail-check'; import '../actions/mail-check';
import '../actions/countercheck'; import '../actions/counter-check';
import { ActionFlow,IActionFlow, IActionResult,IContext } from "./ActionTypes"; import { ActionFlow,IActionFlow, IActionResult,IContext } from "./ActionTypes";
export class ActionProcess{ export class ActionProcess{

View File

@@ -15,8 +15,8 @@
/* Linting */ /* Linting */
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": false,
"noUnusedParameters": true, "noUnusedParameters": false,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"esModuleInterop": true "esModuleInterop": true
}, },