Skip to content

Commit

Permalink
[PM-10318] Add organization user deletion and leaving events to Event…
Browse files Browse the repository at this point in the history
…Service (#11554)
  • Loading branch information
r-tome authored Nov 8, 2024
1 parent 081fe83 commit 1f0c1f1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/web/src/app/core/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
18 changes: 18 additions & 0 deletions apps/web/src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
2 changes: 2 additions & 0 deletions libs/common/src/enums/event-type.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1f0c1f1

Please sign in to comment.