From d94bf9a41b264fd0fd268d20317dc27f5678c2ae Mon Sep 17 00:00:00 2001 From: Charlotte Alexandra Wilson Date: Wed, 23 Oct 2024 22:27:42 +0100 Subject: [PATCH] Feature/risk summary build columns variable (#197059) --- .../components/risk_summary_flyout/common.tsx | 2 +- .../components/risk_summary_flyout/risk_summary.tsx | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx index 1f9832b79654c..1f7c0724a6e67 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx @@ -24,7 +24,7 @@ interface EntityData { risk: RiskStats; } -export const buildColumns: () => Array> = () => [ +export const columnsArray: Array> = [ { field: 'category', name: ( diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx index fee62f34dfdee..fe32fad5b0070 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx @@ -36,7 +36,7 @@ import type { RiskScoreState } from '../../api/hooks/use_risk_score'; import { getRiskScoreSummaryAttributes } from '../../lens_attributes/risk_score_summary'; import { - buildColumns, + columnsArray, getEntityData, getItems, isUserRiskData, @@ -80,9 +80,6 @@ const FlyoutRiskSummaryComponent = ({ }, [entityData?.name, entityData?.risk?.calculated_level, riskData]); const xsFontSize = useEuiFontSize('xxs').fontSize; - - const columns = useMemo(() => buildColumns(), []); - const rows = useMemo(() => getItems(entityData), [entityData]); const onToggle = useCallback( @@ -263,7 +260,7 @@ const FlyoutRiskSummaryComponent = ({