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_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"]

View File

@@ -1,3 +1,2 @@
# KAB_BACKEND_URL="https://kab-backend.azurewebsites.net/"
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)) {
return result
}
console.log(123);
this.props = actionNode.ActionValue as IStrCountCheckProps;
//条件式の計算結果を取得
const record = event.record;
const value = record[this.props.field.code].value;
let st = value.length
record.count.value = st
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 ;

View File

@@ -36,15 +36,18 @@ export class MailCheckAction implements IAction {
canNext: true,
result: false
};
try {
//属性設定を取得する
this.actionProps = actionNode.actionProps;
const emailAction = this.actionProps.find(obj => obj.props.name === 'emailcheck')
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !!! emailAction) {
if (!('field' in actionNode.ActionValue) && !('message' in actionNode.ActionValue) && !!!emailAction) {
return result
}
console.log(actionNode);
this.props = actionNode.ActionValue as IMailCheckProps;
//条件式の計算結果を取得
@@ -52,12 +55,16 @@ export class MailCheckAction implements IAction {
const value = record[this.props.field.code].value;
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;
}
} 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;
}
} else {
result = {
@@ -65,6 +72,7 @@ export class MailCheckAction implements IAction {
result: true
}
}
console.log(record[this.props.field.code]);
return result;
} catch (error) {
event.error = error;

View File

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

View File

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