Skip to content

Commit 971dfd3

Browse files
committed
fix(VulnerabilityTab): Update vulnerability selection logic to use a consistent key format
1 parent 5439ca2 commit 971dfd3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app/[locale]/projects/detail/[id]/components/VulnerabilityTab.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ const formatVulnerabilityHistory = (comment: string): string =>
4646
type EmbeddedProjectVulnerabilities = Embedded<ProjectVulnerability, 'sw360:vulnerabilityDTOes'>
4747
type EmbeddedProjectVulnerabilitySummary = Embedded<ProjectVulnerability, 'sw360:vulnerabilitySummaries'>
4848

49+
const getVulnerabilitySelectionKey = (vulnerability: ProjectVulnerability): string =>
50+
`${vulnerability.intReleaseId}::${vulnerability.externalId}`
51+
4952
export default function VulnerabilityTab({
5053
projectData,
5154
tabType,
@@ -89,9 +92,9 @@ export default function VulnerabilityTab({
8992
<input
9093
className='form-check-input'
9194
type='checkbox'
92-
checked={selectedVulnerabilities.has(row.original.externalId ?? '')}
95+
checked={selectedVulnerabilities.has(getVulnerabilitySelectionKey(row.original))}
9396
onChange={() =>
94-
handleSelect(row.original.externalId, {
97+
handleSelect(getVulnerabilitySelectionKey(row.original), {
9598
intReleaseId: row.original.intReleaseId,
9699
externalId: row.original.externalId,
97100
})

0 commit comments

Comments
 (0)