Skip to content

Commit

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

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>
  • Loading branch information
ibolton336 and sjd78 committed Feb 28, 2024
1 parent 59ad200 commit 6040a5d
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 @@ -573,15 +573,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 @@ -982,11 +979,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 6040a5d

Please sign in to comment.