diff --git a/src/electron/frontend/core/components/Dashboard.js b/src/electron/frontend/core/components/Dashboard.js index 2831390ad..f18acbbac 100644 --- a/src/electron/frontend/core/components/Dashboard.js +++ b/src/electron/frontend/core/components/Dashboard.js @@ -249,10 +249,9 @@ export class Dashboard extends LitElement { const workflowConfig = page.workflow ?? (page.workflow = {}); const workflowValues = page.info.globalState?.project?.workflow ?? {}; - Object.entries(workflowValues).forEach(([ key, state = {} ]) => { - + Object.entries(workflowValues).forEach(([key, state = {}]) => { const config = workflowConfig[key] ?? (workflowConfig[key] = {}); - const value = config.value = workflowValues[key]; + const value = (config.value = workflowValues[key]); if (state.elements) { const elements = state.elements; @@ -274,7 +273,6 @@ export class Dashboard extends LitElement { const { skipped } = this.subSidebar.sections[info.section]?.pages?.[info.id] ?? {}; if (skipped) { - if (isStorybook) return; // Do not skip on storybook const backwards = previous && previous.info.previous === this.page; @@ -315,7 +313,7 @@ export class Dashboard extends LitElement { .finally(() => { if (this.#transitionPromise.value) this.#transitionPromise.trigger(this.main.page); // This ensures calls to page.to() can be properly awaited until the next page is ready - }) + }); } // Populate the sections tracked for this page by using the global state as a model @@ -374,13 +372,15 @@ export class Dashboard extends LitElement { if (!active) active = this.activePage; // default to active page this.main.onTransition = async (transition) => { - - const promise = this.#transitionPromise.value ?? (this.#transitionPromise.value = new Promise( - (resolve) => (this.#transitionPromise.trigger = (v) => { - this.#transitionPromise.value = null; // Reset promise - resolve(v); - }) - )); + const promise = + this.#transitionPromise.value ?? + (this.#transitionPromise.value = new Promise( + (resolve) => + (this.#transitionPromise.trigger = (v) => { + this.#transitionPromise.value = null; // Reset promise + resolve(v); + }) + )); if (typeof transition === "number") { const info = this.page.info; diff --git a/src/electron/frontend/core/components/pages/guided-mode/data/GuidedBackendConfiguration.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedBackendConfiguration.js index d4491b5a2..8051e1d64 100644 --- a/src/electron/frontend/core/components/pages/guided-mode/data/GuidedBackendConfiguration.js +++ b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedBackendConfiguration.js @@ -54,7 +54,6 @@ export class GuidedBackendConfigurationPage extends ManagedPage { header = {}; workflow = { - // Ensure conversion is completed when skipped backend_configuration: { skip: async () => { @@ -64,7 +63,6 @@ export class GuidedBackendConfigurationPage extends ManagedPage { }); }, }, - }; footer = { @@ -160,8 +158,7 @@ export class GuidedBackendConfigurationPage extends ManagedPage { "*": itemIgnore, }, onUpdate: (updatedPath) => { - - this.unsavedUpdates = "conversions" // Trigger conversion updates + this.unsavedUpdates = "conversions"; // Trigger conversion updates const parentPath = updatedPath.slice(0, -1); const form = instance.getFormElement(parentPath); diff --git a/src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js index 291897ef2..55979eaa5 100644 --- a/src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js +++ b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js @@ -1,58 +1,57 @@ -import { html } from "lit"; -import { Page } from "../../Page.js"; - -import { unsafeSVG } from "lit/directives/unsafe-svg.js"; -import folderOpenSVG from "../../../../../assets/icons/folder_open.svg?raw"; - -import { electron } from "../../../../../utils/electron.js"; -import { NWBFilePreview, getSharedPath } from "../../../preview/NWBFilePreview.js"; -const { ipcRenderer } = electron; - -export const getStubArray = (stubs) => - Object.values(stubs) - .map((item) => Object.values(item)) - .flat(); - -export class GuidedStubPreviewPage extends Page { - constructor(...args) { - super(...args); - this.style.height = "100%"; // Fix main section - } - - header = { - subtitle: `Preview file contents on truncated files using the Neurosift application`, - controls: () => - html` { - if (ipcRenderer) - ipcRenderer.send( - "showItemInFolder", - getSharedPath(getStubArray(this.info.globalState.preview.stubs).map((item) => item.file)) - ); - }} - >${unsafeSVG(folderOpenSVG)}`, - }; - - // NOTE: We may want to trigger this whenever (1) this page is visited AND (2) data has been changed. - footer = { - next: "Run Conversion", - onNext: async () => { - await this.save(); // Save in case the conversion fails - return this.to(1); // Will trigger conversion if necessary - }, - }; - - render() { - - const { preview, project } = this.info.globalState; - - return preview.stubs - ? new NWBFilePreview({ project: project.name, files: preview.stubs }) - : html`

Your conversion preview failed. Please try again.

`; - } -} - -customElements.get("nwbguide-guided-stub-review-page") || - customElements.define("nwbguide-guided-stub-review-page", GuidedStubPreviewPage); +import { html } from "lit"; +import { Page } from "../../Page.js"; + +import { unsafeSVG } from "lit/directives/unsafe-svg.js"; +import folderOpenSVG from "../../../../../assets/icons/folder_open.svg?raw"; + +import { electron } from "../../../../../utils/electron.js"; +import { NWBFilePreview, getSharedPath } from "../../../preview/NWBFilePreview.js"; +const { ipcRenderer } = electron; + +export const getStubArray = (stubs) => + Object.values(stubs) + .map((item) => Object.values(item)) + .flat(); + +export class GuidedStubPreviewPage extends Page { + constructor(...args) { + super(...args); + this.style.height = "100%"; // Fix main section + } + + header = { + subtitle: `Preview file contents on truncated files using the Neurosift application`, + controls: () => + html` { + if (ipcRenderer) + ipcRenderer.send( + "showItemInFolder", + getSharedPath(getStubArray(this.info.globalState.preview.stubs).map((item) => item.file)) + ); + }} + >${unsafeSVG(folderOpenSVG)}`, + }; + + // NOTE: We may want to trigger this whenever (1) this page is visited AND (2) data has been changed. + footer = { + next: "Run Conversion", + onNext: async () => { + await this.save(); // Save in case the conversion fails + return this.to(1); // Will trigger conversion if necessary + }, + }; + + render() { + const { preview, project } = this.info.globalState; + + return preview.stubs + ? new NWBFilePreview({ project: project.name, files: preview.stubs }) + : html`

Your conversion preview failed. Please try again.

`; + } +} + +customElements.get("nwbguide-guided-stub-review-page") || + customElements.define("nwbguide-guided-stub-review-page", GuidedStubPreviewPage); diff --git a/src/pyflask/app.py b/src/pyflask/app.py index 10c59189a..7b62ea2a4 100644 --- a/src/pyflask/app.py +++ b/src/pyflask/app.py @@ -110,7 +110,7 @@ def post(self): traceback = payload.get("traceback", "") message = f"{header}\n{'-'*len(header)}\n\n{json.dumps(inputs, indent=2)}\n" - + if traceback: message += f"\n{traceback}\n"