diff --git a/guideGlobalMetadata.json b/guideGlobalMetadata.json index 1346c111f..97eb59b34 100644 --- a/guideGlobalMetadata.json +++ b/guideGlobalMetadata.json @@ -33,6 +33,7 @@ "AlphaOmegaRecordingInterface", "DeepLabCutInterface", "SLEAPInterface", + "FicTracDataInterface", "AudioInterface" ] } diff --git a/schemas/json/generated/FicTracDataInterface.json b/schemas/json/generated/FicTracDataInterface.json new file mode 100644 index 000000000..47804a267 --- /dev/null +++ b/schemas/json/generated/FicTracDataInterface.json @@ -0,0 +1,29 @@ +{ + "required": [], + "properties": { + "FicTracDataInterface": { + "required": [ + "file_path" + ], + "properties": { + "file_path": { + "format": "file", + "type": "string" + }, + "verbose": { + "type": "boolean", + "default": true + } + }, + "type": "object", + "additionalProperties": false + } + }, + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "source.schema.json", + "title": "Source data schema", + "description": "Schema for the source data, files and directories", + "version": "0.1.0" +} diff --git a/src/renderer/src/stories/FileSystemSelector.js b/src/renderer/src/stories/FileSystemSelector.js index fc94871fe..8eab4c6e1 100644 --- a/src/renderer/src/stories/FileSystemSelector.js +++ b/src/renderer/src/stories/FileSystemSelector.js @@ -126,7 +126,7 @@ export class FilesystemSelector extends LitElement { }; #checkType = (value) => { - const isLikelyFile = fs ? fs.lstatSync(value).isFile() : value.split(".").length; + const isLikelyFile = fs ? fs.statSync(value).isFile() : value.split(".").length; if ((this.type === "directory" && isLikelyFile) || (this.type === "file" && !isLikelyFile)) this.#onThrow("Incorrect filesystem object", `Please provide a ${this.type} instead.`); }; diff --git a/src/renderer/src/stories/JSONSchemaForm.js b/src/renderer/src/stories/JSONSchemaForm.js index 2a375271e..73199dd63 100644 --- a/src/renderer/src/stories/JSONSchemaForm.js +++ b/src/renderer/src/stories/JSONSchemaForm.js @@ -514,7 +514,13 @@ export class JSONSchemaForm extends LitElement { const res = entries .map(([key, value]) => { if (!value.properties && key === "definitions") return false; // Skip definitions - if (this.ignore.includes(key)) return false; + if ( + this.ignore.find((v) => { + if (typeof v === "string") return v === key; + else return v.test(key); + }) + ) + return false; if (this.showLevelOverride >= path.length) return isRenderable(key, value); if (required[key]) return isRenderable(key, value); if (this.#getLink([...this.base, ...path, key])) return isRenderable(key, value); diff --git a/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js index 42b25de6e..c42265336 100644 --- a/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js +++ b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js @@ -32,6 +32,7 @@ import NeuralynxRecordingInterfaceSchema from "../../../../../../schemas/json/ge import AlphaOmegaRecordingInterfaceSchema from "../../../../../../schemas/json/generated/AlphaOmegaRecordingInterface.json"; import DeepLabCutInterfaceSchema from "../../../../../../schemas/json/generated/DeepLabCutInterface.json"; import SLEAPInterfaceSchema from "../../../../../../schemas/json/generated/SLEAPInterface.json"; +import FicTracDataInterfaceSchema from "../../../../../../schemas/json/generated/FicTracDataInterface.json"; import AudioInterfaceSchema from "../../../../../../schemas/json/generated/AudioInterface.json"; export default { @@ -109,6 +110,8 @@ globalStateCopy.schema.source_data.properties.AlphaOmegaRecordingInterface = globalStateCopy.schema.source_data.properties.DeepLabCutInterface = DeepLabCutInterfaceSchema.properties.DeepLabCutInterface; globalStateCopy.schema.source_data.properties.SLEAPInterface = SLEAPInterfaceSchema.properties.SLEAPInterface; +globalStateCopy.schema.source_data.properties.FicTracDataInterface = + FicTracDataInterfaceSchema.properties.FicTracDataInterface; globalStateCopy.schema.source_data.properties.AudioInterface = AudioInterfaceSchema.properties.AudioInterface; const results = globalStateCopy.results; @@ -321,6 +324,12 @@ SLEAPInterfaceGlobalCopy.interfaces.interface = SLEAPInterface; SLEAPInterfaceGlobalCopy.schema.source_data = SLEAPInterfaceSchema; SLEAPInterface.args = { activePage, globalState: SLEAPInterfaceGlobalCopy }; +export const FicTracDataInterface = PageTemplate.bind({}); +const FicTracDataInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +FicTracDataInterfaceGlobalCopy.interfaces.interface = FicTracDataInterface; +FicTracDataInterfaceGlobalCopy.schema.source_data = FicTracDataInterfaceSchema; +FicTracDataInterface.args = { activePage, globalState: FicTracDataInterfaceGlobalCopy }; + export const AudioInterface = PageTemplate.bind({}); const AudioInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); AudioInterfaceGlobalCopy.interfaces.interface = AudioInterface; diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js index e0807f79c..3fe49cc04 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js @@ -110,7 +110,14 @@ export class GuidedMetadataPage extends ManagedPage { results, globals: aggregateGlobalMetadata, - ignore: ["Ophys", "subject_id", "session_id"], + ignore: [ + "Ophys", // Always ignore ophys metadata (for now) + "Icephys", // Always ignore icephys metadata (for now) + "Behavior", // Always ignore behavior metadata (for now) + new RegExp("ndx-.+"), // Ignore all ndx extensions + "subject_id", + "session_id", + ], conditionalRequirements: [ {