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

Commit

Permalink
Show warning if restarting a disabled task
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Sep 19, 2023
1 parent c80310a commit 6c3393c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ export type IssueLinkInput = {

export type JiraConfig = {
__typename?: "JiraConfig";
email?: Maybe<Scalars["String"]["output"]>;
host?: Maybe<Scalars["String"]["output"]>;
};

Expand Down Expand Up @@ -4860,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 6c3393c

Please sign in to comment.