Skip to content

Commit ce029ad

Browse files
[7.x] [SIEM] Eliminate Superfluous Untitled Timelines (#65783) (#66485)
* [SIEM] Eliminate Superfluous Untitled Timelines (#65783) # Conflicts: # x-pack/plugins/siem/public/common/components/top_n/index.test.tsx # x-pack/plugins/siem/public/common/mock/timeline_results.ts # x-pack/plugins/siem/public/timelines/components/open_timeline/helpers.test.ts # x-pack/plugins/siem/public/timelines/components/open_timeline/index.test.tsx # x-pack/plugins/siem/public/timelines/components/open_timeline/open_timeline.tsx # x-pack/plugins/siem/public/timelines/components/open_timeline/types.ts # x-pack/plugins/siem/public/timelines/containers/api.ts # x-pack/plugins/siem/public/timelines/pages/index.tsx # x-pack/plugins/siem/public/timelines/store/timeline/defaults.ts # x-pack/plugins/siem/public/timelines/store/timeline/epic.ts # x-pack/plugins/siem/public/timelines/store/timeline/model.ts # yarn.lock * fix lint
1 parent 762e962 commit ce029ad

36 files changed

+915
-254
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const DETECTION_ENGINE_RULES_STATUS_URL = `${DETECTION_ENGINE_RULES_URL}/
9191
export const DETECTION_ENGINE_PREPACKAGED_RULES_STATUS_URL = `${DETECTION_ENGINE_RULES_URL}/prepackaged/_status`;
9292

9393
export const TIMELINE_URL = '/api/timeline';
94+
export const TIMELINE_DRAFT_URL = `${TIMELINE_URL}/_draft`;
9495
export const TIMELINE_EXPORT_URL = `${TIMELINE_URL}/_export`;
9596
export const TIMELINE_IMPORT_URL = `${TIMELINE_URL}/_import`;
9697

x-pack/plugins/siem/common/types/timeline/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ const SavedSortRuntimeType = runtimeTypes.partial({
136136

137137
export enum TimelineType {
138138
default = 'default',
139+
draft = 'draft',
139140
template = 'template',
140141
}
141142

142143
export const TimelineTypeLiteralRt = runtimeTypes.union([
143144
runtimeTypes.literal(TimelineType.template),
145+
runtimeTypes.literal(TimelineType.draft),
144146
runtimeTypes.literal(TimelineType.default),
145147
]);
146148

x-pack/plugins/siem/cypress/tasks/create_new_case.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const createNewCase = (newCase: TestCase) => {
3232
cy.get(INSERT_TIMELINE_BTN).click({ force: true });
3333
cy.get(TIMELINE_SEARCHBOX).type(`${newCase.timeline.title}{enter}`);
3434
cy.get(TIMELINE).should('be.visible');
35+
cy.wait(300);
3536
cy.get(TIMELINE)
3637
.eq(1)
3738
.click({ force: true });

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const getExportedIds = (selectedTimelines: OpenTimelineResult[]) => {
2020
);
2121
};
2222

23-
export const useEditTimelinBatchActions = ({
23+
export const useEditTimelineBatchActions = ({
2424
deleteTimelines,
2525
selectedItems,
2626
tableRef,

x-pack/plugins/siem/public/components/open_timeline/helpers.test.ts

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ describe('helpers', () => {
300300
sortDirection: 'desc',
301301
},
302302
title: '',
303-
timelineType: TimelineType.default,
303+
timelineType: TimelineType.draft,
304304
templateTimelineId: null,
305305
templateTimelineVersion: null,
306306
version: '1',
@@ -397,13 +397,14 @@ describe('helpers', () => {
397397
sortDirection: 'desc',
398398
},
399399
title: '',
400-
timelineType: TimelineType.default,
400+
timelineType: TimelineType.draft,
401401
templateTimelineId: null,
402402
templateTimelineVersion: null,
403403
version: '1',
404404
width: 1100,
405405
});
406406
});
407+
407408
test('should merge columns when event.action is deleted without two extra column names of user.name', () => {
408409
const timeline = {
409410
savedObjectId: 'savedObject-1',
@@ -416,38 +417,80 @@ describe('helpers', () => {
416417
savedObjectId: 'savedObject-1',
417418
columns: [
418419
{
420+
aggregatable: undefined,
421+
category: undefined,
419422
columnHeaderType: 'not-filtered',
423+
description: undefined,
424+
example: undefined,
420425
id: '@timestamp',
426+
placeholder: undefined,
427+
type: undefined,
421428
width: 190,
422429
},
423430
{
431+
aggregatable: undefined,
432+
category: undefined,
424433
columnHeaderType: 'not-filtered',
434+
description: undefined,
435+
example: undefined,
425436
id: 'message',
437+
placeholder: undefined,
438+
type: undefined,
426439
width: 180,
427440
},
428441
{
442+
aggregatable: undefined,
443+
category: undefined,
429444
columnHeaderType: 'not-filtered',
445+
description: undefined,
446+
example: undefined,
430447
id: 'event.category',
448+
placeholder: undefined,
449+
type: undefined,
431450
width: 180,
432451
},
433452
{
453+
aggregatable: undefined,
454+
category: undefined,
434455
columnHeaderType: 'not-filtered',
456+
description: undefined,
457+
example: undefined,
435458
id: 'host.name',
459+
placeholder: undefined,
460+
type: undefined,
436461
width: 180,
437462
},
438463
{
464+
aggregatable: undefined,
465+
category: undefined,
439466
columnHeaderType: 'not-filtered',
467+
description: undefined,
468+
example: undefined,
440469
id: 'source.ip',
470+
placeholder: undefined,
471+
type: undefined,
441472
width: 180,
442473
},
443474
{
475+
aggregatable: undefined,
476+
category: undefined,
444477
columnHeaderType: 'not-filtered',
478+
description: undefined,
479+
example: undefined,
445480
id: 'destination.ip',
481+
placeholder: undefined,
482+
type: undefined,
446483
width: 180,
447484
},
448485
{
486+
aggregatable: undefined,
487+
category: undefined,
449488
columnHeaderType: 'not-filtered',
489+
description: undefined,
490+
example: undefined,
450491
id: 'user.name',
492+
placeholder: undefined,
493+
type: undefined,
451494
width: 180,
452495
},
453496
],
@@ -474,7 +517,7 @@ describe('helpers', () => {
474517
},
475518
loadingEventIds: [],
476519
title: '',
477-
timelineType: TimelineType.default,
520+
timelineType: TimelineType.draft,
478521
templateTimelineId: null,
479522
templateTimelineVersion: null,
480523
noteIds: [],
@@ -642,7 +685,7 @@ describe('helpers', () => {
642685
},
643686
loadingEventIds: [],
644687
title: '',
645-
timelineType: TimelineType.default,
688+
timelineType: TimelineType.draft,
646689
templateTimelineId: null,
647690
templateTimelineVersion: null,
648691
noteIds: [],

0 commit comments

Comments
 (0)