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..dda65a9ee8122 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,13 +141,14 @@ const EntityStoreDashboardPanelsComponent = () => { ); } - const isRiskScoreAvailable = + // Risk score could be installed but disabled + const isRiskScoreInstalled = riskEngineStatus.data && riskEngineStatus.data.risk_engine_status !== RiskEngineStatusEnum.NOT_INSTALLED; return ( - {entityStore.status === 'error' && isRiskScoreAvailable && ( + {entityStore.status === 'stopped' && isRiskScoreInstalled && ( <> {callouts} @@ -158,7 +159,19 @@ const EntityStoreDashboardPanelsComponent = () => { )} - {entityStore.status === 'error' && !isRiskScoreAvailable && ( + + {entityStore.status === 'error' && isRiskScoreInstalled && ( + <> + {callouts} + + + + + + + + )} + {entityStore.status === 'error' && !isRiskScoreInstalled && ( <> {callouts} @@ -170,7 +183,7 @@ const EntityStoreDashboardPanelsComponent = () => { )} - {entityStore.status === 'enabled' && isRiskScoreAvailable && ( + {entityStore.status === 'enabled' && isRiskScoreInstalled && ( <> @@ -183,7 +196,7 @@ const EntityStoreDashboardPanelsComponent = () => { )} - {entityStore.status === 'enabled' && !isRiskScoreAvailable && ( + {entityStore.status === 'enabled' && !isRiskScoreInstalled && ( <> { )} - {entityStore.status === 'not_installed' && !isRiskScoreAvailable && ( + {entityStore.status === 'not_installed' && !isRiskScoreInstalled && ( // TODO: Move modal inside EnableEntityStore component, eliminating the onEnable prop in favour of forwarding the riskScoreEnabled status { /> )} - {entityStore.status === 'not_installed' && isRiskScoreAvailable && ( + {entityStore.status === 'not_installed' && isRiskScoreInstalled && ( <> { visible={modal.visible} toggle={(visible) => setModalState({ visible })} enableStore={enableEntityStore} - riskScore={{ disabled: isRiskScoreAvailable, checked: !isRiskScoreAvailable }} + riskScore={{ disabled: isRiskScoreInstalled, checked: !isRiskScoreInstalled }} entityStore={{ disabled: entityStore.status === 'enabled', checked: entityStore.status !== 'enabled',