diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx index 01d280d61d7209..bca04dcf37a5b9 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx @@ -22,7 +22,6 @@ interface InvestigateInTimelineActionProps { alertIds?: string[]; buttonType?: 'text' | 'icon'; onInvestigateInTimelineAlertClick?: () => void; - timelineId?: string; } const InvestigateInTimelineActionComponent: React.FC = ({ @@ -31,13 +30,11 @@ const InvestigateInTimelineActionComponent: React.FC { const { investigateInTimelineAlertClick } = useInvestigateInTimeline({ ecsRowData, alertIds, onInvestigateInTimelineAlertClick, - timelineId, }); return ( diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx index 54e7da3066ea1e..c1cbe657415a6d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx @@ -27,14 +27,12 @@ interface UseInvestigateInTimelineActionProps { nonEcsRowData?: TimelineNonEcsData[]; alertIds?: string[] | null | undefined; onInvestigateInTimelineAlertClick?: () => void; - timelineId?: string; } export const useInvestigateInTimeline = ({ ecsRowData, alertIds, onInvestigateInTimelineAlertClick, - timelineId, }: UseInvestigateInTimelineActionProps) => { const { data: { search: searchStrategyClient, query }, @@ -80,7 +78,7 @@ export const useInvestigateInTimeline = ({ const showInvestigateInTimelineAction = alertIds != null; const { isLoading: isFetchingAlertEcs, alertsEcsData } = useFetchEcsAlertsData({ alertIds, - skip: alertIds == null || timelineId !== undefined, + skip: alertIds == null, }); const investigateInTimelineAlertClick = useCallback(async () => { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_fetch_ecs_alerts_data.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_fetch_ecs_alerts_data.ts index f7c3c341bfa290..c459fab89a25e8 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_fetch_ecs_alerts_data.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_fetch_ecs_alerts_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useEffect, useState, useRef } from 'react'; +import { useEffect, useState } from 'react'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { isEmpty } from 'lodash'; @@ -25,11 +25,10 @@ export const useFetchEcsAlertsData = ({ }): { isLoading: boolean | null; alertsEcsData: Ecs[] | null } => { const [isLoading, setIsLoading] = useState(null); const [alertsEcsData, setAlertEcsData] = useState(null); - const abortCtrl = useRef(new AbortController()); useEffect(() => { let isSubscribed = true; - const controller = abortCtrl.current; + const abortCtrl = new AbortController(); const fetchAlert = async () => { try { @@ -73,7 +72,7 @@ export const useFetchEcsAlertsData = ({ return (): void => { isSubscribed = false; - controller.abort(); + abortCtrl.abort(); }; }, [alertIds, onError, skip]); 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 53764bd8d25391..75ca399bf52d40 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 @@ -169,7 +169,6 @@ const ActionsComponent: React.FC = ({ key="investigate-in-timeline" alertIds={alertIds} ecsRowData={ecsData} - timelineId={timelineId} /> )}