Skip to content

Commit

Permalink
Fixing import state application, the mininimize helper model needs to…
Browse files Browse the repository at this point in the history
… be reset when the action is triggered
  • Loading branch information
ddelpiano committed May 20, 2024
1 parent d6990de commit b7342f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ class LayoutManager {
case GeppettoActions.IMPORT_APPLICATION_STATE: {
const incomingState = action.data.redux.layout;
this.model = FlexLayout.Model.fromJson(incomingState);
this.minimizeHelper = new MinimizeHelper(this.minimizeHelper.getIsMinimizeEnabled(), this.model)
this.importSession(action.data.sessions);

nextSetLayout = false;
}
default: {
Expand All @@ -332,7 +332,6 @@ class LayoutManager {
next(action);
}
if (nextSetLayout) {

this.fixRowRecursive(this.model._root)
next(updateLayout(this.model));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export class MinimizeHelper {
this.store = null;
}

getIsMinimizeEnabled() {
return this.isMinimizeEnabled;
}

setStore(store: Store<any>) {
this.store = store;
}
Expand Down
6 changes: 3 additions & 3 deletions geppetto.js/geppetto-client/src/common/layout/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const widgets = (state: WidgetMap = {}, action) => {
// want to restore previous position when activated
updatedWidgets[node.getId()].pos = parseInt(i)
}

updatedWidgets[node.getId()].panelName = parent.getId();
if (parent.isMaximized() && node.isVisible()) {
updatedWidgets[node.getId()].status = WidgetStatus.MAXIMIZED;
Expand All @@ -136,9 +136,9 @@ export const widgets = (state: WidgetMap = {}, action) => {
} else {
updatedWidgets[node.getId()].status = WidgetStatus.HIDDEN;
}
}
}
}

return updatedWidgets
}

Expand Down

0 comments on commit b7342f6

Please sign in to comment.