diff --git a/guideGlobalMetadata.json b/guideGlobalMetadata.json index 92b7ed5a2..7c2fef953 100644 --- a/guideGlobalMetadata.json +++ b/guideGlobalMetadata.json @@ -25,6 +25,7 @@ "MCSRawRecordingInterface", "MEArecRecordingInterface", "PlexonRecordingInterface", - "PlexonSortingInterface" + "PlexonSortingInterface", + "AxonaRecordingInterface" ] } diff --git a/schemas/json/generated/AxonaRecordingInterface.json b/schemas/json/generated/AxonaRecordingInterface.json new file mode 100644 index 000000000..3459b77b2 --- /dev/null +++ b/schemas/json/generated/AxonaRecordingInterface.json @@ -0,0 +1,33 @@ +{ + "required": [], + "properties": { + "AxonaRecordingInterface": { + "required": [ + "file_path" + ], + "properties": { + "file_path": { + "format": "file", + "type": "string" + }, + "verbose": { + "type": "boolean", + "default": true + }, + "es_key": { + "type": "string", + "default": "ElectricalSeries" + } + }, + "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/pages/guided-mode/SourceData.stories.js b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js index 6ddc65a66..c2cd8d6cb 100644 --- a/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js +++ b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js @@ -25,6 +25,7 @@ import MCSRawRecordingInterfaceSchema from "../../../../../../schemas/json/gener import MEArecRecordingInterfaceSchema from "../../../../../../schemas/json/generated/MEArecRecordingInterface.json"; import PlexonRecordingInterfaceSchema from "../../../../../../schemas/json/generated/PlexonRecordingInterface.json"; import PlexonSortingInterfaceSchema from "../../../../../../schemas/json/generated/PlexonSortingInterface.json"; +import AxonaRecordingInterfaceSchema from "../../../../../../schemas/json/generated/AxonaRecordingInterface.json"; export default { title: "Pages/Guided Mode/Source Data", @@ -88,6 +89,8 @@ globalStateCopy.schema.source_data.properties.PlexonRecordingInterface = PlexonRecordingInterfaceSchema.properties.PlexonRecordingInterface; globalStateCopy.schema.source_data.properties.PlexonSortingInterface = PlexonSortingInterfaceSchema.properties.PlexonSortingInterface; +globalStateCopy.schema.source_data.properties.AxonaRecordingInterface = + AxonaRecordingInterfaceSchema.properties.AxonaRecordingInterface; const results = globalStateCopy.results; for (let sub in results) { @@ -256,3 +259,9 @@ const PlexonSortingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)) PlexonSortingInterfaceGlobalCopy.interfaces.interface = PlexonSortingInterface; PlexonSortingInterfaceGlobalCopy.schema.source_data = PlexonSortingInterfaceSchema; PlexonSortingInterface.args = { activePage, globalState: PlexonSortingInterfaceGlobalCopy }; + +export const AxonaRecordingInterface = PageTemplate.bind({}); +const AxonaRecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +AxonaRecordingInterfaceGlobalCopy.interfaces.interface = AxonaRecordingInterface; +AxonaRecordingInterfaceGlobalCopy.schema.source_data = AxonaRecordingInterfaceSchema; +AxonaRecordingInterface.args = { activePage, globalState: AxonaRecordingInterfaceGlobalCopy }; diff --git a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js index d9a147336..615ade642 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js @@ -109,10 +109,16 @@ export class GuidedSourceDataPage extends ManagedPage { const schema = this.info.globalState.schema.source_data; delete schema.description; + console.log("Schema", schema); + + const schemaResolved = getSourceDataSchema(schema); + + console.log("Schema", schemaResolved); + const form = new JSONSchemaForm({ identifier: instanceId, mode: "accordion", - schema: getSourceDataSchema(schema), + schema: schemaResolved, results: info.source_data, ignore: [ "verbose",