From 5a78853de5d7d886a0ada6b2a48bcd05878db1d0 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Thu, 19 May 2022 11:28:26 -0400 Subject: [PATCH] [PS-655] Add `Organization_SponsorshipsSynced` event type. (#1696) * Add `Organization_SponsorshipsSynced` event type. Update events display to handle events triggered by installations rather than users * Update jslib --- jslib | 2 +- src/app/common/base.events.component.ts | 5 ++++- src/app/services/event.service.ts | 3 +++ src/locales/en/messages.json | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jslib b/jslib index 2f54893854..3cb94623e2 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 2f54893854da61a742f87b02ec4328f7933bfe27 +Subproject commit 3cb94623e2c6a3ac6cf6dbcd516ba23b03a7aee7 diff --git a/src/app/common/base.events.component.ts b/src/app/common/base.events.component.ts index 8fd78cce39..11ad5c453f 100644 --- a/src/app/common/base.events.component.ts +++ b/src/app/common/base.events.component.ts @@ -122,17 +122,20 @@ export abstract class BaseEventsComponent { const userId = r.actingUserId == null ? r.userId : r.actingUserId; const eventInfo = await this.eventService.getEventInfo(r); const user = this.getUserName(r, userId); + const userName = user != null ? user.name : this.i18nService.t("unknown"); + return new EventView({ message: eventInfo.message, humanReadableMessage: eventInfo.humanReadableMessage, appIcon: eventInfo.appIcon, appName: eventInfo.appName, userId: userId, - userName: user != null ? user.name : this.i18nService.t("unknown"), + userName: r.installationId != null ? `Installation: ${r.installationId}` : userName, userEmail: user != null ? user.email : "", date: r.date, ip: r.ipAddress, type: r.type, + installationId: r.installationId, }); }) ); diff --git a/src/app/services/event.service.ts b/src/app/services/event.service.ts index a851866b0b..02f50cf7b3 100644 --- a/src/app/services/event.service.ts +++ b/src/app/services/event.service.ts @@ -307,6 +307,9 @@ export class EventService { case EventType.Organization_DisabledKeyConnector: msg = humanReadableMsg = this.i18nService.t("disabledKeyConnector"); break; + case EventType.Organization_SponsorshipsSynced: + msg = humanReadableMsg = this.i18nService.t("sponsorshipsSynced"); + break; // Policies case EventType.Policy_Updated: { msg = this.i18nService.t("modifiedPolicyId", this.formatPolicyId(ev)); diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 4e15b6ad05..bb37b09b96 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -5041,6 +5041,9 @@ "message": "Last Sync", "Description": "Used as a prefix to indicate the last time a sync occured. Example \"Last sync 1968-11-16 00:00:00\"" }, + "sponsorshipsSynced": { + "message": "Self-hosted sponsorships synced." + }, "billingManagedByProvider": { "message": "Managed by $PROVIDER$", "placeholders": {