File tree Expand file tree Collapse file tree 7 files changed +48
-1
lines changed Expand file tree Collapse file tree 7 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -326,3 +326,8 @@ export function fetchChartTemplateVersions() {
326
326
export const getDefaultConfig = ( ) : Promise < ResponseType > => {
327
327
return get ( `${ ROUTES . NOTIFIER } /channel/config` )
328
328
}
329
+
330
+ export function getWebhookEventsForEventId ( eventId : string | number ) {
331
+ const URL = `${ ROUTES . GIT_HOST_EVENT } /${ eventId } `
332
+ return get ( URL )
333
+ }
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export const ROUTES = {
47
47
UPDATE : 'update' ,
48
48
CLUSTER_NOTE : 'cluster/note' ,
49
49
APPLICATION_NOTE : 'app/note' ,
50
+ GIT_HOST_EVENT : 'git/host/event' ,
50
51
}
51
52
52
53
export enum KEY_VALUE {
Original file line number Diff line number Diff line change 1
1
import { MaterialInfo } from '../Common'
2
- import { GitTriggers } from './types'
2
+ import { GitTriggers , WebhookEventNameType } from './types'
3
+ import { ReactComponent as ICPullRequest } from '../Assets/Icon/ic-pull-request.svg'
4
+ import { ReactComponent as ICTag } from '../Assets/Icon/ic-tag.svg'
5
+ import { ReactComponent as ICWebhook } from '../Assets/Icon/ic-webhook.svg'
3
6
4
7
interface HighlightSearchTextProps {
5
8
/**
@@ -69,3 +72,14 @@ export const getGitCommitInfo = (materialInfo: MaterialInfo): GitTriggers => ({
69
72
70
73
export const caseInsensitiveStringComparator = ( a : string , b : string ) : number =>
71
74
a . toLowerCase ( ) . localeCompare ( b . toLowerCase ( ) )
75
+
76
+ export const getWebhookEventIcon = ( eventName : WebhookEventNameType ) => {
77
+ switch ( eventName ) {
78
+ case WebhookEventNameType . PULL_REQUEST :
79
+ return < ICPullRequest className = "icon-dim-12" />
80
+ case WebhookEventNameType . TAG_CREATION :
81
+ return < ICTag className = "icon-dim-12" />
82
+ default :
83
+ return < ICWebhook className = "icon-dim-12" />
84
+ }
85
+ }
Original file line number Diff line number Diff line change @@ -227,3 +227,8 @@ export interface MaterialSecurityInfoType {
227
227
isScanned : boolean
228
228
isScanEnabled : boolean
229
229
}
230
+
231
+ export enum WebhookEventNameType {
232
+ PULL_REQUEST = 'Pull Request' ,
233
+ TAG_CREATION = 'Tag Creation' ,
234
+ }
You can’t perform that action at this time.
0 commit comments