Skip to content

Commit

Permalink
[RAC] Persistent timeline fields fix (elastic#110685)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
semd authored and kibanamachine committed Sep 2, 2021
1 parent 3df194f commit cc28064
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,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 @@ -1979,6 +1979,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 @@ -2017,13 +2018,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 @@ -2110,6 +2113,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 @@ -2141,7 +2145,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 @@ -148,6 +148,7 @@ describe('alert actions', () => {
},
deletedEventIds: [],
description: 'This is a sample rule description',
documentType: '',
eqlOptions: {
eventCategoryField: 'event.category',
query: '',
Expand Down Expand Up @@ -204,7 +205,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 @@ -296,6 +296,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 @@ -328,7 +329,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -366,6 +369,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 @@ -398,7 +402,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -436,6 +442,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 @@ -468,7 +475,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -504,6 +513,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 @@ -536,7 +546,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -577,6 +589,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 @@ -612,6 +625,8 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -680,6 +695,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 @@ -758,6 +774,8 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -791,6 +809,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 @@ -823,7 +842,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down Expand Up @@ -861,6 +882,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 @@ -893,7 +915,9 @@ describe('helpers', () => {
noteIds: [],
pinnedEventIds: {},
pinnedEventsSaveObject: {},
queryFields: [],
savedObjectId: 'savedObject-1',
selectAll: false,
selectedEventIds: {},
show: false,
showCheckboxes: false,
Expand Down
Loading

0 comments on commit cc28064

Please sign in to comment.