Skip to content

Commit

Permalink
Merge branch 'release_24.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Nov 20, 2024
2 parents 1e3d2b6 + f382305 commit 8cdd254
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 44 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 @@ -1139,7 +1139,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'
local_button: '#btn-local'

new_user_welcome:
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
11 changes: 10 additions & 1 deletion lib/galaxy/datatypes/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,16 @@ def find_conversion_destination_for_dataset_by_extensions(
if datatype and datatype.matches_any(accepted_datatypes):
return True, None, None

for convert_ext in self.get_converters_by_datatype(ext):
converter_extensions = self.get_converters_by_datatype(ext)
uncompressed_instance = getattr(datatype, "uncompressed_datatype_instance", None)
if uncompressed_instance and uncompressed_instance.file_ext in converter_extensions:
# sort uncompressed instance ahead of other possible conversions
converter_extensions = [
uncompressed_instance.file_ext,
*(ext for ext in converter_extensions if ext != uncompressed_instance.file_ext),
]

for convert_ext in converter_extensions:
convert_ext_datatype = self.get_datatype_by_extension(convert_ext)
if convert_ext_datatype is None:
self.log.warning(
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/jobs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,8 @@ def stop(self, job, job_wrapper):
runner_name = job_runner_name.split(":", 1)[0]
log.debug(f"Stopping job {job_wrapper.get_id_tag()} in {runner_name} runner")
try:
self.job_runners[runner_name].stop_job(job_wrapper)
if job.state != model.Job.states.NEW:
self.job_runners[runner_name].stop_job(job_wrapper)
except KeyError:
log.error(f"stop(): ({job_wrapper.get_id_tag()}) Invalid job runner: {runner_name}")
# Job and output dataset states have already been updated, so nothing is done here.
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/jobs/runners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ def _handle_runner_state(self, runner_state, job_state: "JobState"):
log.exception("Caught exception in runner state handler")

def fail_job(self, job_state: "JobState", exception=False, message="Job failed", full_status=None):
if getattr(job_state, "stop_job", True):
job = job_state.job_wrapper.get_job()
if getattr(job_state, "stop_job", True) and job.state != model.Job.states.NEW:
self.stop_job(job_state.job_wrapper)
job_state.job_wrapper.reclaim_ownership()
self._handle_runner_state("failure", job_state)
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/jobs/runners/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ def recover(self, job, job_wrapper):
self.monitor_queue.put(ajs)

def fail_job(self, job_state: JobState, exception=False, message="Job failed", full_status=None):
if getattr(job_state, "stop_job", True):
job = job_state.job_wrapper.get_job()
if getattr(job_state, "stop_job", True) and job.state != model.Job.states.NEW:
self.stop_job(job_state.job_wrapper)
job_state.job_wrapper.reclaim_ownership()
self._handle_runner_state("failure", job_state)
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 @@ -876,7 +876,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
2 changes: 1 addition & 1 deletion test/functional/tools/implicit_conversion_format_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cut -f 1 '$input1' > '$output1'
</command>
<inputs>
<param type="data" format="fasta" name="input1" label="Input 1" />
<param type="data" format="txt" name="input1" label="Input 1" />
</inputs>
<outputs>
<data name="output1" format="input" />
Expand Down

0 comments on commit 8cdd254

Please sign in to comment.