Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
EVG-18598 Surface warning when restarting a disabled task. (#2069)
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 authored Sep 29, 2023
1 parent 98f6922 commit 43406d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4861,6 +4861,7 @@ export type RestartTaskMutation = {
__typename?: "Task";
execution: number;
latestExecution: number;
priority?: number | null;
buildVariant: string;
buildVariantDisplayName?: string | null;
displayName: string;
Expand Down
1 change: 1 addition & 0 deletions src/gql/mutations/restart-task.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ mutation RestartTask($taskId: String!, $failedOnly: Boolean!) {
...BaseTask
execution
latestExecution
priority
}
}
10 changes: 8 additions & 2 deletions src/pages/task/ActionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,14 @@ export const ActionButtons: React.FC<Props> = ({
RestartTaskMutationVariables
>(RESTART_TASK, {
onCompleted: (data) => {
const { latestExecution } = data.restartTask;
dispatchToast.success("Task scheduled to restart");
const { latestExecution, priority } = data.restartTask;
if (priority < 0) {
dispatchToast.warning(
"Task scheduled to restart, but is disabled. Enable the task to run."
);
} else {
dispatchToast.success("Task scheduled to restart");
}
setExecution(latestExecution);
},
onError: (err) => {
Expand Down

0 comments on commit 43406d5

Please sign in to comment.