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 Jan 3, 2024
1 parent 90c02ca commit 8a2d5f0
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/renderer/src/stories/DandiResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export class DandiResults extends LitElement {
const { message } = await fetch(
`http://api.crossref.org/works${new URL(identifier).pathname}`
).then((res) => res.json());
li.innerHTML = `${message.author.map(({ family, given }) => `${family}, ${given[0]}.`).join(", ")} (${
message.created["date-parts"][0][0]
}). ${message.title[0]}. <i>${message["container-title"]}</i>, <i>${message.volume}</i>(${
message.issue
}), ${message.page}. doi:${message.DOI}`;
li.innerHTML = `${message.author
.map(({ family, given }) => `${family}, ${given[0]}.`)
.join(", ")} (${message.created["date-parts"][0][0]}). ${message.title[0]}. <i>${
message["container-title"]
}</i>, <i>${message.volume}</i>(${message.issue}), ${message.page}. doi:${message.DOI}`;
return li;
})
))
Expand Down
10 changes: 8 additions & 2 deletions src/renderer/src/stories/InstanceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ export class InstanceManager extends LitElement {
const instances = Array.from(this.shadowRoot.querySelectorAll("div[data-instance]"));
const selectedInstanceElement = instances.find((instanceElement) => instanceElement.getAttribute("data-instance") === this.#selected);
const selectedInstanceElement = instances.find(
(instanceElement) => instanceElement.getAttribute("data-instance") === this.#selected
);
if (selectedInstanceElement) {
selectedInstanceElement.hidden = false;
Expand Down Expand Up @@ -437,7 +439,11 @@ export class InstanceManager extends LitElement {
const activeContentElement = this.shadowRoot.querySelector(
"#instance-display > div:not([hidden])"
);
onClick.call(this, activeContentElement.getAttribute("data-instance"), activeContentElement);
onClick.call(
this,
activeContentElement.getAttribute("data-instance"),
activeContentElement
);
}}
>${name}</nwb-button
>`;
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/src/stories/JSONSchemaForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,9 @@ export class JSONSchemaForm extends LitElement {
// Check if everything is internally rendered
get rendered() {
const isRendered = resolve(this.#rendered, () =>
Promise.all([...Object.values(this.#nestedForms), ...Object.values(this.tables)].map(({ rendered }) => rendered))
Promise.all(
[...Object.values(this.#nestedForms), ...Object.values(this.tables)].map(({ rendered }) => rendered)
)
);
return isRendered;
}
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/src/stories/JSONSchemaInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ function getKeyboardFocusableElements(element = document) {
const root = element.shadowRoot || element;
return [
...root.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'),
].filter((focusableElement) => !focusableElement.hasAttribute("disabled") && !focusableElement.getAttribute("aria-hidden"));
].filter(
(focusableElement) =>
!focusableElement.hasAttribute("disabled") && !focusableElement.getAttribute("aria-hidden")
);
}

export class JSONSchemaInput extends LitElement {
Expand Down Expand Up @@ -146,7 +149,7 @@ export class JSONSchemaInput extends LitElement {
const inputElement = this.getElement();
if (inputElement.type === "checkbox") inputElement.checked = value;
else if (inputElement.classList.contains("list"))
inputElement.children[0].items = value
inputElement.children[0].items = value
? value.map((value) => {
return { value };
})
Expand Down
8 changes: 6 additions & 2 deletions src/renderer/src/stories/SimpleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,18 @@ export class SimpleTable extends LitElement {
this.#firstSelected = null;
}

Object.values(this.#selected).forEach((arr) => arr.forEach((cellElement) => cellElement.parentNode.removeAttribute("selected")));
Object.values(this.#selected).forEach((arr) =>
arr.forEach((cellElement) => cellElement.parentNode.removeAttribute("selected"))
);
this.#selected = {};
};

#getPath = (ev) => ev.path || ev.composedPath();
#getCellFromEvent = (ev) => this.#getCellFromPath(this.#getPath(ev));
#getCellFromPath = (path) => {
const found = path.find((element) => element instanceof TableCell || element.children?.[0] instanceof TableCell);
const found = path.find(
(element) => element instanceof TableCell || element.children?.[0] instanceof TableCell
);
if (found instanceof HTMLTableCellElement) return found.children[0];
else return found;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,12 @@ export class GuidedPathExpansionPage extends Page {

const interfaceName = parentPath.slice(-1)[0];

const results = await run(`locate`, { [interfaceName]: entry }, { swal: false }).catch((error) => {
this.notify(error.message, "error");
throw error;
});
const results = await run(`locate`, { [interfaceName]: entry }, { swal: false }).catch(
(error) => {
this.notify(error.message, "error");
throw error;
}
);

const resolved = [];

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/pages/uploads/UploadsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export class UploadsPage extends Page {

transformErrors: (error) => {
if (error.message === "Filesystem Paths is a required property.")
error.message = "Please select at least one file or folder to upload.";
error.message = "Please select at least one file or folder to upload.";
},

validateOnChange: validate,
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/src/stories/preview/NWBFilePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ export class NWBFilePreview extends LitElement {
) // Inspect the first file
: await (async () =>
truncateFilePaths(
await run("inspect_folder", { path, ...options }, { title: title + "s" }),
await run(
"inspect_folder",
{ path, ...options },
{ title: title + "s" }
),
getSharedPath(fileArr.map(({ info }) => info.file))
))();
Expand Down

0 comments on commit 8a2d5f0

Please sign in to comment.