From 9251942d46f714ccac92608b53d5a831f7686516 Mon Sep 17 00:00:00 2001 From: CAWilson94 Date: Wed, 6 Nov 2024 11:38:41 +0000 Subject: [PATCH] added risk score formatter to be consistent with other security screens 2dp --- .../flyout/document_details/right/components/risk_score.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx index fba4343e97499..d7d55e96d30a9 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx @@ -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'; @@ -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; }