From 1f0c1f1b4464f8a0d731421adc87934cb5fa2526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:23:24 +0000 Subject: [PATCH] [PM-10318] Add organization user deletion and leaving events to EventService (#11554) --- apps/web/src/app/core/event.service.ts | 14 ++++++++++++++ apps/web/src/locales/en/messages.json | 18 ++++++++++++++++++ libs/common/src/enums/event-type.enum.ts | 2 ++ 3 files changed, 34 insertions(+) diff --git a/apps/web/src/app/core/event.service.ts b/apps/web/src/app/core/event.service.ts index 0bfe1d0dc8..be6a62443d 100644 --- a/apps/web/src/app/core/event.service.ts +++ b/apps/web/src/app/core/event.service.ts @@ -330,6 +330,20 @@ export class EventService { this.getShortId(ev.organizationUserId), ); break; + case EventType.OrganizationUser_Deleted: + msg = this.i18nService.t("deletedUserId", this.formatOrgUserId(ev)); + humanReadableMsg = this.i18nService.t( + "deletedUserId", + this.getShortId(ev.organizationUserId), + ); + break; + case EventType.OrganizationUser_Left: + msg = this.i18nService.t("userLeftOrganization", this.formatOrgUserId(ev)); + humanReadableMsg = this.i18nService.t( + "userLeftOrganization", + this.getShortId(ev.organizationUserId), + ); + break; // Org case EventType.Organization_Updated: msg = humanReadableMsg = this.i18nService.t("editedOrgSettings"); diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index b4a6a0b348..09feaadcc1 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -9607,5 +9607,23 @@ }, "organizationUserDeletedDesc": { "message": "The user was removed from the organization and all associated user data has been deleted." + }, + "deletedUserId": { + "message": "Deleted user $ID$ - an owner / admin deleted the user account", + "placeholders": { + "id": { + "content": "$1", + "example": "First 8 Character of a GUID" + } + } + }, + "userLeftOrganization": { + "message": "User $ID$ left organization", + "placeholders": { + "id": { + "content": "$1", + "example": "First 8 Character of a GUID" + } + } } } diff --git a/libs/common/src/enums/event-type.enum.ts b/libs/common/src/enums/event-type.enum.ts index c72fb80de4..51b324bb43 100644 --- a/libs/common/src/enums/event-type.enum.ts +++ b/libs/common/src/enums/event-type.enum.ts @@ -56,6 +56,8 @@ export enum EventType { OrganizationUser_Restored = 1512, OrganizationUser_ApprovedAuthRequest = 1513, OrganizationUser_RejectedAuthRequest = 1514, + OrganizationUser_Deleted = 1515, + OrganizationUser_Left = 1516, Organization_Updated = 1600, Organization_PurgedVault = 1601,