From 3c2e48c76c77906bb88c86cc262c3752aec8cc50 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Wed, 10 Apr 2024 12:31:15 -0700 Subject: [PATCH 1/2] Avoid setting units if not exists. Use global base directory in results --- schemas/base-metadata.schema.ts | 25 +++++++++++-------- .../guided-mode/data/GuidedPathExpansion.js | 7 ++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/schemas/base-metadata.schema.ts b/schemas/base-metadata.schema.ts index b9ed45eea..6dd46a272 100644 --- a/schemas/base-metadata.schema.ts +++ b/schemas/base-metadata.schema.ts @@ -156,16 +156,21 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa order: ["channel_name", "group_name", "shank_electrode_number", ...UV_PROPERTIES] }) - ecephys.properties["Units"].title = "Summarized Units" - - updateEcephysTable("Units", copy, { - properties: { - clu_id: { - title: 'Cluster ID', - } - }, - order: ["unit_id", "unit_name", "clu_id", "group_id"] - }) + if (ecephys.properties["Units"]) { + + ecephys.properties["Units"].title = "Summarized Units" + + + updateEcephysTable("Units", copy, { + properties: { + clu_id: { + title: 'Cluster ID', + } + }, + order: ["unit_id", "unit_name", "clu_id", "group_id"] + }) + + } } diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js index 8ea3ee24a..11dc925e1 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -329,6 +329,9 @@ export class GuidedPathExpansionPage extends Page { await this.form.validate(); + const globalBaseDirectory = this.workflow.base_directory.value; + + const finalStructure = {}; for (let key in structure) { const entry = { ...structure[key] }; @@ -337,9 +340,13 @@ export class GuidedPathExpansionPage extends Page { if (fstring.split(".").length > 1) entry.file_path = fstring; else entry.folder_path = fstring; delete entry.format_string_path; + + if (!entry.base_directory && globalBaseDirectory) entry.base_directory = globalBaseDirectory + finalStructure[key] = entry; } + if (Object.keys(finalStructure).length === 0) { const message = "Please configure at least one interface.
Otherwise, revisit Pipeline Workflow to update your configuration."; From 851138d14417e16820b0aad144c136acb80b92a8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 19:32:26 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- schemas/base-metadata.schema.ts | 2 +- .../src/stories/pages/guided-mode/data/GuidedPathExpansion.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/schemas/base-metadata.schema.ts b/schemas/base-metadata.schema.ts index 6dd46a272..062d1a232 100644 --- a/schemas/base-metadata.schema.ts +++ b/schemas/base-metadata.schema.ts @@ -160,7 +160,7 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa ecephys.properties["Units"].title = "Summarized Units" - + updateEcephysTable("Units", copy, { properties: { clu_id: { diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js index 11dc925e1..4d39e77af 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -331,7 +331,6 @@ export class GuidedPathExpansionPage extends Page { const globalBaseDirectory = this.workflow.base_directory.value; - const finalStructure = {}; for (let key in structure) { const entry = { ...structure[key] }; @@ -341,12 +340,11 @@ export class GuidedPathExpansionPage extends Page { else entry.folder_path = fstring; delete entry.format_string_path; - if (!entry.base_directory && globalBaseDirectory) entry.base_directory = globalBaseDirectory + if (!entry.base_directory && globalBaseDirectory) entry.base_directory = globalBaseDirectory; finalStructure[key] = entry; } - if (Object.keys(finalStructure).length === 0) { const message = "Please configure at least one interface.
Otherwise, revisit Pipeline Workflow to update your configuration.";