@@ -34,6 +34,7 @@ import { stopPropagation } from '@Common/Helper'
34
34
import { DATE_TIME_FORMATS } from '@Common/Constants'
35
35
import GitMaterialInfoHeader from './GitMaterialInfoHeader'
36
36
import { MATERIAL_EXCLUDE_TIPPY_TEXT } from '../../constants'
37
+ import { WEBHOOK_EVENT_ACTION_TYPE } from './constants'
37
38
import { GitCommitInfoGenericProps } from './types'
38
39
39
40
const GitCommitInfoGeneric = ( {
@@ -148,7 +149,7 @@ const GitCommitInfoGeneric = ({
148
149
149
150
function handleMoreDataForWebhook ( ) {
150
151
const _moreData = { }
151
- if ( _webhookData . eventactiontype == 'merged' ) {
152
+ if ( _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . MERGED ) {
152
153
Object . keys ( _webhookData . data ) . forEach ( ( _key ) => {
153
154
if (
154
155
_key != 'author' &&
@@ -163,7 +164,7 @@ const GitCommitInfoGeneric = ({
163
164
_moreData [ _key ] = _webhookData . data [ _key ]
164
165
}
165
166
} )
166
- } else if ( _webhookData . eventactiontype == 'non-merged' ) {
167
+ } else if ( _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . NON_MERGED ) {
167
168
Object . keys ( _webhookData . data ) . forEach ( ( _key ) => {
168
169
if ( _key !== 'author' && _key !== 'date' && _key !== 'target checkout' ) {
169
170
_moreData [ _key ] = _webhookData . data [ _key ]
@@ -287,7 +288,7 @@ const GitCommitInfoGeneric = ({
287
288
</ >
288
289
) }
289
290
290
- { _isWebhook && _webhookData . eventactiontype == 'merged' && (
291
+ { _isWebhook && _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . MERGED && (
291
292
< >
292
293
< div className = "flex dc__content-space pr-16 " >
293
294
< div className = "ml-16 " >
@@ -385,7 +386,7 @@ const GitCommitInfoGeneric = ({
385
386
{ handleMoreDataForWebhook ( ) }
386
387
</ >
387
388
) }
388
- { _isWebhook && _webhookData . eventactiontype == 'non-merged' && (
389
+ { _isWebhook && _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . NON_MERGED && (
389
390
< >
390
391
< div className = "flex left pr-16 pb-8 dc__content-space" >
391
392
< div className = "flex left cn-9 fs-13 ml-16" > { _webhookData . data [ 'target checkout' ] } </ div >
0 commit comments