From 8c73b88eaa95fe43b8fd983707a00322a380126e Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 6 Dec 2024 09:32:21 -0500 Subject: [PATCH 1/4] Improve language in collection builders... --- .../Collections/CollectionCreatorModal.vue | 21 +++++++++++-------- .../Collections/ListCollectionCreator.vue | 2 +- .../Collections/PairCollectionCreator.vue | 3 ++- .../PairedListCollectionCreator.vue | 3 ++- .../Collections/common/CollectionCreator.vue | 18 ++++++++++++++-- .../Form/Elements/FormData/FormData.vue | 12 ++++++++++- 6 files changed, 44 insertions(+), 15 deletions(-) diff --git a/client/src/components/Collections/CollectionCreatorModal.vue b/client/src/components/Collections/CollectionCreatorModal.vue index 334f6586e0da..8db25d243c6d 100644 --- a/client/src/components/Collections/CollectionCreatorModal.vue +++ b/client/src/components/Collections/CollectionCreatorModal.vue @@ -113,22 +113,25 @@ watch( } ); +const extensionInTitle = computed(() => { + const extensions = props.extensions; + if (!extensions || extensions.length == 0 || extensions.indexOf("data") >= 0) { + return ""; + } else { + return orList(extensions); + } +}); + const modalTitle = computed(() => { if (props.collectionType === "list") { - return localize( - `Create a collection from a list of ${fromSelection.value ? "selected" : ""} ${ - props.extensions?.length ? orList(props.extensions) : "" - } datasets` - ); + return localize(`Create a list of ${fromSelection.value ? "selected" : ""} ${extensionInTitle.value} datasets`); } else if (props.collectionType === "list:paired") { return localize( - `Create a collection of ${fromSelection.value ? "selected" : ""} ${ - props.extensions?.length ? orList(props.extensions) : "" - } dataset pairs` + `Create a list of ${fromSelection.value ? "selected" : ""} ${extensionInTitle.value} paired datasets` ); } else if (props.collectionType === "paired") { return localize( - `Create a ${props.extensions?.length ? orList(props.extensions) : ""} dataset pair collection ${ + `Create a ${extensionInTitle.value} paired dataset collection ${ fromSelection.value ? "from selected items" : "" }` ); diff --git a/client/src/components/Collections/ListCollectionCreator.vue b/client/src/components/Collections/ListCollectionCreator.vue index 841a206a3635..b68f573c76ae 100644 --- a/client/src/components/Collections/ListCollectionCreator.vue +++ b/client/src/components/Collections/ListCollectionCreator.vue @@ -412,13 +412,13 @@ function renameElement(element: any, name: string) { :history-id="props.historyId" :hide-source-items="hideSourceItems" :extensions="extensions" + collectionType="list" :no-items="props.initialElements.length == 0 && !props.fromSelection" @add-uploaded-files="addUploadedFiles" @on-update-datatype-toggle="changeDatatypeFilter" @onUpdateHideSourceItems="onUpdateHideSourceItems" @clicked-create="clickedCreate">