Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,43 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
comp.getOriginalComp().setParams(comp.cacheParamsMap.get(selection)!)
);
}
} else if ((
!action.editDSL
&& !isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
&& !isCustomAction<RemoteCompReadyAction>(action, "RemoteCompReady")
&& !isCustomAction<ModuleReadyAction>(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<LazyCompReadyAction>(action, "LazyCompReady")
|| isCustomAction<RemoteCompReadyAction>(action, "RemoteCompReady")
|| isCustomAction<ModuleReadyAction>(action, "moduleReady")
) && (
action.path[1] === SELECTED_KEY
|| ( // special check added for modules inside list view
|| (
isCustomAction<ModuleReadyAction>(action, "moduleReady")
&& action.path[1] === this.selection)
)) {
// broadcast
// 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
) {
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<LazyCompReadyAction>(action, "LazyCompReady")
&& !isCustomAction<RemoteCompReadyAction>(action, "RemoteCompReady")
&& !isCustomAction<ModuleReadyAction>(action, "moduleReady")
) || action.path[0] !== MAP_KEY || _.isNil(action.path[1])
) {
comp = super.reduce(action);
} else if (
!action.editDSL
&& (
Expand All @@ -112,8 +120,6 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
) {
comp = super.reduce(action);
}

// console.info("exit withSelectedMultiContext reduce. action: ", action, "\nthis:", this, "\ncomp:", comp);
return comp;
}

Expand Down
Loading