From aef0434624e59e836975f707695580ee52dc7935 Mon Sep 17 00:00:00 2001 From: Karl Cardenas <29551334+karl-cardenas-coding@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:32:03 -0700 Subject: [PATCH] chore: update filters (#4878) * chore: update filters * docs: update modified field --- src/components/CveReportsTable/CveReportsTable.tsx | 12 +++++++----- utils/cves/index.js | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/CveReportsTable/CveReportsTable.tsx b/src/components/CveReportsTable/CveReportsTable.tsx index 324a92a862..129ab04da2 100644 --- a/src/components/CveReportsTable/CveReportsTable.tsx +++ b/src/components/CveReportsTable/CveReportsTable.tsx @@ -51,6 +51,7 @@ interface MinimizedCve { cvssScore: number; cvePublishedTimestamp: string; cveLastModifiedTimestamp: string; + advLastModifiedTimestamp: string; }; spec: { assessment: { @@ -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: { @@ -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", }, { diff --git a/utils/cves/index.js b/utils/cves/index.js index 47e6d79016..13b7465018 100644 --- a/utils/cves/index.js +++ b/utils/cves/index.js @@ -58,7 +58,7 @@ async function generateCVEs() { }, { field: "status.state", - options: ["Analyzed", "Modified"], + options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"], operator: "in", }, ], @@ -80,7 +80,7 @@ async function generateCVEs() { }, { field: "status.state", - options: ["Analyzed", "Modified"], + options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"], operator: "in", }, ], @@ -102,7 +102,7 @@ async function generateCVEs() { }, { field: "status.state", - options: ["Analyzed", "Modified"], + options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"], operator: "in", }, ], @@ -124,7 +124,7 @@ async function generateCVEs() { }, { field: "status.state", - options: ["Analyzed", "Modified"], + options: ["Analyzed", "Modified", "Awaiting Analyses", "Reopened"], operator: "in", }, ],