diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html
index db8af13ed2..d05fed4f92 100644
--- a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html
+++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.html
@@ -1,101 +1,88 @@
-
-
+
+
+
+
+
diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.ts b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.ts
index 8005efcb8d..f26321c32a 100644
--- a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.ts
+++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-restore-revoke.component.ts
@@ -1,11 +1,18 @@
-import { Component } from "@angular/core";
+import { DIALOG_DATA } from "@angular/cdk/dialog";
+import { Component, Inject } from "@angular/core";
-import { ModalConfig } from "@bitwarden/angular/services/modal.service";
import { OrganizationUserService } from "@bitwarden/common/abstractions/organization-user/organization-user.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
+import { DialogService } from "@bitwarden/components";
import { BulkUserDetails } from "./bulk-status.component";
+type BulkRestoreDialogParams = {
+ organizationId: string;
+ users: BulkUserDetails[];
+ isRevoking: boolean;
+};
+
@Component({
selector: "app-bulk-restore-revoke",
templateUrl: "bulk-restore-revoke.component.html",
@@ -25,11 +32,11 @@ export class BulkRestoreRevokeComponent {
constructor(
protected i18nService: I18nService,
private organizationUserService: OrganizationUserService,
- config: ModalConfig
+ @Inject(DIALOG_DATA) protected data: BulkRestoreDialogParams
) {
- this.isRevoking = config.data.isRevoking;
- this.organizationId = config.data.organizationId;
- this.users = config.data.users;
+ this.isRevoking = data.isRevoking;
+ this.organizationId = data.organizationId;
+ this.users = data.users;
this.showNoMasterPasswordWarning = this.users.some((u) => u.hasMasterPassword === false);
}
@@ -38,8 +45,7 @@ export class BulkRestoreRevokeComponent {
return this.i18nService.t(titleKey);
}
- async submit() {
- this.loading = true;
+ submit = async () => {
try {
const response = await this.performBulkUserAction();
@@ -52,9 +58,7 @@ export class BulkRestoreRevokeComponent {
} catch (e) {
this.error = e.message;
}
-
- this.loading = false;
- }
+ };
protected async performBulkUserAction() {
const userIds = this.users.map((user) => user.id);
@@ -70,4 +74,8 @@ export class BulkRestoreRevokeComponent {
);
}
}
+
+ static open(dialogService: DialogService, data: BulkRestoreDialogParams) {
+ return dialogService.open(BulkRestoreRevokeComponent, { data });
+ }
}
diff --git a/apps/web/src/app/admin-console/organizations/members/people.component.ts b/apps/web/src/app/admin-console/organizations/members/people.component.ts
index e696609d17..01c22862a0 100644
--- a/apps/web/src/app/admin-console/organizations/members/people.component.ts
+++ b/apps/web/src/app/admin-console/organizations/members/people.component.ts
@@ -449,16 +449,13 @@ export class PeopleComponent
return;
}
- const ref = this.modalService.open(BulkRestoreRevokeComponent, {
- allowMultipleModals: true,
- data: {
- organizationId: this.organization.id,
- users: this.getCheckedUsers(),
- isRevoking: isRevoking,
- },
+ const ref = BulkRestoreRevokeComponent.open(this.dialogService, {
+ organizationId: this.organization.id,
+ users: this.getCheckedUsers(),
+ isRevoking: isRevoking,
});
- await ref.onClosedPromise();
+ await firstValueFrom(ref.closed);
await this.load();
}