Skip to content

Commit

Permalink
wire setHeaderActionMenu API to dashboard app TopNavMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Sep 2, 2020
1 parent b208bde commit abbc1b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/plugins/dashboard/public/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -72,6 +73,7 @@ export interface RenderDeps {
navigateToDefaultApp: KibanaLegacyStart['navigateToDefaultApp'];
navigateToLegacyKibanaUrl: KibanaLegacyStart['navigateToLegacyKibanaUrl'];
scopedHistory: () => ScopedHistory;
setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'];
savedObjects: SavedObjectsStart;
restorePreviousUrl: () => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export class DashboardAppController {
i18n: i18nStart,
},
history,
setHeaderActionMenu,
kbnUrlStateStorage,
usageCollection,
navigation,
Expand Down Expand Up @@ -682,7 +683,10 @@ export class DashboardAppController {
};
const dashboardNavBar = document.getElementById('dashboardChrome');
const updateNavBar = () => {
ReactDOM.render(<navigation.ui.TopNavMenu {...getNavBarProps()} />, dashboardNavBar);
ReactDOM.render(
<navigation.ui.TopNavMenu {...getNavBarProps()} setMenuMountPoint={setHeaderActionMenu} />,
dashboardNavBar
);
};

const unmountNavBar = () => {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/dashboard/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export class DashboardPlugin
localStorage: new Storage(localStorage),
usageCollection,
scopedHistory: () => this.currentHistory!,
setHeaderActionMenu: params.setHeaderActionMenu,
savedObjects,
restorePreviousUrl,
};
Expand Down

0 comments on commit abbc1b3

Please sign in to comment.