diff --git a/client/src/components/Collections/CollectionCreatorModal.vue b/client/src/components/Collections/CollectionCreatorModal.vue new file mode 100644 index 000000000000..96bdaad6245b --- /dev/null +++ b/client/src/components/Collections/CollectionCreatorModal.vue @@ -0,0 +1,322 @@ + + + + + diff --git a/client/src/components/Collections/ListCollectionCreator.vue b/client/src/components/Collections/ListCollectionCreator.vue index a9750da933f4..8d1e5be51705 100644 --- a/client/src/components/Collections/ListCollectionCreator.vue +++ b/client/src/components/Collections/ListCollectionCreator.vue @@ -19,9 +19,6 @@ import DatasetCollectionElementView from "@/components/Collections/ListDatasetCo interface Props { initialElements: HistoryItemSummary[]; - oncancel: () => void; - oncreate: () => void; - creationFn: (workingElements: HDASummary[], collectionName: string, hideSourceItems: boolean) => any; defaultHideSourceItems?: boolean; fromSelection?: boolean; extensions?: string[]; @@ -31,6 +28,7 @@ const props = defineProps(); const emit = defineEmits<{ (e: "clicked-create", workingElements: HDASummary[], collectionName: string, hideSourceItems: boolean): void; + (e: "on-cancel"): void; }>(); const state = ref("build"); @@ -152,7 +150,7 @@ function _isElementInvalid(element: HistoryItemSummary): string | null { element.extension && !datatypesMapper.value?.isSubTypeOfAny(element.extension, props.extensions!) ) { - return localize("has an invalid extension"); + return localize(`has an invalid extension: ${element.extension}`); } return null; } @@ -231,13 +229,6 @@ function clickedCreate(collectionName: string) { if (state.value !== "error") { emit("clicked-create", returnedElements, collectionName, hideSourceItems.value); - - return props - .creationFn(returnedElements, collectionName, hideSourceItems.value) - .done(props.oncreate) - .fail(() => { - state.value = "error"; - }); } } @@ -339,14 +330,14 @@ function renameElement(element: any, name: string) { {{ localize("No datasets were selected") }} {{ localize("At least one element is needed for the collection. You may need to") }} - + {{ localize("cancel") }} {{ localize("and reselect new elements.") }}
-
@@ -375,14 +366,14 @@ function renameElement(element: any, name: string) { {{ localize("At least one element is needed for the collection. You may need to") }} - + {{ localize("cancel") }} {{ localize("and reselect new elements.") }}
-
@@ -414,7 +405,7 @@ function renameElement(element: any, name: string) { (); @@ -21,7 +23,7 @@ const emit = defineEmits<{ (event: "element-is-discarded", element: any): void; }>(); -const elementName = ref(props.element.name); +const elementName = ref(props.element.name || "..."); watch(elementName, () => { emit("onRename", elementName.value); @@ -43,13 +45,16 @@ function clickDiscard() { {{ element.hid }}: - + + {{ elementName }} - ({{ element.extension }}) + ({{ element.extension }})
- Added to list + + Added to collection + Selected