Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 5, 2024
1 parent 3d6381b commit 0ab0f74
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function createFormModal ({
formProps,
hasInstances = false
}: BaseFormModalOptions & { onSave: Function }) {

const modal = new Modal({
header,
onClose: () => modal.remove()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down Expand Up @@ -92,7 +92,7 @@ export class GuidedUploadPage extends Page {
if (name.includes("api_key")) return await validateDANDIApiKey(value, name.includes("staging"));
},
},
})
});
}

disconnectedCallback() {
Expand Down Expand Up @@ -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;
},
}),
],
Expand All @@ -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...`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@ export class InspectPage extends Page {
return result;
};


#modal;

disconnectedCallback() {
super.disconnectedCallback();
if (this.#modal) this.#modal.remove();
}


showReport = async (value) => {
if (!value) {
const message = "Please provide filesystem entries to inspect.";
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -170,7 +170,7 @@ export function createDandiset(results = {}) {
return {
modal,
done: promise,
}
};
}

async function getAPIKey(staging = false) {
Expand All @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -408,7 +408,7 @@ export class UploadsPage extends Page {

done.then(() => this.requestUpdate());

return modal
return modal;
},
}),
],
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 0ab0f74

Please sign in to comment.