mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution] Remove a data fetching hook from the add to timeline action component (#124331)
* Fetch alert ecs data in actions.tsx and not a hook in every table row * Add error handling and tests for theshold timelines * Fix bad merge * Remove unused imports * Actually remove unused file * Remove usage of alertIds and dead code from cases * Add basic sanity tests that ensure no extra network calls are being made * Remove unused operator * Remove unused imports * Remove unused mock
This commit is contained in:
parent
c299aabcb3
commit
e312c36e4c
18 changed files with 579 additions and 253 deletions
|
@ -7,7 +7,6 @@
|
|||
|
||||
import { EuiCheckbox, EuiLoadingSpinner } from '@elastic/eui';
|
||||
import React, { useCallback } from 'react';
|
||||
import { ALERT_RULE_PRODUCER } from '@kbn/rule-data-utils';
|
||||
import type { ActionProps, HeaderActionProps } from '../../../../../common/types';
|
||||
import * as i18n from './translations';
|
||||
|
||||
|
@ -19,10 +18,7 @@ export const RowCheckBox = ({
|
|||
columnValues,
|
||||
disabled,
|
||||
loadingEventIds,
|
||||
data,
|
||||
}: ActionProps) => {
|
||||
const ruleProducers = data.find((d) => d.field === ALERT_RULE_PRODUCER)?.value ?? [];
|
||||
const ruleProducer = ruleProducers[0];
|
||||
const handleSelectEvent = useCallback(
|
||||
(event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (!disabled) {
|
||||
|
@ -39,7 +35,7 @@ export const RowCheckBox = ({
|
|||
<EuiLoadingSpinner size="m" data-test-subj="event-loader" />
|
||||
) : (
|
||||
<EuiCheckbox
|
||||
data-test-subj={`select-event select-event-rule-producer-${ruleProducer}`}
|
||||
data-test-subj={`select-event select-event-${eventId}`}
|
||||
id={eventId}
|
||||
checked={checked && !disabled}
|
||||
disabled={disabled}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue