Skip to content

Commit d9f477c

Browse files
authored
[7.14] [RAC] Persistent timeline fields fix (#110685) (#112150)
* [RAC] Persistent timeline fields fix (#110685) * fix stringify circular ref crash and default columns on createTimeline * rollback reset buton fix to split PR * adding fields to the storage cleaning * tests fixed * test fix # Conflicts: # x-pack/plugins/security_solution/public/timelines/store/timeline/defaults.ts # x-pack/plugins/timelines/public/store/t_grid/model.ts * fix types and tests
1 parent 70e89b3 commit d9f477c

File tree

12 files changed

+104
-30
lines changed

12 files changed

+104
-30
lines changed

x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('StatefulEventsViewer', () => {
6363
wrapper.update();
6464

6565
expect(wrapper.text()).toMatchInlineSnapshot(
66-
`"Showing: 12 events1 fields sorted@timestamp1event.severityevent.categoryevent.actionhost.namesource.ipdestination.ipdestination.bytesuser.name_idmessage0 of 12 events123"`
66+
`"Showing: 12 events1 fields sorted@timestamp1event.severityevent.categoryevent.actionhost.namesource.ipdestination.ipdestination.bytesuser.name_idmessage0 of 12 123"`
6767
);
6868
});
6969
});

x-pack/plugins/security_solution/public/common/mock/global_state.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ export const mockGlobalState: State = {
212212
activeTab: TimelineTabs.query,
213213
prevActiveTab: TimelineTabs.notes,
214214
deletedEventIds: [],
215+
documentType: '',
216+
queryFields: [],
217+
selectAll: false,
215218
id: 'test',
216219
savedObjectId: null,
217220
columns: defaultHeaders,

x-pack/plugins/security_solution/public/common/mock/timeline_results.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,7 @@ export const mockTimelineModel: TimelineModel = {
19771977
},
19781978
deletedEventIds: [],
19791979
description: 'This is a sample rule description',
1980+
documentType: '',
19801981
eqlOptions: {
19811982
eventCategoryField: 'event.category',
19821983
tiebreakerField: 'event.sequence',
@@ -2015,13 +2016,15 @@ export const mockTimelineModel: TimelineModel = {
20152016
kqlQuery: {
20162017
filterQuery: null,
20172018
},
2019+
queryFields: [],
20182020
itemsPerPage: 25,
20192021
itemsPerPageOptions: [10, 25, 50, 100],
20202022
loadingEventIds: [],
20212023
noteIds: [],
20222024
pinnedEventIds: {},
20232025
pinnedEventsSaveObject: {},
20242026
savedObjectId: 'ef579e40-jibber-jabber',
2027+
selectAll: false,
20252028
selectedEventIds: {},
20262029
show: false,
20272030
showCheckboxes: false,
@@ -2106,6 +2109,7 @@ export const defaultTimelineProps: CreateTimelineProps = {
21062109
dateRange: { end: '2018-11-05T19:03:25.937Z', start: '2018-11-05T18:58:25.937Z' },
21072110
deletedEventIds: [],
21082111
description: '',
2112+
documentType: '',
21092113
eqlOptions: {
21102114
eventCategoryField: 'event.category',
21112115
query: '',
@@ -2137,7 +2141,9 @@ export const defaultTimelineProps: CreateTimelineProps = {
21372141
noteIds: [],
21382142
pinnedEventIds: {},
21392143
pinnedEventsSaveObject: {},
2144+
queryFields: [],
21402145
savedObjectId: null,
2146+
selectAll: false,
21412147
selectedEventIds: {},
21422148
show: false,
21432149
showCheckboxes: false,

x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ describe('alert actions', () => {
146146
},
147147
deletedEventIds: [],
148148
description: 'This is a sample rule description',
149+
documentType: '',
149150
eqlOptions: {
150151
eventCategoryField: 'event.category',
151152
query: '',
@@ -202,7 +203,9 @@ describe('alert actions', () => {
202203
noteIds: [],
203204
pinnedEventIds: {},
204205
pinnedEventsSaveObject: {},
206+
queryFields: [],
205207
savedObjectId: null,
208+
selectAll: false,
206209
selectedEventIds: {},
207210
show: true,
208211
showCheckboxes: false,

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ describe('helpers', () => {
293293
dataProviders: [],
294294
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
295295
description: '',
296+
documentType: '',
296297
deletedEventIds: [],
297298
eqlOptions: {
298299
eventCategoryField: 'event.category',
@@ -325,7 +326,9 @@ describe('helpers', () => {
325326
noteIds: [],
326327
pinnedEventIds: {},
327328
pinnedEventsSaveObject: {},
329+
queryFields: [],
328330
savedObjectId: 'savedObject-1',
331+
selectAll: false,
329332
selectedEventIds: {},
330333
show: false,
331334
showCheckboxes: false,
@@ -404,6 +407,7 @@ describe('helpers', () => {
404407
dataProviders: [],
405408
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
406409
description: '',
410+
documentType: '',
407411
deletedEventIds: [],
408412
eqlOptions: {
409413
eventCategoryField: 'event.category',
@@ -436,7 +440,9 @@ describe('helpers', () => {
436440
noteIds: [],
437441
pinnedEventIds: {},
438442
pinnedEventsSaveObject: {},
443+
queryFields: [],
439444
savedObjectId: 'savedObject-1',
445+
selectAll: false,
440446
selectedEventIds: {},
441447
show: false,
442448
showCheckboxes: false,
@@ -515,6 +521,7 @@ describe('helpers', () => {
515521
dataProviders: [],
516522
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
517523
description: '',
524+
documentType: '',
518525
deletedEventIds: [],
519526
eqlOptions: {
520527
eventCategoryField: 'event.category',
@@ -547,7 +554,9 @@ describe('helpers', () => {
547554
noteIds: [],
548555
pinnedEventIds: {},
549556
pinnedEventsSaveObject: {},
557+
queryFields: [],
550558
savedObjectId: 'savedObject-1',
559+
selectAll: false,
551560
selectedEventIds: {},
552561
show: false,
553562
showCheckboxes: false,
@@ -624,6 +633,7 @@ describe('helpers', () => {
624633
dataProviders: [],
625634
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
626635
description: '',
636+
documentType: '',
627637
deletedEventIds: [],
628638
eqlOptions: {
629639
eventCategoryField: 'event.category',
@@ -656,7 +666,9 @@ describe('helpers', () => {
656666
noteIds: [],
657667
pinnedEventIds: {},
658668
pinnedEventsSaveObject: {},
669+
queryFields: [],
659670
savedObjectId: 'savedObject-1',
671+
selectAll: false,
660672
selectedEventIds: {},
661673
show: false,
662674
showCheckboxes: false,
@@ -771,6 +783,7 @@ describe('helpers', () => {
771783
dataProviders: [],
772784
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
773785
description: '',
786+
documentType: '',
774787
deletedEventIds: [],
775788
eqlOptions: {
776789
eventCategoryField: 'event.category',
@@ -806,6 +819,8 @@ describe('helpers', () => {
806819
noteIds: [],
807820
pinnedEventIds: {},
808821
pinnedEventsSaveObject: {},
822+
queryFields: [],
823+
selectAll: false,
809824
selectedEventIds: {},
810825
show: false,
811826
showCheckboxes: false,
@@ -907,6 +922,7 @@ describe('helpers', () => {
907922
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
908923
dataProviders: [],
909924
description: '',
925+
documentType: '',
910926
deletedEventIds: [],
911927
eqlOptions: {
912928
eventCategoryField: 'event.category',
@@ -985,6 +1001,8 @@ describe('helpers', () => {
9851001
noteIds: [],
9861002
pinnedEventIds: {},
9871003
pinnedEventsSaveObject: {},
1004+
queryFields: [],
1005+
selectAll: false,
9881006
selectedEventIds: {},
9891007
show: false,
9901008
showCheckboxes: false,
@@ -1059,6 +1077,7 @@ describe('helpers', () => {
10591077
dataProviders: [],
10601078
dateRange: { end: '2020-10-28T11:37:31.655Z', start: '2020-10-27T11:37:31.655Z' },
10611079
description: '',
1080+
documentType: '',
10621081
deletedEventIds: [],
10631082
eqlOptions: {
10641083
eventCategoryField: 'event.category',
@@ -1091,7 +1110,9 @@ describe('helpers', () => {
10911110
noteIds: [],
10921111
pinnedEventIds: {},
10931112
pinnedEventsSaveObject: {},
1113+
queryFields: [],
10941114
savedObjectId: 'savedObject-1',
1115+
selectAll: false,
10951116
selectedEventIds: {},
10961117
show: false,
10971118
showCheckboxes: false,
@@ -1170,6 +1191,7 @@ describe('helpers', () => {
11701191
dataProviders: [],
11711192
dateRange: { end: '2020-07-08T08:20:18.966Z', start: '2020-07-07T08:20:18.966Z' },
11721193
description: '',
1194+
documentType: '',
11731195
deletedEventIds: [],
11741196
eqlOptions: {
11751197
eventCategoryField: 'event.category',
@@ -1202,7 +1224,9 @@ describe('helpers', () => {
12021224
noteIds: [],
12031225
pinnedEventIds: {},
12041226
pinnedEventsSaveObject: {},
1227+
queryFields: [],
12051228
savedObjectId: 'savedObject-1',
1229+
selectAll: false,
12061230
selectedEventIds: {},
12071231
show: false,
12081232
showCheckboxes: false,

0 commit comments

Comments
 (0)