Skip to content

Commit

Permalink
Don't show upload files option when selecting datasets.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jan 2, 2025
1 parent 1bbe39c commit b2e2053
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ function renameElement(element: any, name: string) {
:extensions="extensions"
collection-type="list"
:no-items="props.initialElements.length == 0 && !props.fromSelection"
:show-upload="!fromSelection"
@add-uploaded-files="addUploadedFiles"
@on-update-datatype-toggle="changeDatatypeFilter"
@onUpdateHideSourceItems="onUpdateHideSourceItems"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
:extensions-toggle="removeExtensions"
collection-type="paired"
:no-items="props.initialElements.length == 0 && !props.fromSelection"
:show-upload="!fromSelection"
@add-uploaded-files="addUploadedFiles"
@onUpdateHideSourceItems="onUpdateHideSourceItems"
@clicked-create="clickedCreate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
:extensions="extensions"
collection-type="list:paired"
:no-items="props.initialElements.length == 0 && !props.fromSelection"
:show-upload="!fromSelection"
@add-uploaded-files="addUploadedFiles"
@onUpdateHideSourceItems="hideSourceItems = $event"
@clicked-create="clickedCreate"
Expand Down
118 changes: 79 additions & 39 deletions client/src/components/Collections/common/CollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ interface Props {
extensionsToggle?: boolean;
noItems?: boolean;
collectionType?: string;

Check warning on line 48 in client/src/components/Collections/common/CollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Prop 'collectionType' requires default value to be set
showUpload: boolean;
}
const props = withDefaults(defineProps<Props>(), {
suggestedName: "",
extensions: undefined,
extensionsToggle: false,
showUpload: true,
});
const emit = defineEmits<{
Expand Down Expand Up @@ -151,8 +153,8 @@ watch(
</script>

<template>
<BTabs v-model="currentTab" fill justified>
<BTab class="collection-creator" :title="localize('Create Collection')">
<span>
<span v-if="!showUpload" class="collection-creator">
<div v-if="props.noItems">
<CollectionCreatorNoItemsMessage @click-upload="currentTab = Tabs.upload" />
</div>
Expand Down Expand Up @@ -188,45 +190,83 @@ watch(
@clicked-create="emit('clicked-create', collectionName)" />
</div>
</div>
</BTab>
<BTab>
<template v-slot:title>
<FontAwesomeIcon :icon="faUpload" fixed-width />
<span>{{ localize("Upload Files to Add to Collection") }}</span>
</template>
<!-- TODO: This is incomplete; need to return uploadValues to parent -->
<DefaultBox
v-if="configOptions && extensionsSet"
:chunk-upload-size="configOptions.chunkUploadSize"
:default-db-key="configOptions.defaultDbKey"
:default-extension="defaultExtension"
:effective-extensions="props.extensions?.length ? validExtensions : listExtensions"
:file-sources-configured="configOptions.fileSourcesConfigured"
:ftp-upload-site="ftpUploadSite"
:has-callback="false"
:history-id="historyId"
:list-db-keys="[]"
disable-footer
emit-uploaded
@uploaded="addUploadedFiles"
@dismiss="currentTab = Tabs.create">
<template v-slot:footer>
<div class="d-flex align-items-center justify-content-between mt-2">
<BAlert v-if="extensions?.length" class="w-100 py-0" variant="secondary" show>
<HelpText
uri="galaxy.collections.collectionBuilder.requiredUploadExtensions"
:text="localize('Required extensions: ')" />
<strong>{{ orList(extensions) }}</strong>
</BAlert>
</span>
<BTabs v-else v-model="currentTab" fill justified>
<BTab class="collection-creator" :title="localize('Create Collection')">
<div v-if="props.noItems">
<CollectionCreatorNoItemsMessage @click-upload="currentTab = Tabs.upload" />
</div>
<div v-else>
<CollectionCreatorHelpHeader>
<slot name="help-content"></slot>
</CollectionCreatorHelpHeader>

<div class="middle flex-row flex-row-container">
<slot name="middle-content"></slot>
</div>

<div class="footer flex-row">
<div class="vertically-spaced">
<CollectionCreatorShowExtensions :extensions="extensions" />

<div class="d-flex align-items-center justify-content-between">
<CollectionCreatorSourceOptions
v-model="localHideSourceItems"
:render-extensions-toggle="renderExtensionsToggle"
:extensions-toggle="extensionsToggle" />
<CollectionNameInput
v-model="collectionName"
:short-what-is-being-created="shortWhatIsBeingCreated" />
</div>
</div>

<CollectionCreatorFooterButtons
:short-what-is-being-created="shortWhatIsBeingCreated"
:valid-input="validInput"
@clicked-cancel="cancelCreate"
@clicked-create="emit('clicked-create', collectionName)" />
</div>
</div>
</BTab>
<BTab>
<template v-slot:title>
<FontAwesomeIcon :icon="faUpload" fixed-width />
<span>{{ localize("Upload Files to Add to Collection") }}</span>
</template>
<template v-slot:emit-btn-txt>
<FontAwesomeIcon :icon="faPlus" fixed-width />
{{ localize("Add Uploaded") }}
</template>
</DefaultBox>
</BTab>
</BTabs>
<!-- TODO: This is incomplete; need to return uploadValues to parent -->
<DefaultBox
v-if="configOptions && extensionsSet"
:chunk-upload-size="configOptions.chunkUploadSize"
:default-db-key="configOptions.defaultDbKey"
:default-extension="defaultExtension"
:effective-extensions="props.extensions?.length ? validExtensions : listExtensions"
:file-sources-configured="configOptions.fileSourcesConfigured"
:ftp-upload-site="ftpUploadSite"
:has-callback="false"
:history-id="historyId"
:list-db-keys="[]"
disable-footer
emit-uploaded
@uploaded="addUploadedFiles"
@dismiss="currentTab = Tabs.create">
<template v-slot:footer>
<div class="d-flex align-items-center justify-content-between mt-2">
<BAlert v-if="extensions?.length" class="w-100 py-0" variant="secondary" show>
<HelpText
uri="galaxy.collections.collectionBuilder.requiredUploadExtensions"
:text="localize('Required extensions: ')" />
<strong>{{ orList(extensions) }}</strong>
</BAlert>
</div>
</template>
<template v-slot:emit-btn-txt>
<FontAwesomeIcon :icon="faPlus" fixed-width />
{{ localize("Add Uploaded") }}
</template>
</DefaultBox>
</BTab>
</BTabs>
</span>
</template>

<style lang="scss">
Expand Down

0 comments on commit b2e2053

Please sign in to comment.