[Cloud Security] [Quick Wins] [CNVM Dashboard] Reverse Severity order (#162359)

This commit is contained in:
Paulo Henrique 2023-07-20 16:25:24 -07:00 committed by GitHub
parent 7152707b7f
commit f2914fca9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,11 +91,11 @@ const getUniqueCloudAccountsOptions = (
const uniqueCloudAccounts: Array<{ label: string; value: string }> = [];
vulnTrends.forEach((trendTimepoint) => {
const accountStatss = Object.values(
const accountsStats = Object.values(
trendTimepoint.vulnerabilities_stats_by_cloud_account || {}
);
accountStatss.forEach((accountStats) => {
accountsStats.forEach((accountStats) => {
// Check if the entry already exists based on the cloudAccountId
const isDuplicate = uniqueCloudAccounts.find(
(account) => account.value === accountStats.cloudAccountId
@ -163,14 +163,9 @@ export const VulnerabilityTrendGraph = () => {
}> = useMemo(
() => [
{
id: VULNERABILITIES_SEVERITY.CRITICAL,
yAccessors: ['critical'],
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.CRITICAL),
},
{
id: VULNERABILITIES_SEVERITY.HIGH,
yAccessors: ['high'],
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.HIGH),
id: VULNERABILITIES_SEVERITY.LOW,
yAccessors: ['low'],
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.LOW),
},
{
id: VULNERABILITIES_SEVERITY.MEDIUM,
@ -178,9 +173,14 @@ export const VulnerabilityTrendGraph = () => {
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.MEDIUM),
},
{
id: VULNERABILITIES_SEVERITY.LOW,
yAccessors: ['low'],
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.LOW),
id: VULNERABILITIES_SEVERITY.HIGH,
yAccessors: ['high'],
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.HIGH),
},
{
id: VULNERABILITIES_SEVERITY.CRITICAL,
yAccessors: ['critical'],
color: getSeverityStatusColor(VULNERABILITIES_SEVERITY.CRITICAL),
},
],
[]