Skip to content

Commit

Permalink
Merge pull request #18733 from dannon/fix-resume-paused-jobs
Browse files Browse the repository at this point in the history
[24.1] Fix resume paused jobs response handling
  • Loading branch information
mvdbeek authored Aug 24, 2024
2 parents b02b387 + b5ff954 commit a2c396f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
faUserLock,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import axios from "axios";
import {
BButton,
BButtonGroup,
Expand All @@ -34,9 +35,12 @@ import { computed, ref } from "vue";
import { canMutateHistory, type HistorySummary } from "@/api";
import { iframeRedirect } from "@/components/plugins/legacyNavigation";
import { useToast } from "@/composables/toast";
import { getAppRoot } from "@/onload/loadConfig";
import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
import localize from "@/utils/localization";
import { rethrowSimple } from "@/utils/simple-error";
import CopyModal from "@/components/History/Modals/CopyModal.vue";
import SelectorModal from "@/components/History/Modals/SelectorModal.vue";
Expand Down Expand Up @@ -74,6 +78,8 @@ const props = withDefaults(defineProps<Props>(), {
const showSwitchModal = ref(false);
const purgeHistory = ref(false);
const toast = useToast();
const userStore = useUserStore();
const historyStore = useHistoryStore();
Expand Down Expand Up @@ -111,6 +117,16 @@ function userTitle(title: string) {
return localize(title);
}
}
async function resumePausedJobs() {
const url = `${getAppRoot()}history/resume_paused_jobs?current=True`;
try {
const response = await axios.get(url);
toast.success(response.data.message);
} catch (e) {
rethrowSimple(e);
}
}
</script>

<template>
Expand Down Expand Up @@ -187,7 +203,7 @@ function userTitle(title: string) {
<BDropdownItem
:disabled="!canEditHistory"
:title="localize('Resume all Paused Jobs in this History')"
@click="iframeRedirect('/history/resume_paused_jobs?current=True')">
@click="resumePausedJobs()">
<FontAwesomeIcon fixed-width :icon="faPlay" class="mr-1" />
<span v-localize>Resume Paused Jobs</span>
</BDropdownItem>
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/controllers/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def resume_paused_jobs(self, trans, current=False, ids=None, **kwargs):
history = trans.get_history()
if history:
history.resume_paused_jobs()
return trans.show_ok_message("Your jobs have been resumed.")
return {"message": "Your jobs have been resumed.", "status": "success"}
raise exceptions.RequestParameterInvalidException(
"You can currently only resume all the datasets of the current history."
)
Expand Down

0 comments on commit a2c396f

Please sign in to comment.