Skip to content

Commit

Permalink
chore: update filters (#4878)
Browse files Browse the repository at this point in the history
* chore: update filters

* docs: update modified field
  • Loading branch information
karl-cardenas-coding authored Dec 5, 2024
1 parent e376df8 commit aef0434
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/components/CveReportsTable/CveReportsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface MinimizedCve {
cvssScore: number;
cvePublishedTimestamp: string;
cveLastModifiedTimestamp: string;
advLastModifiedTimestamp: string;
};
spec: {
assessment: {
Expand Down Expand Up @@ -99,6 +100,7 @@ export default function CveReportsTable() {
cvssScore: entry.metadata.cvssScore,
cvePublishedTimestamp: entry.metadata.cvePublishedTimestamp,
cveLastModifiedTimestamp: entry.metadata.cveLastModifiedTimestamp,
advLastModifiedTimestamp: entry.metadata.advLastModifiedTimestamp,
},
spec: {
assessment: {
Expand Down Expand Up @@ -160,12 +162,12 @@ export default function CveReportsTable() {
},
{
title: "Modified Date",
dataIndex: ["metadata", "cveLastModifiedTimestamp"],
key: "modifiedDateTime",
dataIndex: ["metadata", "advLastModifiedTimestamp"],
key: "advLastModifiedTimestamp",
sorter: (a, b) =>
new Date(a.metadata.cveLastModifiedTimestamp).getTime() -
new Date(b.metadata.cveLastModifiedTimestamp).getTime(),
render: (text: string) => new Date(text).toLocaleDateString(),
new Date(a.metadata.advLastModifiedTimestamp).getTime() -
new Date(b.metadata.advLastModifiedTimestamp).getTime(),
render: (value: string) => (value ? new Date(value).toLocaleDateString() : "N/A"),
defaultSortOrder: "descend",
},
{
Expand Down
8 changes: 4 additions & 4 deletions utils/cves/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function generateCVEs() {
},
{
field: "status.state",
options: ["Analyzed", "Modified"],
options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"],
operator: "in",
},
],
Expand All @@ -80,7 +80,7 @@ async function generateCVEs() {
},
{
field: "status.state",
options: ["Analyzed", "Modified"],
options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"],
operator: "in",
},
],
Expand All @@ -102,7 +102,7 @@ async function generateCVEs() {
},
{
field: "status.state",
options: ["Analyzed", "Modified"],
options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"],
operator: "in",
},
],
Expand All @@ -124,7 +124,7 @@ async function generateCVEs() {
},
{
field: "status.state",
options: ["Analyzed", "Modified"],
options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"],
operator: "in",
},
],
Expand Down

0 comments on commit aef0434

Please sign in to comment.