diff --git a/apps/web/src/app/common/base.people.component.ts b/apps/web/src/app/common/base.people.component.ts index af65fef96b5..24344890868 100644 --- a/apps/web/src/app/common/base.people.component.ts +++ b/apps/web/src/app/common/base.people.component.ts @@ -204,15 +204,18 @@ export abstract class BasePeopleComponent< this.edit(null); } - async remove(user: UserType) { - const confirmed = await this.platformUtilsService.showDialog( - this.deleteWarningMessage(user), + protected async removeUserConfirmationDialog(user: UserType) { + return this.platformUtilsService.showDialog( + this.i18nService.t("removeUserConfirmation"), this.userNamePipe.transform(user), this.i18nService.t("yes"), this.i18nService.t("no"), "warning" ); + } + async remove(user: UserType) { + const confirmed = await this.removeUserConfirmationDialog(user); if (!confirmed) { return false; } @@ -235,8 +238,8 @@ export abstract class BasePeopleComponent< async deactivate(user: UserType) { const confirmed = await this.platformUtilsService.showDialog( this.deactivateWarningMessage(), - this.i18nService.t("deactivateUserId", this.userNamePipe.transform(user)), - this.i18nService.t("deactivate"), + this.i18nService.t("revokeUserId", this.userNamePipe.transform(user)), + this.i18nService.t("revokeAccess"), this.i18nService.t("cancel"), "warning" ); @@ -251,7 +254,7 @@ export abstract class BasePeopleComponent< this.platformUtilsService.showToast( "success", null, - this.i18nService.t("deactivatedUserId", this.userNamePipe.transform(user)) + this.i18nService.t("revokedUserId", this.userNamePipe.transform(user)) ); await this.load(); } catch (e) { @@ -261,25 +264,13 @@ export abstract class BasePeopleComponent< } async activate(user: UserType) { - const confirmed = await this.platformUtilsService.showDialog( - this.activateWarningMessage(), - this.i18nService.t("activateUserId", this.userNamePipe.transform(user)), - this.i18nService.t("activate"), - this.i18nService.t("cancel"), - "warning" - ); - - if (!confirmed) { - return false; - } - this.actionPromise = this.activateUser(user.id); try { await this.actionPromise; this.platformUtilsService.showToast( "success", null, - this.i18nService.t("activatedUserId", this.userNamePipe.transform(user)) + this.i18nService.t("restoredUserId", this.userNamePipe.transform(user)) ); await this.load(); } catch (e) { @@ -395,7 +386,7 @@ export abstract class BasePeopleComponent< } protected deactivateWarningMessage(): string { - return this.i18nService.t("deactivateUserConfirmation"); + return this.i18nService.t("revokeUserConfirmation"); } protected activateWarningMessage(): string { diff --git a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html b/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html index b8bebcaa6fa..d2005be2290 100644 --- a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html +++ b/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html @@ -22,8 +22,8 @@ {{ error }} - - {{ usersWarning }} + + {{ "revokeUsersWarning" | i18n }} diff --git a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.ts b/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.ts index a6c63765cc8..558c312825f 100644 --- a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.ts +++ b/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.ts @@ -1,6 +1,5 @@ import { Component } from "@angular/core"; -import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref"; import { ModalConfig } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; @@ -26,7 +25,6 @@ export class BulkDeactivateComponent { constructor( protected apiService: ApiService, protected i18nService: I18nService, - private modalRef: ModalRef, config: ModalConfig ) { this.isDeactivating = config.data.isDeactivating; @@ -35,21 +33,16 @@ export class BulkDeactivateComponent { } get bulkTitle() { - const titleKey = this.isDeactivating ? "deactivateUsers" : "activateUsers"; + const titleKey = this.isDeactivating ? "revokeUsers" : "restoreUsers"; return this.i18nService.t(titleKey); } - get usersWarning() { - const warningKey = this.isDeactivating ? "deactivateUsersWarning" : "activateUsersWarning"; - return this.i18nService.t(warningKey); - } - async submit() { this.loading = true; try { const response = await this.performBulkUserAction(); - const bulkMessage = this.isDeactivating ? "bulkDeactivatedMessage" : "bulkActivatedMessage"; + const bulkMessage = this.isDeactivating ? "bulkRevokedMessage" : "bulkRestoredMessage"; response.data.forEach((entry) => { const error = entry.error !== "" ? entry.error : this.i18nService.t(bulkMessage); this.statuses.set(entry.id, error); @@ -60,7 +53,6 @@ export class BulkDeactivateComponent { } this.loading = false; - this.modalRef.close(); } protected async performBulkUserAction() { diff --git a/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.html b/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.html index 993d89533f5..25b91fbf13a 100644 --- a/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.html +++ b/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.html @@ -23,7 +23,7 @@ - {{ "removeUsersWarning" | i18n }} + {{ removeUsersWarning }}
diff --git a/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.ts b/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.ts index e6abeb03228..33641d76164 100644 --- a/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.ts +++ b/apps/web/src/app/organizations/manage/bulk/bulk-remove.component.ts @@ -43,4 +43,8 @@ export class BulkRemoveComponent { const request = new OrganizationUserBulkRequest(this.users.map((user) => user.id)); return await this.apiService.deleteManyOrganizationUsers(this.organizationId, request); } + + protected get removeUsersWarning() { + return this.i18nService.t("removeOrgUsersConfirmation"); + } } diff --git a/apps/web/src/app/organizations/manage/people.component.html b/apps/web/src/app/organizations/manage/people.component.html index a20a95d20aa..d9c981ca733 100644 --- a/apps/web/src/app/organizations/manage/people.component.html +++ b/apps/web/src/app/organizations/manage/people.component.html @@ -35,7 +35,7 @@ [ngClass]="{ active: status == userStatusType.Deactivated }" (click)="filter(userStatusType.Deactivated)" > - {{ "deactivated" | i18n }} + {{ "revoked" | i18n }} {{ deactivatedCount }} @@ -77,11 +77,11 @@