diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-enable-sm-dialog.component.html b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-enable-sm-dialog.component.html new file mode 100644 index 00000000000..ea76b5e0a85 --- /dev/null +++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-enable-sm-dialog.component.html @@ -0,0 +1,46 @@ + + {{ "enableSecretsManager" | i18n }} + +

{{ "bulkEnableSecretsManagerDescription" | i18n }}

+ + + + {{ "member" | i18n }} + {{ "role" | i18n }} + + + + + +
+ +
+
+ {{ u | userName }} +
+
+ {{ u.email }} +
+
+
+ + {{ u.type | userType }} + +
+
+
+ + + + +
diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-enable-sm-dialog.component.ts b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-enable-sm-dialog.component.ts new file mode 100644 index 00000000000..3a0caec17c2 --- /dev/null +++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-enable-sm-dialog.component.ts @@ -0,0 +1,53 @@ +import { DialogRef, DIALOG_DATA } from "@angular/cdk/dialog"; +import { Component, Inject, OnInit } from "@angular/core"; + +import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog"; +import { OrganizationUserService } from "@bitwarden/common/abstractions/organization-user/organization-user.service"; +import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; +import { TableDataSource } from "@bitwarden/components"; + +import { OrganizationUserView } from "../../../core"; + +export type BulkEnableSecretsManagerDialogData = { + orgId: string; + users: OrganizationUserView[]; +}; + +@Component({ + templateUrl: `bulk-enable-sm-dialog.component.html`, +}) +export class BulkEnableSecretsManagerDialogComponent implements OnInit { + protected dataSource = new TableDataSource(); + constructor( + public dialogRef: DialogRef, + @Inject(DIALOG_DATA) private data: BulkEnableSecretsManagerDialogData, + private organizationUserService: OrganizationUserService, + private platformUtilsService: PlatformUtilsService, + private i18nService: I18nService + ) {} + + ngOnInit(): void { + this.dataSource.data = this.data.users; + } + + submit = async () => { + await this.organizationUserService.putOrganizationUserBulkEnableSecretsManager( + this.data.orgId, + this.dataSource.data.map((u) => u.id) + ); + this.platformUtilsService.showToast( + "success", + null, + this.i18nService.t("enabledAccessToSecretsManager") + ); + this.dialogRef.close(); + }; + + static open(dialogService: DialogServiceAbstraction, data: BulkEnableSecretsManagerDialogData) { + return dialogService.open( + BulkEnableSecretsManagerDialogComponent, + { data } + ); + } +} diff --git a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html index 62bcb04bb78..633bf30259a 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html +++ b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.html @@ -255,7 +255,7 @@

- {{ "secretsManagerBeta" | i18n }} + {{ "secretsManager" | i18n }}

-

{{ "secretsManagerBetaDesc" | i18n }}

+

{{ "secretsManagerAccessDesc" | i18n }}

- {{ "userAccessSecretsManager" | i18n }} + {{ "userAccessSecretsManagerGA" | i18n }}
diff --git a/apps/web/src/app/admin-console/organizations/members/members.module.ts b/apps/web/src/app/admin-console/organizations/members/members.module.ts index 1efb10aaced..71f5692a119 100644 --- a/apps/web/src/app/admin-console/organizations/members/members.module.ts +++ b/apps/web/src/app/admin-console/organizations/members/members.module.ts @@ -4,6 +4,7 @@ import { LooseComponentsModule } from "../../../shared"; import { SharedOrganizationModule } from "../shared"; import { BulkConfirmComponent } from "./components/bulk/bulk-confirm.component"; +import { BulkEnableSecretsManagerDialogComponent } from "./components/bulk/bulk-enable-sm-dialog.component"; import { BulkRemoveComponent } from "./components/bulk/bulk-remove.component"; import { BulkRestoreRevokeComponent } from "./components/bulk/bulk-restore-revoke.component"; import { BulkStatusComponent } from "./components/bulk/bulk-status.component"; @@ -21,6 +22,7 @@ import { PeopleComponent } from "./people.component"; ], declarations: [ BulkConfirmComponent, + BulkEnableSecretsManagerDialogComponent, BulkRemoveComponent, BulkRestoreRevokeComponent, BulkStatusComponent, diff --git a/apps/web/src/app/admin-console/organizations/members/people.component.html b/apps/web/src/app/admin-console/organizations/members/people.component.html index c93380b4665..52ae5e96c56 100644 --- a/apps/web/src/app/admin-console/organizations/members/people.component.html +++ b/apps/web/src/app/admin-console/organizations/members/people.component.html @@ -99,6 +99,12 @@ > + + + +