From 863773346c5919be329afefb09cf1dc78ef215fe Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Thu, 14 Dec 2023 20:02:44 -0500 Subject: [PATCH] :bug: Address missing archetype name in delete assessment notification (#1620) https://issues.redhat.com/browse/MTA-1894 Signed-off-by: ibolton336 --- .../components/dynamic-assessment-actions-row.tsx | 2 ++ .../components/assessment-wizard/assessment-wizard.tsx | 2 ++ client/src/app/queries/assessments.ts | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/app/pages/assessment/components/assessment-actions/components/dynamic-assessment-actions-row.tsx b/client/src/app/pages/assessment/components/assessment-actions/components/dynamic-assessment-actions-row.tsx index 5c928916e0..bf77aa71fc 100644 --- a/client/src/app/pages/assessment/components/assessment-actions/components/dynamic-assessment-actions-row.tsx +++ b/client/src/app/pages/assessment/components/assessment-actions/components/dynamic-assessment-actions-row.tsx @@ -190,6 +190,7 @@ const DynamicAssessmentActionsRow: FunctionComponent< assessmentId: assessment.id, applicationName: application?.name, applicationId: application?.id, + archetypeName: archetype?.name, archetypeId: archetype?.id, }).then(() => { createAssessment(); @@ -263,6 +264,7 @@ const DynamicAssessmentActionsRow: FunctionComponent< assessmentId: assessment.id, applicationName: application?.name, applicationId: application?.id, + archetypeName: archetype?.name, archetypeId: archetype?.id, }); }} diff --git a/client/src/app/pages/assessment/components/assessment-wizard/assessment-wizard.tsx b/client/src/app/pages/assessment/components/assessment-wizard/assessment-wizard.tsx index ed8e3140a7..9a06372c86 100644 --- a/client/src/app/pages/assessment/components/assessment-wizard/assessment-wizard.tsx +++ b/client/src/app/pages/assessment/components/assessment-wizard/assessment-wizard.tsx @@ -447,6 +447,7 @@ export const AssessmentWizard: React.FC = ({ assessmentId: assessment.id, applicationName: assessment.application?.name, applicationId: assessment.application?.id, + archetypeName: assessment.archetype?.name, archetypeId: assessment.archetype?.id, }); } else { @@ -455,6 +456,7 @@ export const AssessmentWizard: React.FC = ({ assessmentId: assessment.id, applicationName: assessment.application?.name, applicationId: assessment.application?.id, + archetypeName: assessment.archetype?.name, archetypeId: assessment.archetype?.id, }); } diff --git a/client/src/app/queries/assessments.ts b/client/src/app/queries/assessments.ts index b3796cbe07..8128ba75b4 100644 --- a/client/src/app/queries/assessments.ts +++ b/client/src/app/queries/assessments.ts @@ -107,7 +107,7 @@ export const useUpdateAssessmentMutation = ( }; export const useDeleteAssessmentMutation = ( - onSuccess?: (applicationName: string) => void, + onSuccess?: (name: string) => void, onError?: (err: AxiosError) => void ) => { const queryClient = useQueryClient(); @@ -117,6 +117,7 @@ export const useDeleteAssessmentMutation = ( assessmentId: number; applicationName?: string; applicationId?: number; + archetypeName?: string; archetypeId?: number; }) => { const deletedAssessment = deleteAssessment(args.assessmentId); @@ -138,7 +139,8 @@ export const useDeleteAssessmentMutation = ( return deletedAssessment; }, onSuccess: (_, args) => { - onSuccess && onSuccess(args?.applicationName || "Unknown"); + onSuccess && + onSuccess(args?.applicationName || args?.archetypeName || "Unknown"); }, onError: onError, });