Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-10318] Add organization user deletion and leaving events to EventService #11554

Merged
merged 8 commits into from
Nov 8, 2024
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 @@
this.getShortId(ev.organizationUserId),
);
break;
case EventType.OrganizationUser_Deleted:
msg = this.i18nService.t("deletedUserId", this.formatOrgUserId(ev));
humanReadableMsg = this.i18nService.t(

Check warning on line 335 in apps/web/src/app/core/event.service.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/core/event.service.ts#L334-L335

Added lines #L334 - L335 were not covered by tests
"deletedUserId",
this.getShortId(ev.organizationUserId),
);
break;

Check warning on line 339 in apps/web/src/app/core/event.service.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/core/event.service.ts#L339

Added line #L339 was not covered by tests
case EventType.OrganizationUser_Left:
msg = this.i18nService.t("userLeftOrganization", this.formatOrgUserId(ev));
humanReadableMsg = this.i18nService.t(

Check warning on line 342 in apps/web/src/app/core/event.service.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/core/event.service.ts#L341-L342

Added lines #L341 - L342 were not covered by tests
"userLeftOrganization",
this.getShortId(ev.organizationUserId),
);
break;

Check warning on line 346 in apps/web/src/app/core/event.service.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/core/event.service.ts#L346

Added line #L346 was not covered by tests
// 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 @@ -9421,5 +9421,23 @@
},
"permanentlyDeleteAttachmentConfirmation": {
"message": "Are you sure you want to permanently delete this attachment?"
},
"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
Loading