Skip to content

Commit

Permalink
Merge pull request #1727 from akto-api-security/hotfix/fixed_api_crit…
Browse files Browse the repository at this point in the history
…ical_risk_score

fix: reverted api risk score graph in api security posture
  • Loading branch information
Ark2307 authored Nov 15, 2024
2 parents d566d81 + a9fb966 commit 0318bb2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ function HomeDashboard() {

// Prepare the result array with values from 5 to 0
const result = [
{ "badgeValue": 5, "progressValue": "0%", "text": 0, "topColor": "#E45357", "backgroundColor": "#FFDCDD", "badgeColor": "critical" },
{ "badgeValue": 4, "progressValue": "0%", "text": 0, "topColor": "#EF864C", "backgroundColor": "#FFD9C4", "badgeColor": "attention" },
{ "badgeValue": 3, "progressValue": "0%", "text": 0, "topColor": "#F6C564", "backgroundColor": "#FFF1D4", "badgeColor": "warning" },
{ "badgeValue": 2, "progressValue": "0%", "text": 0, "topColor": "#F5D8A1", "backgroundColor": "#FFF6E6", "badgeColor": "info" },
Expand All @@ -365,7 +366,7 @@ function HomeDashboard() {

// Update progress and text based on riskScoreMap values
Object.keys(apiStats.riskScoreMap).forEach((key) => {
const badgeIndex = 4 - parseInt(key, 10);
const badgeIndex = 5 - parseInt(key, 10);
const value = apiStats.riskScoreMap[key];
result[badgeIndex].text = value ? value : 0;
if (!totalApisCount || totalApisCount === 0) {
Expand Down

0 comments on commit 0318bb2

Please sign in to comment.