Skip to content

Commit

Permalink
🐛 Add tooltip for migration wave delete option in app table (#1705) (#…
Browse files Browse the repository at this point in the history
…1717)

Resolves https://issues.redhat.com/browse/MTA-1958

- Also adds translation entry for other similar message in toolbar

---------

Signed-off-by: Ian Bolton <ibolton@redhat.com>
Co-authored-by: Scott Dickerson <sdickers@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>

Signed-off-by: Ian Bolton <ibolton@redhat.com>
Signed-off-by: Cherry Picker <noreply@github.com>
Co-authored-by: Ian Bolton <ibolton@redhat.com>
Co-authored-by: Scott Dickerson <sdickers@redhat.com>
  • Loading branch information
3 people authored Feb 28, 2024
1 parent 3114082 commit 0dcfa7f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,12 @@ export const ApplicationsTable: React.FC = () => {
</DropdownItem>,
]
: [];

const applicationDropdownItems = applicationWriteAccess
? [
<ConditionalTooltip
key="delete-app-tooltip"
isTooltipEnabled={areAppsInWaves}
content={
"Cannot delete application(s) assigned to migration wave(s)."
}
content={t("message.cannotDeleteApplicationsAssignedToMigrationWave")}
>
<DropdownItem
key="applications-bulk-delete"
Expand Down Expand Up @@ -1000,11 +997,20 @@ export const ApplicationsTable: React.FC = () => {
...(applicationWriteAccess
? [
{
isAriaDisabled:
application.migrationWave !== null,
tooltipProps: {
content:
application.migrationWave !== null
? t(
"message.cannotDeleteApplicationsAssignedToMigrationWave"
)
: "",
},

title: t("actions.delete"),
onClick: () =>
setApplicationsToDelete([application]),
isDisabled:
application.migrationWave !== null,
},
]
: []),
Expand Down

0 comments on commit 0dcfa7f

Please sign in to comment.