Skip to content

Commit

Permalink
CreateDandisetView: Fix max length for name/description
Browse files Browse the repository at this point in the history
Fixes the max lengths for the name and description on the create
dandiset form by pulling them directly from the schema instead of
hardcoding.
  • Loading branch information
mvandenburgh committed Feb 24, 2023
1 parent 122c6dd commit 435cfbd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web/src/views/CreateDandisetView/CreateDandisetView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
label="Name*"
hint="Provide a title for this dataset"
persistent-hint
:counter="120"
:counter="nameMaxLength"
required
outlined
/>
<v-textarea
v-model="description"
label="Description*"
hint="Provide a description for this dataset"
:counter="3000"
:counter="descriptionMaxLength"
persistent-hint
required
outlined
Expand Down Expand Up @@ -145,6 +145,10 @@ const awardNumberRules = computed(
() => [(v: string) => awardNumberValidator(v) || VALIDATION_FAIL_MESSAGE],
);
const nameMaxLength: ComputedRef<number> = computed(() => store.schema.properties.name.maxLength);
const descriptionMaxLength: ComputedRef<number> = computed(
() => store.schema.properties.description.maxLength,
);
const dandiLicenses: ComputedRef<LicenseType[]> = computed(
() => store.schema.definitions.LicenseType.enum,
);
Expand Down

0 comments on commit 435cfbd

Please sign in to comment.