Skip to content

Commit

Permalink
add a message and link to upload tab if no initial elements
Browse files Browse the repository at this point in the history
This meant also adjusting the creator(s) content to prioritize the alert message with the link.
  • Loading branch information
ahmedhamidawan committed Dec 3, 2024
1 parent 247d679 commit 5dbf3b0
Show file tree
Hide file tree
Showing 5 changed files with 693 additions and 693 deletions.
15 changes: 3 additions & 12 deletions client/src/components/Collections/CollectionCreatorModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { computed, ref, watch } from "vue";
import type { HDASummary, HistoryItemSummary, HistorySummary } from "@/api";
import { createDatasetCollection } from "@/components/History/model/queries";
import { useGlobalUploadModal } from "@/composables/globalUploadModal.js";
import { useCollectionBuilderItemsStore } from "@/stores/collectionBuilderItemsStore";
import { useHistoryStore } from "@/stores/historyStore";
import localize from "@/utils/localization";
Expand All @@ -21,8 +20,6 @@ import Heading from "@/components/Common/Heading.vue";
import GenericItem from "@/components/History/Content/GenericItem.vue";
import LoadingSpan from "@/components/LoadingSpan.vue";
const { openGlobalUploadModal } = useGlobalUploadModal();
interface Props {
historyId: string;
showModal: boolean;
Expand Down Expand Up @@ -263,12 +260,6 @@ function resetModal() {
<BAlert v-else-if="!fromSelection && historyItemsError" variant="danger" show>
{{ historyItemsError }}
</BAlert>
<BAlert v-else-if="!creatorItems?.length" variant="info" show>
{{ localize("No items available to create a collection.") }}
<BLink class="text-decoration-none" @click.stop.prevent="openGlobalUploadModal">
Upload some datasets and try again.
</BLink>
</BAlert>
<BAlert v-else-if="creatingCollection" variant="info" show>
<LoadingSpan :message="localize('Creating collection')" />
</BAlert>
Expand All @@ -295,7 +286,7 @@ function resetModal() {
<ListCollectionCreator
v-else-if="props.collectionType === 'list'"
:history-id="props.historyId"
:initial-elements="creatorItems"
:initial-elements="creatorItems || []"
:default-hide-source-items="props.defaultHideSourceItems"
:from-selection="fromSelection"
:extensions="props.extensions"
Expand All @@ -304,7 +295,7 @@ function resetModal() {
<PairedListCollectionCreator
v-else-if="props.collectionType === 'list:paired'"
:history-id="props.historyId"
:initial-elements="creatorItems"
:initial-elements="creatorItems || []"
:default-hide-source-items="props.defaultHideSourceItems"
:from-selection="fromSelection"
:extensions="props.extensions"
Expand All @@ -313,7 +304,7 @@ function resetModal() {
<PairCollectionCreator
v-else-if="props.collectionType === 'paired'"
:history-id="props.historyId"
:initial-elements="creatorItems"
:initial-elements="creatorItems || []"
:default-hide-source-items="props.defaultHideSourceItems"
:from-selection="fromSelection"
:extensions="props.extensions"
Expand Down
Loading

0 comments on commit 5dbf3b0

Please sign in to comment.