Skip to content

Commit

Permalink
[7.14] [RAC] Persistent timeline fields fix (elastic#110685) (elastic…
Browse files Browse the repository at this point in the history
…#112150)

* [RAC] Persistent timeline fields fix (elastic#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
  • Loading branch information
semd authored Sep 14, 2021
1 parent 70e89b3 commit d9f477c
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('StatefulEventsViewer', () => {
wrapper.update();

expect(wrapper.text()).toMatchInlineSnapshot(
`"Showing: 12 events1 fields sorted@timestamp1event.severityevent.categoryevent.actionhost.namesource.ipdestination.ipdestination.bytesuser.name_idmessage0 of 12 events123"`
`"Showing: 12 events1 fields sorted@timestamp1event.severityevent.categoryevent.actionhost.namesource.ipdestination.ipdestination.bytesuser.name_idmessage0 of 12 123"`
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ export const mockGlobalState: State = {
activeTab: TimelineTabs.query,
prevActiveTab: TimelineTabs.notes,
deletedEventIds: [],
documentType: '',
queryFields: [],
selectAll: false,
id: 'test',
savedObjectId: null,
columns: defaultHeaders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,7 @@ export const mockTimelineModel: TimelineModel = {
},
deletedEventIds: [],
description: 'This is a sample rule description',
documentType: '',
eqlOptions: {
eventCategoryField: 'event.category',
tiebreakerField: 'event.sequence',
Expand Down Expand Up @@ -2015,13 +2016,15 @@ export const mockTimelineModel: TimelineModel = {
kqlQuery: {
filterQuery: null,
},
queryFields: [],
itemsPerPage: 25,
itemsPerPageOptions: [10, 25, 50, 100],
loadingEventIds: [],
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
savedObjectId: 'ef579e40-jibber-jabber',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -2106,6 +2109,7 @@ export const defaultTimelineProps: CreateTimelineProps = {
dateRange: { end: '2018-11-05T19:03:25.937Z', start: '2018-11-05T18:58:25.937Z' },
deletedEventIds: [],
description: '',
documentType: '',
eqlOptions: {
eventCategoryField: 'event.category',
query: '',
Expand Down Expand Up @@ -2137,7 +2141,9 @@ export const defaultTimelineProps: CreateTimelineProps = {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: null,
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ describe('alert actions', () => {
},
deletedEventIds: [],
description: 'This is a sample rule description',
documentType: '',
eqlOptions: {
eventCategoryField: 'event.category',
query: '',
Expand Down Expand Up @@ -202,7 +203,9 @@ describe('alert actions', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: null,
selectAll: false,
selectedEventIds: {},
show: true,
showCheckboxes: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -325,7 +326,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -404,6 +407,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -436,7 +440,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -515,6 +521,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -547,7 +554,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -624,6 +633,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -656,7 +666,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -771,6 +783,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -806,6 +819,8 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -907,6 +922,7 @@ describe('helpers', () => {
dateRange: { start: '2020-07-07T08:20:18.966Z', end: '2020-07-08T08:20:18.966Z' },
dataProviders: [],
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -985,6 +1001,8 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -1059,6 +1077,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { end: '2020-10-28T11:37:31.655Z', start: '2020-10-27T11:37:31.655Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -1091,7 +1110,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -1170,6 +1191,7 @@ describe('helpers', () => {
dataProviders: [],
dateRange: { end: '2020-07-08T08:20:18.966Z', start: '2020-07-07T08:20:18.966Z' },
description: '',
documentType: '',
deletedEventIds: [],
eqlOptions: {
eventCategoryField: 'event.category',
Expand Down Expand Up @@ -1202,7 +1224,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down
Loading

0 comments on commit d9f477c

Please sign in to comment.