diff --git a/apps/web/src/app/common/base.people.component.ts b/apps/web/src/app/common/base.people.component.ts index 24344890868..b1aab35b322 100644 --- a/apps/web/src/app/common/base.people.component.ts +++ b/apps/web/src/app/common/base.people.component.ts @@ -55,9 +55,9 @@ export abstract class BasePeopleComponent< : 0; } - get deactivatedCount() { - return this.statusMap.has(this.userStatusType.Deactivated) - ? this.statusMap.get(this.userStatusType.Deactivated).length + get revokedCount() { + return this.statusMap.has(this.userStatusType.Revoked) + ? this.statusMap.get(this.userStatusType.Revoked).length : 0; } @@ -112,8 +112,8 @@ export abstract class BasePeopleComponent< abstract edit(user: UserType): void; abstract getUsers(): Promise>; abstract deleteUser(id: string): Promise; - abstract deactivateUser(id: string): Promise; - abstract activateUser(id: string): Promise; + abstract revokeUser(id: string): Promise; + abstract restoreUser(id: string): Promise; abstract reinviteUser(id: string): Promise; abstract confirmUser(user: UserType, publicKey: Uint8Array): Promise; @@ -133,7 +133,7 @@ export abstract class BasePeopleComponent< } else { this.statusMap.get(u.status).push(u); } - if (u.status !== this.userStatusType.Deactivated) { + if (u.status !== this.userStatusType.Revoked) { this.activeUsers.push(u); } }); @@ -235,9 +235,9 @@ export abstract class BasePeopleComponent< this.actionPromise = null; } - async deactivate(user: UserType) { + async revoke(user: UserType) { const confirmed = await this.platformUtilsService.showDialog( - this.deactivateWarningMessage(), + this.revokeWarningMessage(), this.i18nService.t("revokeUserId", this.userNamePipe.transform(user)), this.i18nService.t("revokeAccess"), this.i18nService.t("cancel"), @@ -248,7 +248,7 @@ export abstract class BasePeopleComponent< return false; } - this.actionPromise = this.deactivateUser(user.id); + this.actionPromise = this.revokeUser(user.id); try { await this.actionPromise; this.platformUtilsService.showToast( @@ -263,8 +263,8 @@ export abstract class BasePeopleComponent< this.actionPromise = null; } - async activate(user: UserType) { - this.actionPromise = this.activateUser(user.id); + async restore(user: UserType) { + this.actionPromise = this.restoreUser(user.id); try { await this.actionPromise; this.platformUtilsService.showToast( @@ -381,18 +381,10 @@ export abstract class BasePeopleComponent< return !searching && this.users && this.users.length > this.pageSize; } - protected deleteWarningMessage(user: UserType): string { - return this.i18nService.t("removeUserConfirmation"); - } - - protected deactivateWarningMessage(): string { + protected revokeWarningMessage(): string { return this.i18nService.t("revokeUserConfirmation"); } - protected activateWarningMessage(): string { - return this.i18nService.t("activateUserConfirmation"); - } - protected getCheckedUsers() { return this.users.filter((u) => (u as any).checked); } diff --git a/apps/web/src/app/modules/loose-components.module.ts b/apps/web/src/app/modules/loose-components.module.ts index 37b6d8172ff..1d6d66b4787 100644 --- a/apps/web/src/app/modules/loose-components.module.ts +++ b/apps/web/src/app/modules/loose-components.module.ts @@ -29,8 +29,8 @@ import { NavbarComponent } from "../layouts/navbar.component"; import { UserLayoutComponent } from "../layouts/user-layout.component"; import { OrganizationLayoutComponent } from "../organizations/layouts/organization-layout.component"; import { BulkConfirmComponent as OrgBulkConfirmComponent } from "../organizations/manage/bulk/bulk-confirm.component"; -import { BulkDeactivateComponent as OrgBulkDeactivateomponent } from "../organizations/manage/bulk/bulk-deactivate.component"; import { BulkRemoveComponent as OrgBulkRemoveComponent } from "../organizations/manage/bulk/bulk-remove.component"; +import { BulkRestoreRevokeComponent as OrgBulkRestoreRevokeComponent } from "../organizations/manage/bulk/bulk-restore-revoke.component"; import { BulkStatusComponent as OrgBulkStatusComponent } from "../organizations/manage/bulk/bulk-status.component"; import { CollectionAddEditComponent as OrgCollectionAddEditComponent } from "../organizations/manage/collection-add-edit.component"; import { CollectionsComponent as OrgManageCollectionsComponent } from "../organizations/manage/collections.component"; @@ -237,7 +237,7 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga OrganizationSubscriptionComponent, OrgAttachmentsComponent, OrgBulkConfirmComponent, - OrgBulkDeactivateomponent, + OrgBulkRestoreRevokeComponent, OrgBulkRemoveComponent, OrgBulkStatusComponent, OrgCiphersComponent, @@ -390,7 +390,7 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga OrganizationSubscriptionComponent, OrgAttachmentsComponent, OrgBulkConfirmComponent, - OrgBulkDeactivateomponent, + OrgBulkRestoreRevokeComponent, OrgBulkRemoveComponent, OrgBulkStatusComponent, OrgCiphersComponent, diff --git a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html b/apps/web/src/app/organizations/manage/bulk/bulk-restore-revoke.component.html similarity index 99% rename from apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html rename to apps/web/src/app/organizations/manage/bulk/bulk-restore-revoke.component.html index d2005be2290..e02ee93e885 100644 --- a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.html +++ b/apps/web/src/app/organizations/manage/bulk/bulk-restore-revoke.component.html @@ -22,7 +22,7 @@ {{ error }} - + {{ "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-restore-revoke.component.ts similarity index 70% rename from apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.ts rename to apps/web/src/app/organizations/manage/bulk/bulk-restore-revoke.component.ts index 558c312825f..fa0a916ef05 100644 --- a/apps/web/src/app/organizations/manage/bulk/bulk-deactivate.component.ts +++ b/apps/web/src/app/organizations/manage/bulk/bulk-restore-revoke.component.ts @@ -8,11 +8,11 @@ import { OrganizationUserBulkRequest } from "@bitwarden/common/models/request/or import { BulkUserDetails } from "./bulk-status.component"; @Component({ - selector: "app-bulk-deactivate", - templateUrl: "bulk-deactivate.component.html", + selector: "app-bulk-restore-revoke", + templateUrl: "bulk-restore-revoke.component.html", }) -export class BulkDeactivateComponent { - isDeactivating: boolean; +export class BulkRestoreRevokeComponent { + isRevoking: boolean; organizationId: string; users: BulkUserDetails[]; @@ -27,13 +27,13 @@ export class BulkDeactivateComponent { protected i18nService: I18nService, config: ModalConfig ) { - this.isDeactivating = config.data.isDeactivating; + this.isRevoking = config.data.isRevoking; this.organizationId = config.data.organizationId; this.users = config.data.users; } get bulkTitle() { - const titleKey = this.isDeactivating ? "revokeUsers" : "restoreUsers"; + const titleKey = this.isRevoking ? "revokeUsers" : "restoreUsers"; return this.i18nService.t(titleKey); } @@ -42,7 +42,7 @@ export class BulkDeactivateComponent { try { const response = await this.performBulkUserAction(); - const bulkMessage = this.isDeactivating ? "bulkRevokedMessage" : "bulkRestoredMessage"; + const bulkMessage = this.isRevoking ? "bulkRevokedMessage" : "bulkRestoredMessage"; response.data.forEach((entry) => { const error = entry.error !== "" ? entry.error : this.i18nService.t(bulkMessage); this.statuses.set(entry.id, error); @@ -57,10 +57,10 @@ export class BulkDeactivateComponent { protected async performBulkUserAction() { const request = new OrganizationUserBulkRequest(this.users.map((user) => user.id)); - if (this.isDeactivating) { - return await this.apiService.deactivateManyOrganizationUsers(this.organizationId, request); + if (this.isRevoking) { + return await this.apiService.revokeManyOrganizationUsers(this.organizationId, request); } else { - return await this.apiService.activateManyOrganizationUsers(this.organizationId, request); + return await this.apiService.restoreManyOrganizationUsers(this.organizationId, request); } } } diff --git a/apps/web/src/app/organizations/manage/people.component.html b/apps/web/src/app/organizations/manage/people.component.html index d9c981ca733..ff583bcf36b 100644 --- a/apps/web/src/app/organizations/manage/people.component.html +++ b/apps/web/src/app/organizations/manage/people.component.html @@ -32,11 +32,11 @@
@@ -75,11 +75,11 @@ {{ "confirmSelected" | i18n }} - - @@ -158,7 +158,7 @@ {{ "accepted" | i18n }} - {{ + {{ "revoked" | i18n }} {{ u.name }} @@ -255,8 +255,8 @@ class="dropdown-item" href="#" appStopClick - (click)="activate(u)" - *ngIf="u.status === userStatusType.Deactivated" + (click)="restore(u)" + *ngIf="u.status === userStatusType.Revoked" > {{ "restoreAccess" | i18n }} @@ -265,8 +265,8 @@ class="dropdown-item" href="#" appStopClick - (click)="deactivate(u)" - *ngIf="u.status !== userStatusType.Deactivated" + (click)="revoke(u)" + *ngIf="u.status !== userStatusType.Revoked" > {{ "revokeAccess" | i18n }} diff --git a/apps/web/src/app/organizations/manage/people.component.ts b/apps/web/src/app/organizations/manage/people.component.ts index 5bf6144ddaa..922fb6847f1 100644 --- a/apps/web/src/app/organizations/manage/people.component.ts +++ b/apps/web/src/app/organizations/manage/people.component.ts @@ -29,8 +29,8 @@ import { OrganizationUserUserDetailsResponse } from "@bitwarden/common/models/re import { BasePeopleComponent } from "../../common/base.people.component"; import { BulkConfirmComponent } from "./bulk/bulk-confirm.component"; -import { BulkDeactivateComponent } from "./bulk/bulk-deactivate.component"; import { BulkRemoveComponent } from "./bulk/bulk-remove.component"; +import { BulkRestoreRevokeComponent } from "./bulk/bulk-restore-revoke.component"; import { BulkStatusComponent } from "./bulk/bulk-status.component"; import { EntityEventsComponent } from "./entity-events.component"; import { ResetPasswordComponent } from "./reset-password.component"; @@ -167,12 +167,12 @@ export class PeopleComponent return this.apiService.deleteOrganizationUser(this.organizationId, id); } - deactivateUser(id: string): Promise { - return this.apiService.deactivateOrganizationUser(this.organizationId, id); + revokeUser(id: string): Promise { + return this.apiService.revokeOrganizationUser(this.organizationId, id); } - activateUser(id: string): Promise { - return this.apiService.activateOrganizationUser(this.organizationId, id); + restoreUser(id: string): Promise { + return this.apiService.restoreOrganizationUser(this.organizationId, id); } reinviteUser(id: string): Promise { @@ -245,11 +245,11 @@ export class PeopleComponent modal.close(); this.removeUser(user); }); - comp.onDeactivatedUser.subscribe(() => { + comp.onRevokedUser.subscribe(() => { modal.close(); this.load(); }); - comp.onActivatedUser.subscribe(() => { + comp.onRestoredUser.subscribe(() => { modal.close(); this.load(); }); @@ -290,25 +290,25 @@ export class PeopleComponent await this.load(); } - async bulkDeactivate() { - await this.bulkActivateOrDeactivate(true); + async bulkRevoke() { + await this.bulkRevokeOrRestore(true); } - async bulkActivate() { - await this.bulkActivateOrDeactivate(false); + async bulkRestore() { + await this.bulkRevokeOrRestore(false); } - async bulkActivateOrDeactivate(isDeactivating: boolean) { + async bulkRevokeOrRestore(isRevoking: boolean) { if (this.actionPromise != null) { return; } - const ref = this.modalService.open(BulkDeactivateComponent, { + const ref = this.modalService.open(BulkRestoreRevokeComponent, { allowMultipleModals: true, data: { organizationId: this.organizationId, users: this.getCheckedUsers(), - isDeactivating: isDeactivating, + isRevoking: isRevoking, }, }); diff --git a/apps/web/src/app/organizations/manage/user-add-edit.component.html b/apps/web/src/app/organizations/manage/user-add-edit.component.html index 2820ac05e2f..11b2b4cf19d 100644 --- a/apps/web/src/app/organizations/manage/user-add-edit.component.html +++ b/apps/web/src/app/organizations/manage/user-add-edit.component.html @@ -11,7 +11,7 @@