Skip to content

Commit 92472b6

Browse files
authored
Merge pull request #1987 from akto-api-security/feature/critical_styling
Changed severity badge colors
2 parents 026a53a + 5859406 commit 92472b6

File tree

5 files changed

+41
-29
lines changed

5 files changed

+41
-29
lines changed

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/dashboard.css

+20
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,24 @@
196196
background: white;
197197
margin-top: -20px;
198198
padding-block: 10px;
199+
}
200+
201+
.badge-wrapper-CRITICAL .Polaris-Badge {
202+
background-color: #E45357 !important;
203+
color: white !important;
204+
}
205+
206+
.badge-wrapper-HIGH .Polaris-Badge {
207+
background-color: #EF864C !important;
208+
color: white !important;
209+
}
210+
211+
.badge-wrapper-MEDIUM .Polaris-Badge {
212+
background-color: #F6C564 !important;
213+
color: white !important;
214+
}
215+
216+
.badge-wrapper-LOW .Polaris-Badge {
217+
background-color: #6FD1A6;
218+
color: white !important;
199219
}

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/issues/IssuesPage/style.css

-20
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,4 @@
1414

1515
.custom-tag-false p {
1616
color: #008060;
17-
}
18-
19-
.badge-wrapper-CRITICAL .Polaris-Badge {
20-
background-color: #E45357 !important;
21-
color: white !important;
22-
}
23-
24-
.badge-wrapper-HIGH .Polaris-Badge {
25-
background-color: #EF864C !important;
26-
color: white !important;
27-
}
28-
29-
.badge-wrapper-MEDIUM .Polaris-Badge {
30-
background-color: #F6C564 !important;
31-
color: white !important;
32-
}
33-
34-
.badge-wrapper-LOW .Polaris-Badge {
35-
background-color: #6FD1A6;
36-
color: white !important;
3717
}

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/SingleTestRunPage/SingleTestRunPage.js

+15-6
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ function SingleTestRunPage() {
200200
let tmp = {...summary};
201201
if(tmp === null || tmp?.countIssues === null || tmp?.countIssues === undefined){
202202
tmp.countIssues = {
203+
"CRITICAL": 0,
203204
"HIGH": 0,
204205
"MEDIUM": 0,
205206
"LOW": 0
@@ -695,12 +696,20 @@ const editableConfigsComp = (
695696
{
696697
selectedTestRun?.severity &&
697698
selectedTestRun.severity
698-
.map((item) =>
699-
<Badge key={item} status={func.getTestResultStatus(item)}>
700-
<Text fontWeight="regular">
701-
{item}
702-
</Text>
703-
</Badge>
699+
.map((item) =>{
700+
const sev = item.split(' ')
701+
const tempSev = sev.length > 1 ? sev[1].toUpperCase() : ''
702+
return(
703+
<div className={`badge-wrapper-${tempSev}`}>
704+
<Badge key={item}>
705+
<Text fontWeight="regular">
706+
{item}
707+
</Text>
708+
</Badge>
709+
</div>
710+
)
711+
}
712+
704713
)}
705714
<Button plain monochrome onClick={() => setUpdateTable(Date.now().toString())}><Tooltip content="Refresh page" dismissOnMouseOut> <Icon source={RefreshMajor} /></Tooltip></Button>
706715
</HorizontalStack>

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/testing/transform.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ const transform = {
216216
},
217217
prepareCountIssues : (data) => {
218218
let obj={
219+
'Critical': (data && data['CRITICAL']) ? data['CRITICAL'] : 0,
219220
'High': (data && data['HIGH']) ? data['HIGH'] : 0,
220221
'Medium':(data && data['MEDIUM']) ? data['MEDIUM'] : 0,
221222
'Low': (data && data['LOW']) ? data['LOW'] : 0
@@ -299,7 +300,7 @@ const transform = {
299300
const prettifiedTest={
300301
...obj,
301302
testName: transform.prettifyTestName(data.name || "Test", iconObj.icon,iconObj.color, iconObj.tooltipContent),
302-
severity: observeFunc.getIssuesList(transform.filterObjectByValueGreaterThanZero(testingRunResultSummary.countIssues || {"HIGH" : 0, "MEDIUM": 0, "LOW": 0}))
303+
severity: observeFunc.getIssuesList(transform.filterObjectByValueGreaterThanZero(testingRunResultSummary.countIssues || {"CRITICAL": 0, "HIGH" : 0, "MEDIUM": 0, "LOW": 0}))
303304
}
304305
return prettifiedTest
305306
}else{
@@ -868,7 +869,9 @@ getPrettifiedTestRunResults(testRunResults){
868869
let prettifiedObj = {
869870
...obj,
870871
nameComp: <div data-testid={obj.name}><Box maxWidth="250px"><TooltipText tooltip={obj.name} text={obj.name} textProps={{fontWeight: 'medium'}}/></Box></div>,
871-
severityComp: obj?.vulnerable === true ? <Badge size="small" status={func.getTestResultStatus(obj?.severity[0])}>{obj?.severity[0]}</Badge> : <Text>-</Text>,
872+
severityComp: obj?.vulnerable === true ? <div className={`badge-wrapper-${obj?.severity[0].toUpperCase()}`}>
873+
<Badge size="small" status={func.getTestResultStatus(obj?.severity[0])}>{obj?.severity[0]}</Badge>
874+
</div>: <Text>-</Text>,
872875
cweDisplayComp: obj?.cweDisplay?.length > 0 ? <HorizontalStack gap={1} wrap={false}>
873876
{obj.cweDisplay.map((ele,index)=>{
874877
return(

apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/transform.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ const dashboardFunc = {
218218
}
219219
},
220220
sortAndFilterAlerts(alerts) {
221-
const severityOrder = { 'HIGH': 3, 'MEDIUM': 2, 'LOW': 1 };
221+
const severityOrder = { 'CRITICAL': 4, 'HIGH': 3, 'MEDIUM': 2, 'LOW': 1 };
222222
const dismissLimit = 60 * 60;
223223
const currentTime = func.timeNow()
224224

0 commit comments

Comments
 (0)