Skip to content

Commit 4605896

Browse files
Fix API
1 parent 1d03ac7 commit 4605896

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

x-pack/plugins/security_solution/common/constants.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,3 @@ export const showAllOthersBucket: string[] = [
167167
'destination.ip',
168168
'user.name',
169169
];
170-
171-
/*
172-
* This should be set to true after https://github.com/elastic/kibana/pull/67496 is merged
173-
*/
174-
export const enableElasticFilter = false;

x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ export const getTimelineTitle = (
217217
duplicate: boolean,
218218
timelineType?: TimelineType
219219
) => {
220-
const isCreateFromAction = timeline.timelineType !== timelineType;
221-
if (isCreateFromAction) return '';
220+
const isCreateTimelineFromAction = timelineType && timeline.timelineType !== timelineType;
221+
if (isCreateTimelineFromAction) return '';
222222

223223
return duplicate ? `${timeline.title} - Duplicate` : timeline.title || '';
224224
};
@@ -228,7 +228,7 @@ export const getTimelineStatus = (
228228
duplicate: boolean,
229229
timelineType?: TimelineType
230230
) => {
231-
const isCreateTimelineFromAction = timeline.timelineType !== timelineType;
231+
const isCreateTimelineFromAction = timelineType && timeline.timelineType !== timelineType;
232232
if (isCreateTimelineFromAction) return TimelineStatus.draft;
233233

234234
return duplicate ? TimelineStatus.active : timeline.status;

x-pack/plugins/security_solution/server/lib/timeline/saved_object.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { getOr } from 'lodash/fp';
88

99
import { SavedObjectsFindOptions } from '../../../../../../src/core/server';
10-
import { UNAUTHENTICATED_USER, enableElasticFilter } from '../../../common/constants';
10+
import { UNAUTHENTICATED_USER } from '../../../common/constants';
1111
import { NoteSavedObject } from '../../../common/types/timeline/note';
1212
import { PinnedEventSavedObject } from '../../../common/types/timeline/pinned_event';
1313
import {
@@ -125,7 +125,9 @@ const getTimelineTypeFilter = (
125125
status: TimelineStatusLiteralWithNull
126126
) => {
127127
const typeFilter =
128-
timelineType === TimelineType.template
128+
timelineType == null
129+
? null
130+
: timelineType === TimelineType.template
129131
? `siem-ui-timeline.attributes.timelineType: ${TimelineType.template}` /** Show only whose timelineType exists and equals to "template" */
130132
: /** Show me every timeline whose timelineType is not "template".
131133
* which includes timelineType === 'default' and
@@ -151,12 +153,10 @@ const getTimelineTypeFilter = (
151153
templateTimelineType == null
152154
? null
153155
: templateTimelineType === TemplateTimelineType.elastic
154-
? `siem-ui-timeline.attributes.createdBy: "Elsatic"`
156+
? `siem-ui-timeline.attributes.createdBy: "Elastic"`
155157
: `not siem-ui-timeline.attributes.createdBy: "Elastic"`;
156158

157-
const filters = enableElasticFilter
158-
? [typeFilter, draftFilter, immutableFilter, templateTimelineTypeFilter]
159-
: [typeFilter, draftFilter, immutableFilter];
159+
const filters = [typeFilter, draftFilter, immutableFilter, templateTimelineTypeFilter];
160160
return filters.filter((f) => f != null).join(' and ');
161161
};
162162

0 commit comments

Comments
 (0)