diff --git a/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx b/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx index f13cc2fb20..d5b856f761 100644 --- a/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx +++ b/client/src/app/pages/applications/analysis-wizard/analysis-wizard.tsx @@ -72,7 +72,7 @@ const defaultTaskData: TaskData = { export const defaultTaskgroup: Taskgroup = { name: `taskgroup.analyzer`, - addon: "analyzer", + kind: "analyzer", data: { ...defaultTaskData, }, 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 8ced4d2be7..9e7f67a7d8 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -148,7 +148,7 @@ export const ApplicationsTable: React.FC = () => { tasks.find((task: Task) => task.application?.id === application.id); const { tasks, hasActiveTasks } = useFetchTasks( - { addon: "analyzer" }, + { kind: "analyzer", addon: "analyzer" }, isAnalyzeModalOpen ); diff --git a/client/src/app/queries/tasks.ts b/client/src/app/queries/tasks.ts index 6fbddbbeb1..adaa5f3b12 100644 --- a/client/src/app/queries/tasks.ts +++ b/client/src/app/queries/tasks.ts @@ -20,6 +20,7 @@ import { interface FetchTasksFilters { addon?: string; + kind?: string; } export const TasksQueryKey = "tasks"; @@ -38,7 +39,16 @@ export const useFetchTasks = ( select: (allTasks) => { const uniqSorted = allTasks .filter((task) => - filters?.addon ? filters.addon === task.addon : true + // If there are any tasks with the addon field, we will still need to consider those older + // tasks that do not have the kind field. This is because the kind field was added later and is + // preferred over the addon field. + + // The task manager will determine and assign the addon field when the addon is specified and addon isnt + // which will result in both being set. + + filters?.kind || filters?.addon + ? filters.kind === task.kind || filters.addon === task.addon + : true ) // sort by application.id (ascending) then createTime (newest to oldest) .sort((a, b) =>