From a4795e9558bcabe5b53d4a4f6855a9726c57a940 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 Signed-off-by: Cherry Picker --- 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 9f6d3f1d4..81cd6d48a 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 de45d031a..c8f656b95 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -576,15 +576,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, }, ] : []),