From 5859406c644a71975d7108d5c873c45286c43a70 Mon Sep 17 00:00:00 2001 From: Fenil Shah Date: Wed, 15 Jan 2025 14:02:36 +0530 Subject: [PATCH] changed severity badge colors --- .../src/apps/dashboard/pages/dashboard.css | 20 ++++++++++++++++++ .../pages/issues/IssuesPage/style.css | 20 ------------------ .../SingleTestRunPage/SingleTestRunPage.js | 21 +++++++++++++------ .../apps/dashboard/pages/testing/transform.js | 7 +++++-- .../web/src/apps/dashboard/pages/transform.js | 2 +- 5 files changed, 41 insertions(+), 29 deletions(-) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css index f739b21873..8fa91a8489 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css @@ -196,4 +196,24 @@ background: white; margin-top: -20px; padding-block: 10px; +} + +.badge-wrapper-CRITICAL .Polaris-Badge { + background-color: #E45357 !important; + color: white !important; +} + +.badge-wrapper-HIGH .Polaris-Badge { + background-color: #EF864C !important; + color: white !important; +} + +.badge-wrapper-MEDIUM .Polaris-Badge { + background-color: #F6C564 !important; + color: white !important; +} + +.badge-wrapper-LOW .Polaris-Badge { + background-color: #6FD1A6; + color: white !important; } \ No newline at end of file diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/issues/IssuesPage/style.css b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/issues/IssuesPage/style.css index b45ad31f76..4a91b7d48d 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/issues/IssuesPage/style.css +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/issues/IssuesPage/style.css @@ -14,24 +14,4 @@ .custom-tag-false p { color: #008060; -} - -.badge-wrapper-CRITICAL .Polaris-Badge { - background-color: #E45357 !important; - color: white !important; -} - -.badge-wrapper-HIGH .Polaris-Badge { - background-color: #EF864C !important; - color: white !important; -} - -.badge-wrapper-MEDIUM .Polaris-Badge { - background-color: #F6C564 !important; - color: white !important; -} - -.badge-wrapper-LOW .Polaris-Badge { - background-color: #6FD1A6; - color: white !important; } \ No newline at end of file diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js index 28e8552157..a82d5be1c4 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js @@ -200,6 +200,7 @@ function SingleTestRunPage() { let tmp = {...summary}; if(tmp === null || tmp?.countIssues === null || tmp?.countIssues === undefined){ tmp.countIssues = { + "CRITICAL": 0, "HIGH": 0, "MEDIUM": 0, "LOW": 0 @@ -695,12 +696,20 @@ const editableConfigsComp = ( { selectedTestRun?.severity && selectedTestRun.severity - .map((item) => - - - {item} - - + .map((item) =>{ + const sev = item.split(' ') + const tempSev = sev.length > 1 ? sev[1].toUpperCase() : '' + return( +
+ + + {item} + + +
+ ) + } + )} diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js index d6da1d471d..ad90223977 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js @@ -216,6 +216,7 @@ const transform = { }, prepareCountIssues : (data) => { let obj={ + 'Critical': (data && data['CRITICAL']) ? data['CRITICAL'] : 0, 'High': (data && data['HIGH']) ? data['HIGH'] : 0, 'Medium':(data && data['MEDIUM']) ? data['MEDIUM'] : 0, 'Low': (data && data['LOW']) ? data['LOW'] : 0 @@ -299,7 +300,7 @@ const transform = { const prettifiedTest={ ...obj, testName: transform.prettifyTestName(data.name || "Test", iconObj.icon,iconObj.color, iconObj.tooltipContent), - severity: observeFunc.getIssuesList(transform.filterObjectByValueGreaterThanZero(testingRunResultSummary.countIssues || {"HIGH" : 0, "MEDIUM": 0, "LOW": 0})) + severity: observeFunc.getIssuesList(transform.filterObjectByValueGreaterThanZero(testingRunResultSummary.countIssues || {"CRITICAL": 0, "HIGH" : 0, "MEDIUM": 0, "LOW": 0})) } return prettifiedTest }else{ @@ -868,7 +869,9 @@ getPrettifiedTestRunResults(testRunResults){ let prettifiedObj = { ...obj, nameComp:
, - severityComp: obj?.vulnerable === true ? {obj?.severity[0]} : -, + severityComp: obj?.vulnerable === true ?
+ {obj?.severity[0]} +
: -, cweDisplayComp: obj?.cweDisplay?.length > 0 ? {obj.cweDisplay.map((ele,index)=>{ return( diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/transform.js b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/transform.js index 1ec067e9a8..4affb01e74 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/transform.js +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/transform.js @@ -218,7 +218,7 @@ const dashboardFunc = { } }, sortAndFilterAlerts(alerts) { - const severityOrder = { 'HIGH': 3, 'MEDIUM': 2, 'LOW': 1 }; + const severityOrder = { 'CRITICAL': 4, 'HIGH': 3, 'MEDIUM': 2, 'LOW': 1 }; const dismissLimit = 60 * 60; const currentTime = func.timeNow()