mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +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:
@@ -143,6 +143,7 @@ export class AllActivityComponent implements OnInit {
|
|||||||
const dialogRef = NewApplicationsDialogComponent.open(this.dialogService, {
|
const dialogRef = NewApplicationsDialogComponent.open(this.dialogService, {
|
||||||
newApplications: this.newApplications,
|
newApplications: this.newApplications,
|
||||||
organizationId: organizationId as OrganizationId,
|
organizationId: organizationId as OrganizationId,
|
||||||
|
hasExistingCriticalApplications: this.totalCriticalAppsCount > 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
await lastValueFrom(dialogRef.closed);
|
await lastValueFrom(dialogRef.closed);
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<span bitDialogTitle>
|
<span bitDialogTitle>
|
||||||
{{
|
{{
|
||||||
currentView() === DialogView.SelectApplications
|
currentView() === DialogView.SelectApplications
|
||||||
? ("reviewNewApplications" | i18n)
|
? hasNoCriticalApplications()
|
||||||
|
? ("prioritizeCriticalApplications" | i18n)
|
||||||
|
: ("reviewNewApplications" | i18n)
|
||||||
: ("assignTasksToMembers" | i18n)
|
: ("assignTasksToMembers" | i18n)
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
@@ -11,7 +13,11 @@
|
|||||||
@if (currentView() === DialogView.SelectApplications) {
|
@if (currentView() === DialogView.SelectApplications) {
|
||||||
<div>
|
<div>
|
||||||
<p bitTypography="body1" class="tw-mb-5">
|
<p bitTypography="body1" class="tw-mb-5">
|
||||||
{{ "reviewNewApplicationsDescription" | i18n }}
|
{{
|
||||||
|
hasNoCriticalApplications()
|
||||||
|
? ("selectCriticalApplicationsDescription" | i18n)
|
||||||
|
: ("reviewNewApplicationsDescription" | i18n)
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="tw-flex tw-items-center tw-gap-2.5 tw-mb-5">
|
<div class="tw-flex tw-items-center tw-gap-2.5 tw-mb-5">
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ export interface NewApplicationsDialogData {
|
|||||||
* the route subscription has fired.
|
* the route subscription has fired.
|
||||||
*/
|
*/
|
||||||
organizationId: OrganizationId;
|
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;
|
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.
|
* Toggles the selection state of an application.
|
||||||
* @param applicationName The application to toggle
|
* @param applicationName The application to toggle
|
||||||
|
|||||||
Reference in New Issue
Block a user