mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PM-14551] Update copy for revoke dialog (#12089)
* update copy for revoke dialog * Update bulk restore copy * update copy in dialog * remove unused copy * Check run earlier during setup (#11958) (cherry picked from commit80c71c191b) * Check run earlier during setup (#11958) (cherry picked from commit80c71c191b) * add copy * update button copy * add feature flag logic * restore copy, fix build error * fix copy * remove unused copy --------- Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
@@ -1,7 +1,14 @@
|
|||||||
<bit-dialog>
|
<bit-dialog
|
||||||
|
dialogSize="large"
|
||||||
|
*ngIf="{ enabled: accountDeprovisioningEnabled$ | async } as accountDeprovisioning"
|
||||||
|
>
|
||||||
<ng-container bitDialogTitle>
|
<ng-container bitDialogTitle>
|
||||||
<h1>{{ bulkTitle }}</h1>
|
<h1 *ngIf="accountDeprovisioning.enabled; else nonMemberTitle">{{ bulkMemberTitle }}</h1>
|
||||||
|
<ng-template #nonMemberTitle>
|
||||||
|
<h1>{{ bulkTitle }}</h1>
|
||||||
|
</ng-template>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<div bitDialogContent>
|
<div bitDialogContent>
|
||||||
<bit-callout type="danger" *ngIf="users.length <= 0">
|
<bit-callout type="danger" *ngIf="users.length <= 0">
|
||||||
{{ "noSelectedUsersApplicable" | i18n }}
|
{{ "noSelectedUsersApplicable" | i18n }}
|
||||||
@@ -11,15 +18,81 @@
|
|||||||
{{ error }}
|
{{ error }}
|
||||||
</bit-callout>
|
</bit-callout>
|
||||||
|
|
||||||
<ng-container *ngIf="!done">
|
<bit-callout
|
||||||
<bit-callout type="warning" *ngIf="users.length > 0 && !error && isRevoking">
|
type="danger"
|
||||||
<p>{{ "revokeUsersWarning" | i18n }}</p>
|
*ngIf="nonCompliantMembers && accountDeprovisioning.enabled"
|
||||||
<p *ngIf="this.showNoMasterPasswordWarning">
|
title="{{ 'nonCompliantMembersTitle' | i18n }}"
|
||||||
{{ "removeMembersWithoutMasterPasswordWarning" | i18n }}
|
>
|
||||||
</p>
|
{{ "nonCompliantMembersError" | i18n }}
|
||||||
</bit-callout>
|
</bit-callout>
|
||||||
|
|
||||||
<bit-table>
|
<ng-container *ngIf="!done">
|
||||||
|
<ng-container *ngIf="accountDeprovisioning.enabled">
|
||||||
|
<div *ngIf="users.length > 0 && !error && isRevoking">
|
||||||
|
<p>{{ "revokeMembersWarning" | i18n }}</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
{{ "claimedAccountRevoke" | i18n }}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{{ "unclaimedAccountRevoke" | i18n }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
{{ "restoreMembersInstructions" | i18n }}
|
||||||
|
</p>
|
||||||
|
<p *ngIf="this.showNoMasterPasswordWarning">
|
||||||
|
{{ "removeMembersWithoutMasterPasswordWarning" | i18n }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container *ngIf="!accountDeprovisioning.enabled">
|
||||||
|
<bit-callout type="warning" *ngIf="users.length > 0 && !error && isRevoking">
|
||||||
|
<p>{{ "revokeUsersWarning" | i18n }}</p>
|
||||||
|
</bit-callout>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<bit-table *ngIf="accountDeprovisioning.enabled">
|
||||||
|
<ng-container header>
|
||||||
|
<tr>
|
||||||
|
<th bitCell class="tw-w-1/2">{{ "member" | i18n }}</th>
|
||||||
|
<th bitCell *ngIf="isRevoking">{{ "details" | i18n }}</th>
|
||||||
|
<th bitCell *ngIf="this.showNoMasterPasswordWarning">{{ "details" | i18n }}</th>
|
||||||
|
</tr>
|
||||||
|
</ng-container>
|
||||||
|
<ng-template body>
|
||||||
|
<tr bitRow *ngFor="let user of users">
|
||||||
|
<td bitCell width="30">
|
||||||
|
<div class="tw-flex tw-items-center">
|
||||||
|
<div class="tw-flex tw-items-center tw-mr-6">
|
||||||
|
<bit-avatar [text]="user | userName" [id]="user.id" size="small"></bit-avatar>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ user.email }}
|
||||||
|
<small class="tw-block tw-text-muted" *ngIf="user.name">{{ user.name }}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td *ngIf="isRevoking" bitCell width="30">
|
||||||
|
{{
|
||||||
|
user.managedByOrganization ? ("claimedAccount" | i18n) : ("unclaimedAccount" | i18n)
|
||||||
|
}}
|
||||||
|
</td>
|
||||||
|
<td bitCell *ngIf="this.showNoMasterPasswordWarning">
|
||||||
|
<span class="tw-block tw-lowercase tw-text-muted">
|
||||||
|
<ng-container *ngIf="user.hasMasterPassword === true"> - </ng-container>
|
||||||
|
<ng-container *ngIf="user.hasMasterPassword === false">
|
||||||
|
<i class="bwi bwi-exclamation-triangle" aria-hidden="true"></i>
|
||||||
|
{{ "noMasterPassword" | i18n }}
|
||||||
|
</ng-container>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
</bit-table>
|
||||||
|
|
||||||
|
<bit-table *ngIf="!accountDeprovisioning.enabled">
|
||||||
<ng-container header>
|
<ng-container header>
|
||||||
<tr>
|
<tr>
|
||||||
<th bitCell colspan="2">{{ "user" | i18n }}</th>
|
<th bitCell colspan="2">{{ "user" | i18n }}</th>
|
||||||
@@ -50,21 +123,55 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="done">
|
<ng-container *ngIf="done">
|
||||||
<bit-table>
|
<bit-table *ngIf="accountDeprovisioning.enabled">
|
||||||
<ng-container header>
|
<ng-container header>
|
||||||
<tr>
|
<tr>
|
||||||
<th bitCell colspan="2">{{ "user" | i18n }}</th>
|
<th bitCell class="tw-w-1/2">{{ "member" | i18n }}</th>
|
||||||
<th>{{ "status" | i18n }}</th>
|
<th bitCell>{{ "status" | i18n }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-template body>
|
<ng-template body>
|
||||||
<tr bitRow *ngFor="let user of users">
|
<tr bitRow *ngFor="let user of users">
|
||||||
<td bitCell width="30">
|
<td bitCell width="30">
|
||||||
<bit-avatar [text]="user | userName" [id]="user.id" size="small"></bit-avatar>
|
<div class="tw-flex tw-items-center">
|
||||||
|
<div class="tw-flex tw-items-center tw-mr-6">
|
||||||
|
<bit-avatar [text]="user | userName" [id]="user.id" size="small"></bit-avatar>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ user.email }}
|
||||||
|
<small class="tw-block tw-text-muted" *ngIf="user.name">{{ user.name }}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td bitCell>
|
<td bitCell *ngIf="statuses.has(user.id)">
|
||||||
{{ user.email }}
|
{{ statuses.get(user.id) }}
|
||||||
<small class="tw-block tw-text-muted" *ngIf="user.name">{{ user.name }}</small>
|
</td>
|
||||||
|
<td bitCell *ngIf="!statuses.has(user.id)">
|
||||||
|
{{ "bulkFilteredMessage" | i18n }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
</bit-table>
|
||||||
|
|
||||||
|
<bit-table *ngIf="!accountDeprovisioning.enabled">
|
||||||
|
<ng-container header>
|
||||||
|
<tr>
|
||||||
|
<th bitCell class="tw-w-1/2">{{ "member" | i18n }}</th>
|
||||||
|
<th bitCell>{{ "status" | i18n }}</th>
|
||||||
|
</tr>
|
||||||
|
</ng-container>
|
||||||
|
<ng-template body>
|
||||||
|
<tr bitRow *ngFor="let user of users">
|
||||||
|
<td bitCell width="30">
|
||||||
|
<div class="tw-flex tw-items-center">
|
||||||
|
<div class="tw-flex tw-items-center tw-mr-6">
|
||||||
|
<bit-avatar [text]="user | userName" [id]="user.id" size="small"></bit-avatar>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ user.email }}
|
||||||
|
<small class="tw-block tw-text-muted" *ngIf="user.name">{{ user.name }}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td bitCell *ngIf="statuses.has(user.id)">
|
<td bitCell *ngIf="statuses.has(user.id)">
|
||||||
{{ statuses.get(user.id) }}
|
{{ statuses.get(user.id) }}
|
||||||
@@ -79,7 +186,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<ng-container bitDialogFooter>
|
<ng-container bitDialogFooter>
|
||||||
<button type="button" bitButton *ngIf="!done && users.length > 0" [bitAction]="submit">
|
<button type="button" bitButton *ngIf="!done && users.length > 0" [bitAction]="submit">
|
||||||
{{ bulkTitle }}
|
{{ accountDeprovisioning.enabled ? bulkMemberTitle : bulkTitle }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" bitButton buttonType="secondary" bitDialogClose>
|
<button type="button" bitButton buttonType="secondary" bitDialogClose>
|
||||||
{{ "close" | i18n }}
|
{{ "close" | i18n }}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import { DIALOG_DATA } from "@angular/cdk/dialog";
|
import { DIALOG_DATA } from "@angular/cdk/dialog";
|
||||||
import { Component, Inject } from "@angular/core";
|
import { Component, Inject } from "@angular/core";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
import { OrganizationUserApiService } from "@bitwarden/admin-console/common";
|
import { OrganizationUserApiService } from "@bitwarden/admin-console/common";
|
||||||
import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/enums";
|
import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/enums";
|
||||||
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||||
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
@@ -29,10 +32,13 @@ export class BulkRestoreRevokeComponent {
|
|||||||
done = false;
|
done = false;
|
||||||
error: string;
|
error: string;
|
||||||
showNoMasterPasswordWarning = false;
|
showNoMasterPasswordWarning = false;
|
||||||
|
nonCompliantMembers: boolean = false;
|
||||||
|
accountDeprovisioningEnabled$: Observable<boolean>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected i18nService: I18nService,
|
protected i18nService: I18nService,
|
||||||
private organizationUserApiService: OrganizationUserApiService,
|
private organizationUserApiService: OrganizationUserApiService,
|
||||||
|
private configService: ConfigService,
|
||||||
@Inject(DIALOG_DATA) protected data: BulkRestoreDialogParams,
|
@Inject(DIALOG_DATA) protected data: BulkRestoreDialogParams,
|
||||||
) {
|
) {
|
||||||
this.isRevoking = data.isRevoking;
|
this.isRevoking = data.isRevoking;
|
||||||
@@ -41,6 +47,9 @@ export class BulkRestoreRevokeComponent {
|
|||||||
this.showNoMasterPasswordWarning = this.users.some(
|
this.showNoMasterPasswordWarning = this.users.some(
|
||||||
(u) => u.status > OrganizationUserStatusType.Invited && u.hasMasterPassword === false,
|
(u) => u.status > OrganizationUserStatusType.Invited && u.hasMasterPassword === false,
|
||||||
);
|
);
|
||||||
|
this.accountDeprovisioningEnabled$ = this.configService.getFeatureFlag$(
|
||||||
|
FeatureFlag.AccountDeprovisioning,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get bulkTitle() {
|
get bulkTitle() {
|
||||||
@@ -48,14 +57,26 @@ export class BulkRestoreRevokeComponent {
|
|||||||
return this.i18nService.t(titleKey);
|
return this.i18nService.t(titleKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get bulkMemberTitle() {
|
||||||
|
const titleKey = this.isRevoking ? "revokeMembers" : "restoreMembers";
|
||||||
|
return this.i18nService.t(titleKey);
|
||||||
|
}
|
||||||
|
|
||||||
submit = async () => {
|
submit = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await this.performBulkUserAction();
|
const response = await this.performBulkUserAction();
|
||||||
|
|
||||||
const bulkMessage = this.isRevoking ? "bulkRevokedMessage" : "bulkRestoredMessage";
|
const bulkMessage = this.isRevoking ? "bulkRevokedMessage" : "bulkRestoredMessage";
|
||||||
response.data.forEach((entry) => {
|
|
||||||
const error = entry.error !== "" ? entry.error : this.i18nService.t(bulkMessage);
|
response.data.forEach(async (entry) => {
|
||||||
|
const error =
|
||||||
|
entry.error !== ""
|
||||||
|
? this.i18nService.t("cannotRestoreAccessError")
|
||||||
|
: this.i18nService.t(bulkMessage);
|
||||||
this.statuses.set(entry.id, error);
|
this.statuses.set(entry.id, error);
|
||||||
|
if (entry.error !== "") {
|
||||||
|
this.nonCompliantMembers = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.done = true;
|
this.done = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export interface BulkUserDetails {
|
|||||||
email: string;
|
email: string;
|
||||||
status: OrganizationUserStatusType | ProviderUserStatusType;
|
status: OrganizationUserStatusType | ProviderUserStatusType;
|
||||||
hasMasterPassword?: boolean;
|
hasMasterPassword?: boolean;
|
||||||
|
managedByOrganization?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type BulkStatusEntry = {
|
type BulkStatusEntry = {
|
||||||
|
|||||||
@@ -29,6 +29,33 @@
|
|||||||
"notifiedMembers": {
|
"notifiedMembers": {
|
||||||
"message": "Notified members"
|
"message": "Notified members"
|
||||||
},
|
},
|
||||||
|
"revokeMembers": {
|
||||||
|
"message": "Revoke members"
|
||||||
|
},
|
||||||
|
"restoreMembers": {
|
||||||
|
"message": "Restore members"
|
||||||
|
},
|
||||||
|
"revokeMembersWarning":{
|
||||||
|
"message": "Members with claimed and unclaimed accounts will have different results when revoked:"
|
||||||
|
},
|
||||||
|
"claimedAccountRevoke": {
|
||||||
|
"message": "Claimed account: Revoke access to Bitwarden account"
|
||||||
|
},
|
||||||
|
"unclaimedAccountRevoke": {
|
||||||
|
"message": "Unclaimed account: Revoke access to organization data"
|
||||||
|
},
|
||||||
|
"claimedAccount": {
|
||||||
|
"message": "Claimed account"
|
||||||
|
},
|
||||||
|
"unclaimedAccount": {
|
||||||
|
"message": "Unclaimed account"
|
||||||
|
},
|
||||||
|
"restoreMembersInstructions": {
|
||||||
|
"message": "To restore a member's account, go to the Revoked tab. The process may take a few seconds to complete and cannot be interrupted or canceled."
|
||||||
|
},
|
||||||
|
"cannotRestoreAccessError":{
|
||||||
|
"message": "Cannot restore organization access"
|
||||||
|
},
|
||||||
"allApplicationsWithCount": {
|
"allApplicationsWithCount": {
|
||||||
"message": "All applications ($COUNT$)",
|
"message": "All applications ($COUNT$)",
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
@@ -5610,6 +5637,12 @@
|
|||||||
"bulkFilteredMessage": {
|
"bulkFilteredMessage": {
|
||||||
"message": "Excluded, not applicable for this action"
|
"message": "Excluded, not applicable for this action"
|
||||||
},
|
},
|
||||||
|
"nonCompliantMembersTitle":{
|
||||||
|
"message": "Non-compliant members"
|
||||||
|
},
|
||||||
|
"nonCompliantMembersError":{
|
||||||
|
"message": "Members that are non-compliant with the Single organization or Two-step login policy cannot be restored until they adhere to the policy requirements"
|
||||||
|
},
|
||||||
"fingerprint": {
|
"fingerprint": {
|
||||||
"message": "Fingerprint"
|
"message": "Fingerprint"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user