diff --git a/guideGlobalMetadata.json b/guideGlobalMetadata.json index 7c2fef953..97eb59b34 100644 --- a/guideGlobalMetadata.json +++ b/guideGlobalMetadata.json @@ -15,6 +15,8 @@ "KiloSortSortingInterface", "Spike2RecordingInterface", "BrukerTiffSinglePlaneImagingInterface", + "ExtractSegmentationInterface", + "CnmfeSegmentationInterface", "BrukerTiffMultiPlaneImagingInterface", "MicroManagerTiffImagingInterface", "ScanImageImagingInterface", @@ -26,6 +28,12 @@ "MEArecRecordingInterface", "PlexonRecordingInterface", "PlexonSortingInterface", - "AxonaRecordingInterface" + "AxonaRecordingInterface", + "NeuralynxRecordingInterface", + "AlphaOmegaRecordingInterface", + "DeepLabCutInterface", + "SLEAPInterface", + "FicTracDataInterface", + "AudioInterface" ] } diff --git a/package-lock.json b/package-lock.json index 5d07fc752..5ee7d7459 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "lottie-web": "^5.9.5", "notyf": "^3.9.0", "sweetalert2": "^11.6.13", + "tippy.js": "^6.3.7", "v8-compile-cache": "^2.3.0" }, "devDependencies": { @@ -3400,6 +3401,15 @@ "node": ">=14" } }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@radix-ui/number": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.0.1.tgz", @@ -19446,6 +19456,14 @@ "node": ">=14.0.0" } }, + "node_modules/tippy.js": { + "version": "6.3.7", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", + "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", + "dependencies": { + "@popperjs/core": "^2.9.0" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", diff --git a/package.json b/package.json index dda8296a5..fb97e0b00 100644 --- a/package.json +++ b/package.json @@ -151,6 +151,7 @@ "lottie-web": "^5.9.5", "notyf": "^3.9.0", "sweetalert2": "^11.6.13", + "tippy.js": "^6.3.7", "v8-compile-cache": "^2.3.0" }, "devDependencies": { diff --git a/schemas/json/generated/AlphaOmegaRecordingInterface.json b/schemas/json/generated/AlphaOmegaRecordingInterface.json new file mode 100644 index 000000000..420bf7378 --- /dev/null +++ b/schemas/json/generated/AlphaOmegaRecordingInterface.json @@ -0,0 +1,33 @@ +{ + "required": [], + "properties": { + "AlphaOmegaRecordingInterface": { + "required": [ + "folder_path" + ], + "properties": { + "folder_path": { + "format": "directory", + "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/schemas/json/generated/AudioInterface.json b/schemas/json/generated/AudioInterface.json new file mode 100644 index 000000000..9ffca2ef0 --- /dev/null +++ b/schemas/json/generated/AudioInterface.json @@ -0,0 +1,28 @@ +{ + "required": [], + "properties": { + "AudioInterface": { + "required": [ + "file_paths" + ], + "properties": { + "file_paths": { + "type": "array" + }, + "verbose": { + "type": "boolean", + "default": false + } + }, + "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/schemas/json/generated/CnmfeSegmentationInterface.json b/schemas/json/generated/CnmfeSegmentationInterface.json new file mode 100644 index 000000000..381a6c3a7 --- /dev/null +++ b/schemas/json/generated/CnmfeSegmentationInterface.json @@ -0,0 +1,29 @@ +{ + "required": [], + "properties": { + "CnmfeSegmentationInterface": { + "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/schemas/json/generated/DeepLabCutInterface.json b/schemas/json/generated/DeepLabCutInterface.json new file mode 100644 index 000000000..29cbcd0bd --- /dev/null +++ b/schemas/json/generated/DeepLabCutInterface.json @@ -0,0 +1,38 @@ +{ + "required": [], + "properties": { + "DeepLabCutInterface": { + "required": [ + "file_path", + "config_file_path" + ], + "properties": { + "file_path": { + "format": "file", + "type": "string" + }, + "config_file_path": { + "format": "file", + "type": "string" + }, + "subject_name": { + "type": "string", + "default": "ind1" + }, + "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/schemas/json/generated/ExtractSegmentationInterface.json b/schemas/json/generated/ExtractSegmentationInterface.json new file mode 100644 index 000000000..6d488ff38 --- /dev/null +++ b/schemas/json/generated/ExtractSegmentationInterface.json @@ -0,0 +1,36 @@ +{ + "required": [], + "properties": { + "ExtractSegmentationInterface": { + "required": [ + "file_path", + "sampling_frequency" + ], + "properties": { + "file_path": { + "format": "file", + "type": "string" + }, + "sampling_frequency": { + "type": "number" + }, + "output_struct_name": { + "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/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/schemas/json/generated/NeuralynxRecordingInterface.json b/schemas/json/generated/NeuralynxRecordingInterface.json new file mode 100644 index 000000000..dfd28cada --- /dev/null +++ b/schemas/json/generated/NeuralynxRecordingInterface.json @@ -0,0 +1,36 @@ +{ + "required": [], + "properties": { + "NeuralynxRecordingInterface": { + "required": [ + "folder_path" + ], + "properties": { + "folder_path": { + "format": "directory", + "type": "string" + }, + "stream_name": { + "type": "string" + }, + "verbose": { + "type": "boolean", + "default": false + }, + "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/schemas/json/generated/SLEAPInterface.json b/schemas/json/generated/SLEAPInterface.json new file mode 100644 index 000000000..57242afdc --- /dev/null +++ b/schemas/json/generated/SLEAPInterface.json @@ -0,0 +1,36 @@ +{ + "required": [], + "properties": { + "SLEAPInterface": { + "required": [ + "file_path" + ], + "properties": { + "file_path": { + "format": "file", + "type": "string" + }, + "video_file_path": { + "format": "file", + "type": "string" + }, + "verbose": { + "type": "boolean", + "default": true + }, + "frames_per_second": { + "type": "number" + } + }, + "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/assets/css/demo.css b/src/renderer/assets/css/demo.css index 4d4eb688f..f959c0a4d 100755 --- a/src/renderer/assets/css/demo.css +++ b/src/renderer/assets/css/demo.css @@ -713,13 +713,6 @@ table.table-save-metadata { font-size: 14px; font-style: italic; } - -.info { - width: 18px; - height: 18px; - float: right; -} - .tooltipnew .tooltiptext { visibility: hidden; width: 400px; diff --git a/src/renderer/assets/css/global.css b/src/renderer/assets/css/global.css index bb44ffba5..936161b96 100755 --- a/src/renderer/assets/css/global.css +++ b/src/renderer/assets/css/global.css @@ -14,7 +14,16 @@ } .notyf__message { - word-wrap: break-word; + word-break: break-all; +} + +/* Tippy */ +.tippy-box[data-theme~="error"] { + background-color: hsl(0, 100%, 70%); +} + +.tippy-box[data-theme~="warning"] { + background-color: hsl(57, 100%, 70%); } /* Global ---------------------------- */ diff --git a/src/renderer/src/stories/FileSystemSelector.js b/src/renderer/src/stories/FileSystemSelector.js index 5bdc10c9d..8eab4c6e1 100644 --- a/src/renderer/src/stories/FileSystemSelector.js +++ b/src/renderer/src/stories/FileSystemSelector.js @@ -1,6 +1,6 @@ import { LitElement, css, html } from "lit"; -import { remote } from "../electron/index"; +import { fs, remote } from "../electron/index"; const { dialog } = remote; function getObjectTypeReferenceString(type, multiple, { nested, native } = {}) { @@ -126,7 +126,7 @@ export class FilesystemSelector extends LitElement { }; #checkType = (value) => { - const isLikelyFile = value.split(".").length !== 1; + 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.`); }; @@ -150,8 +150,6 @@ export class FilesystemSelector extends LitElement { if (this.multiple && !Array.isArray(resolvedValue)) resolvedValue = []; - console.log(resolvedValue); - this.value = resolvedValue; this.onSelect(this.value); const event = new Event("change"); // Create a new change event diff --git a/src/renderer/src/stories/JSONSchemaForm.js b/src/renderer/src/stories/JSONSchemaForm.js index ecc801efd..4bbc76abf 100644 --- a/src/renderer/src/stories/JSONSchemaForm.js +++ b/src/renderer/src/stories/JSONSchemaForm.js @@ -521,7 +521,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); @@ -627,7 +633,6 @@ export class JSONSchemaForm extends LitElement { // For non-links, throw a basic requirement error if the property is required if (!errors.length && isRequired && !parent[name]) { const schema = this.getSchema(localPath); - console.log(schema); errors.push({ message: `${schema.title ?? header(name)} is a required property.`, type: "error", diff --git a/src/renderer/src/stories/List.ts b/src/renderer/src/stories/List.ts index 7ffb24b26..d6e92b37e 100644 --- a/src/renderer/src/stories/List.ts +++ b/src/renderer/src/stories/List.ts @@ -28,6 +28,7 @@ export class List extends LitElement { #empty { padding: 20px 10px; + margin-left: -40px; color: gray; } diff --git a/src/renderer/src/stories/Table.js b/src/renderer/src/stories/Table.js index 2707b2da2..eaa0f4948 100644 --- a/src/renderer/src/stories/Table.js +++ b/src/renderer/src/stories/Table.js @@ -6,6 +6,9 @@ import { errorHue, warningHue } from "./globals"; import { checkStatus } from "../validation"; import { emojiFontFamily } from "./globals"; +import tippy from "tippy.js"; +import "tippy.js/dist/tippy.css"; + const maxRows = 20; // Inject scoped stylesheet @@ -13,6 +16,7 @@ const styles = ` ${css} + .handsontable td[error] { background: hsl(${errorHue}, 100%, 90%) !important; } @@ -37,11 +41,8 @@ const styles = ` padding-left: 20px } - [title] .relative::after { - content: 'ℹ️'; - display: inline-block; + .relative .info { margin: 0px 5px; - text-align: center; font-size: 80%; font-family: ${emojiFontFamily} } @@ -283,7 +284,19 @@ export class Table extends LitElement { const onAfterGetHeader = function (index, TH) { const desc = entries[colHeaders[index]].description; - if (desc) TH.setAttribute("title", desc); + if (desc) { + const rel = TH.querySelector(".relative"); + let span = rel.querySelector(".info"); + if (!span) { + span = document.createElement("span"); + span.classList.add("info"); + span.innerText = "ℹ️"; + rel.append(span); + } + + if (span._tippy) span._tippy.destroy(); + tippy(span, { content: `${desc}` }); + } }; const data = this.#getData(); @@ -425,17 +438,20 @@ export class Table extends LitElement { if (cell) { let title = ""; + let theme = ""; if (warnings.length) { - cell.setAttribute("warning", ""); - title = warnings.map((o) => o.message).join("\n"); + (theme = "warning"), (title = warnings.map((o) => o.message).join("\n")); } else cell.removeAttribute("warning"); if (errors.length) { - cell.setAttribute("error", ""); - title = errors.map((o) => o.message).join("\n"); // Class switching handled automatically + (theme = "error"), (title = errors.map((o) => o.message).join("\n")); // Class switching handled automatically } else cell.removeAttribute("error"); - if (title) cell.title = title; + if (theme) cell.setAttribute(theme, ""); + + if (cell._tippy) cell._tippy.destroy(); + + if (title) tippy(cell, { content: title, theme }); } this.#checkStatus(); // Check status after every validation update diff --git a/src/renderer/src/stories/pages/Page.js b/src/renderer/src/stories/pages/Page.js index 016764081..50f962a65 100644 --- a/src/renderer/src/stories/pages/Page.js +++ b/src/renderer/src/stories/pages/Page.js @@ -56,8 +56,9 @@ export class Page extends LitElement { }; notify = (...args) => { - const note = notify(...args); - this.#notifications.push(note); + const ref = notify(...args); + this.#notifications.push(ref); + return ref; }; to = async (transition) => { 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 c2cd8d6cb..c42265336 100644 --- a/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js +++ b/src/renderer/src/stories/pages/guided-mode/SourceData.stories.js @@ -14,6 +14,8 @@ import CellExplorerSortingInterfaceSchema from "../../../../../../schemas/json/g import KiloSortSortingInterfaceSchema from "../../../../../../schemas/json/generated/KiloSortSortingInterface.json"; import Spike2RecordingInterfaceSchema from "../../../../../../schemas/json/generated/Spike2RecordingInterface.json"; import BrukerTiffSinglePlaneImagingInterfaceSchema from "../../../../../../schemas/json/generated/BrukerTiffSinglePlaneImagingInterface.json"; +import ExtractSegmentationInterfaceSchema from "../../../../../../schemas/json/generated/ExtractSegmentationInterface.json"; +import CnmfeSegmentationInterfaceSchema from "../../../../../../schemas/json/generated/CnmfeSegmentationInterface.json"; import BrukerTiffMultiPlaneImagingInterfaceSchema from "../../../../../../schemas/json/generated/BrukerTiffMultiPlaneImagingInterface.json"; import MicroManagerTiffImagingInterfaceSchema from "../../../../../../schemas/json/generated/MicroManagerTiffImagingInterface.json"; import ScanImageImagingInterfaceSchema from "../../../../../../schemas/json/generated/ScanImageImagingInterface.json"; @@ -26,6 +28,12 @@ import MEArecRecordingInterfaceSchema from "../../../../../../schemas/json/gener import PlexonRecordingInterfaceSchema from "../../../../../../schemas/json/generated/PlexonRecordingInterface.json"; import PlexonSortingInterfaceSchema from "../../../../../../schemas/json/generated/PlexonSortingInterface.json"; import AxonaRecordingInterfaceSchema from "../../../../../../schemas/json/generated/AxonaRecordingInterface.json"; +import NeuralynxRecordingInterfaceSchema from "../../../../../../schemas/json/generated/NeuralynxRecordingInterface.json"; +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 { title: "Pages/Guided Mode/Source Data", @@ -67,6 +75,10 @@ globalStateCopy.schema.source_data.properties.Spike2RecordingInterface = Spike2RecordingInterfaceSchema.properties.Spike2RecordingInterface; globalStateCopy.schema.source_data.properties.BrukerTiffSinglePlaneImagingInterface = BrukerTiffSinglePlaneImagingInterfaceSchema.properties.BrukerTiffSinglePlaneImagingInterface; +globalStateCopy.schema.source_data.properties.ExtractSegmentationInterface = + ExtractSegmentationInterfaceSchema.properties.ExtractSegmentationInterface; +globalStateCopy.schema.source_data.properties.CnmfeSegmentationInterface = + CnmfeSegmentationInterfaceSchema.properties.CnmfeSegmentationInterface; globalStateCopy.schema.source_data.properties.BrukerTiffMultiPlaneImagingInterface = BrukerTiffMultiPlaneImagingInterfaceSchema.properties.BrukerTiffMultiPlaneImagingInterface; globalStateCopy.schema.source_data.properties.MicroManagerTiffImagingInterface = @@ -91,6 +103,16 @@ globalStateCopy.schema.source_data.properties.PlexonSortingInterface = PlexonSortingInterfaceSchema.properties.PlexonSortingInterface; globalStateCopy.schema.source_data.properties.AxonaRecordingInterface = AxonaRecordingInterfaceSchema.properties.AxonaRecordingInterface; +globalStateCopy.schema.source_data.properties.NeuralynxRecordingInterface = + NeuralynxRecordingInterfaceSchema.properties.NeuralynxRecordingInterface; +globalStateCopy.schema.source_data.properties.AlphaOmegaRecordingInterface = + AlphaOmegaRecordingInterfaceSchema.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; for (let sub in results) { @@ -194,6 +216,18 @@ BrukerTiffSinglePlaneImagingInterface.args = { globalState: BrukerTiffSinglePlaneImagingInterfaceGlobalCopy, }; +export const ExtractSegmentationInterface = PageTemplate.bind({}); +const ExtractSegmentationInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +ExtractSegmentationInterfaceGlobalCopy.interfaces.interface = ExtractSegmentationInterface; +ExtractSegmentationInterfaceGlobalCopy.schema.source_data = ExtractSegmentationInterfaceSchema; +ExtractSegmentationInterface.args = { activePage, globalState: ExtractSegmentationInterfaceGlobalCopy }; + +export const CnmfeSegmentationInterface = PageTemplate.bind({}); +const CnmfeSegmentationInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +CnmfeSegmentationInterfaceGlobalCopy.interfaces.interface = CnmfeSegmentationInterface; +CnmfeSegmentationInterfaceGlobalCopy.schema.source_data = CnmfeSegmentationInterfaceSchema; +CnmfeSegmentationInterface.args = { activePage, globalState: CnmfeSegmentationInterfaceGlobalCopy }; + export const BrukerTiffMultiPlaneImagingInterface = PageTemplate.bind({}); const BrukerTiffMultiPlaneImagingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); BrukerTiffMultiPlaneImagingInterfaceGlobalCopy.interfaces.interface = BrukerTiffMultiPlaneImagingInterface; @@ -265,3 +299,39 @@ const AxonaRecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState) AxonaRecordingInterfaceGlobalCopy.interfaces.interface = AxonaRecordingInterface; AxonaRecordingInterfaceGlobalCopy.schema.source_data = AxonaRecordingInterfaceSchema; AxonaRecordingInterface.args = { activePage, globalState: AxonaRecordingInterfaceGlobalCopy }; + +export const NeuralynxRecordingInterface = PageTemplate.bind({}); +const NeuralynxRecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +NeuralynxRecordingInterfaceGlobalCopy.interfaces.interface = NeuralynxRecordingInterface; +NeuralynxRecordingInterfaceGlobalCopy.schema.source_data = NeuralynxRecordingInterfaceSchema; +NeuralynxRecordingInterface.args = { activePage, globalState: NeuralynxRecordingInterfaceGlobalCopy }; + +export const AlphaOmegaRecordingInterface = PageTemplate.bind({}); +const AlphaOmegaRecordingInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +AlphaOmegaRecordingInterfaceGlobalCopy.interfaces.interface = AlphaOmegaRecordingInterface; +AlphaOmegaRecordingInterfaceGlobalCopy.schema.source_data = AlphaOmegaRecordingInterfaceSchema; +AlphaOmegaRecordingInterface.args = { activePage, globalState: AlphaOmegaRecordingInterfaceGlobalCopy }; + +export const DeepLabCutInterface = PageTemplate.bind({}); +const DeepLabCutInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +DeepLabCutInterfaceGlobalCopy.interfaces.interface = DeepLabCutInterface; +DeepLabCutInterfaceGlobalCopy.schema.source_data = DeepLabCutInterfaceSchema; +DeepLabCutInterface.args = { activePage, globalState: DeepLabCutInterfaceGlobalCopy }; + +export const SLEAPInterface = PageTemplate.bind({}); +const SLEAPInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState)); +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; +AudioInterfaceGlobalCopy.schema.source_data = AudioInterfaceSchema; +AudioInterface.args = { activePage, globalState: AudioInterfaceGlobalCopy }; 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: [ { 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 c1b4e2e72..f259b7c9a 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js @@ -166,10 +166,7 @@ export class GuidedPathExpansionPage extends Page { const subjects = Object.keys(results); if (subjects.length === 0) { const message = "No subjects found with the current configuration. Please try again."; - notyf.open({ - type: "error", - message, - }); + this.notify(message, "error"); throw message; } @@ -197,10 +194,7 @@ export class GuidedPathExpansionPage extends Page { if (!this.optional.toggled) { const message = "Please select a path expansion option."; - notyf.open({ - type: "error", - message, - }); + this.notify(message, "error"); throw new Error(message); } 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 615ade642..40454e18d 100644 --- a/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js +++ b/src/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js @@ -109,12 +109,8 @@ 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", diff --git a/src/renderer/src/stories/pages/settings/SettingsPage.js b/src/renderer/src/stories/pages/settings/SettingsPage.js index 3aff44476..d610f96ac 100644 --- a/src/renderer/src/stories/pages/settings/SettingsPage.js +++ b/src/renderer/src/stories/pages/settings/SettingsPage.js @@ -35,9 +35,9 @@ export class SettingsPage extends Page { #notification; - #openNotyf = (opts) => { + #openNotyf = (message, type) => { if (this.#notification) notyf.dismiss(this.#notification); - return (this.#notification = notyf.open(opts)); + return (this.#notification = this.notify(message, type)); }; beforeSave = () => { @@ -51,10 +51,7 @@ export class SettingsPage extends Page { merge(this.form.resolved, global.data); global.save(); // Save the changes, even if invalid on the form - this.#openNotyf({ - type: "success", - message: "Global settings changes saved", - }); + this.#openNotyf("Global settings changes saved", "success"); }; render() { @@ -63,8 +60,7 @@ export class SettingsPage extends Page { const button = new Button({ label: "Save Changes", onClick: async () => { - if (!this.unsavedUpdates) - return this.#openNotyf({ type: "success", message: "All changes were already saved" }); + if (!this.unsavedUpdates) return this.#openNotyf("All changes were already saved", "success"); this.save(); }, }); diff --git a/src/renderer/src/stories/pages/uploads/UploadsPage.js b/src/renderer/src/stories/pages/uploads/UploadsPage.js index 7039bbb9f..6ddefb19c 100644 --- a/src/renderer/src/stories/pages/uploads/UploadsPage.js +++ b/src/renderer/src/stories/pages/uploads/UploadsPage.js @@ -48,20 +48,17 @@ export async function uploadToDandi(info, type = "project" in info ? "project" : }, { title: "Uploading to DANDI" } ).catch((e) => { - notyf.open({ - type: "error", - message: e.message, - }); + this.notify(e.message, "error"); throw e; }); if (result) - notyf.open({ - type: "success", - message: `${ + this.notify( + `${ info.project ?? `${info[folderPathKey].length} filesystem entries` } successfully uploaded to Dandiset ${dandiset_id}`, - }); + "success" + ); return result; }