Skip to content

Commit b1d54e7

Browse files
committed
Merge branch 'template-timeline' of github.com:angorayc/kibana into template-timeline
2 parents 6413a11 + 1995a71 commit b1d54e7

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

x-pack/plugins/siem/public/components/open_timeline/index.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { mount } from 'enzyme';
99
import { MockedProvider } from 'react-apollo/test-utils';
1010
import React from 'react';
1111
import { ThemeProvider } from 'styled-components';
12-
import { getOr } from 'lodash/fp';
1312

1413
import { wait } from '../../lib/helpers';
1514
import { TestProviderWithoutDragAndDrop, apolloClient } from '../../mock/test_providers';

x-pack/plugins/siem/public/components/open_timeline/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Dispatch } from 'redux';
1212
import { defaultHeaders } from '../../components/timeline/body/column_headers/default_headers';
1313
import { deleteTimelineMutation } from '../../containers/timeline/delete/persist.gql_query';
1414
import { AllTimelinesVariables, useGetAllTimeline } from '../../containers/timeline/all';
15-
import { allTimelinesQuery } from '../../containers/timeline/all/index.gql_query';
1615
import { DeleteTimelineMutation, SortFieldTimeline, Direction } from '../../graphql/types';
1716
import { State, timelineSelectors } from '../../store';
1817
import { ColumnHeaderOptions, TimelineModel } from '../../store/timeline/model';
@@ -161,8 +160,8 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>(
161160
);
162161

163162
/** Invoked when the user clicks the action to delete the selected timelines */
164-
const onDeleteSelected: OnDeleteSelected = useCallback(() => {
165-
deleteTimelines(getSelectedTimelineIds(selectedItems));
163+
const onDeleteSelected: OnDeleteSelected = useCallback(async () => {
164+
await deleteTimelines(getSelectedTimelineIds(selectedItems));
166165

167166
// NOTE: we clear the selection state below, but if the server fails to
168167
// delete a timeline, it will remain selected in the table:

x-pack/plugins/siem/public/components/open_timeline/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AllTimelinesVariables } from '../../containers/timeline/all';
99
import { TimelineModel } from '../../store/timeline/model';
1010
import { NoteResult } from '../../graphql/types';
1111
import { Refetch } from '../../store/inputs/model';
12-
import { TimelineTypes } from '../../../../../../plugins/siem/common/types/timeline';
12+
import { TimelineType } from '../../../common/types/timeline';
1313

1414
/** The users who added a timeline to favorites */
1515
export interface FavoriteTimelineResult {
@@ -49,7 +49,7 @@ export interface OpenTimelineResult {
4949
savedObjectId?: string | null;
5050
title?: string | null;
5151
templateTimelineId?: string | null;
52-
type?: TimelineTypes.template | TimelineTypes.default;
52+
type?: TimelineType.template | TimelineType.default;
5353
updated?: number | null;
5454
updatedBy?: string | null;
5555
}

x-pack/plugins/siem/public/components/recent_timelines/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const StatefulRecentTimelinesComponent = React.memo<Props>(
6262
[filterBy]
6363
);
6464

65-
const { fetchAllTimeline, timelines, loading } = useGetAllTimeline();
65+
const { fetchAllTimeline, timelines, totalCount, loading } = useGetAllTimeline();
6666

6767
useEffect(() => {
6868
fetchAllTimeline({
@@ -76,8 +76,10 @@ const StatefulRecentTimelinesComponent = React.memo<Props>(
7676
sortOrder: Direction.desc,
7777
},
7878
onlyUserFavorite: filterBy === 'favorites',
79+
timelines,
80+
totalCount,
7981
});
80-
}, [filterBy]);
82+
}, [filterBy, timelines, totalCount]);
8183

8284
return (
8385
<>

0 commit comments

Comments
 (0)