diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx index 99e2475f95a78..63ffcf7b9eae1 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_panels.tsx @@ -141,6 +141,7 @@ const EntityStoreDashboardPanelsComponent = () => { ); } + // TODO Rename variable because the Risk score could be installed but disabled const isRiskScoreAvailable = riskEngineStatus.data && riskEngineStatus.data.risk_engine_status !== RiskEngineStatusEnum.NOT_INSTALLED; @@ -199,35 +200,37 @@ const EntityStoreDashboardPanelsComponent = () => { )} - {entityStore.status === 'not_installed' && !isRiskScoreAvailable && ( - // TODO: Move modal inside EnableEntityStore component, eliminating the onEnable prop in favour of forwarding the riskScoreEnabled status - setModalState({ visible: true })} - loadingRiskEngine={riskEngineInitializing} - /> - )} + {(entityStore.status === 'not_installed' || entityStore.status === 'stopped') && + !isRiskScoreAvailable && ( + // TODO: Move modal inside EnableEntityStore component, eliminating the onEnable prop in favour of forwarding the riskScoreEnabled status + setModalState({ visible: true })} + loadingRiskEngine={riskEngineInitializing} + /> + )} - {entityStore.status === 'not_installed' && isRiskScoreAvailable && ( - <> - - - setModalState({ - visible: true, - }) - } - /> - - - - - - - - - )} + {(entityStore.status === 'not_installed' || entityStore.status === 'stopped') && + isRiskScoreAvailable && ( + <> + + + setModalState({ + visible: true, + }) + } + /> + + + + + + + + + )}