From 0ab0f74d26e7b6b98c5613f3b2d221d4f0989a28 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:33:28 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../core/components/forms/GlobalFormModal.ts | 2 +- .../pages/guided-mode/data/GuidedPathExpansion.js | 2 +- .../pages/guided-mode/data/GuidedSourceData.js | 4 ++-- .../pages/guided-mode/options/GuidedUpload.js | 10 +++++----- .../core/components/pages/inspect/InspectPage.js | 4 +--- .../core/components/pages/settings/SettingsPage.js | 3 +-- .../core/components/pages/uploads/UploadsPage.js | 12 ++++++------ tests/e2e/workflow.ts | 2 +- 8 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/electron/frontend/core/components/forms/GlobalFormModal.ts b/src/electron/frontend/core/components/forms/GlobalFormModal.ts index 2650263f0..bd0f919bc 100644 --- a/src/electron/frontend/core/components/forms/GlobalFormModal.ts +++ b/src/electron/frontend/core/components/forms/GlobalFormModal.ts @@ -37,7 +37,7 @@ export function createFormModal ({ formProps, hasInstances = false }: BaseFormModalOptions & { onSave: Function }) { - + const modal = new Modal({ header, onClose: () => modal.remove() diff --git a/src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js index 9b5e23f66..1d096586e 100644 --- a/src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js @@ -45,7 +45,7 @@ export async function autocompleteFormatString(path) { const modal = new Modal({ header: `${interfaceName} — Autocomplete Format String`, - onClose: () => modal.remove() + onClose: () => modal.remove(), }); const content = document.createElement("div"); diff --git a/src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js index 402f48b79..2fd038091 100644 --- a/src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js +++ b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js @@ -256,9 +256,9 @@ export class GuidedSourceDataPage extends ManagedPage { header.append(h2, small); - const modal = new Modal({ + const modal = new Modal({ header, - onClose: () => modal.remove() + onClose: () => modal.remove(), }); let alignment; diff --git a/src/electron/frontend/core/components/pages/guided-mode/options/GuidedUpload.js b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedUpload.js index c5d8f84b8..d35e3e616 100644 --- a/src/electron/frontend/core/components/pages/guided-mode/options/GuidedUpload.js +++ b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedUpload.js @@ -41,7 +41,7 @@ export class GuidedUploadPage extends Page { icon: keyIcon, label: "API Keys", onClick: () => { - document.body.append(this.globalModal) + document.body.append(this.globalModal); this.globalModal.form.results = structuredClone(global.data.DANDI?.api_keys ?? {}); this.globalModal.open = true; }, @@ -92,7 +92,7 @@ export class GuidedUploadPage extends Page { if (name.includes("api_key")) return await validateDANDIApiKey(value, name.includes("staging")); }, }, - }) + }); } disconnectedCallback() { @@ -175,7 +175,7 @@ export class GuidedUploadPage extends Page { const result = createDandiset.call(this, { title: this.form.resolved.dandiset }); const { modal, done } = result; done.then(() => this.requestUpdate()); - return modal + return modal; }, }), ], @@ -190,8 +190,8 @@ export class GuidedUploadPage extends Page { // Confirm that one api key exists promise.then(() => { const api_keys = global.data.DANDI?.api_keys; - if (!api_keys || !Object.keys(api_keys).length) this.header.controls[0].onClick() // Add modal and open it - }) + if (!api_keys || !Object.keys(api_keys).length) this.header.controls[0].onClick(); // Add modal and open it + }); const untilResult = until(promise, html`Loading form contents...`); diff --git a/src/electron/frontend/core/components/pages/inspect/InspectPage.js b/src/electron/frontend/core/components/pages/inspect/InspectPage.js index 98527b0b6..2dea9bb24 100644 --- a/src/electron/frontend/core/components/pages/inspect/InspectPage.js +++ b/src/electron/frontend/core/components/pages/inspect/InspectPage.js @@ -49,7 +49,6 @@ export class InspectPage extends Page { return result; }; - #modal; disconnectedCallback() { @@ -57,7 +56,6 @@ export class InspectPage extends Page { if (this.#modal) this.#modal.remove(); } - showReport = async (value) => { if (!value) { const message = "Please provide filesystem entries to inspect."; @@ -105,7 +103,7 @@ export class InspectPage extends Page { header: value.length === 1 ? value : `Selected Filesystem Entries`, controls: [downloadJSONButton, downloadTextButton], footer: legend, - onClose: () => this.#modal.remove() + onClose: () => this.#modal.remove(), }); const container = document.createElement("div"); diff --git a/src/electron/frontend/core/components/pages/settings/SettingsPage.js b/src/electron/frontend/core/components/pages/settings/SettingsPage.js index b96de5744..2f67cea66 100644 --- a/src/electron/frontend/core/components/pages/settings/SettingsPage.js +++ b/src/electron/frontend/core/components/pages/settings/SettingsPage.js @@ -259,12 +259,11 @@ export class SettingsPage extends Page { infoIcon.innerHTML = infoSVG; infoIcon.onclick = () => { - if (this.#releaseNotesModal) return (this.#releaseNotesModal.open = true); const modal = (this.#releaseNotesModal = new Modal({ header: `Release Notes`, - onClose: () => modal.remove() + onClose: () => modal.remove(), })); const releaseNotes = document.createElement("div"); diff --git a/src/electron/frontend/core/components/pages/uploads/UploadsPage.js b/src/electron/frontend/core/components/pages/uploads/UploadsPage.js index 0bd20e03e..6e345e3ce 100644 --- a/src/electron/frontend/core/components/pages/uploads/UploadsPage.js +++ b/src/electron/frontend/core/components/pages/uploads/UploadsPage.js @@ -47,7 +47,7 @@ export function createDandiset(results = {}) { const modal = new Modal({ header: "Create a Dandiset", - onClose: () => modal.remove() + onClose: () => modal.remove(), }); const content = document.createElement("div"); @@ -170,7 +170,7 @@ export function createDandiset(results = {}) { return { modal, done: promise, - } + }; } async function getAPIKey(staging = false) { @@ -186,7 +186,7 @@ async function getAPIKey(staging = false) { const modal = new Modal({ header: `${api_key ? "Update" : "Provide"} your ${header(whichAPIKey)}`, open: true, - onClose: () => modal.remove() + onClose: () => modal.remove(), }); const input = new JSONSchemaInput({ @@ -364,9 +364,9 @@ export class UploadsPage extends Page { global.data.uploads = {}; global.save(); - const modal = new Modal({ + const modal = new Modal({ open: true, - onClose: () => modal.remove() + onClose: () => modal.remove(), }); modal.header = "DANDI Upload Summary"; const summary = new DandiResults({ @@ -408,7 +408,7 @@ export class UploadsPage extends Page { done.then(() => this.requestUpdate()); - return modal + return modal; }, }), ], diff --git a/tests/e2e/workflow.ts b/tests/e2e/workflow.ts index ae8ebcc69..e3975a1ce 100644 --- a/tests/e2e/workflow.ts +++ b/tests/e2e/workflow.ts @@ -56,7 +56,7 @@ export const uploadToDandi = (subdirectory, forceSkip = false) => { const page = document.querySelector('nwb-dashboard').page page.dismiss() // Dismiss all internal notifications - + }, modalId) await evaluate(async (dandisetId) => {