Skip to content

Commit 1995a71

Browse files
committed
fix dependency
1 parent 5315cc7 commit 1995a71

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-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: 16 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';
@@ -148,9 +147,11 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>(
148147
sortOrder: sortDirection as Direction,
149148
},
150149
onlyUserFavorite: onlyFavorites,
150+
timelines,
151+
totalCount,
151152
});
152153
},
153-
[search, pageIndex, pageSize, sortField, sortDirection, onlyFavorites]
154+
[search, pageIndex, pageSize, sortField, sortDirection, onlyFavorites, timelines, totalCount]
154155
);
155156

156157
/** Invoked when the user clicks the action to delete the selected timelines */
@@ -166,14 +167,26 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>(
166167
sortOrder: sortDirection as Direction,
167168
},
168169
onlyUserFavorite: onlyFavorites,
170+
timelines,
171+
totalCount,
169172
});
170173

171174
// NOTE: we clear the selection state below, but if the server fails to
172175
// delete a timeline, it will remain selected in the table:
173176
resetSelectionState();
174177

175178
// TODO: the query must re-execute to show the results of the deletion
176-
}, [selectedItems, search, pageIndex, pageSize, sortField, sortDirection, onlyFavorites]);
179+
}, [
180+
selectedItems,
181+
search,
182+
pageIndex,
183+
pageSize,
184+
sortField,
185+
sortDirection,
186+
onlyFavorites,
187+
timelines,
188+
totalCount,
189+
]);
177190

178191
/** Invoked when the user selects (or de-selects) timelines */
179192
const onSelectionChange: OnSelectionChange = useCallback(

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)