From 4453a5c114c12fa0f86e527a9b0d34b78b8803eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:01:29 +0100 Subject: [PATCH] [PM-11333] Rename deleteOrganizationUser to removeOrganizationUser in BaseMembersComponent, OrganizationUserService and related files --- .../admin-console/common/base-members.component.ts | 4 ++-- .../members/components/bulk/bulk-remove.component.ts | 6 +++--- .../member-dialog/member-dialog.component.ts | 2 +- .../organizations/members/members.component.ts | 4 ++-- .../providers/manage/members.component.ts | 2 +- .../organization-user/organization-user.service.ts | 12 ++++++------ .../organization-user.service.implementation.ts | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/web/src/app/admin-console/common/base-members.component.ts b/apps/web/src/app/admin-console/common/base-members.component.ts index c13bec78c5..2d0d66e293 100644 --- a/apps/web/src/app/admin-console/common/base-members.component.ts +++ b/apps/web/src/app/admin-console/common/base-members.component.ts @@ -96,7 +96,7 @@ export abstract class BaseMembersComponent { abstract edit(user: UserView): void; abstract getUsers(): Promise | UserView[]>; - abstract deleteUser(id: string): Promise; + abstract removeUser(id: string): Promise; abstract reinviteUser(id: string): Promise; abstract confirmUser(user: UserView, publicKey: Uint8Array): Promise; @@ -132,7 +132,7 @@ export abstract class BaseMembersComponent { return false; } - this.actionPromise = this.deleteUser(user.id); + this.actionPromise = this.removeUser(user.id); try { await this.actionPromise; this.toastService.showToast({ diff --git a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-remove.component.ts b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-remove.component.ts index 15a24eb25e..60d1aec41c 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-remove.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/bulk/bulk-remove.component.ts @@ -45,7 +45,7 @@ export class BulkRemoveComponent { submit = async () => { this.loading = true; try { - const response = await this.deleteUsers(); + const response = await this.removeUsers(); response.data.forEach((entry) => { const error = entry.error !== "" ? entry.error : this.i18nService.t("bulkRemovedMessage"); @@ -59,8 +59,8 @@ export class BulkRemoveComponent { this.loading = false; }; - protected async deleteUsers() { - return await this.organizationUserService.deleteManyOrganizationUsers( + protected async removeUsers() { + return await this.organizationUserService.removeManyOrganizationUsers( this.organizationId, this.users.map((user) => user.id), ); diff --git a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts index ef36f2b80b..9f02c63f07 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts @@ -487,7 +487,7 @@ export class MemberDialogComponent implements OnDestroy { } } - await this.organizationUserService.deleteOrganizationUser( + await this.organizationUserService.removeOrganizationUser( this.params.organizationId, this.params.organizationUserId, ); diff --git a/apps/web/src/app/admin-console/organizations/members/members.component.ts b/apps/web/src/app/admin-console/organizations/members/members.component.ts index 66a62f7acc..c1bc970d5d 100644 --- a/apps/web/src/app/admin-console/organizations/members/members.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/members.component.ts @@ -269,8 +269,8 @@ export class MembersComponent extends BaseMembersComponent return collectionMap; } - deleteUser(id: string): Promise { - return this.organizationUserService.deleteOrganizationUser(this.organization.id, id); + removeUser(id: string): Promise { + return this.organizationUserService.removeOrganizationUser(this.organization.id, id); } revokeUser(id: string): Promise { diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts index 3e9856638e..f78bccd354 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/manage/members.component.ts @@ -190,7 +190,7 @@ export class MembersComponent extends BaseMembersComponent { await this.apiService.postProviderUserConfirm(this.providerId, user.id, request); } - deleteUser = (id: string): Promise => + removeUser = (id: string): Promise => this.apiService.deleteProviderUser(this.providerId, id); edit = async (user: ProviderUser | null): Promise => { diff --git a/libs/common/src/admin-console/abstractions/organization-user/organization-user.service.ts b/libs/common/src/admin-console/abstractions/organization-user/organization-user.service.ts index 7058be0803..aada830f95 100644 --- a/libs/common/src/admin-console/abstractions/organization-user/organization-user.service.ts +++ b/libs/common/src/admin-console/abstractions/organization-user/organization-user.service.ts @@ -210,19 +210,19 @@ export abstract class OrganizationUserService { ): Promise; /** - * Delete an organization user + * Remove an organization user * @param organizationId - Identifier for the organization the user belongs to * @param id - Organization user identifier */ - abstract deleteOrganizationUser(organizationId: string, id: string): Promise; + abstract removeOrganizationUser(organizationId: string, id: string): Promise; /** - * Delete many organization users + * Remove many organization users * @param organizationId - Identifier for the organization the users belongs to - * @param ids - List of organization user identifiers to delete - * @return List of user ids, including both those that were successfully deleted and those that had an error + * @param ids - List of organization user identifiers to remove + * @return List of user ids, including both those that were successfully removed and those that had an error */ - abstract deleteManyOrganizationUsers( + abstract removeManyOrganizationUsers( organizationId: string, ids: string[], ): Promise>; diff --git a/libs/common/src/admin-console/services/organization-user/organization-user.service.implementation.ts b/libs/common/src/admin-console/services/organization-user/organization-user.service.implementation.ts index b66805a20b..e3687691b6 100644 --- a/libs/common/src/admin-console/services/organization-user/organization-user.service.implementation.ts +++ b/libs/common/src/admin-console/services/organization-user/organization-user.service.implementation.ts @@ -274,7 +274,7 @@ export class OrganizationUserServiceImplementation implements OrganizationUserSe ); } - deleteOrganizationUser(organizationId: string, id: string): Promise { + removeOrganizationUser(organizationId: string, id: string): Promise { return this.apiService.send( "DELETE", "/organizations/" + organizationId + "/users/" + id, @@ -284,7 +284,7 @@ export class OrganizationUserServiceImplementation implements OrganizationUserSe ); } - async deleteManyOrganizationUsers( + async removeManyOrganizationUsers( organizationId: string, ids: string[], ): Promise> {