Skip to content

Commit

Permalink
added risk score formatter to be consistent with other security scree…
Browse files Browse the repository at this point in the history
…ns 2dp
  • Loading branch information
CAWilson94 committed Nov 6, 2024
1 parent 84723a3 commit 9251942
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import React, { memo } from 'react';
import { ALERT_RISK_SCORE } from '@kbn/rule-data-utils';
import { FormattedMessage } from '@kbn/i18n-react';
import { formatRiskScore } from '../../../../entity_analytics/common';
import { AlertHeaderBlock } from './alert_header_block';
import { RISK_SCORE_TITLE_TEST_ID, RISK_SCORE_VALUE_TEST_ID } from './test_ids';
import { useDocumentDetailsContext } from '../../shared/context';
Expand All @@ -25,9 +26,9 @@ export const RiskScore = memo(() => {

let alertRiskScore: string;
if (typeof fieldsData === 'string') {
alertRiskScore = fieldsData;
alertRiskScore = formatRiskScore(Number(fieldsData));
} else if (Array.isArray(fieldsData) && fieldsData.length > 0) {
alertRiskScore = fieldsData[0];
alertRiskScore = formatRiskScore(Number(fieldsData[0]));
} else {
return null;
}
Expand Down

0 comments on commit 9251942

Please sign in to comment.