From 0f04a08984a1e3a97ad75372600f2692ec8848a7 Mon Sep 17 00:00:00 2001 From: Scott J Dickerson Date: Mon, 15 Jul 2024 17:33:35 -0400 Subject: [PATCH] Add SucceededWithErrors for the ApplicationTasksStatus Signed-off-by: Scott J Dickerson --- .../components/column-application-name.tsx | 10 ++++++++++ .../applications-table/useDecoratedApplications.ts | 9 ++++++++- client/src/app/queries/tasks.ts | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/client/src/app/pages/applications/applications-table/components/column-application-name.tsx b/client/src/app/pages/applications/applications-table/components/column-application-name.tsx index 1b1cf2adda..b10a295861 100644 --- a/client/src/app/pages/applications/applications-table/components/column-application-name.tsx +++ b/client/src/app/pages/applications/applications-table/components/column-application-name.tsx @@ -7,6 +7,7 @@ import { TimesCircleIcon, InProgressIcon, ExclamationCircleIcon, + ExclamationTriangleIcon, PendingIcon, } from "@patternfly/react-icons"; @@ -79,6 +80,15 @@ const statusMap: Record = { ), }, + SuccessWithErrors: { + popoverVariant: "warning", + headerText: "All tasks succeeded, but some errors occurred", + icon: () => ( + + + + ), + }, }; const linkToTasks = (applicationName: string) => { diff --git a/client/src/app/pages/applications/applications-table/useDecoratedApplications.ts b/client/src/app/pages/applications/applications-table/useDecoratedApplications.ts index 2cf66dae1e..fc46eae3b9 100644 --- a/client/src/app/pages/applications/applications-table/useDecoratedApplications.ts +++ b/client/src/app/pages/applications/applications-table/useDecoratedApplications.ts @@ -19,7 +19,8 @@ export type ApplicationTasksStatus = | "Queued" | "Failed" | "Canceled" - | "Success"; + | "Success" + | "SuccessWithErrors"; export interface DecoratedApplication extends Application { /** reference to the Application being decorated */ @@ -33,6 +34,7 @@ export interface DecoratedApplication extends Application { latestHasQueued: boolean; latestHasRunning: boolean; latestHasSuccess: boolean; + latestHasSuccessWithErrors: boolean; /** The most recently created `kind === "analyzer"` task for the application */ currentAnalyzer: Task | undefined; @@ -83,6 +85,8 @@ const chooseApplicationTaskStatus = ({ ? "Failed" : tasks.latestHasCanceled ? "Canceled" + : tasks.latestHasSuccessWithErrors + ? "SuccessWithErrors" : "Success"; }; @@ -125,6 +129,9 @@ const decorateApplications = ( latestHasSuccess: latest.some((task) => TaskStates.Success.includes(task.state ?? "") ), + latestHasSuccessWithErrors: latest.some((task) => + TaskStates.SuccessWithErrors.includes(task.state ?? "") + ), currentAnalyzer: tasksByKind["analyzer"]?.[0], }, diff --git a/client/src/app/queries/tasks.ts b/client/src/app/queries/tasks.ts index 4bc393ccd3..1f95581d69 100644 --- a/client/src/app/queries/tasks.ts +++ b/client/src/app/queries/tasks.ts @@ -26,6 +26,7 @@ export const TaskStates = { Queued: ["Ready", "Postponed", "Pending", "Running"], // "Created", "QuotaBlocked" ?? Running: ["Running"], Success: ["Succeeded", "SucceededWithErrors"], + SuccessWithErrors: ["SucceededWithErrors"], }; export const TasksQueryKey = "tasks";