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 23, 2024
1 parent ac2596f commit 9c085bf
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/renderer/src/stories/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ export class Accordion extends LitElement {
};

toOpen = (state = this.open) => {
if (!this.toggleable) return true; // Force open if not toggleable
if (!this.toggleable)
return true; // Force open if not toggleable
else if (this.disabled) return false; // Force closed if disabled
return state;
};
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/src/stories/FileSystemSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ export class FilesystemSelector extends LitElement {
// const path = file.filePath ?? file.filePaths?.[0];
this.#handleFiles(results.filePath ?? results.filePaths, type);
} else {
let handles = await (type === "directory"
? window.showDirectoryPicker()
: window.showOpenFilePicker({ multiple: this.multiple })
let handles = await (
type === "directory"
? window.showDirectoryPicker()
: window.showOpenFilePicker({ multiple: this.multiple })
).catch(() => []); // Call using the same options

const result = Array.isArray(handles) ? handles.map(({ name }) => name) : handles.name;
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/stories/SimpleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,8 @@ export class SimpleTable extends LitElement {
let target = this.data;

if (!isResolved) {
if (!this.keyColumn) this.data[rowName] = {}; // Add new row to array
if (!this.keyColumn)
this.data[rowName] = {}; // Add new row to array
else {
rowName = row;
if (!this.#unresolved[rowName]) this.#unresolved[rowName] = {}; // Ensure row exists
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/stories/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ export class Table extends LitElement {
let target = this.data;

if (!isResolved) {
if (!this.keyColumn) this.data[rowName] = {}; // Add new row to array
if (!this.keyColumn)
this.data[rowName] = {}; // Add new row to array
else {
rowName = row;
if (!unresolved[rowName]) unresolved[rowName] = {}; // Ensure row exists
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/src/stories/pages/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export class Page extends LitElement {
transition === 1 && // Only ensure save for standard forward progression
!this.info.states.saved)
) {
if (transition === 1) await this.save(); // Save before a single forward transition
if (transition === 1)
await this.save(); // Save before a single forward transition
else {
await Swal.fire({
title: "You have unsaved data on this page.",
Expand Down Expand Up @@ -144,7 +145,8 @@ export class Page extends LitElement {
if (!Array.isArray(toRun)) toRun = this.mapSessions();

// Filter the sessions to run
if (typeof original === "number") toRun = randomizeElements(toRun, original); // Grab a random set of sessions
if (typeof original === "number")
toRun = randomizeElements(toRun, original); // Grab a random set of sessions
else if (typeof original === "string") toRun = toRun.filter(({ subject }) => subject === original);
else if (typeof original === "function") toRun = toRun.filter(original);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,14 @@ export class GuidedPathExpansionPage extends Page {
if (!keepExistingData) {
for (let sub in globalResults) {
const subRef = results[sub];
if (!subRef) delete globalResults[sub]; // Delete removed subjects
if (!subRef)
delete globalResults[sub]; // Delete removed subjects
else {
for (let ses in globalResults[sub]) {
const sesRef = subRef[ses];

if (!sesRef) delete globalResults[sub][ses]; // Delete removed sessions
if (!sesRef)
delete globalResults[sub][ses]; // Delete removed sessions
else {
const globalSesRef = globalResults[sub][ses];

Expand Down
12 changes: 5 additions & 7 deletions src/renderer/src/stories/pages/settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ const schema = merge(
properties: {
DANDI: {
title: "DANDI Settings",
...dandiGlobalSchema
...dandiGlobalSchema,
},
developer: {
title: "Developer Settings",
...developerGlobalSchema
...developerGlobalSchema,
},
},
required: ["DANDI"],
Expand Down Expand Up @@ -140,7 +140,6 @@ export class SettingsPage extends Page {
this.#openNotyf(`Global settings changes saved.`, "success");
};


render() {
this.localState = structuredClone(global.data);

Expand All @@ -157,7 +156,6 @@ export class SettingsPage extends Page {
onThrow,
});


const generatePipelineButton = new Button({
label: "Generate Test Pipelines",
onClick: async () => {
Expand All @@ -179,13 +177,13 @@ export class SettingsPage extends Page {

this.#openNotyf(`Generated ${nPipelines} test pipelines`, "success");
},
})
});

setTimeout(() => {
const testFolderInput = this.form.getInput(["developer", "testing_data_folder"]);
console.log(testFolderInput)
console.log(testFolderInput);
testFolderInput.after(generatePipelineButton);
}, 100)
}, 100);

return html`
<p><b>Server Port:</b> ${port}</p>
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/stories/pages/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export function merge(toMerge = {}, target = {}, mergeOptions = {}) {
} else if (isObject(value)) {
if (isObject(targetValue)) target[k] = merge(value, targetValue, mergeOptions);
else {
if (mergeOptions.clone) target[k] = merge(value, {}, mergeOptions); // Replace primitive values
if (mergeOptions.clone)
target[k] = merge(value, {}, mergeOptions); // Replace primitive values
else target[k] = value; // Replace object values
}
} else target[k] = value; // Replace primitive values
Expand Down

0 comments on commit 9c085bf

Please sign in to comment.