From f9f79299c2e628757b61aeb9f0bcfbdcee54e26d Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Wed, 6 Nov 2024 11:03:59 +0100 Subject: [PATCH 1/3] task: Added Release Plan Template events --- src/lib/types/events.ts | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index d71c28df5f91..500787df863b 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -204,6 +204,10 @@ export const ACTIONS_CREATED = 'actions-created' as const; export const ACTIONS_UPDATED = 'actions-updated' as const; export const ACTIONS_DELETED = 'actions-deleted' as const; +export const RELEASE_PLAN_TEMPLATE_CREATED = 'release-plan-template-created'; +export const RELEASE_PLAN_TEMPLATE_UPDATED = 'release-plan-template-updated'; +export const RELEASE_PLAN_TEMPLATE_DELETED = 'release-plan-template-deleted'; + export const IEventTypes = [ APPLICATION_CREATED, FEATURE_CREATED, @@ -351,6 +355,9 @@ export const IEventTypes = [ ACTIONS_CREATED, ACTIONS_UPDATED, ACTIONS_DELETED, + RELEASE_PLAN_TEMPLATE_CREATED, + RELEASE_PLAN_TEMPLATE_UPDATED, + RELEASE_PLAN_TEMPLATE_DELETED, ] as const; export type IEventType = (typeof IEventTypes)[number]; @@ -2009,6 +2016,42 @@ export class GroupDeletedEvent extends BaseEvent { } } +export class ReleasePlanTemplateCreatedEvent extends BaseEvent { + readonly data: any; + constructor(eventData: { + data: any; + auditUser: IAuditUser; + }) { + super(RELEASE_PLAN_TEMPLATE_CREATED, eventData.auditUser); + this.data = eventData.data; + } +} + +export class ReleasePlanTemplateUpdatedEvent extends BaseEvent { + readonly preData: any; + readonly data: any; + constructor(eventData: { + data: any; + preData: any; + auditUser: IAuditUser; + }) { + super(RELEASE_PLAN_TEMPLATE_UPDATED, eventData.auditUser); + this.data = eventData.data; + this.preData = eventData.preData; + } +} + +export class ReleasePlanTemplateDeletedEvent extends BaseEvent { + readonly preData: any; + constructor(eventData: { + preData: any; + auditUser: IAuditUser; + }) { + super(RELEASE_PLAN_TEMPLATE_DELETED, eventData.auditUser); + this.preData = eventData.preData; + } +} + interface IUserEventData extends Pick< IUserWithRootRole, From a4de63e11f3fd13932bac03478a8fba2f05d037d Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Wed, 6 Nov 2024 11:13:38 +0100 Subject: [PATCH 2/3] chore: yarn lint --- src/lib/types/events.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index eab3136409f9..cb02c4d6b0c6 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -209,7 +209,6 @@ export const RELEASE_PLAN_TEMPLATE_UPDATED = 'release-plan-template-updated'; export const RELEASE_PLAN_TEMPLATE_DELETED = 'release-plan-template-deleted'; export const USER_PREFERENCE_UPDATED = 'user-preference-updated' as const; - export const IEventTypes = [ APPLICATION_CREATED, FEATURE_CREATED, From a6594071db1badc135e59f511696d38ff7e8c0c8 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Wed, 6 Nov 2024 11:14:47 +0100 Subject: [PATCH 3/3] fix: include as const for new event strings --- src/lib/types/events.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index cb02c4d6b0c6..3ddee00068c2 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -204,9 +204,12 @@ export const ACTIONS_CREATED = 'actions-created' as const; export const ACTIONS_UPDATED = 'actions-updated' as const; export const ACTIONS_DELETED = 'actions-deleted' as const; -export const RELEASE_PLAN_TEMPLATE_CREATED = 'release-plan-template-created'; -export const RELEASE_PLAN_TEMPLATE_UPDATED = 'release-plan-template-updated'; -export const RELEASE_PLAN_TEMPLATE_DELETED = 'release-plan-template-deleted'; +export const RELEASE_PLAN_TEMPLATE_CREATED = + 'release-plan-template-created' as const; +export const RELEASE_PLAN_TEMPLATE_UPDATED = + 'release-plan-template-updated' as const; +export const RELEASE_PLAN_TEMPLATE_DELETED = + 'release-plan-template-deleted' as const; export const USER_PREFERENCE_UPDATED = 'user-preference-updated' as const; export const IEventTypes = [