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 Oct 3, 2023
1 parent 0641300 commit 81b6f26
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 31 deletions.
2 changes: 1 addition & 1 deletion schemas/json/base_metadata_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/renderer/src/dependencies/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const startLottie = (lottieElement, animationData) => {
return thisLottie;
};

const longDuration = 20000
const longDuration = 20000;

// ---------- Notification Helper ----------
export const notyf = new Notyf({
Expand Down Expand Up @@ -94,7 +94,7 @@ export const notyf = new Notyf({
tagName: "i",
color: "white",
},
duration: longDuration
duration: longDuration,
},
{
type: "error",
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/src/stories/FileSystemSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ export class FilesystemSelector extends LitElement {
};

#handleFiles = async (pathOrPaths, type) => {

const resolvedType = type ?? this.type
const resolvedType = type ?? this.type;

if (Array.isArray(pathOrPaths)) pathOrPaths.forEach(this.#checkType);
else if (!type) this.#checkType(pathOrPaths);
Expand All @@ -151,7 +150,7 @@ export class FilesystemSelector extends LitElement {

if (this.multiple && !Array.isArray(resolvedValue)) resolvedValue = [];

console.log(resolvedValue)
console.log(resolvedValue);

this.value = resolvedValue;
this.onSelect(this.value);
Expand Down Expand Up @@ -187,7 +186,7 @@ export class FilesystemSelector extends LitElement {
resolved = this.value.map((str) => str.replaceAll("\\", "/"));
isUpdated = JSON.stringify(resolved) !== JSON.stringify(this.value);
} else {
resolved = typeof this.value === 'string' ? this.value.replaceAll("\\", "/") : this.value;
resolved = typeof this.value === "string" ? this.value.replaceAll("\\", "/") : this.value;
isUpdated = resolved !== this.value;
}

Expand Down
13 changes: 5 additions & 8 deletions src/renderer/src/stories/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class Search extends LitElement {
super();
this.options = options;
this.showAllWhenEmpty = showAllWhenEmpty;
this.disabledLabel = disabledLabel
this.disabledLabel = disabledLabel;
}

static get styles() {
Expand Down Expand Up @@ -79,7 +79,6 @@ export class Search extends LitElement {
font-size: 90%;
white-space: nowrap;
min-width: min-content;
}
`;
}
Expand Down Expand Up @@ -118,14 +117,12 @@ export class Search extends LitElement {
list = document.createElement("ul");

render() {

// Update list
this.list.remove();
this.list = document.createElement("ul");

if (this.disabledLabel) this.style.setProperty('--disabled-label', `"${this.disabledLabel}"`);
else this.style.removeProperty('--disabled-label')

if (this.disabledLabel) this.style.setProperty("--disabled-label", `"${this.disabledLabel}"`);
else this.style.removeProperty("--disabled-label");

const slot = document.createElement("slot");
this.list.appendChild(slot);
Expand All @@ -151,7 +148,7 @@ export class Search extends LitElement {

if (option.disabled) li.setAttribute("disabled", "");

const container = document.createElement('div')
const container = document.createElement("div");

const label = document.createElement("h4");
label.classList.add("label");
Expand All @@ -163,7 +160,7 @@ export class Search extends LitElement {
keywords.innerText = option.keywords.join(", ");
container.appendChild(keywords);

li.append(container)
li.append(container);
this.list.appendChild(li);

return option.disabled;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/assets/server.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions src/renderer/src/stories/pages/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,14 @@ export class Page extends LitElement {
popup.hideLoading();
const element = popup.getHtmlContainer();
element.innerText = "";
element.style.textAlign = 'left'
element.style.textAlign = "left";
const progressBar = new ProgressBar();
elements.progress = progressBar;
element.append(progressBar);
element.insertAdjacentHTML('beforeend', `<small><small><b>Note:</b> This may take a while to complete...</small></small>`)
element.insertAdjacentHTML(
"beforeend",
`<small><small><b>Note:</b> This may take a while to complete...</small></small>`
);
// }

let completed = 0;
Expand Down Expand Up @@ -194,7 +197,7 @@ export class Page extends LitElement {
}

popup.close();
element.style.textAlign = '' // Clear style update
element.style.textAlign = ""; // Clear style update

return results;
}
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/src/stories/pages/guided-mode/GuidedStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export class GuidedStartPage extends Page {
<p class="guided--help-text">
Guided Mode is divided into four high-level sections. During the first three sections, you
will be directed to specify the data formats and files to include in your dataset and
provide information about your conversion pipeline. In the final section, NWB GUIDE will automatically
generate a valid NWB file and ask for your review before uploading to DANDI. Note that none
of your local data files will ever be modified or moved.
provide information about your conversion pipeline. In the final section, NWB GUIDE will
automatically generate a valid NWB file and ask for your review before uploading to DANDI.
Note that none of your local data files will ever be modified or moved.
</p>
${new InfoBox({
header: "Learn more about the conversion process",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class GuidedStructurePage extends Page {

search = new Search({
showAllWhenEmpty: true,
disabledLabel: "Not supported"
disabledLabel: "Not supported",
});

list = new List({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,32 @@ import baseMetadataSchema from "../../../../../../../schemas/base-metadata.schem

const changesAcrossSessions = {
Subject: ["weight", "subject_id", "age", "date_of_birth", "age__reference"],
NWBFile: ["session_id", "session_start_time", "identifier", "data_collection", "notes", "pharmacolocy", "session_description", "slices", "source_script", "source_script_file_name"]
}
NWBFile: [
"session_id",
"session_start_time",
"identifier",
"data_collection",
"notes",
"pharmacolocy",
"session_description",
"slices",
"source_script",
"source_script_file_name",
],
};

const projectMetadataSchema = merge(projectGlobalSchema, projectGeneralSchema);

Object.entries(baseMetadataSchema.properties).forEach(([globalProp, v]) => {
Object.keys(v.properties).filter(prop => !(changesAcrossSessions[globalProp] ?? []).includes(prop)).forEach(prop => {
const globalNestedProp = projectMetadataSchema.properties[globalProp] ?? (projectMetadataSchema.properties[globalProp] = { properties: {} })
globalNestedProp.properties[prop] = baseMetadataSchema.properties[globalProp].properties[prop]
})
})
Object.keys(v.properties)
.filter((prop) => !(changesAcrossSessions[globalProp] ?? []).includes(prop))
.forEach((prop) => {
const globalNestedProp =
projectMetadataSchema.properties[globalProp] ??
(projectMetadataSchema.properties[globalProp] = { properties: {} });
globalNestedProp.properties[prop] = baseMetadataSchema.properties[globalProp].properties[prop];
});
});

export class GuidedNewDatasetPage extends Page {
constructor(...args) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/pages/preview/PreviewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class PreviewPage extends Page {
if (path) {
const result = await fetch(`${baseUrl}/files/${path}`, { method: "POST" }).then((res) => res.text());
if (result) this.neurosift.url = result;
} else this.neurosift.url = undefined
} else this.neurosift.url = undefined;
};

neurosift = new Neurosift();
Expand Down

0 comments on commit 81b6f26

Please sign in to comment.