Skip to content

Commit

Permalink
Merge pull request #525 from NeurodataWithoutBorders/remove-preview-o…
Browse files Browse the repository at this point in the history
…utput-location

Remove preview output location option
  • Loading branch information
CodyCBakerPhD authored Nov 22, 2023
2 parents 40b081c + 3827837 commit 2e94f79
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
6 changes: 0 additions & 6 deletions schemas/json/project/globals.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
"type": "string",
"format": "directory",
"description": "Provide a custom output location for your NWB files. Will default to ~/NWB_GUIDE/conversions"
},

"preview_output_folder": {
"type": "string",
"format": "directory",
"description": "Provide a custom output location for your NWB stub files. Will default to ~/NWB_GUIDE/preview. These files are expected to much smaller than the conversion files (only ~MB in scale)."
}
}
}
4 changes: 2 additions & 2 deletions src/renderer/src/stories/pages/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class Page extends LitElement {
const { subject, session, globalState = this.info.globalState } = info;
const file = `sub-${subject}/sub-${subject}_ses-${session}.nwb`;

const { conversion_output_folder, preview_output_folder, name } = globalState.project;
const { conversion_output_folder, name } = globalState.project;

// Resolve the correct session info from all of the metadata for this conversion
const sessionInfo = {
Expand All @@ -197,7 +197,7 @@ export class Page extends LitElement {

const result = await runConversion(
{
output_folder: conversionOptions.stub_test ? preview_output_folder : conversion_output_folder,
output_folder: conversionOptions.stub_test ? undefined : conversion_output_folder,
project_name: name,
nwbfile_path: file,
overwrite: true, // We assume override is true because the native NWB file dialog will not allow the user to select an existing file (unless they approve the overwrite)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { validateOnChange } from "../../../../validation/index.js";
import projectGeneralSchema from "../../../../../../../schemas/json/project/general.json" assert { type: "json" };
import projectGlobalSchema from "../../../../../../../schemas/json/project/globals.json" assert { type: "json" };
import { merge } from "../../utils.js";
import { schemaToPages } from "../../FormPage.js";
import { onThrow } from "../../../../errors";

import { globalSchema } from "../../../../../../../schemas/base-metadata.schema";
import { header } from "../../../forms/utils";

const projectMetadataSchema = merge(projectGlobalSchema, projectGeneralSchema);
Expand Down Expand Up @@ -81,7 +78,7 @@ export class GuidedNewDatasetPage extends Page {
const schema = { ...projectMetadataSchema };
schema.properties = { ...schema.properties };

this.state = merge(global.data.output_locations, structuredClone(this.info.globalState.project));
this.state = merge(global.data, structuredClone(this.info.globalState.project));

this.form = new JSONSchemaForm({
schema,
Expand Down
19 changes: 13 additions & 6 deletions src/renderer/src/stories/pages/settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ import projectGlobalSchema from "../../../../../../schemas/json/project/globals.

import { validateDANDIApiKey } from "../../../validation/dandi";

const schema = {
properties: {
output_locations: projectGlobalSchema,
DANDI: dandiGlobalSchema,
const schema = merge(
projectGlobalSchema,
{
properties: {
DANDI: dandiGlobalSchema,
},
required: ["DANDI"],
},
required: ["output_locations", "DANDI"],
};
{
arrays: true,
}
);

console.log(schema);

import { Button } from "../../Button.js";
import { global } from "../../../progress/index.js";
Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/validation/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

"name": false,
"conversion_output_folder": false,
"preview_output_folder": false,

"NWBFile": {
"identifier": false,
Expand Down

0 comments on commit 2e94f79

Please sign in to comment.