Skip to content

Commit 6ca303b

Browse files
committed
Merge branch 'feat/resource-scan-v2' into demo/resource-browser
2 parents ebc205e + 68b3849 commit 6ca303b

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/Common/SegmentedBarChart/SegmentedBarChart.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
2424
{entities?.map((entity) => (
2525
<div className="flexbox dc__gap-4 dc__align-items-center">
2626
<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>
2933
</div>
3034
))}
3135
</div>

src/Shared/Components/ScannedByToolModal/ScannedByToolModal.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1+
import React from 'react'
12
import { IMAGE_SCAN_TOOL, SCAN_TOOL_ID_TRIVY } from '../../constants'
23
import { ScannedByToolModalProps } from './types'
34
import { ReactComponent as ICClair } from '../../../Assets/Icon/ic-clair.svg'
45
import { ReactComponent as ICTrivy } from '../../../Assets/Icon/ic-trivy.svg'
56

6-
const ScannedByToolModal = ({ scanToolId }: ScannedByToolModalProps) => {
7+
const ScannedByToolModal: React.FC<ScannedByToolModalProps> = ({
8+
scanToolId,
9+
fontSize = 13,
10+
spacingBetweenTextAndIcon = 6,
11+
}) => {
712
const isTrivy = scanToolId === SCAN_TOOL_ID_TRIVY
813

914
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}`}>
1217
Scanned by
1318
<span className="fw-6 ml-4" data-testid="scanned-by-tool">
1419
{isTrivy ? IMAGE_SCAN_TOOL.Trivy : IMAGE_SCAN_TOOL.Clair}
1520
</span>
1621
</span>
1722
{isTrivy ? (
18-
<ICTrivy className="h-20 w-20 ml-6 dc__no-shrink" />
23+
<ICTrivy className="icon-dim-20 dc__no-shrink" />
1924
) : (
20-
<ICClair className="h-20 w-20 ml-6 dc__no-shrink" />
25+
<ICClair className="icon-dim-20 dc__no-shrink" />
2126
)}
22-
</>
27+
</div>
2328
)
2429
}
2530

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export interface ScannedByToolModalProps {
22
scanToolId?: number
3+
fontSize?: number
4+
spacingBetweenTextAndIcon?: number
35
}

0 commit comments

Comments
 (0)