Skip to content

Commit

Permalink
cleanup timeline integration code
Browse files Browse the repository at this point in the history
  • Loading branch information
oatkiller committed Jun 25, 2020
1 parent 0df4787 commit c6d911d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { EuiButtonEmpty, EuiHorizontalRule, EuiTitle } from '@elastic/eui';
import { EuiButtonEmpty, EuiHorizontalRule } from '@elastic/eui';
import React, { useCallback } from 'react';
import { useDispatch } from 'react-redux';
import styled from 'styled-components';

import { updateTimelineGraphEventId } from '../../../timelines/store/timeline/actions';
import { useManageTimeline } from '../manage_timeline';
import { Resolver } from '../../../resolver/view';

const OverlayContainer = styled.div<{ bodyHeight?: number }>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ export const getEventType = (event: Ecs): Omit<EventType, 'all'> => {
export const showGraphView = (graphEventId?: string) =>
graphEventId != null && graphEventId.length > 0;

export const isInvestigateInResolverActionEnabled: (
ecsData: Ecs
) => boolean = (ecsData) => {
export const isInvestigateInResolverActionEnabled: (ecsData?: Ecs) => boolean = (ecsData) => {
return (
ecsData !== undefined &&
ecsData.agent?.type === 'endpoint' &&
Expand All @@ -121,8 +119,7 @@ export const getInvestigateInResolverAction = ({
displayType: 'icon',
iconType: 'node',
id: 'investigateInResolver',
isActionDisabled: (ecsData: Ecs) =>
!isInvestigateInResolverActionEnabled(ecsData),
isActionDisabled: (ecsData?: Ecs) => !isInvestigateInResolverActionEnabled(ecsData),
onClick: ({ eventId }: TimelineRowActionOnClick) => {
return dispatch(
updateTimelineGraphEventId({
Expand Down

0 comments on commit c6d911d

Please sign in to comment.