From 68a7c1a96f35863aaf8dacc4922eb1cb77b82bef Mon Sep 17 00:00:00 2001 From: Philippe Oberti Date: Thu, 11 Jul 2024 08:27:30 +0200 Subject: [PATCH] [Security Solution][Alert details] - do not show Notes tab for Rule creation preview alerts (#187966) (cherry picked from commit cc7588c8cb9cc428e97df6b057a898fa7ceb5383) --- .../public/flyout/document_details/left/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/index.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/index.tsx index 8facaef0885ca..f4a89cbc2b7bc 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/index.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/index.tsx @@ -32,7 +32,7 @@ export const LeftPanelNotesTab: LeftPanelPaths = 'notes'; export const LeftPanel: FC> = memo(({ path }) => { const { telemetry } = useKibana().services; const { openLeftPanel } = useExpandableFlyoutApi(); - const { eventId, indexName, scopeId, getFieldsData } = useDocumentDetailsContext(); + const { eventId, indexName, scopeId, getFieldsData, isPreview } = useDocumentDetailsContext(); const eventKind = getField(getFieldsData('event.kind')); const securitySolutionNotesEnabled = useIsExperimentalFeatureEnabled( 'securitySolutionNotesEnabled' @@ -43,11 +43,11 @@ export const LeftPanel: FC> = memo(({ path }) => { eventKind === EventKind.signal ? [tabs.insightsTab, tabs.investigationTab, tabs.responseTab] : [tabs.insightsTab]; - if (securitySolutionNotesEnabled) { + if (securitySolutionNotesEnabled && !isPreview) { tabList.push(tabs.notesTab); } return tabList; - }, [eventKind, securitySolutionNotesEnabled]); + }, [eventKind, isPreview, securitySolutionNotesEnabled]); const selectedTabId = useMemo(() => { const defaultTab = tabsDisplayed[0].id;