diff --git a/src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js b/src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js index 1768a7fc6..ff3ab9668 100644 --- a/src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js +++ b/src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js @@ -1,106 +1,106 @@ -import { html } from "lit"; -import { unsafeSVG } from "lit/directives/unsafe-svg.js"; -import folderOpenSVG from "../../../../../assets/icons/folder_open.svg?raw"; - -import { Page } from "../../Page.js"; -import { getStubArray } from "../options/GuidedStubPreview.js"; -import { getSharedPath } from "../../../preview/NWBFilePreview.js"; - -import { electron, path } from "../../../../../utils/electron.js"; - -import manualActionsJSON from "../../../../../../../schemas/json/manual_actions.json"; - -import { CodeBlock } from "../../../CodeBlock.js"; - -const { ipcRenderer } = electron; - -export class GuidedResultsPage extends Page { - constructor(...args) { - super(...args); - } - - header = { - controls: () => - html` { - if (ipcRenderer) ipcRenderer.send("showItemInFolder", this.#sharedPath()); - }} - >${unsafeSVG(folderOpenSVG)}`, - }; - - footer = {}; - - #sharedPath = () => { - const { conversion } = this.info.globalState; - if (!conversion) return ""; - return getSharedPath(getStubArray(conversion).map((item) => item.file)); - }; - - updated() { - this.save(); // Save the current state - } - - render() { - const { conversion } = this.info.globalState; - - if (!conversion) - return html`

Your conversion failed. Please try again.

`; - - // Show a snippet for how to open the NWB file - return html` -

Your data was successfully converted to NWB!

-
    - ${getStubArray(conversion) - .map(({ file }) => file.split(path.sep).slice(-1)[0]) - .sort() - .map((id) => html`
  1. ${id}
  2. `)} -
-

But what about my other data?

-

- The GUIDE still can't do everything. You may need to manually adjust the NWB file to ensure it contains - all the necessary data. -

- ${new CodeBlock({ - text: `from pynwb import NWBHDF5IO, NWBFile, TimeSeries - -filename = "${this.#sharedPath()}" - -# Open the file -with NWBHDF5IO(filename, "r+") as io: - nwbfile = io.read() - - # Adjust the file as needed - # ... - - # Write the modified file - io.write(nwbfile) -`, - })} -
Related Documentation
-
- ${manualActionsJSON.map( - ({ name, description, url }) => html` -
-

- ${name} -

- ${description} -
- ` - )} -
-

- For more information, please refer to the - PyNWB and - MatNWB documentation. -

- `; - } -} - -customElements.get("nwbguide-guided-results-page") || - customElements.define("nwbguide-guided-results-page", GuidedResultsPage); +import { html } from "lit"; +import { unsafeSVG } from "lit/directives/unsafe-svg.js"; +import folderOpenSVG from "../../../../../assets/icons/folder_open.svg?raw"; + +import { Page } from "../../Page.js"; +import { getStubArray } from "../options/GuidedStubPreview.js"; +import { getSharedPath } from "../../../preview/NWBFilePreview.js"; + +import { electron, path } from "../../../../../utils/electron.js"; + +import manualActionsJSON from "../../../../../../../schemas/json/manual_actions.json"; + +import { CodeBlock } from "../../../CodeBlock.js"; + +const { ipcRenderer } = electron; + +export class GuidedResultsPage extends Page { + constructor(...args) { + super(...args); + } + + header = { + controls: () => + html` { + if (ipcRenderer) ipcRenderer.send("showItemInFolder", this.#sharedPath()); + }} + >${unsafeSVG(folderOpenSVG)}`, + }; + + footer = {}; + + #sharedPath = () => { + const { conversion } = this.info.globalState; + if (!conversion) return ""; + return getSharedPath(getStubArray(conversion).map((item) => item.file)); + }; + + updated() { + this.save(); // Save the current state + } + + render() { + const { conversion } = this.info.globalState; + + if (!conversion) + return html`

Your conversion failed. Please try again.

`; + + // Show a snippet for how to open the NWB file + return html` +

Your data was successfully converted to NWB!

+
    + ${getStubArray(conversion) + .map(({ file }) => file.split(path.sep).slice(-1)[0]) + .sort() + .map((id) => html`
  1. ${id}
  2. `)} +
+

But what about my other data?

+

+ The GUIDE still can't do everything. You may need to manually adjust the NWB file to ensure it contains + all the necessary data. +

+ ${new CodeBlock({ + text: `from pynwb import NWBHDF5IO, NWBFile, TimeSeries + +filename = "${this.#sharedPath()}" + +# Open the file +with NWBHDF5IO(filename, "r+") as io: + nwbfile = io.read() + + # Adjust the file as needed + # ... + + # Write the modified file + io.write(nwbfile) +`, + })} +
Related Documentation
+
+ ${manualActionsJSON.map( + ({ name, description, url }) => html` +
+

+ ${name} +

+ ${description} +
+ ` + )} +
+

+ For more information, please refer to the + PyNWB and + MatNWB documentation. +

+ `; + } +} + +customElements.get("nwbguide-guided-results-page") || + customElements.define("nwbguide-guided-results-page", GuidedResultsPage);