From 0b58adf829dd0fa6ee4897bc76f591be853da428 Mon Sep 17 00:00:00 2001 From: Faran Javed Date: Wed, 1 Oct 2025 16:43:08 +0500 Subject: [PATCH] [Fix]: revert chart expansion --- .../generators/withSelectedMultiContext.tsx | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/client/packages/lowcoder/src/comps/generators/withSelectedMultiContext.tsx b/client/packages/lowcoder/src/comps/generators/withSelectedMultiContext.tsx index 326db5b57..d34f0ad76 100644 --- a/client/packages/lowcoder/src/comps/generators/withSelectedMultiContext.tsx +++ b/client/packages/lowcoder/src/comps/generators/withSelectedMultiContext.tsx @@ -73,6 +73,17 @@ export function withSelectedMultiContext( comp.getOriginalComp().setParams(comp.cacheParamsMap.get(selection)!) ); } + } else if (( + !action.editDSL + && !isCustomAction(action, "LazyCompReady") + && !isCustomAction(action, "RemoteCompReady") + && !isCustomAction(action, "moduleReady") + ) || action.path[0] !== MAP_KEY || _.isNil(action.path[1]) + ) { + if (action.path[0] === MAP_KEY && action.path[1] === SELECTED_KEY) { + action.path[1] = this.selection; + } + comp = super.reduce(action); } else if (( action.editDSL || isCustomAction(action, "LazyCompReady") @@ -80,36 +91,17 @@ export function withSelectedMultiContext( || isCustomAction(action, "moduleReady") ) && ( action.path[1] === SELECTED_KEY - || ( + || ( // special check added for modules inside list view isCustomAction(action, "moduleReady") && action.path[1] === this.selection) )) { - // broadcast edits from the selected design-time view to all instances and template - const newAction = { - ...action, - path: action.path.slice(2), - }; - comp = comp.reduce(WithMultiContextComp.forEachAction(newAction)); - comp = comp.reduce(wrapChildAction(COMP_KEY, newAction)); - } else if ( - // ensure edits made in the expanded view configurator (SELECTED key) - // also update the template - action.path[0] === MAP_KEY && action.path[1] === SELECTED_KEY - ) { + // broadcast const newAction = { ...action, path: action.path.slice(2), }; comp = comp.reduce(WithMultiContextComp.forEachAction(newAction)); comp = comp.reduce(wrapChildAction(COMP_KEY, newAction)); - } else if (( - !action.editDSL - && !isCustomAction(action, "LazyCompReady") - && !isCustomAction(action, "RemoteCompReady") - && !isCustomAction(action, "moduleReady") - ) || action.path[0] !== MAP_KEY || _.isNil(action.path[1]) - ) { - comp = super.reduce(action); } else if ( !action.editDSL && ( @@ -120,6 +112,8 @@ export function withSelectedMultiContext( ) { comp = super.reduce(action); } + + // console.info("exit withSelectedMultiContext reduce. action: ", action, "\nthis:", this, "\ncomp:", comp); return comp; }