From 6040a5d8c6f85b2cf99e284304fe52e358fc6597 Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Wed, 28 Feb 2024 13:47:01 -0500 Subject: [PATCH] :bug: Add tooltip for migration wave delete option in app table (#1705) Resolves https://issues.redhat.com/browse/MTA-1958 - Also adds translation entry for other similar message in toolbar --------- Signed-off-by: Ian Bolton Co-authored-by: Scott Dickerson --- client/public/locales/en/translation.json | 1 + .../applications-table/applications-table.tsx | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 7b3c3993c2..32f0ae1e7b 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -176,6 +176,7 @@ "blockedDeleteApplication": "Cannot delete {{what}} because it is associated with an application.", "blockedDeleteTarget": "Cannot delete {{what}} because it is associated with a target.", "defaultBlockedDelete": "Cannot delete {{what}} because it is associated with another object.", + "cannotDeleteApplicationsAssignedToMigrationWave": "Cannot delete applications that are assigned to a migration wave.", "continueConfirmation": "Yes, continue", "copyAssessmentAndReviewBody": "Some of the selected target applications have an in-progress or complete assessment/review. By continuing, the existing assessment(s)/review(s) will be replaced by the copied assessment/review. Do you wish to continue?", "copyAssessmentAndReviewQuestion": "Copy assessment and review?", 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 09ae2e7d9d..796d9f316b 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -573,15 +573,12 @@ export const ApplicationsTable: React.FC = () => { , ] : []; - const applicationDropdownItems = applicationWriteAccess ? [ { ...(applicationWriteAccess ? [ { + isAriaDisabled: + application.migrationWave !== null, + tooltipProps: { + content: + application.migrationWave !== null + ? t( + "message.cannotDeleteApplicationsAssignedToMigrationWave" + ) + : "", + }, + title: t("actions.delete"), onClick: () => setApplicationsToDelete([application]), - isDisabled: - application.migrationWave !== null, }, ] : []),