From f5061c7c5139da7de62e8ede2e12fe38b45cab2f Mon Sep 17 00:00:00 2001 From: Maja Grubic Date: Fri, 17 Jul 2020 13:10:46 +0100 Subject: [PATCH] Adding missing null check --- src/plugins/visualize/config.ts | 2 +- .../public/application/components/visualize_top_nav.tsx | 3 +++ src/plugins/visualize/public/application/utils/utils.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/visualize/config.ts b/src/plugins/visualize/config.ts index 6f01c8d1d5e8b..ee79a37717f26 100644 --- a/src/plugins/visualize/config.ts +++ b/src/plugins/visualize/config.ts @@ -20,7 +20,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - showNewVisualizeFlow: schema.boolean({ defaultValue: true }), + showNewVisualizeFlow: schema.boolean({ defaultValue: false }), }); export type ConfigSchema = TypeOf; diff --git a/src/plugins/visualize/public/application/components/visualize_top_nav.tsx b/src/plugins/visualize/public/application/components/visualize_top_nav.tsx index b3950fabac7d6..5a8d7ff7a8e81 100644 --- a/src/plugins/visualize/public/application/components/visualize_top_nav.tsx +++ b/src/plugins/visualize/public/application/components/visualize_top_nav.tsx @@ -43,6 +43,7 @@ interface VisualizeTopNavProps { savedVisInstance: SavedVisInstance; stateContainer: VisualizeAppStateContainer; visualizationIdFromUrl?: string; + embeddableId?: string; } const TopNav = ({ @@ -56,6 +57,7 @@ const TopNav = ({ savedVisInstance, stateContainer, visualizationIdFromUrl, + embeddableId, }: VisualizeTopNavProps) => { const { services } = useKibana(); const { TopNavMenu } = services.navigation.ui; @@ -89,6 +91,7 @@ const TopNav = ({ savedVisInstance, stateContainer, visualizationIdFromUrl, + embeddableId, }, services ); diff --git a/src/plugins/visualize/public/application/utils/utils.ts b/src/plugins/visualize/public/application/utils/utils.ts index c470509827037..f8a724503d409 100644 --- a/src/plugins/visualize/public/application/utils/utils.ts +++ b/src/plugins/visualize/public/application/utils/utils.ts @@ -62,7 +62,8 @@ export const visStateToEditorState = ( ) => { const savedVisState = services.visualizations.convertFromSerializedVis(vis.serialize()); return { - uiState: savedVis.uiStateJSON ? JSON.parse(savedVis.uiStateJSON) : vis.uiState.toJSON(), + uiState: + savedVis && savedVis.uiStateJSON ? JSON.parse(savedVis.uiStateJSON) : vis.uiState.toJSON(), query: vis.data.searchSource?.getOwnField('query') || getDefaultQuery(services), filters: (vis.data.searchSource?.getOwnField('filter') as Filter[]) || [], vis: { ...savedVisState.visState, title: vis.title },