Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Add tooltip for migration wave delete option in app table #1705

Merged
merged 3 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading