diff --git a/src/lib/addons/datadog-definition.ts b/src/lib/addons/datadog-definition.ts index d2e0de5e0b..0c87aef376 100644 --- a/src/lib/addons/datadog-definition.ts +++ b/src/lib/addons/datadog-definition.ts @@ -12,6 +12,7 @@ import { FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, FEATURE_PROJECT_CHANGE, + FEATURE_VARIANTS_UPDATED, } from '../types/events'; import { IAddonDefinition } from '../types/model'; @@ -54,6 +55,7 @@ const dataDogDefinition: IAddonDefinition = { FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, FEATURE_PROJECT_CHANGE, + FEATURE_VARIANTS_UPDATED, ], tagTypes: [ { diff --git a/src/lib/addons/feature-event-formatter-md.ts b/src/lib/addons/feature-event-formatter-md.ts index d65c21fe9b..6f6ea8c4c1 100644 --- a/src/lib/addons/feature-event-formatter-md.ts +++ b/src/lib/addons/feature-event-formatter-md.ts @@ -13,6 +13,7 @@ import { FEATURE_METADATA_UPDATED, FEATURE_PROJECT_CHANGE, IEvent, + FEATURE_VARIANTS_UPDATED, } from '../types/events'; export interface FeatureEventFormatter { @@ -108,6 +109,8 @@ export class FeatureEventFormatterMd implements FeatureEventFormatter { return 'created'; case FEATURE_UPDATED: return 'updated'; + case FEATURE_VARIANTS_UPDATED: + return 'updated variants for'; default: return type; } diff --git a/src/lib/addons/slack-definition.ts b/src/lib/addons/slack-definition.ts index 198a466d40..03cacf4478 100644 --- a/src/lib/addons/slack-definition.ts +++ b/src/lib/addons/slack-definition.ts @@ -12,6 +12,7 @@ import { FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, FEATURE_PROJECT_CHANGE, + FEATURE_VARIANTS_UPDATED, } from '../types/events'; import { IAddonDefinition } from '../types/model'; @@ -71,6 +72,7 @@ const slackDefinition: IAddonDefinition = { FEATURE_STRATEGY_UPDATE, FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, + FEATURE_VARIANTS_UPDATED, FEATURE_PROJECT_CHANGE, ], tagTypes: [ diff --git a/src/lib/addons/teams-definition.ts b/src/lib/addons/teams-definition.ts index 388bd25b18..9bf97a2781 100644 --- a/src/lib/addons/teams-definition.ts +++ b/src/lib/addons/teams-definition.ts @@ -12,6 +12,7 @@ import { FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, FEATURE_PROJECT_CHANGE, + FEATURE_VARIANTS_UPDATED, } from '../types/events'; import { IAddonDefinition } from '../types/model'; @@ -42,6 +43,7 @@ const teamsDefinition: IAddonDefinition = { FEATURE_STRATEGY_UPDATE, FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, + FEATURE_VARIANTS_UPDATED, FEATURE_PROJECT_CHANGE, ], }; diff --git a/src/lib/addons/webhook-definition.ts b/src/lib/addons/webhook-definition.ts index 5786f4e0fb..5ef518f322 100644 --- a/src/lib/addons/webhook-definition.ts +++ b/src/lib/addons/webhook-definition.ts @@ -4,6 +4,7 @@ import { FEATURE_ENVIRONMENT_DISABLED, FEATURE_ENVIRONMENT_ENABLED, FEATURE_METADATA_UPDATED, + FEATURE_VARIANTS_UPDATED, FEATURE_PROJECT_CHANGE, FEATURE_REVIVED, FEATURE_STALE_OFF, @@ -70,6 +71,7 @@ const webhookDefinition: IAddonDefinition = { FEATURE_STRATEGY_UPDATE, FEATURE_STRATEGY_ADD, FEATURE_METADATA_UPDATED, + FEATURE_VARIANTS_UPDATED, FEATURE_PROJECT_CHANGE, ], }; diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index 04bf3edfa9..5f4e29b855 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -146,23 +146,23 @@ export class FeatureVariantEvent extends BaseEvent { readonly featureName: string; - readonly data: { - oldVariants: IVariant[]; - newVariants: IVariant[]; - }; + readonly data: { variants: IVariant[] }; + + readonly preData: { variants: IVariant[] }; constructor(p: { project: string; featureName: string; createdBy: string; tags: ITag[]; - oldVariants: IVariant[]; newVariants: IVariant[]; + oldVariants: IVariant[]; }) { super(FEATURE_VARIANTS_UPDATED, p.createdBy, p.tags); this.project = p.project; this.featureName = p.featureName; - this.data = { oldVariants: p.oldVariants, newVariants: p.newVariants }; + this.data = { variants: p.newVariants }; + this.preData = { variants: p.oldVariants }; } }