Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed May 28, 2020
1 parent c047a9e commit f9469c6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 98 deletions.
16 changes: 8 additions & 8 deletions x-pack/plugins/siem/public/alerts/components/signals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,6 @@ export const SignalsTableComponent: React.FC<SignalsTableComponentProps> = ({
}
}, [defaultFilters, filterGroup]);
const { initializeTimeline, setTimelineActions } = useManageTimeline();
useEffect(() => {
setTimelineActions({
id: SIGNALS_PAGE_TIMELINE_ID,
queryFields: requiredFieldsForActions,
timelineActions: additionalActions,
});
}, [additionalActions]);

useEffect(() => {
initializeTimeline({
Expand All @@ -287,7 +280,14 @@ export const SignalsTableComponent: React.FC<SignalsTableComponentProps> = ({
title: i18n.SIGNALS_TABLE_TITLE,
selectAll: canUserCRUD ? selectAll : false,
});
}, [canUserCRUD, selectAll]);
}, []);
useEffect(() => {
setTimelineActions({
id: SIGNALS_PAGE_TIMELINE_ID,
queryFields: requiredFieldsForActions,
timelineActions: additionalActions,
});
}, [additionalActions]);
const headerFilterGroup = useMemo(
() => <SignalsTableFilterGroup onFilterGroupChanged={onFilterGroupChangedCallback} />,
[onFilterGroupChangedCallback]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
* you may not use this file except in compliance with the Elastic License.
*/

import React, { useMemo } from 'react';
import React, { useEffect, useMemo } from 'react';

import { Filter } from '../../../../../../../src/plugins/data/public';
import { StatefulEventsViewer } from '../events_viewer';
import { alertsDefaultModel } from './default_headers';

import { useManageTimeline } from '../../../timelines/components/manage_timeline';
import * as i18n from './translations';
export interface OwnProps {
end: number;
id: string;
Expand Down Expand Up @@ -58,6 +59,17 @@ interface Props {

const AlertsTableComponent: React.FC<Props> = ({ endDate, startDate, pageFilters = [] }) => {
const alertsFilter = useMemo(() => [...defaultAlertsFilters, ...pageFilters], [pageFilters]);
const { initializeTimeline } = useManageTimeline();

useEffect(() => {
initializeTimeline({
id: ALERTS_TABLE_ID,
documentType: i18n.ALERTS_DOCUMENT_TYPE,
footerText: i18n.TOTAL_COUNT_OF_ALERTS,
title: i18n.ALERTS_TABLE_TITLE,
unit: i18n.UNIT,
});
}, []);
return (
<StatefulEventsViewer
pageFilters={alertsFilter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { OnChangeItemsPerPage, OnLoadMore } from '../events';
import { LastUpdatedAt } from './last_updated';
import * as i18n from './translations';
import { useEventDetailsWidthContext } from '../../../../common/components/events_viewer/event_details_width_context';
import { useManageTimeline, TimelineTypeContext } from '../../manage_timeline';
import { useManageTimeline } from '../../manage_timeline';

export const isCompactFooter = (width: number): boolean => width < 600;

Expand Down

This file was deleted.

0 comments on commit f9469c6

Please sign in to comment.