fix: properly update dependency map (#9169)
Properly update dependency map
This commit is contained in:
parent
3f87f4959e
commit
c98bbbe6ae
|
|
@ -450,21 +450,7 @@ export default class DataTreeEvaluator {
|
|||
entityName: string,
|
||||
): DependencyMap {
|
||||
const dependencies: DependencyMap = {};
|
||||
if (isAction(entity) || isWidget(entity)) {
|
||||
const dynamicBindingPathList = getEntityDynamicBindingPathList(entity);
|
||||
if (dynamicBindingPathList.length) {
|
||||
dynamicBindingPathList.forEach((dynamicPath) => {
|
||||
const propertyPath = dynamicPath.key;
|
||||
const unevalPropValue = _.get(entity, propertyPath);
|
||||
const { jsSnippets } = getDynamicBindings(unevalPropValue);
|
||||
const existingDeps =
|
||||
dependencies[`${entityName}.${propertyPath}`] || [];
|
||||
dependencies[`${entityName}.${propertyPath}`] = existingDeps.concat(
|
||||
jsSnippets.filter((jsSnippet) => !!jsSnippet),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (isWidget(entity)) {
|
||||
// Make property dependant on the default property as any time the default changes
|
||||
// the property needs to change
|
||||
|
|
@ -518,6 +504,23 @@ export default class DataTreeEvaluator {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (isAction(entity) || isWidget(entity)) {
|
||||
const dynamicBindingPathList = getEntityDynamicBindingPathList(entity);
|
||||
if (dynamicBindingPathList.length) {
|
||||
dynamicBindingPathList.forEach((dynamicPath) => {
|
||||
const propertyPath = dynamicPath.key;
|
||||
const unevalPropValue = _.get(entity, propertyPath);
|
||||
const { jsSnippets } = getDynamicBindings(unevalPropValue);
|
||||
const existingDeps =
|
||||
dependencies[`${entityName}.${propertyPath}`] || [];
|
||||
dependencies[`${entityName}.${propertyPath}`] = existingDeps.concat(
|
||||
jsSnippets.filter((jsSnippet) => !!jsSnippet),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -356,16 +356,16 @@ describe("DataTreeEvaluator", () => {
|
|||
Text2: ["Text2.text"],
|
||||
Text3: ["Text3.text"],
|
||||
Text4: ["Text4.text"],
|
||||
Table1: [
|
||||
Table1: expect.arrayContaining([
|
||||
"Table1.tableData",
|
||||
"Table1.searchText",
|
||||
"Table1.selectedRowIndex",
|
||||
"Table1.selectedRowIndices",
|
||||
],
|
||||
Dropdown1: [
|
||||
]),
|
||||
Dropdown1: expect.arrayContaining([
|
||||
"Dropdown1.selectedOptionValue",
|
||||
"Dropdown1.selectedOptionValueArr",
|
||||
],
|
||||
]),
|
||||
"Text2.text": ["Text1.text"],
|
||||
"Text3.text": ["Text1.text"],
|
||||
"Dropdown1.selectedOptionValue": [],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user