@@ -28,7 +28,7 @@ import { ReactComponent as Check } from '@Icons/ic-check-circle.svg'
28
28
import { ReactComponent as Abort } from '@Icons/ic-abort.svg'
29
29
import { SourceTypeMap , createGitCommitUrl , getGitBranchUrl } from '@Common/Common.service'
30
30
import { stopPropagation } from '@Common/Helper'
31
- import { DATE_TIME_FORMATS } from '@Common/Constants'
31
+ import { DATE_TIME_FORMATS , GitProviderType } from '@Common/Constants'
32
32
import { ReactComponent as Tag } from '@Icons/ic-tag.svg'
33
33
import { getLowerCaseObject , getWebhookDate } from '@Shared/Helpers'
34
34
import { ReactComponent as Hash } from '@Icons/ic-hash.svg'
@@ -180,30 +180,38 @@ const GitCommitInfoGeneric = ({
180
180
return null
181
181
}
182
182
183
- const renderPRInfoCard = ( ) =>
184
- _isWebhook &&
185
- _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . MERGED && (
186
- < div className = "flex column left dc__gap-8" >
187
- < div className = "flex dc__content-space w-100" >
188
- { renderPullRequestId ( _webhookData . data [ 'git url' ] ) }
189
- { getCheckUncheckIcon ( ) }
190
- </ div >
191
- { renderWebhookTitle ( ) }
192
- { renderBasicGitCommitInfoForWebhook ( true ) }
183
+ const renderPRInfoCard = ( ) => (
184
+ < div className = "flex column left dc__gap-8" >
185
+ < div className = "flex dc__content-space w-100" >
186
+ { renderPullRequestId ( _webhookData . data [ 'git url' ] ) }
187
+ { getCheckUncheckIcon ( ) }
193
188
</ div >
194
- )
189
+ { renderWebhookTitle ( ) }
190
+ { renderBasicGitCommitInfoForWebhook ( true ) }
191
+ </ div >
192
+ )
195
193
196
- const renderTagInfoCard = ( ) =>
197
- _isWebhook &&
198
- _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . NON_MERGED && (
199
- < >
200
- < div className = "flex left dc__content-space" >
201
- { renderTagCreationId ( _webhookData . data [ 'target checkout' ] ) }
202
- { getCheckUncheckIcon ( ) }
203
- </ div >
204
- { renderBasicGitCommitInfoForWebhook ( ) }
205
- </ >
206
- )
194
+ const renderTagInfoCard = ( ) => (
195
+ < >
196
+ < div className = "flex left dc__content-space" >
197
+ { renderTagCreationId ( _webhookData . data [ 'target checkout' ] ) }
198
+ { getCheckUncheckIcon ( ) }
199
+ </ div >
200
+ { renderBasicGitCommitInfoForWebhook ( ) }
201
+ </ >
202
+ )
203
+
204
+ const renderWebhookGitInfoCard = ( ) => {
205
+ if ( ! _isWebhook ) return null
206
+
207
+ const isMerged = _webhookData . eventactiontype === WEBHOOK_EVENT_ACTION_TYPE . MERGED
208
+
209
+ if ( materialUrl . includes ( GitProviderType . GITLAB ) ) {
210
+ // TODO: This is a temporary fix for the issue where the eventActionType data incorrect
211
+ return isMerged ? renderTagInfoCard ( ) : renderPRInfoCard ( )
212
+ }
213
+ return isMerged ? renderPRInfoCard ( ) : renderTagInfoCard ( )
214
+ }
207
215
208
216
return (
209
217
< div className = "git-commit-info-generic__wrapper cn-9 fs-12" >
@@ -277,9 +285,7 @@ const GitCommitInfoGeneric = ({
277
285
</ div >
278
286
</ >
279
287
) }
280
-
281
- { renderPRInfoCard ( ) }
282
- { renderTagInfoCard ( ) }
288
+ { renderWebhookGitInfoCard ( ) }
283
289
</ div >
284
290
</ div >
285
291
)
0 commit comments