Merged PR 67: BUG540 値取得と値挿入の組合で、データを挿入できるよう修正 、BUG550・548 値取得と値挿入の組合で取得元の未入力の空白(’’)値のエラー修正
BUG540 値取得と値挿入の組合で、データを挿入できるよう修正 値挿入、ログインユーザー取得のコンポーネントから取得したユーザーオブジェクトを値挿入できるよう、コードを修正いたしました。 1.値の挿入先が「ユーザーフィールド」の場合、変数名だけで ユーザー名が挿入される。(内部的に 変数.codeを呼び出し、挿入) 2.値の挿入先が「文字列」など「ユーザーフィールド」以外の場合、 変数名だけで、何も指定がなければユーザー名が挿入される。(内部的に 変数.codeを呼び出し、挿入) 3.「変数.code」「変数.name」「変数.mail」などを入れていた場合は、その指定通りに挿入される。 4.また、値取得のコンポーネントで作成された、ユーザーオブジェクトに複数人設定されている場合は、複数人フィールドに挿入される BUG550・548 値取得と値挿入の組合で取得元の未入力の空白(’’)値のエラー修正 ・文字列1行、文字列複数行、リンクなどの文字列フィールドには、手入力の値も変数の値も、空白文字の混入や空文字の上書きを許可いたしました。その他のフィールドは、手入力の値とも変数の値も、入力エラー(空白文字の混入)がないことをチェックするコードを追加いたしました Related work items: #540, #548, #550
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import { each } from "jquery";
|
||||||
import { actionAddins } from ".";
|
import { actionAddins } from ".";
|
||||||
import { IAction,IActionResult, IActionNode, IActionProperty, IField, IContext } from "../types/ActionTypes";
|
import { IAction,IActionResult, IActionNode, IActionProperty, IField, IContext } from "../types/ActionTypes";
|
||||||
import { ConditionTree } from '../types/Conditions';
|
import { ConditionTree } from '../types/Conditions';
|
||||||
@@ -41,9 +42,13 @@ export class InsertValueAction implements IAction{
|
|||||||
* @param {string} inputValue - 挿入する値
|
* @param {string} inputValue - 挿入する値
|
||||||
* @return {boolean} -入力値が有効な日付形式の場合はtrueを返し、そうでない場合は例外を発生させる
|
* @return {boolean} -入力値が有効な日付形式の場合はtrueを返し、そうでない場合は例外を発生させる
|
||||||
*/
|
*/
|
||||||
checkInputBlank(fieldType :string | undefined,inputValue :string,fieldCode :string,fieldRequired :boolean | undefined,event :any): boolean{
|
checkInputValueBlank(fieldType :string | undefined,inputValueArray :any,fieldCode :string,fieldRequired :boolean | undefined,event :any): boolean{
|
||||||
|
|
||||||
|
let blankCheck;
|
||||||
//正規表現チェック
|
//正規表現チェック
|
||||||
let blankCheck= inputValue.match(/^(\s| )+?$/);//半角スペース・タブ文字・改行・改ページ・全角スペース
|
for(let i =0;i<inputValueArray.length;i++){
|
||||||
|
blankCheck = inputValueArray[i].match(/^(\s| )*$/);//空文字・半角スペース・タブ文字・改行・改ページ・全角スペース
|
||||||
|
}
|
||||||
|
|
||||||
if(blankCheck !== null){
|
if(blankCheck !== null){
|
||||||
//空白文字を空白文字が非対応のフィールドに挿入しようとしている場合、例外を発生させる
|
//空白文字を空白文字が非対応のフィールドに挿入しようとしている場合、例外を発生させる
|
||||||
@@ -62,6 +67,36 @@ export class InsertValueAction implements IAction{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空白文字の変数を非対応のフィールドに挿入しようとしていないか、必須項目フィールドに挿入しようとしていないかチェックする
|
||||||
|
* @param {string} inputValue - 挿入する値
|
||||||
|
* @return {boolean} -入力値が有効な日付形式の場合はtrueを返し、そうでない場合は例外を発生させる
|
||||||
|
*/
|
||||||
|
checkVariableValueBlank(fieldType :string | undefined,inputValueArray :any,fieldCode :string,fieldRequired :boolean | undefined,event :any): boolean{
|
||||||
|
|
||||||
|
let blankCheck;
|
||||||
|
//正規表現チェック
|
||||||
|
for(let i =0;i<inputValueArray.length;i++){
|
||||||
|
blankCheck = inputValueArray[i].match(/^(\s| )*$/);//空文字・半角スペース・タブ文字・改行・改ページ・全角スペース
|
||||||
|
}
|
||||||
|
|
||||||
|
if(blankCheck !== null){
|
||||||
|
//空白文字を空白文字が非対応のフィールドに挿入しようとしている場合、例外を発生させる
|
||||||
|
if(fieldType === "NUMBER" || fieldType === "DATE" || fieldType === "DATETIME" || fieldType === "TIME" || fieldType === "USER_SELECT"
|
||||||
|
|| fieldType === "ORGANIZATION_SELECT" || fieldType === "GROUP_SELECT" || fieldType === "RADIO_BUTTON" || fieldType === "DROP_DOWN" || fieldType === "CHECK_BOX" || fieldType === "MULTI_SELECT"){
|
||||||
|
event.record[fieldCode]['error'] = "「"+fieldCode+"」"+"に挿入しようとした、変数の値が空白・空白文字です。"; //レコードにエラーを表示
|
||||||
|
throw new Error("「"+fieldCode+"」"+"に挿入しようとした、変数の値が空白・空白文字です。「値を挿入する」コンポーネントの処理を中断しました。");
|
||||||
|
|
||||||
|
//空白文字を必須項目フィールドに挿入しようとしている場合、例外を発生させる
|
||||||
|
}else if(fieldRequired){
|
||||||
|
event.record[fieldCode]['error'] = "「"+fieldCode+"」"+"フィールドは必須項目であり、空白・空白文字の値の変数は、挿入できません。"; //レコードにエラーを表示
|
||||||
|
throw new Error("「"+fieldCode+"」"+"フィールドは必須項目であり、空白・空白文字の値の変数は、挿入できません。「値を挿入する」コンポーネントの処理を中断しました。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入力値が半角数字かチェックする関数
|
* 入力値が半角数字かチェックする関数
|
||||||
* @param {string} inputValue - 挿入する値
|
* @param {string} inputValue - 挿入する値
|
||||||
@@ -203,19 +238,27 @@ export class InsertValueAction implements IAction{
|
|||||||
* @param {string} inputValue - 挿入する値
|
* @param {string} inputValue - 挿入する値
|
||||||
* @return {string | boolean} 入力値が登録されているユーザー情報から見つかった場合、trueを返し、見つからなかった場合、falseを返す
|
* @return {string | boolean} 入力値が登録されているユーザー情報から見つかった場合、trueを返し、見つからなかった場合、falseを返す
|
||||||
*/
|
*/
|
||||||
async setInputUser(inputValue :string): Promise<string | boolean>{
|
async setInputUser(inputValue :any): Promise<any | boolean>{
|
||||||
|
|
||||||
//ユーザー名を格納する変数
|
//ユーザー名を格納する変数
|
||||||
let usersName;
|
let usersName = [];
|
||||||
const usersInfoColumnIndex=0;
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//APIでユーザー情報を取得する
|
//APIでユーザー情報を取得する
|
||||||
const resp =await kintone.api(kintone.api.url('/v1/users', true), 'GET', {codes:[inputValue ]})
|
const resp =await kintone.api(kintone.api.url('/v1/users', true), 'GET', {codes: inputValue.join(',')})
|
||||||
|
let usersInfo = resp.users;
|
||||||
|
|
||||||
//入力されたログイン名(メールアドレス)がユーザー情報に登録されている場合、そのユーザー名を取得する
|
if (usersInfo.length !== inputValue.length) {
|
||||||
if (resp.users[usersInfoColumnIndex].code === inputValue) {
|
throw new Error();
|
||||||
usersName=resp.users[usersInfoColumnIndex].name;
|
}
|
||||||
|
|
||||||
|
//入力されたログイン名がユーザー情報に登録されている場合、そのユーザー名を取得する
|
||||||
|
for (let indexUsersInfo in usersInfo) {
|
||||||
|
for(let indexInputUser in inputValue){
|
||||||
|
if(usersInfo[indexUsersInfo].code === inputValue[indexInputUser]){
|
||||||
|
usersName.push(usersInfo[indexUsersInfo].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//ユーザー名が取得できた場合、ログイン名とユーザー名をフィールドにセットする
|
//ユーザー名が取得できた場合、ログイン名とユーザー名をフィールドにセットする
|
||||||
@@ -225,7 +268,6 @@ export class InsertValueAction implements IAction{
|
|||||||
}catch{
|
}catch{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return usersName;
|
return usersName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,6 +333,66 @@ export class InsertValueAction implements IAction{
|
|||||||
return groupsName;
|
return groupsName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ユーザーオブジェクトを挿入する場合、挿入先フィールドによって、適切なオブジェクトの値を取得し、セットする
|
||||||
|
* @param {string} inputValue -入力された値
|
||||||
|
* @param {string} objectValue -オブジェクト変数
|
||||||
|
* @param {string} fieldType -挿入先フィールドタイプ
|
||||||
|
* @param {string} fieldCode -挿入先フィールドタイプ
|
||||||
|
* @return {string} -挿入先フィールドによって、ログインユーザーオブジェクトの何の値を返すか、変わる
|
||||||
|
*/
|
||||||
|
setValueOfUserObject(inputValue :any,objectValue :any,fieldType : any,fieldCode : any): any{
|
||||||
|
|
||||||
|
//変数の値
|
||||||
|
let variableValue = [];
|
||||||
|
|
||||||
|
//ユーザー選択フィールドに挿入時、ユーザーオブジェクトのcodeを代入する
|
||||||
|
if(fieldType.includes('USER_SELECT')){
|
||||||
|
//変数の値取得
|
||||||
|
// variableValue = getContextVarByPath(context.variables,inputValue);
|
||||||
|
if(!Array.isArray(objectValue)){
|
||||||
|
variableValue.push(objectValue.code);
|
||||||
|
}else{
|
||||||
|
for(let i=0;i<objectValue.length;i++){
|
||||||
|
variableValue.push(objectValue[i].code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
//ユーザー選択フィールド以外に挿入時、ユーザーオブジェクトの値の指定があれば、その値を代入する
|
||||||
|
if(inputValue.includes('.name') || inputValue.includes('.email') || inputValue.includes('.employeeNumber')
|
||||||
|
|| inputValue.includes('.extensionNumber') || inputValue.includes('.id') || inputValue.includes('.isGuest')|| inputValue.includes('.timezone')
|
||||||
|
|| inputValue.includes('.language') || inputValue.includes('.mobilePhone') || inputValue.includes('.phone') || inputValue.includes('.url')){
|
||||||
|
|
||||||
|
//値を挿入する変数名取得
|
||||||
|
let objectPropertyName = inputValue.substr(inputValue.indexOf('.') + 1);
|
||||||
|
if(!Array.isArray(objectValue)){
|
||||||
|
variableValue.push(objectValue[objectPropertyName]);
|
||||||
|
}else{
|
||||||
|
for(let i=0;i<objectValue.length;i++){
|
||||||
|
variableValue.push(objectValue[i][objectPropertyName]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ユーザー選択フィールド以外に挿入時、ユーザーオブジェクトの値の指定がなければ、codeを代入する
|
||||||
|
}else{
|
||||||
|
if(!Array.isArray(objectValue)){
|
||||||
|
variableValue.push(objectValue.code);
|
||||||
|
}else{
|
||||||
|
for(let i=0;i<objectValue.length;i++){
|
||||||
|
variableValue.push(objectValue[i].code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(variableValue === undefined){
|
||||||
|
throw new Error("「"+fieldCode+"」"+"フィールドに入れようとした変数は、無効な入力形式です。");
|
||||||
|
}
|
||||||
|
|
||||||
|
return variableValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -347,7 +449,7 @@ export class InsertValueAction implements IAction{
|
|||||||
//既定のプロパティのインターフェースへ変換する
|
//既定のプロパティのインターフェースへ変換する
|
||||||
this.props = actionNode.ActionValue as IInsertValueProps;
|
this.props = actionNode.ActionValue as IInsertValueProps;
|
||||||
|
|
||||||
//挿入する値を取得
|
//プロパティの挿入する値を取得
|
||||||
let fieldValue = this.props.value;
|
let fieldValue = this.props.value;
|
||||||
//フィールドの種類を取得
|
//フィールドの種類を取得
|
||||||
const fieldType = this.props.field.type;
|
const fieldType = this.props.field.type;
|
||||||
@@ -360,42 +462,91 @@ export class InsertValueAction implements IAction{
|
|||||||
//ラジオボタン・チェックボックス・複数選択・ドロップダウンの選択肢を取得
|
//ラジオボタン・チェックボックス・複数選択・ドロップダウンの選択肢を取得
|
||||||
let fieldOptions =this.props.field.options;
|
let fieldOptions =this.props.field.options;
|
||||||
//変数の値を格納する
|
//変数の値を格納する
|
||||||
let variableValue;
|
let variableValue :any;
|
||||||
|
//挿入する値を格納する
|
||||||
|
let fieldValueArray = [];
|
||||||
|
let objectValue :any;
|
||||||
|
let notInputError;
|
||||||
|
|
||||||
//変数の場合、値が取得できるかチェック
|
//変数の場合、値が取得できるかチェック
|
||||||
if(insertValueType === "変数" && conditionResult){
|
if(insertValueType === "変数" && conditionResult){
|
||||||
variableValue = context.variables[fieldValue];
|
|
||||||
|
|
||||||
if(variableValue === undefined){
|
//変数の値を呼び出して代入する
|
||||||
|
const getContextVarByPath = (obj: any, path: string) => {
|
||||||
|
return path.split(".").reduce((o, k) => (o || {})[k], obj);
|
||||||
|
};
|
||||||
|
|
||||||
|
//オブジェクト変数で、値の指定がある場合は、変数名のみ取得
|
||||||
|
var variablesName = fieldValue.substr(0, fieldValue.indexOf('.'));
|
||||||
|
if(variablesName){
|
||||||
|
//変数の値取得
|
||||||
|
objectValue = getContextVarByPath(context.variables,variablesName)
|
||||||
|
}else{
|
||||||
|
//変数の値取得
|
||||||
|
objectValue = getContextVarByPath(context.variables,fieldValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
//オブジェクト変数の場合、プロパティを取得し、何のオブジェクト変数か判断する
|
||||||
|
if(objectValue !== null && typeof objectValue === 'object'){
|
||||||
|
let objectProperties=[]
|
||||||
|
|
||||||
|
if(objectValue.length > 0){
|
||||||
|
objectProperties=Object.keys(objectValue[0]);
|
||||||
|
}else{
|
||||||
|
objectProperties = Object.keys(objectValue);
|
||||||
|
}
|
||||||
|
//(ログインユーザー・値取得のコンポーネントからの)ユーザーオブジェクトを挿入時、挿入先フィールドによって、値を指定する
|
||||||
|
if(objectProperties.includes('code') && objectProperties.includes('name')){
|
||||||
|
objectValue=this.setValueOfUserObject(fieldValue,objectValue,fieldType,fieldCode);
|
||||||
|
|
||||||
|
//ユーザーオブジェクトから取得した値を、fieldValueArrayに代入
|
||||||
|
for (const value of objectValue) {
|
||||||
|
fieldValueArray.push(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//オブジェクト変数でない場合、変数をfieldValueArrayに代入
|
||||||
|
variableValue = context.variables[fieldValue];
|
||||||
|
fieldValueArray[0] = variableValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//変数がfieldValueArrayに代入できなかった場合は、エラーを出す
|
||||||
|
if(objectValue === undefined && fieldValueArray === undefined){
|
||||||
throw new Error("「"+fieldCode+"」"+"フィールドに入れようとした変数は、無効な入力形式です。");
|
throw new Error("「"+fieldCode+"」"+"フィールドに入れようとした変数は、無効な入力形式です。");
|
||||||
}
|
}
|
||||||
fieldValue = variableValue;
|
|
||||||
|
//変数の値にエラー(空文字・空白文字の混入)がないことをチェックする
|
||||||
|
notInputError=this.checkVariableValueBlank(fieldType,fieldValueArray,fieldCode,fieldRequired,event);
|
||||||
|
|
||||||
|
//手入力の場合、プロパティ挿入する値をfieldArrayに代入
|
||||||
|
}else{
|
||||||
|
fieldValueArray.push(fieldValue);
|
||||||
|
//入力エラー(空白文字の混入)がないことをチェック
|
||||||
|
notInputError=this.checkInputValueBlank(fieldType,fieldValueArray,fieldCode,fieldRequired,event);
|
||||||
}
|
}
|
||||||
|
|
||||||
//入力値チェック後、形式変換、型変換した値を格納する変数
|
//形式変換、型変換した値を格納する変数
|
||||||
let correctFormattedValue;
|
let correctFormattedValue = undefined;
|
||||||
//入力値チェック後、形式変換、型変換した値を格納する配列
|
//形式変換、型変換した値を格納する配列
|
||||||
let correctValues :string[] = [];
|
let correctValues :any[] = [];
|
||||||
//入力エラー(空白文字の混入)がないことをチェック
|
|
||||||
let notInputError=this.checkInputBlank(fieldType,fieldValue,fieldCode,fieldRequired,event);
|
|
||||||
|
|
||||||
//条件式の結果がtrue、入力エラー(空白文字の混入)がない場合、挿入する値をフィールドタイプ別にチェックする
|
//条件式の結果がtrue、入力エラー(空白文字の混入)がない場合、挿入する値をフィールドタイプ別にチェックする
|
||||||
if(conditionResult && notInputError){
|
if(conditionResult && notInputError){
|
||||||
|
|
||||||
//文字列型のフィールドに挿入しようとしている値が適切の場合、correctFormattedValueに代入する
|
//文字列型のフィールドに挿入しようとしている値が適切の場合、correctFormattedValueに代入する
|
||||||
if(fieldType === "SINGLE_LINE_TEXT" || fieldType === "MULTI_LINE_TEXT" || fieldType === "RICH_TEXT" || fieldType === "LINK" ){
|
if(fieldType === "SINGLE_LINE_TEXT" || fieldType === "MULTI_LINE_TEXT" || fieldType === "RICH_TEXT" || fieldType === "LINK" ){
|
||||||
correctFormattedValue = fieldValue;
|
correctFormattedValue = fieldValueArray.join(',');
|
||||||
|
|
||||||
//数値型のフィールドに挿入しようとしている値が適切の場合、数値型に型変換してcorrectFormattedValueに代入する
|
//数値型のフィールドに挿入しようとしている値が適切の場合、数値型に型変換してcorrectFormattedValueに代入する
|
||||||
}else if(fieldType === "NUMBER" ){
|
}else if(fieldType === "NUMBER" ){
|
||||||
if(this.checkInputNumber(fieldValue,fieldCode,event)){//入力値チェック
|
if(this.checkInputNumber(fieldValueArray[0],fieldCode,event)){//入力値チェック
|
||||||
correctFormattedValue = Number(fieldValue);//型変換
|
correctFormattedValue = Number(fieldValueArray[0]);//型変換
|
||||||
}
|
}
|
||||||
|
|
||||||
//日付・日時型のフィールドに挿入しようとしている値が適切の場合、指定の日付・日時に形式変換してcorrectFormattedValueに代入する
|
//日付・日時型のフィールドに挿入しようとしている値が適切の場合、指定の日付・日時に形式変換してcorrectFormattedValueに代入する
|
||||||
}else if(fieldType === "DATE" || fieldType === "DATETIME" ){
|
}else if(fieldType === "DATE" || fieldType === "DATETIME" ){
|
||||||
if(this.checkInputDate(fieldValue,fieldCode,event)){//入力値チェック
|
if(this.checkInputDate(fieldValueArray[0],fieldCode,event)){//入力値チェック
|
||||||
let formattedDate = this.changeDateFormat(fieldValue,fieldType,fieldCode,event)
|
let formattedDate = this.changeDateFormat(fieldValueArray[0],fieldType,fieldCode,event)
|
||||||
if(formattedDate){
|
if(formattedDate){
|
||||||
correctFormattedValue = formattedDate
|
correctFormattedValue = formattedDate
|
||||||
}
|
}
|
||||||
@@ -403,33 +554,35 @@ export class InsertValueAction implements IAction{
|
|||||||
|
|
||||||
//時刻フィールドに挿入しようとしている値が適切の場合、correctFormattedValueに代入する
|
//時刻フィールドに挿入しようとしている値が適切の場合、correctFormattedValueに代入する
|
||||||
}else if(fieldType === "TIME"){
|
}else if(fieldType === "TIME"){
|
||||||
if(this.checkInputTime(fieldValue,fieldCode,event)){//入力値チェック
|
if(this.checkInputTime(fieldValueArray[0],fieldCode,event)){//入力値チェック
|
||||||
correctFormattedValue = fieldValue;
|
correctFormattedValue = fieldValueArray[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//ラジオボタン・ドロップダウンのフィールドの選択肢と入力値が一致した場合、correctFormattedValueに代入する
|
//ラジオボタン・ドロップダウンのフィールドの選択肢と入力値が一致した場合、correctFormattedValueに代入する
|
||||||
}else if(fieldType === "RADIO_BUTTON" || fieldType === "DROP_DOWN"){
|
}else if(fieldType === "RADIO_BUTTON" || fieldType === "DROP_DOWN"){
|
||||||
if(this.checkInputOption(fieldValue,fieldOptions,fieldCode,event)){//入力値チェック
|
if(this.checkInputOption(fieldValueArray[0],fieldOptions,fieldCode,event)){//入力値チェック
|
||||||
correctFormattedValue = fieldValue;
|
correctFormattedValue = fieldValueArray[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//チェックボックス・複数選択のフィールドの選択肢と入力値が一致した場合、correctValuesの配列に代入する
|
//チェックボックス・複数選択のフィールドの選択肢と入力値が一致した場合、correctValuesの配列に代入する
|
||||||
}else if(fieldType === "CHECK_BOX" || fieldType === "MULTI_SELECT" ){
|
}else if(fieldType === "CHECK_BOX" || fieldType === "MULTI_SELECT" ){
|
||||||
if(this.checkInputOption(fieldValue,fieldOptions,fieldCode,event)){//入力値チェック
|
if(this.checkInputOption(fieldValueArray[0],fieldOptions,fieldCode,event)){//入力値チェック
|
||||||
correctValues[0] = fieldValue;
|
correctValues[0] = fieldValueArray[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//ユーザー情報フィードに挿入しようとした値が適切な場合、correctFormattedValueに代入する
|
//ユーザー情報フィードに挿入しようとした値が適切な場合、correctValues(配列)に代入する
|
||||||
}else if(fieldType === "USER_SELECT"){
|
}else if(fieldType === "USER_SELECT"){
|
||||||
//挿入する値がユーザー情報から見つかれば、ユーザー名を格納
|
//挿入する値がユーザー情報から見つかれば、ユーザー名を格納
|
||||||
let users=await this.setInputUser(fieldValue);
|
let usersName=await this.setInputUser(fieldValueArray);
|
||||||
|
|
||||||
//ユーザー名が格納できている場合、ログイン名とユーザー名をcorrectFormattedValueに代入する
|
//ユーザー名が格納できている場合、ログイン名とユーザー名をcorrectValues(配列)に代入する
|
||||||
if(!users){
|
if(!usersName){
|
||||||
event.record[fieldCode]['error']="ユーザー選択に、挿入しようとしたユーザー情報は見つかりませんでした。「値を挿入する」コンポーネントの処理を中断しました。";
|
event.record[fieldCode]['error']="ユーザー選択に、挿入しようとしたユーザー情報は見つかりませんでした。「値を挿入する」コンポーネントの処理を中断しました。";
|
||||||
throw new Error("ユーザー選択に、挿入しようとしたユーザー情報は見つかりませんでした。「値を挿入する」コンポーネントの処理を中断しました。");
|
throw new Error("ユーザー選択に、挿入しようとしたユーザー情報は見つかりませんでした。「値を挿入する」コンポーネントの処理を中断しました。");
|
||||||
}else{
|
}
|
||||||
correctFormattedValue=[{ code: fieldValue, name: users }];
|
|
||||||
|
for(let indexInputUser in fieldValueArray){
|
||||||
|
correctValues.push({ code: fieldValueArray[indexInputUser], name: usersName[indexInputUser] });
|
||||||
}
|
}
|
||||||
|
|
||||||
//組織情報フィードに挿入しようとした値が適切な場合、correctFormattedValueに代入する
|
//組織情報フィードに挿入しようとした値が適切な場合、correctFormattedValueに代入する
|
||||||
@@ -464,12 +617,12 @@ export class InsertValueAction implements IAction{
|
|||||||
if(!event.type.includes('success')){
|
if(!event.type.includes('success')){
|
||||||
|
|
||||||
//条件式の結果がtrueかつ挿入する値が変換できた場合、フィールド(ラジオボタン・ドロップダウン・チェックボックス・複数選択・文字列一行・文字列複数行・リッチエディタ・数値・日付・日時・時刻)にセット
|
//条件式の結果がtrueかつ挿入する値が変換できた場合、フィールド(ラジオボタン・ドロップダウン・チェックボックス・複数選択・文字列一行・文字列複数行・リッチエディタ・数値・日付・日時・時刻)にセット
|
||||||
if(conditionResult && (correctFormattedValue || correctValues)){
|
if(conditionResult){
|
||||||
//条件式の結果がtureかつ、値を正しい形式に変換できた場合、フィールドに値をセットする
|
//条件式の結果がtureかつ、値を正しい形式に変換できた場合、フィールドに値をセットする
|
||||||
if(correctFormattedValue){
|
if(correctFormattedValue !== null && correctFormattedValue !== undefined){
|
||||||
event.record[fieldCode].value = correctFormattedValue;
|
event.record[fieldCode].value = correctFormattedValue;
|
||||||
//条件式の結果がtureかつ、値を正しい形式(配列)に変換できた場合、フィールドに値(配列)をセットする
|
//条件式の結果がtureかつ、値を正しい形式(配列)に変換できた場合、フィールドに値(配列)をセットする
|
||||||
}else if(correctValues.length > 0){
|
}else if(correctValues.length > 0 && correctValues !== null && correctValues !== undefined){
|
||||||
event.record[fieldCode].value = correctValues;
|
event.record[fieldCode].value = correctValues;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user