Skip to content

Commit

Permalink
feat(cve): update columns (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
kahboom authored Oct 7, 2024
1 parent fff6a4e commit 9bfdb5e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 43 deletions.
6 changes: 3 additions & 3 deletions client/src/app/pages/advisory-details/vulnerabilities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export const Vulnerabilities: React.FC<VulnerabilitiesProps> = ({
idProperty: "identifier",
items: vulnerabilities,
columnNames: {
identifier: "Identifier",
title: "Title",
severity: "Severity",
identifier: "Name",
title: "Description",
severity: "CVSS",
discovered: "Discovered",
released: "Released",
cwe: "CWE",
Expand Down
20 changes: 10 additions & 10 deletions client/src/app/pages/sbom-details/vulnerabilities-by-sbom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,16 @@ export const VulnerabilitiesBySbom: React.FC<VulnerabilitiesBySbomProps> = ({
items: tableDataWithUiId,
isLoading: false,
columnNames: {
identifier: "Identifier",
title: "Title",
severity: "Severity",
name: "Name",
description: "Description",
cvss: "CVSS",
advisory: "Advisory",
context: "Context",
status: "Status",
},
hasActionsColumn: false,
isSortEnabled: true,
sortableColumns: ["identifier"],
sortableColumns: ["name"],
isPaginationEnabled: true,
isFilterEnabled: true,
filterCategories: [
Expand Down Expand Up @@ -249,9 +249,9 @@ export const VulnerabilitiesBySbom: React.FC<VulnerabilitiesBySbomProps> = ({
<Thead>
<Tr>
<TableHeaderContentWithControls {...tableControls}>
<Th {...getThProps({ columnKey: "identifier" })} />
<Th {...getThProps({ columnKey: "title" })} />
<Th {...getThProps({ columnKey: "severity" })} />
<Th {...getThProps({ columnKey: "name" })} />
<Th {...getThProps({ columnKey: "description" })} />
<Th {...getThProps({ columnKey: "cvss" })} />
<Th {...getThProps({ columnKey: "advisory" })} />
<Th {...getThProps({ columnKey: "context" })} />
<Th {...getThProps({ columnKey: "status" })} />
Expand All @@ -273,7 +273,7 @@ export const VulnerabilitiesBySbom: React.FC<VulnerabilitiesBySbomProps> = ({
item={item}
rowIndex={rowIndex}
>
<Td width={15} {...getTdProps({ columnKey: "identifier" })}>
<Td width={15} {...getTdProps({ columnKey: "name" })}>
<Button
size="sm"
variant={ButtonVariant.secondary}
Expand All @@ -285,11 +285,11 @@ export const VulnerabilitiesBySbom: React.FC<VulnerabilitiesBySbomProps> = ({
<Td
width={35}
modifier="truncate"
{...getTdProps({ columnKey: "title" })}
{...getTdProps({ columnKey: "description" })}
>
{item.vulnerability?.title}
</Td>
<Td width={10} {...getTdProps({ columnKey: "severity" })}>
<Td width={10} {...getTdProps({ columnKey: "cvss" })}>
{item.vulnerability?.average_severity && (
<SeverityShieldAndText
value={item.vulnerability.average_severity}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export const AdvisoriesByVulnerability: React.FC<
items: advisories,
isLoading: false,
columnNames: {
identifier: "Identifier",
title: "Title",
severity: "Severity",
identifier: "Name",
title: "Description",
severity: "CVSS",
published: "Published",
modified: "Modified",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useFetchVulnerabilities } from "@app/queries/vulnerabilities";
interface IVulnerabilitySearchContext {
tableControls: ITableControls<
VulnerabilitySummary,
"packages" | "identifier" | "title" | "severity" | "sboms" | "advisories",
"packages" | "identifier" | "title" | "severity" | "published" | "sboms",
never,
"" | "average_severity",
string
Expand All @@ -44,12 +44,12 @@ export const VulnerabilitySearchProvider: React.FunctionComponent<
tableName: "vulnerability",
persistenceKeyPrefix: TablePersistenceKeyPrefixes.vulnerabilities,
columnNames: {
identifier: "Identifier",
title: "Title",
severity: "Severity",
identifier: "Name",
title: "Description",
severity: "CVSS",
published: "Published",
packages: "Packages",
sboms: "SBOMs",
advisories: "Advisories",
},
isPaginationEnabled: true,
isSortEnabled: true,
Expand All @@ -64,8 +64,8 @@ export const VulnerabilitySearchProvider: React.FunctionComponent<
},
{
categoryKey: "average_severity",
title: "Severity",
placeholderText: "Severity",
title: "CVSS",
placeholderText: "CVSS",
type: FilterType.multiselect,
selectOptions: [
{ value: "none", label: "None" },
Expand Down
24 changes: 4 additions & 20 deletions client/src/app/pages/vulnerability-list/vulnerability-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export const VulnerabilityTable: React.FC = () => {
<Th {...getThProps({ columnKey: "identifier" })} />
<Th {...getThProps({ columnKey: "title" })} />
<Th {...getThProps({ columnKey: "severity" })} />
<Th {...getThProps({ columnKey: "published" })} />
<Th {...getThProps({ columnKey: "packages" })} />
<Th {...getThProps({ columnKey: "sboms" })} />
<Th {...getThProps({ columnKey: "advisories" })} />
</TableHeaderContentWithControls>
</Tr>
</Thead>
Expand Down Expand Up @@ -140,6 +140,9 @@ export const VulnerabilityTable: React.FC = () => {
<SeverityShieldAndText value={item.average_severity} />
)}
</Td>
<Td width={10} {...getTdProps({ columnKey: "published" })}>
{formatDate(item.published)}
</Td>
<Td
width={10}
modifier="truncate"
Expand All @@ -164,17 +167,6 @@ export const VulnerabilityTable: React.FC = () => {
>
SBOMs
</Td>
<Td
width={10}
{...getTdProps({
columnKey: "advisories",
isCompoundExpandToggle: true,
item: item,
rowIndex,
})}
>
Advisories
</Td>
<Td isActionCell>
<ActionsColumn
items={[
Expand Down Expand Up @@ -289,14 +281,6 @@ export const VulnerabilityTable: React.FC = () => {
/>
</>
) : null}
{isCellExpanded(item, "advisories") ? (
<>
<AdvisoriesByVulnerability
variant="compact"
advisories={item.advisories}
/>
</>
) : null}
</div>
</ExpandableRowContent>
</Td>
Expand Down

0 comments on commit 9bfdb5e

Please sign in to comment.