Skip to content

Fixed comps inside table's expansion container not keeping values #874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
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
Prev Previous commit
fix expansion container comps not saved
  • Loading branch information
raheeliftikhar5 committed May 13, 2024
commit adfe6b07f231d72b1b94df71ba16b35f9003a0b3
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export function lazyLoadComp(
}

private async load() {
console.log('lazyLoad ->', compName);
if (!compPath) {
return;
}
Expand All @@ -115,7 +114,6 @@ export function lazyLoadComp(
log.error("loader not found, lazy load info:", compPath);
return;
}
console.log(LazyExportedComp)

const params: CompParams<any> = {
dispatch: this.dispatch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
}

override reduce(action: CompAction): this {
console.info("enter withSelectedMultiContext reduce. action: ", action, "\nthis: ", this);
// console.info("enter withSelectedMultiContext reduce. action: ", action, "\nthis: ", this);
let comp = this;
if (isMyCustomAction<SetSelectionAction>(action, "setSelection")) {
const { selection, params } = action.value;
Expand All @@ -73,26 +73,33 @@ export function withSelectedMultiContext<TCtor extends MultiCompConstructor>(
);
}
} else if ((
!action.editDSL
&& !isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
&& !isCustomAction<ModuleReadyAction>(action, "moduleReady")
) || action.path[0] !== MAP_KEY || _.isNil(action.path[1])) {
!action.editDSL
&& !isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
&& !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<ModuleReadyAction>(action, "moduleReady")
) && action.path[1] === SELECTED_KEY) {
action.editDSL
|| isCustomAction<LazyCompReadyAction>(action, "LazyCompReady")
|| isCustomAction<ModuleReadyAction>(action, "moduleReady")
) && 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<ModuleReadyAction>(action, "moduleReady")
&& action.path[0] === MAP_KEY
) {
comp = super.reduce(action);
}

// console.info("exit withSelectedMultiContext reduce. action: ", action, "\nthis:", this, "\ncomp:", comp);
Expand Down
Loading