From 7398eaf3c395fc94a510b2e491b8ace66abad99b Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 24 Apr 2024 14:43:50 -0700 Subject: [PATCH 01/23] Update Build-and-deploy-mac.yml --- .github/workflows/Build-and-deploy-mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Build-and-deploy-mac.yml b/.github/workflows/Build-and-deploy-mac.yml index 450bd74a7..5921647e6 100644 --- a/.github/workflows/Build-and-deploy-mac.yml +++ b/.github/workflows/Build-and-deploy-mac.yml @@ -22,7 +22,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: activate-environment: nwb-guide - environment-file: environments/environment-MAC.yml + environment-file: environments/environment-MAC-arm64.yml auto-activate-base: false - uses: actions/setup-node@v3 From da51bf9f635e36fd806fd29c19d25a358e2dc353 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 24 Apr 2024 14:54:09 -0700 Subject: [PATCH 02/23] Update testing.yml --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f5b0e6c49..b7f8ffd0e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -28,7 +28,7 @@ jobs: label: environments/environment-Linux.yml - os: macos-latest - label: environments/environment-Mac.yml + label: environments/environment-MAC-arm64.yml - os: windows-latest label: environments/environment-Windows.yml From 92566f1b7462e75901bcfee8b5bb35dc1a7712cb Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 24 Apr 2024 16:55:07 -0500 Subject: [PATCH 03/23] Update env for macos-latest m1 --- .github/workflows/pyflask-build-and-dist-tests.yml | 2 +- .github/workflows/testing-live-services.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index cee21a443..240f82b76 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -33,7 +33,7 @@ jobs: - python-version: "3.9" os: macos-latest - label: environments/environment-Mac.yml + label: environments/environment-MAC-arm64.yml prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" diff --git a/.github/workflows/testing-live-services.yml b/.github/workflows/testing-live-services.yml index 1169c03d8..dbd115c79 100644 --- a/.github/workflows/testing-live-services.yml +++ b/.github/workflows/testing-live-services.yml @@ -28,7 +28,7 @@ jobs: label: environments/environment-Linux.yml - os: macos-latest - label: environments/environment-Mac.yml + label: environments/environment-MAC-arm64.yml - os: windows-latest label: environments/environment-Windows.yml From 4bb8a23521d802c8089de34c5a2e130124502184 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Thu, 25 Apr 2024 00:45:21 -0500 Subject: [PATCH 04/23] Add mac x64 workflows --- .github/workflows/Build-and-deploy-mac.yml | 1 + .github/workflows/pyflask-build-and-dist-tests.yml | 5 +++++ .github/workflows/testing-live-services.yml | 3 +++ .github/workflows/testing.yml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/.github/workflows/Build-and-deploy-mac.yml b/.github/workflows/Build-and-deploy-mac.yml index 5921647e6..31b72078b 100644 --- a/.github/workflows/Build-and-deploy-mac.yml +++ b/.github/workflows/Build-and-deploy-mac.yml @@ -1,5 +1,6 @@ name: Mac Release run-name: ${{ github.actor }} is building a MAC release for NWB GUIDE +# NOTE: even though the runner is an arm64 mac, both x64 and arm64 releases will be made on: workflow_dispatch: diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index 240f82b76..05848358b 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -36,6 +36,11 @@ jobs: label: environments/environment-MAC-arm64.yml prefix: /Users/runner/miniconda3/envs/nwb-guide + - python-version: "3.9" + os: macos-13 + label: environments/environment-MAC.yml + prefix: /Users/runner/miniconda3/envs/nwb-guide + - python-version: "3.9" os: windows-latest label: environments/environment-Windows.yml diff --git a/.github/workflows/testing-live-services.yml b/.github/workflows/testing-live-services.yml index dbd115c79..a5c5a2c7c 100644 --- a/.github/workflows/testing-live-services.yml +++ b/.github/workflows/testing-live-services.yml @@ -30,6 +30,9 @@ jobs: - os: macos-latest label: environments/environment-MAC-arm64.yml + - os: macos-13 + label: environments/environment-MAC.yml + - os: windows-latest label: environments/environment-Windows.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b7f8ffd0e..1eb200ae8 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -30,6 +30,9 @@ jobs: - os: macos-latest label: environments/environment-MAC-arm64.yml + - os: macos-13 + label: environments/environment-MAC.yml + - os: windows-latest label: environments/environment-Windows.yml From 822057ae17088df60976e43c8ab90d2b67bded2e Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Thu, 25 Apr 2024 00:46:52 -0500 Subject: [PATCH 05/23] Add comments --- .github/workflows/pyflask-build-and-dist-tests.yml | 4 ++-- .github/workflows/testing-live-services.yml | 4 ++-- .github/workflows/testing.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index 05848358b..badf1553e 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -32,12 +32,12 @@ jobs: # prefix: /usr/share/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-latest + os: macos-latest # Mac arm64 runner label: environments/environment-MAC-arm64.yml prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-13 + os: macos-13 # Mac x64 runner label: environments/environment-MAC.yml prefix: /Users/runner/miniconda3/envs/nwb-guide diff --git a/.github/workflows/testing-live-services.yml b/.github/workflows/testing-live-services.yml index a5c5a2c7c..975c7478e 100644 --- a/.github/workflows/testing-live-services.yml +++ b/.github/workflows/testing-live-services.yml @@ -27,10 +27,10 @@ jobs: - os: ubuntu-latest label: environments/environment-Linux.yml - - os: macos-latest + - os: macos-latest # Mac arm64 runner label: environments/environment-MAC-arm64.yml - - os: macos-13 + - os: macos-13 # Mac x64 runner label: environments/environment-MAC.yml - os: windows-latest diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1eb200ae8..9d22c5c28 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -27,10 +27,10 @@ jobs: - os: ubuntu-latest label: environments/environment-Linux.yml - - os: macos-latest + - os: macos-latest # Mac arm64 runner label: environments/environment-MAC-arm64.yml - - os: macos-13 + - os: macos-13 # Mac x64 runner label: environments/environment-MAC.yml - os: windows-latest From 1ac510f730d7134e5cd857ac37df850d4c551950 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 05:48:03 +0000 Subject: [PATCH 06/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/pyflask-build-and-dist-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index badf1553e..bc16e925a 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -37,7 +37,7 @@ jobs: prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-13 # Mac x64 runner + os: macos-13 # Mac x64 runner label: environments/environment-MAC.yml prefix: /Users/runner/miniconda3/envs/nwb-guide From 4b8238f737013c910180bddd39b17fc5cec7affc Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:42:23 -0400 Subject: [PATCH 07/23] try 12 --- .github/workflows/pyflask-build-and-dist-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index bc16e925a..8e528468c 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -37,7 +37,7 @@ jobs: prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-13 # Mac x64 runner + os: macos-12 # Mac x64 runner label: environments/environment-MAC.yml prefix: /Users/runner/miniconda3/envs/nwb-guide From 7bbd94ea06859571db51dbbbe5fa28f6e445a1d9 Mon Sep 17 00:00:00 2001 From: Ben Dichter Date: Thu, 25 Apr 2024 11:49:06 -0400 Subject: [PATCH 08/23] Update dataset.rst I think calling this "Example Dataset Generation" makes the docs a bit clearer --- docs/tutorials/dataset.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/dataset.rst b/docs/tutorials/dataset.rst index 079492639..6b436641a 100644 --- a/docs/tutorials/dataset.rst +++ b/docs/tutorials/dataset.rst @@ -1,5 +1,5 @@ -Dataset Generation -================== +Example Dataset Generation +========================== Our tutorials focus on converting extracellular electrophysiology data in the SpikeGLX and Phy formats. To get you started as quickly as possible, we’ve created a way to generate this Neuropixel-like dataset at the click of a button! From e99f7bd35848e09945acf88f368a61386939e8cc Mon Sep 17 00:00:00 2001 From: Ben Dichter Date: Thu, 25 Apr 2024 11:50:50 -0400 Subject: [PATCH 09/23] Update index.rst --- docs/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 01f317c28..a4333737f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ -Welcome to the NWB GUIDE documentation! -======================================= +NWB GUIDE documentation +======================= | .. image:: ../src/renderer/assets/img/logo-guide-draft-transparent-tight.png @@ -13,7 +13,7 @@ Welcome to the NWB GUIDE documentation! The **NWB Graphical User Interface for Data Entry (GUIDE)** is an Electron-based application designed to help you navigate the complex process of converting data from common proprietary formats into the :nwb-overview:`Neurodata Without Borders (NWB) <>` standard. -The resulting files are fully compliant with the best practices expected of the :dandi-archive:`Distributed Archives for Neurophysiology Data Integration (DANDI) <>`. +The resulting files are fully compliant with the best practices expected by the :dandi-archive:`Distributed Archives for Neurophysiology Data Integration (DANDI) <>`. .. toctree:: :maxdepth: 2 From ecfc0310da0824605a2b41b29b0ab49f71191ab5 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:02:08 -0400 Subject: [PATCH 10/23] try other alias --- .github/workflows/pyflask-build-and-dist-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index 8e528468c..a78139ed1 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -32,12 +32,12 @@ jobs: # prefix: /usr/share/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-latest # Mac arm64 runner + os: macos-latest-xlarge # Mac arm64 runner label: environments/environment-MAC-arm64.yml prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-12 # Mac x64 runner + os: macos-latest-large # Mac x64 runner label: environments/environment-MAC.yml prefix: /Users/runner/miniconda3/envs/nwb-guide From 2766e42c0b37f6e58de1c0aac7559d55ff5d5d48 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:16:13 -0400 Subject: [PATCH 11/23] try printing architecture --- .github/workflows/pyflask-build-and-dist-tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index a78139ed1..b31e32e3f 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -32,13 +32,13 @@ jobs: # prefix: /usr/share/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-latest-xlarge # Mac arm64 runner + os: macos-latest # Mac arm64 runner label: environments/environment-MAC-arm64.yml prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" - os: macos-latest-large # Mac x64 runner - label: environments/environment-MAC.yml + os: macos-13 # Mac x64 runner + label: environments/environment-MAC-arm64.yml prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" @@ -50,6 +50,9 @@ jobs: - uses: actions/checkout@v4 - run: git fetch --prune --unshallow --tags + - name: Printout architecture + run: echo uname -m + # see https://github.com/conda-incubator/setup-miniconda#caching-environments - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v3 From 0d500bea14e43822b046787e494ec0e1055f2a0c Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:25:30 -0400 Subject: [PATCH 12/23] remove echo --- .github/workflows/pyflask-build-and-dist-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index b31e32e3f..983d87f87 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -51,7 +51,7 @@ jobs: - run: git fetch --prune --unshallow --tags - name: Printout architecture - run: echo uname -m + run: uname -m # see https://github.com/conda-incubator/setup-miniconda#caching-environments - name: Setup Mambaforge From 6f67d8dc1ca57f353ecff72b81dd6d8df71b9777 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:30:52 -0400 Subject: [PATCH 13/23] fix sonpy removal condition --- .github/workflows/pyflask-build-and-dist-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pyflask-build-and-dist-tests.yml b/.github/workflows/pyflask-build-and-dist-tests.yml index 983d87f87..bbf9e4f93 100644 --- a/.github/workflows/pyflask-build-and-dist-tests.yml +++ b/.github/workflows/pyflask-build-and-dist-tests.yml @@ -38,7 +38,7 @@ jobs: - python-version: "3.9" os: macos-13 # Mac x64 runner - label: environments/environment-MAC-arm64.yml + label: environments/environment-MAC.yml prefix: /Users/runner/miniconda3/envs/nwb-guide - python-version: "3.9" @@ -89,7 +89,7 @@ jobs: - run: npm ci --verbose # fix for macos build - - if: matrix.os == 'macos-latest' + - if: matrix.os == 'macos-latest' || matrix.os == 'macos-13' run: rm -f /Users/runner/miniconda3/envs/nwb-guide/lib/python3.9/site-packages/sonpy/linux/sonpy.so - name: Build PyFlask distribution From fc9e08bd6975d224ca54230eb5550cb34b2a430d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:00:52 +0000 Subject: [PATCH 14/23] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 328c18cbe..9273adef7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black exclude: ^docs/ From 1bc9cc3e3d734a51120d3d0558948fd32d2ea3ec Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Thu, 2 May 2024 12:06:51 -0700 Subject: [PATCH 15/23] Run on first page load and ensure conversion review has proper behavior --- src/renderer/src/pages.js | 1 + src/renderer/src/stories/pages/Page.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/renderer/src/pages.js b/src/renderer/src/pages.js index 3f15cb90c..8a172bfe2 100644 --- a/src/renderer/src/pages.js +++ b/src/renderer/src/pages.js @@ -144,6 +144,7 @@ const pages = { title: "Conversion Review", label: "Review conversion", section: sections[2], + sync: ["conversion"], }), upload: new GuidedUploadPage({ diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index a8a0767d1..d07c83d8c 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -134,9 +134,10 @@ export class Page extends LitElement { // Indicate conversion has run successfully const { desyncedData } = this.info.globalState; + if (!desyncedData) this.info.globalState.desyncedData = { }; + if (desyncedData) { - delete desyncedData[key]; - if (Object.keys(desyncedData).length === 0) delete this.info.globalState.desyncedData; + desyncedData[key] = false; await this.save({}, false); } } @@ -255,16 +256,15 @@ export class Page extends LitElement { if (!sync) return; const { desyncedData } = info.globalState; - if (desyncedData) { - return Promise.all( - sync.map((k) => { - if (desyncedData[k]) { - if (k === "conversion") return this.convert(); - else if (k === "preview") return this.convert({ preview: true }); - } - }) - ); - } + + return Promise.all( + sync.map((k) => { + if (desyncedData?.[k] !== false) { + if (k === "conversion") return this.convert(); + else if (k === "preview") return this.convert({ preview: true }); + } + }) + ); }; updateSections = () => { From a4fe2776686825cfe27df40d5aa6638656a6b99f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 19:09:56 +0000 Subject: [PATCH 16/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/renderer/src/stories/pages/Page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index d07c83d8c..e7c00eff4 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -134,7 +134,7 @@ export class Page extends LitElement { // Indicate conversion has run successfully const { desyncedData } = this.info.globalState; - if (!desyncedData) this.info.globalState.desyncedData = { }; + if (!desyncedData) this.info.globalState.desyncedData = {}; if (desyncedData) { desyncedData[key] = false; From 7e419734874fdda56fb617da03df2f5d77323884 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Thu, 2 May 2024 13:27:21 -0700 Subject: [PATCH 17/23] Fix tests --- src/renderer/src/progress/index.js | 4 ++-- src/renderer/src/stories/Dashboard.js | 16 +++++++++------- src/renderer/src/stories/pages/FormPage.js | 2 +- tests/e2e/e2e.test.ts | 11 +---------- tests/e2e/workflow.ts | 7 +++---- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/renderer/src/progress/index.js b/src/renderer/src/progress/index.js index 56a180f52..84fc87553 100644 --- a/src/renderer/src/progress/index.js +++ b/src/renderer/src/progress/index.js @@ -182,13 +182,13 @@ export const get = (name) => { ); }; -export function resume(name) { +export async function resume(name) { const global = this ? this.load(name) : get(name); let commandToResume = global["page-before-exit"] || "//details"; updateURLParams({ project: name }); - if (this) this.onTransition(commandToResume); + if (this) await this.onTransition(commandToResume); return commandToResume; } diff --git a/src/renderer/src/stories/Dashboard.js b/src/renderer/src/stories/Dashboard.js index bf7727d8d..8f0cc5acb 100644 --- a/src/renderer/src/stories/Dashboard.js +++ b/src/renderer/src/stories/Dashboard.js @@ -242,7 +242,7 @@ export class Dashboard extends LitElement { this.page.set(toPass, false); - this.page.checkSyncState().then(() => { + this.page.checkSyncState().then(async () => { const projectName = info.globalState?.project?.name; this.subSidebar.header = projectName @@ -256,6 +256,7 @@ 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 // Run skip functions @@ -264,9 +265,10 @@ export class Dashboard extends LitElement { }); // Skip right over the page if configured as such - if (previous && previous.info.previous === this.page) this.page.onTransition(-1); - else this.page.onTransition(1); + if (previous && previous.info.previous === this.page) await this.page.onTransition(-1); + else await this.page.onTransition(1); } + }); } @@ -328,13 +330,13 @@ export class Dashboard extends LitElement { if (typeof transition === "number") { const info = this.page.info; const sign = Math.sign(transition); - if (sign === 1) return this.setAttribute("activePage", info.next.info.id); - else if (sign === -1) return this.setAttribute("activePage", (info.previous ?? info.parent).info.id); // Default to back in time + if (sign === 1) transition = info.next.info.id + else if (sign === -1) transition = (info.previous ?? info.parent).info.id; // Default to back in time } - + this.setAttribute("activePage", transition); - return await promise; + return promise; }; this.main.updatePages = () => { diff --git a/src/renderer/src/stories/pages/FormPage.js b/src/renderer/src/stories/pages/FormPage.js index 76b9068e0..8930e8d17 100644 --- a/src/renderer/src/stories/pages/FormPage.js +++ b/src/renderer/src/stories/pages/FormPage.js @@ -63,7 +63,7 @@ export class GuidedFormPage extends Page { onNext: async () => { await this.save(); // Save in case validation fails await this.form.validate(); // Validate the results of the form - this.to(1); + return this.to(1); }, }; diff --git a/tests/e2e/e2e.test.ts b/tests/e2e/e2e.test.ts index f7b0f2343..44ba41161 100644 --- a/tests/e2e/e2e.test.ts +++ b/tests/e2e/e2e.test.ts @@ -144,17 +144,8 @@ describe('E2E Test', () => { }, { upload_to_dandi: true }) - await toNextPage('structure') // Save data without a popup await to('//conversion') - - // Do not prompt to save - await evaluate(() => { - const dashboard = document.querySelector('nwb-dashboard') - const page = dashboard.page - page.unsavedUpdates = false - }) - - await to('//upload') // NOTE: It would be nice to avoid having to re-run the conversion... + await to('//upload') }) diff --git a/tests/e2e/workflow.ts b/tests/e2e/workflow.ts index fd097e01a..88fadc88d 100644 --- a/tests/e2e/workflow.ts +++ b/tests/e2e/workflow.ts @@ -429,19 +429,18 @@ export default async function runWorkflow(name, workflow, identifier) { test('Review NWB Inspector output', async () => { - await takeScreenshot(join(identifier, 'inspect-page'), 5000) // Finish file inspection and allow full load of Neurosift page + await takeScreenshot(join(identifier, 'inspect-page'), 5000) // Allow for the completion of file validation await toNextPage('preview') }) test('Review Neurosift visualization', async () => { - await takeScreenshot(join(identifier, 'preview-page'), 1000) // Finish loading Neurosift + await takeScreenshot(join(identifier, 'preview-page'), 1000) // Allow full load of Neurosift page await toNextPage('conversion') }) test('View the conversion results', async () => { - - await takeScreenshot(join(identifier, 'conversion-results-page'), 300) + await takeScreenshot(join(identifier, 'conversion-results-page'), 1000) if (workflow.upload_to_dandi) await toNextPage('upload') else await toNextPage('') }) From cdad7edf75b6d9f985f224b3f4e900250821deba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 20:28:29 +0000 Subject: [PATCH 18/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/renderer/src/stories/Dashboard.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/stories/Dashboard.js b/src/renderer/src/stories/Dashboard.js index 8f0cc5acb..e56b50273 100644 --- a/src/renderer/src/stories/Dashboard.js +++ b/src/renderer/src/stories/Dashboard.js @@ -256,7 +256,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 // Run skip functions @@ -268,7 +267,6 @@ export class Dashboard extends LitElement { if (previous && previous.info.previous === this.page) await this.page.onTransition(-1); else await this.page.onTransition(1); } - }); } @@ -330,10 +328,10 @@ export class Dashboard extends LitElement { if (typeof transition === "number") { const info = this.page.info; const sign = Math.sign(transition); - if (sign === 1) transition = info.next.info.id + if (sign === 1) transition = info.next.info.id; else if (sign === -1) transition = (info.previous ?? info.parent).info.id; // Default to back in time } - + this.setAttribute("activePage", transition); return promise; From 46be5424982230e2300131cce0b22ca7cbf829d9 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Thu, 2 May 2024 13:36:09 -0700 Subject: [PATCH 19/23] Update tests to fail without this PR --- tests/e2e/workflow.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/e2e/workflow.ts b/tests/e2e/workflow.ts index 88fadc88d..6fadea192 100644 --- a/tests/e2e/workflow.ts +++ b/tests/e2e/workflow.ts @@ -1,4 +1,4 @@ -import { describe, test } from "vitest" +import { describe, expect, test } from "vitest" import { sleep } from '../puppeteer' @@ -441,8 +441,18 @@ export default async function runWorkflow(name, workflow, identifier) { test('View the conversion results', async () => { await takeScreenshot(join(identifier, 'conversion-results-page'), 1000) + + const conversionCompleted = await evaluate(() => { + const dashboard = document.querySelector('nwb-dashboard') + const page = dashboard.page + return !!page.info.globalState.conversion + }) + if (workflow.upload_to_dandi) await toNextPage('upload') else await toNextPage('') + + expect(conversionCompleted).toBe(true) + }) From 3e3a82a4223bd66ead49da494ee275cf00a1e802 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Thu, 2 May 2024 14:42:17 -0700 Subject: [PATCH 20/23] Fix storybook --- src/renderer/src/stories/pages/Page.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index e7c00eff4..b06d3fd34 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -1,7 +1,7 @@ import { LitElement, html } from "lit"; import { openProgressSwal, runConversion } from "./guided-mode/options/utils.js"; import { get, save } from "../../progress/index.js"; -import { dismissNotification, notify } from "../../dependencies/globals.js"; +import { dismissNotification, isStorybook, notify } from "../../dependencies/globals.js"; import { randomizeElements, mapSessions, merge } from "./utils.js"; import { ProgressBar } from "../ProgressBar"; @@ -254,9 +254,11 @@ export class Page extends LitElement { checkSyncState = async (info = this.info, sync = info.sync) => { if (!sync) return; + if (isStorybook) return; const { desyncedData } = info.globalState; + f return Promise.all( sync.map((k) => { if (desyncedData?.[k] !== false) { From f1693ffcfb36706fe883f2b054317721ce702249 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Thu, 2 May 2024 14:42:43 -0700 Subject: [PATCH 21/23] Delete GuidedStart.stories.js --- .../pages/guided-mode/GuidedStart.stories.js | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 src/renderer/src/stories/pages/guided-mode/GuidedStart.stories.js diff --git a/src/renderer/src/stories/pages/guided-mode/GuidedStart.stories.js b/src/renderer/src/stories/pages/guided-mode/GuidedStart.stories.js deleted file mode 100644 index 1a812dcb2..000000000 --- a/src/renderer/src/stories/pages/guided-mode/GuidedStart.stories.js +++ /dev/null @@ -1,14 +0,0 @@ -import { globalState, PageTemplate } from "./storyStates"; - -export default { - title: "Pages/Guided Mode/Start", - parameters: { - chromatic: { disableSnapshot: false }, - }, -}; - -export const Default = PageTemplate.bind({}); -Default.args = { - activePage: "//start", - globalState, -}; From 476c489c61c6bf21803eb23ee600686a7b3e45c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 21:42:59 +0000 Subject: [PATCH 22/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/renderer/src/stories/pages/Page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index b06d3fd34..5c08b5a9f 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -258,7 +258,7 @@ export class Page extends LitElement { const { desyncedData } = info.globalState; - f + f; return Promise.all( sync.map((k) => { if (desyncedData?.[k] !== false) { From 764846a9aa63ba933c48725046713e74fd61b57c Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Fri, 3 May 2024 09:36:00 -0700 Subject: [PATCH 23/23] Remove stray character --- src/renderer/src/stories/pages/Page.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index 5c08b5a9f..c077662eb 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -258,7 +258,6 @@ export class Page extends LitElement { const { desyncedData } = info.globalState; - f; return Promise.all( sync.map((k) => { if (desyncedData?.[k] !== false) {