Skip to content

Commit

Permalink
feat: add new message banner events (#5055)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-1516/add-new-message-banner-events

Adds new message banner events to help us keep track of changes related
to the new feature.
  • Loading branch information
nunogois authored Oct 16, 2023
1 parent 65d95e9 commit 364e315
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/addons/feature-event-formatter-md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import {
GROUP_UPDATED,
IConstraint,
IEvent,
MESSAGE_BANNER_CREATED,
MESSAGE_BANNER_DELETED,
MESSAGE_BANNER_UPDATED,
PROJECT_CREATED,
PROJECT_DELETED,
SEGMENT_CREATED,
Expand Down Expand Up @@ -229,6 +232,18 @@ const EVENT_MAP: Record<string, IEventData> = {
action: '*{{user}}* updated group *{{event.preData.name}}*',
path: '/admin/groups',
},
[MESSAGE_BANNER_CREATED]: {
action: '*{{user}}* created message banner *{{event.data.message}}*',
path: '/admin/message-banners',
},
[MESSAGE_BANNER_DELETED]: {
action: '*{{user}}* deleted message banner *{{event.preData.message}}*',
path: '/admin/message-banners',
},
[MESSAGE_BANNER_UPDATED]: {
action: '*{{user}}* updated message banner *{{event.preData.message}}*',
path: '/admin/message-banners',
},
[PROJECT_CREATED]: {
action: '*{{user}}* created project *{{project}}*',
path: '/projects',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/addons/slack-app-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ import {
SERVICE_ACCOUNT_DELETED,
SERVICE_ACCOUNT_UPDATED,
GROUP_DELETED,
MESSAGE_BANNER_CREATED,
MESSAGE_BANNER_UPDATED,
MESSAGE_BANNER_DELETED,
} from '../types/events';
import { IAddonDefinition } from '../types/model';

Expand Down Expand Up @@ -124,6 +127,9 @@ const slackAppDefinition: IAddonDefinition = {
GROUP_CREATED,
GROUP_DELETED,
GROUP_UPDATED,
MESSAGE_BANNER_CREATED,
MESSAGE_BANNER_UPDATED,
MESSAGE_BANNER_DELETED,
PROJECT_CREATED,
PROJECT_DELETED,
SEGMENT_CREATED,
Expand Down
7 changes: 7 additions & 0 deletions src/lib/types/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export const SERVICE_ACCOUNT_DELETED = 'service-account-deleted' as const;
export const FEATURE_POTENTIALLY_STALE_ON =
'feature-potentially-stale-on' as const;

export const MESSAGE_BANNER_CREATED = 'message-banner-created' as const;
export const MESSAGE_BANNER_UPDATED = 'message-banner-updated' as const;
export const MESSAGE_BANNER_DELETED = 'message-banner-deleted' as const;

export const IEventTypes = [
APPLICATION_CREATED,
FEATURE_CREATED,
Expand Down Expand Up @@ -256,6 +260,9 @@ export const IEventTypes = [
FEATURE_DEPENDENCY_ADDED,
FEATURE_DEPENDENCY_REMOVED,
FEATURE_DEPENDENCIES_REMOVED,
MESSAGE_BANNER_CREATED,
MESSAGE_BANNER_UPDATED,
MESSAGE_BANNER_DELETED,
] as const;
export type IEventType = typeof IEventTypes[number];

Expand Down

0 comments on commit 364e315

Please sign in to comment.