Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions app/client/src/workers/common/DependencyMap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const updateDependencyMap = ({
const allAddedPaths = getAllPaths({
[fullPropertyPath]: get(unEvalDataTree, fullPropertyPath),
});

// If a new entity is added, add setter functions to all nodes
if (entityName === fullPropertyPath) {
const addedNodes = getEntitySetterFunctions(
Expand All @@ -163,8 +164,9 @@ export const updateDependencyMap = ({
addNodesToDepedencyMapFn(allAddedPaths, false) ||
didUpdateDependencyMap;

const isAddingNewWidget = entityName === fullPropertyPath;
if (isWidgetActionOrJsObject(entity)) {
if (!isDynamicLeaf(unEvalDataTree, fullPropertyPath, configTree)) {
if (isAddingNewWidget) {
const entityDependencyMap = getEntityDependencies(
entity,
configTree[entityName],
Expand All @@ -188,21 +190,23 @@ export const updateDependencyMap = ({
);
}
} else {
const entityPathDependencies = getEntityPathDependencies(
entity,
entityConfig,
fullPropertyPath,
allKeys,
);
const { errors: extractDependencyErrors, references } =
extractInfoFromBindings(entityPathDependencies, allKeys);
if (isDynamicLeaf(unEvalDataTree, fullPropertyPath, configTree)) {
const entityPathDependencies = getEntityPathDependencies(
entity,
entityConfig,
fullPropertyPath,
allKeys,
);
const { errors: extractDependencyErrors, references } =
extractInfoFromBindings(entityPathDependencies, allKeys);

setDependenciesToDepedencyMapFn(fullPropertyPath, references);
setDependenciesToDepedencyMapFn(fullPropertyPath, references);

didUpdateDependencyMap = true;
dataTreeEvalErrors = dataTreeEvalErrors.concat(
extractDependencyErrors,
);
didUpdateDependencyMap = true;
dataTreeEvalErrors = dataTreeEvalErrors.concat(
extractDependencyErrors,
);
}
}
}
break;
Expand Down