From 2ba07ee43d68d476af3b77bc5543ae69a4e41da0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 01:13:50 -0700 Subject: [PATCH] fix: register right navigation for dev tool only when console is enabled (#6701) (#6708) (cherry picked from commit b5121d37a66f067148056ca9a404634f3a682f94) Signed-off-by: tygao Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- src/plugins/dev_tools/public/plugin.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/plugins/dev_tools/public/plugin.ts b/src/plugins/dev_tools/public/plugin.ts index 45f07f8d651e..e2f3d0cf45e3 100644 --- a/src/plugins/dev_tools/public/plugin.ts +++ b/src/plugins/dev_tools/public/plugin.ts @@ -137,19 +137,21 @@ export class DevToolsPlugin implements Plugin { public start(core: CoreStart) { if (this.getSortedDevTools().length === 0) { this.appStateUpdater.next(() => ({ navLinkStatus: AppNavLinkStatus.hidden })); + } else { + // Register right navigation for dev tool only when console is enabled. + core.chrome.navControls.registerRight({ + order: RightNavigationOrder.DevTool, + mount: toMountPoint( + React.createElement(RightNavigationButton, { + appId: this.id, + iconType: 'consoleApp', + title: this.title, + application: core.application, + http: core.http, + }) + ), + }); } - core.chrome.navControls.registerRight({ - order: RightNavigationOrder.DevTool, - mount: toMountPoint( - React.createElement(RightNavigationButton, { - appId: this.id, - iconType: 'consoleApp', - title: this.title, - application: core.application, - http: core.http, - }) - ), - }); } public stop() {}