fix: added condition for where clause evaluated value binding path (#10308)
This commit is contained in:
parent
33a4c74994
commit
8cc35e797e
|
|
@ -42,8 +42,7 @@ export const getBindingPathsOfAction = (
|
|||
formConfig.evaluationSubstitutionType,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (formConfig.controlType === "ARRAY_FIELD") {
|
||||
} else if (formConfig.controlType === "ARRAY_FIELD") {
|
||||
let actionValue = _.get(action, formConfig.configProperty);
|
||||
if (Array.isArray(actionValue)) {
|
||||
actionValue = actionValue.filter((val) => val);
|
||||
|
|
@ -63,6 +62,54 @@ export const getBindingPathsOfAction = (
|
|||
});
|
||||
}
|
||||
}
|
||||
} else if (formConfig.controlType === "WHERE_CLAUSE") {
|
||||
const recursiveFindBindingPathsForWhereClause = (
|
||||
newConfigPath: string,
|
||||
actionValue: any,
|
||||
) => {
|
||||
if (
|
||||
actionValue &&
|
||||
actionValue.hasOwnProperty("children") &&
|
||||
Array.isArray(actionValue.children)
|
||||
) {
|
||||
actionValue.children.forEach((value: any, index: number) => {
|
||||
recursiveFindBindingPathsForWhereClause(
|
||||
`${newConfigPath}.children[${index}]`,
|
||||
value,
|
||||
);
|
||||
});
|
||||
} else {
|
||||
if (actionValue.hasOwnProperty("key")) {
|
||||
bindingPaths[
|
||||
`${newConfigPath}.key`
|
||||
] = getCorrectEvaluationSubstitutionType(
|
||||
formConfig.evaluationSubstitutionType,
|
||||
);
|
||||
}
|
||||
|
||||
if (actionValue.hasOwnProperty("value")) {
|
||||
bindingPaths[
|
||||
`${newConfigPath}.value`
|
||||
] = getCorrectEvaluationSubstitutionType(
|
||||
formConfig.evaluationSubstitutionType,
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const actionValue = _.get(action, formConfig.configProperty);
|
||||
if (
|
||||
actionValue &&
|
||||
actionValue.hasOwnProperty("children") &&
|
||||
Array.isArray(actionValue.children)
|
||||
) {
|
||||
actionValue.children.forEach((value: any, index: number) => {
|
||||
recursiveFindBindingPathsForWhereClause(
|
||||
`${configPath}.children[${index}]`,
|
||||
value,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user