Skip to content

Commit

Permalink
use endpointAlertCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Aug 4, 2021
1 parent 001bb03 commit 102fc60
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import React, { useState, useCallback, useMemo } from 'react';
import { EuiContextMenu, EuiButton, EuiPopover } from '@elastic/eui';
import type { ExceptionListType } from '@kbn/securitysolution-io-ts-list-types';

import { find } from 'lodash/fp';
import { TAKE_ACTION } from '../alerts_table/alerts_utility_bar/translations';

import { TimelineEventsDetailsItem, TimelineNonEcsData } from '../../../../common';
Expand All @@ -29,6 +28,7 @@ import { CHANGE_ALERT_STATUS } from './translations';
import { getFieldValue } from '../host_isolation/helpers';
import type { Ecs } from '../../../../common/ecs';
import { Status } from '../../../../common/detection_engine/schemas/common/schemas';
import { endpointAlertCheck } from '../../../common/utils/endpoint_alert_check';

interface ActionsData {
alertStatus: Status;
Expand Down Expand Up @@ -96,15 +96,7 @@ export const TakeActionDropdown = React.memo(
if (detailsData == null) {
return false;
}

const eventModules = find(
{ category: 'signal', field: 'signal.original_event.module' },
detailsData
)?.values;
const kinds = find({ category: 'signal', field: 'signal.original_event.kind' }, detailsData)
?.values;

return !!(eventModules?.includes('endpoint') && kinds?.includes('alert'));
return endpointAlertCheck({ data: detailsData });
}, [detailsData]);

const togglePopoverHandler = useCallback(() => {
Expand Down

0 comments on commit 102fc60

Please sign in to comment.