From 435cfbd9a70f8de1c7d6728d0c181be27ef56421 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Fri, 24 Feb 2023 14:41:07 -0500 Subject: [PATCH] CreateDandisetView: Fix max length for name/description Fixes the max lengths for the name and description on the create dandiset form by pulling them directly from the schema instead of hardcoding. --- web/src/views/CreateDandisetView/CreateDandisetView.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/views/CreateDandisetView/CreateDandisetView.vue b/web/src/views/CreateDandisetView/CreateDandisetView.vue index b1cc60b62..c4a4c33e5 100644 --- a/web/src/views/CreateDandisetView/CreateDandisetView.vue +++ b/web/src/views/CreateDandisetView/CreateDandisetView.vue @@ -10,7 +10,7 @@ label="Name*" hint="Provide a title for this dataset" persistent-hint - :counter="120" + :counter="nameMaxLength" required outlined /> @@ -18,7 +18,7 @@ v-model="description" label="Description*" hint="Provide a description for this dataset" - :counter="3000" + :counter="descriptionMaxLength" persistent-hint required outlined @@ -145,6 +145,10 @@ const awardNumberRules = computed( () => [(v: string) => awardNumberValidator(v) || VALIDATION_FAIL_MESSAGE], ); +const nameMaxLength: ComputedRef = computed(() => store.schema.properties.name.maxLength); +const descriptionMaxLength: ComputedRef = computed( + () => store.schema.properties.description.maxLength, +); const dandiLicenses: ComputedRef = computed( () => store.schema.definitions.LicenseType.enum, );