Skip to content

Commit

Permalink
Merge branch 'fix-embargo' of https://github.com/NeurodataWithoutBord…
Browse files Browse the repository at this point in the history
…ers/nwb-guide into fix-embargo
  • Loading branch information
garrettmflynn committed Jun 10, 2024
2 parents 80a5b47 + fc9cce2 commit 6f0dce7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/electron/frontend/core/components/JSONSchemaForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,10 @@ export class JSONSchemaForm extends LitElement {
};

validate = async (resolved = this.resolved) => {

if (this.validateEmptyValues === false) {
this.validateEmptyValues = true;
await new Promise((resolve) => setTimeout(resolve, 0)); // Wait for next tick (re-render start)
await this.rendered // Wait for re-render
await this.rendered; // Wait for re-render
}

// Validate nested forms (skip disabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function createDandiset(results = {}) {
schema: dandiCreateSchema,
results,
validateEmptyValues: false, // Only show errors after submission

validateOnChange: async (name, parent) => {
const value = parent[name];

Expand All @@ -90,8 +90,8 @@ export function createDandiset(results = {}) {
groups: [
{
name: "Embargo your Data",
properties: [[ "embargo_status" ], [ "nih_award_number" ]],
link: true
properties: [["embargo_status"], ["nih_award_number"]],
link: true,
},
],
});
Expand All @@ -106,7 +106,6 @@ export function createDandiset(results = {}) {
label: "Create",
primary: true,
onClick: async () => {

await form.validate().catch(() => {
const message = "Please fill out all required fields";
notify("Dandiset was not set", "error");
Expand Down

0 comments on commit 6f0dce7

Please sign in to comment.