Skip to content

Commit

Permalink
feat: Advisory List - Revision Column added (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Nov 5, 2024
1 parent 87cb954 commit f0b6020
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions client/src/app/pages/advisory-list/advisory-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import { useFetchAdvisories } from "@app/queries/advisories";
interface IAdvisorySearchContext {
tableControls: ITableControls<
AdvisorySummary,
"identifier" | "title" | "severity" | "revision" | "vulnerabilities",
"identifier" | "severity",
"" | "average_severity" | "revision",
"identifier" | "title" | "severity" | "modified" | "vulnerabilities",
"identifier" | "severity" | "modified",
"" | "average_severity" | "modified",
string
>;

Expand Down Expand Up @@ -47,12 +47,12 @@ export const AdvisorySearchProvider: React.FunctionComponent<
identifier: "ID",
title: "Title",
severity: "Aggregated Severity",
revision: "Revision",
modified: "Revision",
vulnerabilities: "Vulnerabilities",
},
isPaginationEnabled: true,
isSortEnabled: true,
sortableColumns: ["identifier", "severity"],
sortableColumns: ["identifier", "severity", "modified"],
isFilterEnabled: true,
filterCategories: [
{
Expand All @@ -75,7 +75,7 @@ export const AdvisorySearchProvider: React.FunctionComponent<
],
},
{
categoryKey: "revision",
categoryKey: "modified",
title: "Revision",
type: FilterType.dateRange,
},
Expand All @@ -93,6 +93,7 @@ export const AdvisorySearchProvider: React.FunctionComponent<
hubSortFieldKeys: {
identifier: "identifier",
severity: "average_score",
modified: "modified",
},
})
);
Expand Down
10 changes: 5 additions & 5 deletions client/src/app/pages/advisory-list/advisory-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { useDownload } from "@app/hooks/domain-controls/useDownload";

import { SeverityShieldAndText } from "@app/components/SeverityShieldAndText";
import { VulnerabilityGallery } from "@app/components/VulnerabilityGallery";
import { formatDate } from "@app/utils/utils";

import { AdvisorySearchContext } from "./advisory-context";

export const AdvisoryTable: React.FC = ({}) => {
Expand Down Expand Up @@ -55,7 +57,7 @@ export const AdvisoryTable: React.FC = ({}) => {
<Th {...getThProps({ columnKey: "identifier" })} />
<Th {...getThProps({ columnKey: "title" })} />
<Th {...getThProps({ columnKey: "severity" })} />
<Th {...getThProps({ columnKey: "revision" })} />
<Th {...getThProps({ columnKey: "modified" })} />
<Th {...getThProps({ columnKey: "vulnerabilities" })} />
</TableHeaderContentWithControls>
</Tr>
Expand Down Expand Up @@ -120,10 +122,8 @@ export const AdvisoryTable: React.FC = ({}) => {
value={item.average_severity as Severity}
/>
</Td>
<Td width={10} {...getTdProps({ columnKey: "revision" })}>
<a href="https://github.com/trustification/trustify/issues/967">
issue-967
</a>
<Td width={10} {...getTdProps({ columnKey: "modified" })}>
{formatDate(item.modified)}
</Td>
<Td
width={20}
Expand Down

0 comments on commit f0b6020

Please sign in to comment.