From 1a5b23dd1e8cbb85c874e0142ee5102722523917 Mon Sep 17 00:00:00 2001 From: David Sanchez Soler Date: Thu, 13 May 2021 14:45:17 +0200 Subject: [PATCH] Disable contextMenu when event is not event.kind=event --- .../timelines/components/timeline/body/actions/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx index 015c4c0b45949..0824dea0803ba 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx @@ -115,6 +115,11 @@ const ActionsComponent: React.FC = ({ ); const eventType = getEventType(ecsData); + const isEventContextMenuEnabled = useMemo( + () => isEventFilteringEnabled && !!ecsData.event?.kind && ecsData.event?.kind[0] === 'event', + [ecsData.event?.kind, isEventFilteringEnabled] + ); + return ( <> {showCheckboxes && ( @@ -197,7 +202,7 @@ const ActionsComponent: React.FC = ({ key="alert-context-menu" ecsRowData={ecsData} timelineId={timelineId} - disabled={eventType !== 'signal' && (!isEventFilteringEnabled || eventType !== 'raw')} + disabled={eventType !== 'signal' && !isEventContextMenuEnabled} refetch={refetch} onRuleChange={onRuleChange} />