File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
Shared/Components/ScannedByToolModal Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,12 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
24
24
{ entities ?. map ( ( entity ) => (
25
25
< div className = "flexbox dc__gap-4 dc__align-items-center" >
26
26
< div className = "dot" style = { { backgroundColor : entity . color , width : '10px' , height : '10px' } } />
27
- < span className = { countClassName } > { entity . value } </ span >
28
- < span className = { labelClassName } > { entity . label } </ span >
27
+ < span className = { countClassName } data-testid = { `segmented-bar-chart-${ entity . label } -value` } >
28
+ { entity . value }
29
+ </ span >
30
+ < span className = { labelClassName } data-testid = { `segmented-bar-chart-${ entity . label } -label` } >
31
+ { entity . label }
32
+ </ span >
29
33
</ div >
30
34
) ) }
31
35
</ div >
Original file line number Diff line number Diff line change
1
+ import React from 'react'
1
2
import { IMAGE_SCAN_TOOL , SCAN_TOOL_ID_TRIVY } from '../../constants'
2
3
import { ScannedByToolModalProps } from './types'
3
4
import { ReactComponent as ICClair } from '../../../Assets/Icon/ic-clair.svg'
4
5
import { ReactComponent as ICTrivy } from '../../../Assets/Icon/ic-trivy.svg'
5
6
6
- const ScannedByToolModal = ( { scanToolId } : ScannedByToolModalProps ) => {
7
+ const ScannedByToolModal : React . FC < ScannedByToolModalProps > = ( {
8
+ scanToolId,
9
+ fontSize = 13 ,
10
+ spacingBetweenTextAndIcon = 6 ,
11
+ } ) => {
7
12
const isTrivy = scanToolId === SCAN_TOOL_ID_TRIVY
8
13
9
14
return (
10
- < >
11
- < span className = " dc__italic-font-style fs-13" >
15
+ < div className = "flexbox" style = { { gap : ` ${ spacingBetweenTextAndIcon } px` } } >
16
+ < span className = { ` dc__italic-font-style fs-${ fontSize } ` } >
12
17
Scanned by
13
18
< span className = "fw-6 ml-4" data-testid = "scanned-by-tool" >
14
19
{ isTrivy ? IMAGE_SCAN_TOOL . Trivy : IMAGE_SCAN_TOOL . Clair }
15
20
</ span >
16
21
</ span >
17
22
{ isTrivy ? (
18
- < ICTrivy className = "h-20 w -20 ml-6 dc__no-shrink" />
23
+ < ICTrivy className = "icon-dim -20 dc__no-shrink" />
19
24
) : (
20
- < ICClair className = "h-20 w -20 ml-6 dc__no-shrink" />
25
+ < ICClair className = "icon-dim -20 dc__no-shrink" />
21
26
) }
22
- </ >
27
+ </ div >
23
28
)
24
29
}
25
30
Original file line number Diff line number Diff line change 1
1
export interface ScannedByToolModalProps {
2
2
scanToolId ?: number
3
+ fontSize ?: number
4
+ spacingBetweenTextAndIcon ?: number
3
5
}
You can’t perform that action at this time.
0 commit comments