Skip to content

Commit f0b6020

Browse files
feat: Advisory List - Revision Column added (#217)
1 parent 87cb954 commit f0b6020

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

client/src/app/pages/advisory-list/advisory-context.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import { useFetchAdvisories } from "@app/queries/advisories";
1717
interface IAdvisorySearchContext {
1818
tableControls: ITableControls<
1919
AdvisorySummary,
20-
"identifier" | "title" | "severity" | "revision" | "vulnerabilities",
21-
"identifier" | "severity",
22-
"" | "average_severity" | "revision",
20+
"identifier" | "title" | "severity" | "modified" | "vulnerabilities",
21+
"identifier" | "severity" | "modified",
22+
"" | "average_severity" | "modified",
2323
string
2424
>;
2525

@@ -47,12 +47,12 @@ export const AdvisorySearchProvider: React.FunctionComponent<
4747
identifier: "ID",
4848
title: "Title",
4949
severity: "Aggregated Severity",
50-
revision: "Revision",
50+
modified: "Revision",
5151
vulnerabilities: "Vulnerabilities",
5252
},
5353
isPaginationEnabled: true,
5454
isSortEnabled: true,
55-
sortableColumns: ["identifier", "severity"],
55+
sortableColumns: ["identifier", "severity", "modified"],
5656
isFilterEnabled: true,
5757
filterCategories: [
5858
{
@@ -75,7 +75,7 @@ export const AdvisorySearchProvider: React.FunctionComponent<
7575
],
7676
},
7777
{
78-
categoryKey: "revision",
78+
categoryKey: "modified",
7979
title: "Revision",
8080
type: FilterType.dateRange,
8181
},
@@ -93,6 +93,7 @@ export const AdvisorySearchProvider: React.FunctionComponent<
9393
hubSortFieldKeys: {
9494
identifier: "identifier",
9595
severity: "average_score",
96+
modified: "modified",
9697
},
9798
})
9899
);

client/src/app/pages/advisory-list/advisory-table.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import { useDownload } from "@app/hooks/domain-controls/useDownload";
2323

2424
import { SeverityShieldAndText } from "@app/components/SeverityShieldAndText";
2525
import { VulnerabilityGallery } from "@app/components/VulnerabilityGallery";
26+
import { formatDate } from "@app/utils/utils";
27+
2628
import { AdvisorySearchContext } from "./advisory-context";
2729

2830
export const AdvisoryTable: React.FC = ({}) => {
@@ -55,7 +57,7 @@ export const AdvisoryTable: React.FC = ({}) => {
5557
<Th {...getThProps({ columnKey: "identifier" })} />
5658
<Th {...getThProps({ columnKey: "title" })} />
5759
<Th {...getThProps({ columnKey: "severity" })} />
58-
<Th {...getThProps({ columnKey: "revision" })} />
60+
<Th {...getThProps({ columnKey: "modified" })} />
5961
<Th {...getThProps({ columnKey: "vulnerabilities" })} />
6062
</TableHeaderContentWithControls>
6163
</Tr>
@@ -120,10 +122,8 @@ export const AdvisoryTable: React.FC = ({}) => {
120122
value={item.average_severity as Severity}
121123
/>
122124
</Td>
123-
<Td width={10} {...getTdProps({ columnKey: "revision" })}>
124-
<a href="https://github.com/trustification/trustify/issues/967">
125-
issue-967
126-
</a>
125+
<Td width={10} {...getTdProps({ columnKey: "modified" })}>
126+
{formatDate(item.modified)}
127127
</Td>
128128
<Td
129129
width={20}

0 commit comments

Comments
 (0)