Skip to content

Commit 75f1486

Browse files
Merge pull request #2032 from iamfaran/fix/revert-chart-expansion
[Fix]: revert chart expansion
2 parents 578dc3c + 0b58adf commit 75f1486

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

client/packages/lowcoder/src/comps/generators/withSelectedMultiContext.tsx

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,43 +73,35 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
7373
comp.getOriginalComp().setParams(comp.cacheParamsMap.get(selection)!)
7474
);
7575
}
76+
} else if ((
77+
!action.editDSL
78+
&& !isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
79+
&& !isCustomAction<RemoteCompReadyAction>(action, "RemoteCompReady")
80+
&& !isCustomAction<ModuleReadyAction>(action, "moduleReady")
81+
) || action.path[0] !== MAP_KEY || _.isNil(action.path[1])
82+
) {
83+
if (action.path[0] === MAP_KEY && action.path[1] === SELECTED_KEY) {
84+
action.path[1] = this.selection;
85+
}
86+
comp = super.reduce(action);
7687
} else if ((
7788
action.editDSL
7889
|| isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
7990
|| isCustomAction<RemoteCompReadyAction>(action, "RemoteCompReady")
8091
|| isCustomAction<ModuleReadyAction>(action, "moduleReady")
8192
) && (
8293
action.path[1] === SELECTED_KEY
83-
|| (
94+
|| ( // special check added for modules inside list view
8495
isCustomAction<ModuleReadyAction>(action, "moduleReady")
8596
&& action.path[1] === this.selection)
8697
)) {
87-
// broadcast edits from the selected design-time view to all instances and template
88-
const newAction = {
89-
...action,
90-
path: action.path.slice(2),
91-
};
92-
comp = comp.reduce(WithMultiContextComp.forEachAction(newAction));
93-
comp = comp.reduce(wrapChildAction(COMP_KEY, newAction));
94-
} else if (
95-
// ensure edits made in the expanded view configurator (SELECTED key)
96-
// also update the template
97-
action.path[0] === MAP_KEY && action.path[1] === SELECTED_KEY
98-
) {
98+
// broadcast
9999
const newAction = {
100100
...action,
101101
path: action.path.slice(2),
102102
};
103103
comp = comp.reduce(WithMultiContextComp.forEachAction(newAction));
104104
comp = comp.reduce(wrapChildAction(COMP_KEY, newAction));
105-
} else if ((
106-
!action.editDSL
107-
&& !isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
108-
&& !isCustomAction<RemoteCompReadyAction>(action, "RemoteCompReady")
109-
&& !isCustomAction<ModuleReadyAction>(action, "moduleReady")
110-
) || action.path[0] !== MAP_KEY || _.isNil(action.path[1])
111-
) {
112-
comp = super.reduce(action);
113105
} else if (
114106
!action.editDSL
115107
&& (
@@ -120,6 +112,8 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
120112
) {
121113
comp = super.reduce(action);
122114
}
115+
116+
// console.info("exit withSelectedMultiContext reduce. action: ", action, "\nthis:", this, "\ncomp:", comp);
123117
return comp;
124118
}
125119

0 commit comments

Comments
 (0)