Skip to content
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

Ensure persistent workflow changes appear in section states #715

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions environments/environment-Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dependencies:
- pytest == 7.2.2
- pytest-cov == 4.1.0
- scikit-learn == 1.4.0
- scipy == 1.12.0
6 changes: 3 additions & 3 deletions src/renderer/src/stories/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ export class Dashboard extends LitElement {
else if (typeof page === "object") return this.getPage(Object.values(page)[0]);
}

updateSections({ sidebar = true, main = false } = {}) {
updateSections({ sidebar = true, main = false } = {}, globalState = this.page.info.globalState) {
const info = this.page.info;
let parent = info.parent;

if (sidebar) {
this.subSidebar.sections = this.#getSections(parent.info.pages, info.globalState); // Update sidebar items (if changed)
this.subSidebar.sections = this.#getSections(parent.info.pages, globalState); // Update sidebar items (if changed)
}

const { sections } = this.subSidebar;
Expand Down Expand Up @@ -229,7 +229,7 @@ export class Dashboard extends LitElement {
if (isNested) {
let parent = info.parent;
while (parent.info.parent) parent = parent.info.parent; // Lock sections to the top-level parent
this.updateSections({ sidebar: true });
this.updateSections({ sidebar: true }, toPass.globalState);
this.subSidebar.active = info.id; // Update active item (if changed)
this.sidebar.hide(true);
this.subSidebar.show();
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/pages/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export class Page extends LitElement {

updateSections = () => {
const dashboard = document.querySelector("nwb-dashboard");
dashboard.updateSections({ sidebar: true, main: true });
dashboard.updateSections({ sidebar: true, main: true }, this.info.globalState);
};

#unsaved = false;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/stories/pages/guided-mode/setup/Preform.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ export class GuidedPreform extends Page {
if (typeof value === "boolean") {
this.unsavedUpdates = true;
this.info.globalState.project.workflow = this.state;
await this.save({}, false);
this.updateSections();
this.updateSections(); // Trigger section changes with new workflow
await this.save({}, false); // Save new workflow and section changes
}
},
onThrow,
Expand Down
Loading