18
18
import { useState } from 'react'
19
19
import moment from 'moment'
20
20
import Tippy from '@tippyjs/react'
21
+ import ClipboardButton from '@Common/ClipboardButton/ClipboardButton'
21
22
import { stopPropagation } from '../../../Common/Helper'
22
23
import { ReactComponent as Commit } from '../../../Assets/Icon/ic-commit.svg'
23
24
import { ReactComponent as CommitIcon } from '../../../Assets/Icon/ic-code-commit.svg'
@@ -33,6 +34,7 @@ import GitMaterialInfoHeader from './GitMaterialInfoHeader'
33
34
import { DATE_TIME_FORMATS } from '../../../Common/Constants'
34
35
import { MATERIAL_EXCLUDE_TIPPY_TEXT } from '../../constants'
35
36
import { GitCommitInfoGenericProps } from './types'
37
+ import { ReactComponent as Circle } from '../../../Assets/Icon/ic-circle.svg'
36
38
37
39
const GitCommitInfoGeneric = ( {
38
40
materialSourceType,
@@ -198,7 +200,7 @@ const GitCommitInfoGeneric = ({
198
200
)
199
201
}
200
202
201
- return < span data-testid = "valid-git-commit" > Select </ span >
203
+ return < Circle data-testid = "valid-git-commit" / >
202
204
}
203
205
204
206
return (
@@ -215,36 +217,50 @@ const GitCommitInfoGeneric = ({
215
217
{ ! _isWebhook && (
216
218
< >
217
219
{ _lowerCaseCommitInfo . commit && (
218
- < div className = "ml-16 mr-16 flex dc__content-space" >
220
+ < div className = "flex dc__content-space" >
219
221
{ _commitUrl ? (
220
- < a
221
- href = { _commitUrl }
222
- target = "_blank"
223
- rel = "noopener noreferrer"
224
- className = "commit-hash"
225
- onClick = { stopPropagation }
226
- data-testid = { `deployment-history-source-code-material-history${ index } ` }
227
- >
228
- < div
229
- className = "material-history__header"
230
- data-testid = { `git-commit-credential${ index } ` }
222
+ < div className = "flexbox dc__gap-8" >
223
+ < a
224
+ href = { _commitUrl }
225
+ target = "_blank"
226
+ rel = "noopener noreferrer"
227
+ className = "commit-hash"
228
+ onClick = { stopPropagation }
229
+ data-testid = { `deployment-history-source-code-material-history${ index } ` }
231
230
>
232
- < Commit className = "commit-hash__icon" />
233
- { _lowerCaseCommitInfo . commit }
234
- </ div >
235
- </ a >
231
+ < div
232
+ className = "material-history__header "
233
+ data-testid = { `git-commit-credential${ index } ` }
234
+ >
235
+ < Commit className = "commit-hash__icon" />
236
+ { _lowerCaseCommitInfo . commit . slice ( - 6 ) }
237
+ </ div >
238
+ </ a >
239
+ < ClipboardButton content = { _lowerCaseCommitInfo . commit } />
240
+ </ div >
236
241
) : null }
237
242
{ selectedCommitInfo ? (
238
- < div className = "material-history__select-text dc_max-width__max-content" >
243
+ < div className = "dc_max-width__max-content" >
239
244
{ _lowerCaseCommitInfo . isselected ? (
240
- < Check data-testid = "selected-git-commit" className = "dc__align-right" />
245
+ < Check
246
+ data-testid = "selected-git-commit"
247
+ className = "dc__align-right icon-dim-20"
248
+ />
241
249
) : (
242
250
matSelectionText ( )
243
251
) }
244
252
</ div >
245
253
) : null }
246
254
</ div >
247
255
) }
256
+ { _lowerCaseCommitInfo . message ? (
257
+ < div
258
+ data-testid = { `${ _lowerCaseCommitInfo . message . trim ( ) } -${ isExcluded ? 'excluded' : 'included' } ` }
259
+ className = "material-history__text flex left top material-history-text--padded dc__word-break-all mb-8"
260
+ >
261
+ < span className = "fs-13 fw-6 lh-20 cn-9" > { _lowerCaseCommitInfo . message } </ span >
262
+ </ div >
263
+ ) : null }
248
264
{ _lowerCaseCommitInfo . author ? (
249
265
< div className = "material-history__text flex left" >
250
266
< PersonIcon className = "icon-dim-16 mr-8" /> { _lowerCaseCommitInfo . author }
@@ -256,15 +272,6 @@ const GitCommitInfoGeneric = ({
256
272
{ moment ( _lowerCaseCommitInfo . date ) . format ( DATE_TIME_FORMATS . TWELVE_HOURS_FORMAT ) }
257
273
</ div >
258
274
) : null }
259
- { _lowerCaseCommitInfo . message ? (
260
- < div
261
- data-testid = { `${ _lowerCaseCommitInfo . message . trim ( ) } -${ isExcluded ? 'excluded' : 'included' } ` }
262
- className = "material-history__text flex left top material-history-text--padded dc__word-break-all"
263
- >
264
- < MessageIcon className = "icon-dim-16 mw-16 mr-8 mt-2" />
265
- { _lowerCaseCommitInfo . message }
266
- </ div >
267
- ) : null }
268
275
</ >
269
276
) }
270
277
@@ -287,8 +294,12 @@ const GitCommitInfoGeneric = ({
287
294
) : null }
288
295
</ div >
289
296
{ selectedCommitInfo ? (
290
- < div className = "material-history__select-text flexbox dc__align-items-center dc__content-end fs-12" >
291
- { _lowerCaseCommitInfo . isselected ? < Check className = "dc__align-right" /> : 'Select' }
297
+ < div className = "flexbox dc__align-items-center dc__content-end fs-12" >
298
+ { _lowerCaseCommitInfo . isselected ? (
299
+ < Check className = "dc__align-right" />
300
+ ) : (
301
+ < Circle data-testid = "valid-git-commit" />
302
+ ) }
292
303
</ div >
293
304
) : null }
294
305
</ div >
0 commit comments