From abbc1b30b036c32cbb0ec83c4baf88a05e3b219b Mon Sep 17 00:00:00 2001 From: pgayvallet Date: Wed, 2 Sep 2020 15:59:57 +0200 Subject: [PATCH] wire setHeaderActionMenu API to dashboard app TopNavMenu --- src/plugins/dashboard/public/application/application.ts | 2 ++ .../public/application/dashboard_app_controller.tsx | 6 +++++- src/plugins/dashboard/public/plugin.tsx | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/dashboard/public/application/application.ts b/src/plugins/dashboard/public/application/application.ts index 21f423d009ee7..fcfae88d58bc7 100644 --- a/src/plugins/dashboard/public/application/application.ts +++ b/src/plugins/dashboard/public/application/application.ts @@ -31,6 +31,7 @@ import { SavedObjectsClientContract, PluginInitializerContext, ScopedHistory, + AppMountParameters, } from 'kibana/public'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; import { Storage } from '../../../kibana_utils/public'; @@ -72,6 +73,7 @@ export interface RenderDeps { navigateToDefaultApp: KibanaLegacyStart['navigateToDefaultApp']; navigateToLegacyKibanaUrl: KibanaLegacyStart['navigateToLegacyKibanaUrl']; scopedHistory: () => ScopedHistory; + setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; savedObjects: SavedObjectsStart; restorePreviousUrl: () => void; } diff --git a/src/plugins/dashboard/public/application/dashboard_app_controller.tsx b/src/plugins/dashboard/public/application/dashboard_app_controller.tsx index 0d20fdee07df5..24fedc19369a8 100644 --- a/src/plugins/dashboard/public/application/dashboard_app_controller.tsx +++ b/src/plugins/dashboard/public/application/dashboard_app_controller.tsx @@ -144,6 +144,7 @@ export class DashboardAppController { i18n: i18nStart, }, history, + setHeaderActionMenu, kbnUrlStateStorage, usageCollection, navigation, @@ -682,7 +683,10 @@ export class DashboardAppController { }; const dashboardNavBar = document.getElementById('dashboardChrome'); const updateNavBar = () => { - ReactDOM.render(, dashboardNavBar); + ReactDOM.render( + , + dashboardNavBar + ); }; const unmountNavBar = () => { diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index 3dbf6d9d3997e..068e475039865 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -331,6 +331,7 @@ export class DashboardPlugin localStorage: new Storage(localStorage), usageCollection, scopedHistory: () => this.currentHistory!, + setHeaderActionMenu: params.setHeaderActionMenu, savedObjects, restorePreviousUrl, };