From ab62f136be32114d8ae0082a0a36126194527f13 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Sat, 21 Dec 2024 13:24:23 -0500 Subject: [PATCH 1/3] Refactor DLP validation error UI into its own component --- .../DandisetLandingView/DandisetPublish.vue | 145 +---------------- .../DandisetValidationErrors.vue | 152 ++++++++++++++++++ 2 files changed, 156 insertions(+), 141 deletions(-) create mode 100644 web/src/views/DandisetLandingView/DandisetValidationErrors.vue diff --git a/web/src/views/DandisetLandingView/DandisetPublish.vue b/web/src/views/DandisetLandingView/DandisetPublish.vue index d2a587e73..5a1572af4 100644 --- a/web/src/views/DandisetLandingView/DandisetPublish.vue +++ b/web/src/views/DandisetLandingView/DandisetPublish.vue @@ -153,124 +153,7 @@ - - - - - - - - - - - - - - - - - mdi-playlist-remove - - - - -
- This Dandiset has {{ currentDandiset.version_validation_errors.length }} - metadata validation error(s). -
-
-
-
- - - - - - - mdi-database-remove - - - - -
- This Dandiset has {{ numAssetValidationErrors }} - asset validation error(s). -
-
-
-
+ @@ -354,15 +237,14 @@ import moment from 'moment'; import type { RawLocation } from 'vue-router'; import { useRoute } from 'vue-router/composables'; + import { dandiRest, loggedIn as loggedInFunc, user } from '@/rest'; import { useDandisetStore } from '@/stores/dandiset'; import router from '@/router'; import type { User, Version } from '@/types'; - import { draftVersion } from '@/utils/constants'; -import { open as meditorOpen } from '@/components/Meditor/state'; +import DandisetValidationErrors from './DandisetValidationErrors.vue'; -import ValidationErrorDialog from '@/components/DLP/ValidationErrorDialog.vue'; const PUBLISH_CHECKLIST = [ 'A descriptive title (e.g., Data related to foraging behavior in bees rather than Smith et al 2022)', @@ -490,30 +372,11 @@ onUnmounted(() => { window.clearInterval(timer); }); -// Error dialog -const errorDialogOpen = ref(false); -type ErrorCategory = 'metadata' | 'assets'; -const selectedTab = ref('metadata'); -function openErrorDialog(tab: ErrorCategory) { - errorDialogOpen.value = true; - selectedTab.value = tab; -} -function openMeditor() { - errorDialogOpen.value = false; - meditorOpen.value = true; -} -const numAssetValidationErrors = computed(() => { - if (currentDandiset.value === null) { - return 0; - } - - return currentDandiset.value.asset_validation_errors.length; -}); const publishButtonDisabled = computed(() => !!( currentDandiset.value?.version_validation_errors.length - || numAssetValidationErrors.value + || currentDandiset.value?.asset_validation_errors.length || currentDandiset.value?.dandiset.embargo_status !== 'OPEN' || publishDisabledMessage.value )); diff --git a/web/src/views/DandisetLandingView/DandisetValidationErrors.vue b/web/src/views/DandisetLandingView/DandisetValidationErrors.vue new file mode 100644 index 000000000..80d2aa9dc --- /dev/null +++ b/web/src/views/DandisetLandingView/DandisetValidationErrors.vue @@ -0,0 +1,152 @@ + + + From e1ea6bc05e020168003c03e03aaeb3fc02907326 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Sat, 21 Dec 2024 13:28:01 -0500 Subject: [PATCH 2/3] Display validation errors on DLP for embargoed dandisets --- web/src/views/DandisetLandingView/DandisetUnembargo.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/views/DandisetLandingView/DandisetUnembargo.vue b/web/src/views/DandisetLandingView/DandisetUnembargo.vue index d862d6333..e1417c0f0 100644 --- a/web/src/views/DandisetLandingView/DandisetUnembargo.vue +++ b/web/src/views/DandisetLandingView/DandisetUnembargo.vue @@ -146,6 +146,9 @@ This dandiset is being unembargoed, please wait. + + + This Version @@ -176,6 +179,7 @@ import moment from 'moment'; import { dandiRest } from '@/rest'; import { useDandisetStore } from '@/stores/dandiset'; import type { IncompleteUpload } from '@/types'; +import DandisetValidationErrors from './DandisetValidationErrors.vue'; import filesize from 'filesize'; function formatDate(date: string, format: string = 'll'): string { From 0f5bd72a2a7637c62bf3e9df0fad47807f327e60 Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh Date: Sat, 21 Dec 2024 13:29:01 -0500 Subject: [PATCH 3/3] Improve wording for missing assets summary If a dandiset has assets, but they are all in the INVALID status, it will not have an assets summary. --- web/src/components/DLP/OverviewTab.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/DLP/OverviewTab.vue b/web/src/components/DLP/OverviewTab.vue index 4a03df129..ba2a6089e 100644 --- a/web/src/components/DLP/OverviewTab.vue +++ b/web/src/components/DLP/OverviewTab.vue @@ -165,7 +165,7 @@ v-else-if="!assetSummary || !Object.keys(assetSummary).length" class="font-italic font-weight-bold" > - This Dandiset does not contain any assets. + This Dandiset does not contain any valid assets.