From 5a41dd8fdb565fe9dbdd59ac596814bb8bb72944 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Wed, 29 Nov 2023 12:55:21 +0200 Subject: [PATCH] [ES|QL] Make the dashboard SO lighter (#172130) ## Summary This PR makes the dashboard SO lighter by removing the initialContext from the state. It is not needed after the navigation from Discover to Dashboard and can create SO size problems as it contains a lot of information for the transition. (cherry picked from commit cb3fd2132f47d43e4d46b8f5b085195cb8dda806) # Conflicts: # x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts --- .../public/datasources/text_based/text_based_languages.test.ts | 1 + .../lens/public/datasources/text_based/text_based_languages.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts index 0b0437cc96c0b..0a7b29ee8a7b2 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.test.ts @@ -401,6 +401,7 @@ describe('Textbased Data Source', () => { ); expect(suggestions[0].state).toEqual({ ...state, + initialContext: undefined, fieldList: textBasedQueryColumns, layers: { newid: { diff --git a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx index 43d971caf24a9..eac90e3588a96 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/text_based_languages.tsx @@ -125,6 +125,7 @@ export function getTextBasedDatasource({ const query = context.query; const updatedState = { ...state, + initialContext: undefined, fieldList: textBasedQueryColumns, layers: { ...state.layers,