Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.1] Fix resume paused jobs response handling #18733

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading