From c77b1b6e59b346de89abff38854bc1e03489b062 Mon Sep 17 00:00:00 2001 From: Pablo Machado Date: Mon, 18 Nov 2024 12:15:39 +0100 Subject: [PATCH] [8.16] [Securitysolution] Add Risk score missing privileges callout to enablement flyout (#199804) (#200506) # Backport This will backport the following commits from `main` to `8.16`: - [[Securitysolution] Add Risk score missing privileges callout to enablement flyout (#199804)](https://github.com/elastic/kibana/pull/199804) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) \n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Pablo Machado "}},{"branch":"8.16","label":"v8.16.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --- .../entity_store/components/enablement_modal.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx index 5ba3a6b95f7b1..9eeecc04ff784 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx @@ -28,6 +28,8 @@ import { ENABLEMENT_DESCRIPTION_RISK_ENGINE_ONLY, ENABLEMENT_DESCRIPTION_ENTITY_STORE_ONLY, } from '../translations'; +import { useMissingRiskEnginePrivileges } from '../../../hooks/use_missing_risk_engine_privileges'; +import { RiskEnginePrivilegesCallOut } from '../../risk_engine_privileges_callout'; export interface Enablements { riskScore: boolean; @@ -59,6 +61,7 @@ export const EntityStoreEnablementModal: React.FC } checked={enablements.riskScore} - disabled={riskScore.disabled || false} + disabled={ + riskScore.disabled || + (!riskEnginePrivileges.isLoading && !riskEnginePrivileges?.hasAllRequiredPrivileges) + } onChange={() => setEnablements((prev) => ({ ...prev, riskScore: !prev.riskScore }))} /> + {!riskEnginePrivileges.isLoading && !riskEnginePrivileges.hasAllRequiredPrivileges && ( + + + + )} {ENABLEMENT_DESCRIPTION_RISK_ENGINE_ONLY} - } checked={enablements.entityStore} - disabled={entityStore.disabled || false} + disabled={entityStore.disabled} onChange={() => setEnablements((prev) => ({ ...prev, entityStore: !prev.entityStore })) }