diff --git a/client/src/app/pages/applications/applications-table/applications-table.tsx b/client/src/app/pages/applications/applications-table/applications-table.tsx index f3b7c7baf..a329dbd1b 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -76,6 +76,7 @@ import { useFetchApplications, } from "@app/queries/applications"; import { + TaskStates, useCancelTaskMutation, useFetchTaskDashboard, } from "@app/queries/tasks"; @@ -609,12 +610,10 @@ export const ApplicationsTable: React.FC = () => { .flatMap((app) => app.tasks.currentAnalyzer) .filter(Boolean); - const terminalStates = ["Succeeded", "Failed", "Canceled", ""]; - return ( currentAnalyzerTasksForSelected.length === 0 || currentAnalyzerTasksForSelected.every(({ state }) => - terminalStates.includes(state ?? "") + TaskStates.Terminal.includes(state ?? "") ) ); }; diff --git a/client/src/app/queries/tasks.ts b/client/src/app/queries/tasks.ts index 67dd81c5d..6c9818dbf 100644 --- a/client/src/app/queries/tasks.ts +++ b/client/src/app/queries/tasks.ts @@ -28,6 +28,7 @@ export const TaskStates = { Running: ["Running"], Success: ["Succeeded", "SucceededWithErrors"], SuccessWithErrors: ["SucceededWithErrors"], + Terminal: ["Succeeded", "SucceededWithErrors", "Failed", "Canceled"], }; export const TasksQueryKey = "tasks";