Skip to content

Commit

Permalink
Merge pull request #19083 from ahmedhamidawan/use_singular_default_bo…
Browse files Browse the repository at this point in the history
…x_in_upload

[24.1] Persist uploaded data between Regular and Collection upload tabs
  • Loading branch information
mvdbeek authored Nov 8, 2024
2 parents 6004c81 + d6a5f99 commit 2c59753
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 39 deletions.
63 changes: 32 additions & 31 deletions client/src/components/Upload/UploadContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ const props = defineProps({
},
});
const collectionTabActive = ref(null);
const extensionsSet = ref(false);
const datatypesMapper = ref(null);
const datatypesMapperReady = ref(false);
const dbKeysSet = ref(false);
const listExtensions = ref([]);
const listDbKeys = ref([]);
const regular = ref(null);
const regularTabActive = ref(null);
const { percentage, status } = storeToRefs(useUploadStore());
Expand Down Expand Up @@ -112,12 +114,15 @@ const ready = computed(
);
const canUploadToHistory = computed(() => currentHistory.value && canMutateHistory(currentHistory.value));
const showCollection = computed(() => !props.formats && props.multiple);
const showComposite = computed(() => !props.formats || hasCompositeExtension);
const showRegular = computed(() => !props.formats || hasRegularExtension);
const showComposite = computed(() => !props.formats || hasCompositeExtension.value);
const showRegular = computed(() => !props.formats || hasRegularExtension.value);
const showRules = computed(() => !props.formats || props.multiple);
function immediateUpload(files) {
regular.value?.addFiles(files, true);
if (showRegular.value) {
regularTabActive.value = true;
regular.value?.addFiles(files, true);
}
}
function toData(items, history_id, composite = false) {
Expand Down Expand Up @@ -172,21 +177,7 @@ defineExpose({
</span>
</BAlert>
<BTabs v-else-if="ready">
<BTab v-if="showRegular" id="regular" title="Regular" button-id="tab-title-link-regular">
<DefaultBox
ref="regular"
:chunk-upload-size="chunkUploadSize"
:default-db-key="defaultDbKey"
:default-extension="defaultExtension"
:effective-extensions="effectiveExtensions"
:file-sources-configured="fileSourcesConfigured"
:ftp-upload-site="currentUserId && ftpUploadSite"
:has-callback="hasCallback"
:history-id="currentHistoryId"
:list-db-keys="listDbKeys"
:multiple="multiple"
@progress="progress"
v-on="$listeners" />
<BTab v-if="showRegular" title="Regular" button-id="tab-title-link-regular" :active.sync="regularTabActive">
</BTab>
<BTab v-if="showComposite" id="composite" title="Composite" button-id="tab-title-link-composite">
<CompositeBox
Expand All @@ -199,19 +190,11 @@ defineExpose({
:list-db-keys="listDbKeys"
v-on="$listeners" />
</BTab>
<BTab v-if="showCollection" id="collection" title="Collection" button-id="tab-title-link-collection">
<DefaultBox
:chunk-upload-size="chunkUploadSize"
:default-db-key="defaultDbKey"
:default-extension="defaultExtension"
:effective-extensions="effectiveExtensions"
:file-sources-configured="fileSourcesConfigured"
:ftp-upload-site="currentUserId && ftpUploadSite"
:has-callback="hasCallback"
:history-id="currentHistoryId"
:is-collection="true"
:list-db-keys="listDbKeys"
v-on="$listeners" />
<BTab
v-if="showCollection"
title="Collection"
button-id="tab-title-link-collection"
:active.sync="collectionTabActive">
</BTab>
<BTab v-if="showRules" id="rule-based" title="Rule-based" button-id="tab-title-link-rule-based">
<RulesInput
Expand All @@ -221,6 +204,24 @@ defineExpose({
:history-id="currentHistoryId"
v-on="$listeners" />
</BTab>
<DefaultBox
v-if="showRegular || showCollection"
v-show="regularTabActive || collectionTabActive"
:id="collectionTabActive ? 'collection' : 'regular'"
ref="regular"
:chunk-upload-size="chunkUploadSize"
:default-db-key="defaultDbKey"
:default-extension="defaultExtension"
:effective-extensions="effectiveExtensions"
:file-sources-configured="fileSourcesConfigured"
:ftp-upload-site="currentUserId && ftpUploadSite"
:has-callback="hasCallback"
:history-id="currentHistoryId"
:list-db-keys="listDbKeys"
:multiple="regularTabActive ? multiple : undefined"
:is-collection="collectionTabActive"
@progress="progress"
v-on="$listeners" />
</BTabs>
<div v-else>
<LoadingSpan message="Loading required information from Galaxy server." />
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ upload:
setting_space_to_tab: '.upload-space-to-tab'
source_button: '#upload-row-${n} .upload-source'
start: '#activity-upload'
start_button: '#btn-start'
start_button: '#regular #btn-start'

new_user_welcome:
selectors:
Expand Down
6 changes: 3 additions & 3 deletions config/plugins/tours/core.history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ steps:
https://raw.githubusercontent.com/bgruening/galaxytools/adf077b912ddebd97b07b947b855cdd2862ed8ef/tools/statistics/test-data/anderson.tabular
- title: "Start the upload"
element: "#btn-start"
element: "#regular #btn-start"
intro: "Upload the data into your Galaxy <b>History</b>."
postclick:
- "#btn-start"
- "#btn-close"
- "#regular #btn-start"
- "#regular #btn-close"

- title: "History"
element: "#current-history-panel"
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ def _perform_upload(

self.upload_start()

self.wait_for_and_click_selector("button#btn-close")
self.components.upload.close_button.wait_for_and_click()

def perform_upload_of_composite_dataset_pasted_data(self, ext, paste_content):
self.home()
Expand Down
6 changes: 3 additions & 3 deletions lib/galaxy_test/selenium/test_uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_upload_modal_retains_content(self):
self.upload_start_click()
self.upload_queue_local_file(self.get_filename("1.sam"))
self.upload_paste_data("some pasted data")
self.wait_for_and_click_selector("button#btn-close")
self.components.upload.close_button.wait_for_and_click()

# reopen modal and check that the files are still there
self.upload_start_click()
Expand All @@ -191,12 +191,12 @@ def test_upload_modal_retains_content(self):

# perform upload and close modal
self.upload_start()
self.wait_for_and_click_selector("button#btn-close")
self.components.upload.close_button.wait_for_and_click()

# add another pasted file, but don't upload it
self.upload_start_click()
self.upload_paste_data("some more pasted data")
self.wait_for_and_click_selector("button#btn-close")
self.components.upload.close_button.wait_for_and_click()

# reopen modal and see 2 uploaded, 1 yet to upload
self.upload_start_click()
Expand Down

0 comments on commit 2c59753

Please sign in to comment.