1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

fix: show correct title/description in new applications dialog based on critical apps state (#17275)

- Show "Prioritize critical applications" when org has no critical apps
- Show "Review new applications" when org already has critical apps
- Add hasExistingCriticalApplications flag to dialog data
- Add reviewNewApplications i18n keys
This commit is contained in:
Alex
2025-11-07 11:03:02 -05:00
committed by GitHub
parent 519889f8f4
commit c0b3cfd76e
3 changed files with 22 additions and 2 deletions

View File

@@ -143,6 +143,7 @@ export class AllActivityComponent implements OnInit {
const dialogRef = NewApplicationsDialogComponent.open(this.dialogService, {
newApplications: this.newApplications,
organizationId: organizationId as OrganizationId,
hasExistingCriticalApplications: this.totalCriticalAppsCount > 0,
});
await lastValueFrom(dialogRef.closed);

View File

@@ -2,7 +2,9 @@
<span bitDialogTitle>
{{
currentView() === DialogView.SelectApplications
? ("reviewNewApplications" | i18n)
? hasNoCriticalApplications()
? ("prioritizeCriticalApplications" | i18n)
: ("reviewNewApplications" | i18n)
: ("assignTasksToMembers" | i18n)
}}
</span>
@@ -11,7 +13,11 @@
@if (currentView() === DialogView.SelectApplications) {
<div>
<p bitTypography="body1" class="tw-mb-5">
{{ "reviewNewApplicationsDescription" | i18n }}
{{
hasNoCriticalApplications()
? ("selectCriticalApplicationsDescription" | i18n)
: ("reviewNewApplicationsDescription" | i18n)
}}
</p>
<div class="tw-flex tw-items-center tw-gap-2.5 tw-mb-5">

View File

@@ -45,6 +45,11 @@ export interface NewApplicationsDialogData {
* the route subscription has fired.
*/
organizationId: OrganizationId;
/**
* Whether the organization has any existing critical applications.
* Used to determine which title and description to show in the dialog.
*/
hasExistingCriticalApplications: boolean;
}
/**
@@ -130,6 +135,14 @@ export class NewApplicationsDialogComponent {
return this.dialogParams.newApplications;
}
/**
* Returns true if the organization has no existing critical applications.
* Used to conditionally show different titles and descriptions.
*/
protected hasNoCriticalApplications(): boolean {
return !this.dialogParams.hasExistingCriticalApplications;
}
/**
* Toggles the selection state of an application.
* @param applicationName The application to toggle