diff --git a/src/plugins/dev_tools/public/dev_tool.ts b/src/plugins/dev_tools/public/dev_tool.ts index 197e93f20a539..8adfd4c76482d 100644 --- a/src/plugins/dev_tools/public/dev_tool.ts +++ b/src/plugins/dev_tools/public/dev_tool.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { ReactNode } from 'react'; import { AppMount } from 'src/core/public'; /** @@ -26,8 +27,9 @@ export class DevToolApp { /** * The human readable name of the dev tool. Should be internationalized. * This will be used as a label in the tab above the actual tool. + * May also be a ReactNode. */ - public readonly title: string; + public readonly title: ReactNode; public readonly mount: AppMount; /** @@ -55,7 +57,7 @@ export class DevToolApp { constructor( id: string, - title: string, + title: ReactNode, mount: AppMount, enableRouting: boolean, order: number, diff --git a/src/plugins/dev_tools/public/plugin.ts b/src/plugins/dev_tools/public/plugin.ts index 6cf3c57d19ac8..e9f5d206de918 100644 --- a/src/plugins/dev_tools/public/plugin.ts +++ b/src/plugins/dev_tools/public/plugin.ts @@ -7,7 +7,7 @@ */ import { BehaviorSubject } from 'rxjs'; -import { Plugin, CoreSetup, AppMountParameters } from 'src/core/public'; +import { Plugin, CoreSetup, AppMountParameters, AppSearchDeepLink } from 'src/core/public'; import { AppUpdater } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { sortBy } from 'lodash'; @@ -84,6 +84,20 @@ export class DevToolsPlugin implements Plugin { public start() { if (this.getSortedDevTools().length === 0) { this.appStateUpdater.next(() => ({ navLinkStatus: AppNavLinkStatus.hidden })); + } else { + this.appStateUpdater.next(() => { + const deepLinks: AppSearchDeepLink[] = [...this.devTools.values()] + .filter( + // Some tools do not use a string title, so we filter those out + (tool) => !tool.enableRouting && !tool.isDisabled() && typeof tool.title === 'string' + ) + .map((tool) => ({ + id: tool.id, + title: tool.title as string, + path: `#/${tool.id}`, + })); + return { meta: { searchDeepLinks: deepLinks } }; + }); } } diff --git a/x-pack/plugins/apm/public/components/app/Main/route_config/index.tsx b/x-pack/plugins/apm/public/components/app/Main/route_config/index.tsx index 0ed9c5c919ddb..9410fd00411e3 100644 --- a/x-pack/plugins/apm/public/components/app/Main/route_config/index.tsx +++ b/x-pack/plugins/apm/public/components/app/Main/route_config/index.tsx @@ -173,6 +173,7 @@ export const routes: APMRouteDefinition[] = [ render: renderAsRedirectTo('/services'), breadcrumb: 'APM', }, + // !! Need to be kept in sync with the searchDeepLinks in x-pack/plugins/apm/public/plugin.ts { exact: true, path: '/services', @@ -181,6 +182,7 @@ export const routes: APMRouteDefinition[] = [ defaultMessage: 'Services', }), }, + // !! Need to be kept in sync with the searchDeepLinks in x-pack/plugins/apm/public/plugin.ts { exact: true, path: '/traces', @@ -326,6 +328,7 @@ export const routes: APMRouteDefinition[] = [ component: TraceLink, breadcrumb: null, }, + // !! Need to be kept in sync with the searchDeepLinks in x-pack/plugins/apm/public/plugin.ts { exact: true, path: '/service-map', diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index 143076e56c831..6ba9689535084 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { i18n } from '@kbn/i18n'; import type { ConfigSchema } from '.'; import { AppMountParameters, @@ -143,6 +144,32 @@ export class ApmPlugin implements Plugin { appRoute: '/app/apm', icon: 'plugins/apm/public/icon.svg', category: DEFAULT_APP_CATEGORIES.observability, + meta: { + // !! Need to be kept in sync with the routes in x-pack/plugins/apm/public/components/app/Main/route_config/index.tsx + searchDeepLinks: [ + { + id: 'services', + title: i18n.translate('xpack.apm.breadcrumb.servicesTitle', { + defaultMessage: 'Services', + }), + path: '/services', + }, + { + id: 'traces', + title: i18n.translate('xpack.apm.breadcrumb.tracesTitle', { + defaultMessage: 'Traces', + }), + path: '/traces', + }, + { + id: 'service-map', + title: i18n.translate('xpack.apm.breadcrumb.serviceMapTitle', { + defaultMessage: 'Service Map', + }), + path: '/service-map', + }, + ], + }, async mount(params: AppMountParameters) { // Load application bundle and Get start services diff --git a/x-pack/plugins/infra/public/pages/logs/page_content.tsx b/x-pack/plugins/infra/public/pages/logs/page_content.tsx index 648915ad4075c..d43fe198c5077 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/page_content.tsx @@ -40,6 +40,7 @@ export const LogsPageContent: React.FunctionComponent = () => { initialize(); }); + // !! Need to be kept in sync with the searchDeepLinks in x-pack/plugins/infra/public/plugin.ts const streamTab = { app: 'logs', title: streamTabTitle, diff --git a/x-pack/plugins/infra/public/pages/metrics/index.tsx b/x-pack/plugins/infra/public/pages/metrics/index.tsx index 51cc4ca098483..b43d7640f6390 100644 --- a/x-pack/plugins/infra/public/pages/metrics/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/index.tsx @@ -120,6 +120,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { > + {/** !! Need to be kept in sync with the searchDeepLinks in x-pack/plugins/infra/public/plugin.ts */} { // mount callback should not use setup dependencies, get start dependencies instead @@ -82,6 +115,32 @@ export class Plugin implements InfraClientPluginClass { order: 8200, appRoute: '/app/metrics', category: DEFAULT_APP_CATEGORIES.observability, + meta: { + // !! Need to be kept in sync with the routes in x-pack/plugins/infra/public/pages/metrics/index.tsx + searchDeepLinks: [ + { + id: 'inventory', + title: i18n.translate('xpack.infra.homePage.inventoryTabTitle', { + defaultMessage: 'Inventory', + }), + path: '/inventory', + }, + { + id: 'metrics-explorer', + title: i18n.translate('xpack.infra.homePage.metricsExplorerTabTitle', { + defaultMessage: 'Metrics Explorer', + }), + path: '/explorer', + }, + { + id: 'settings', + title: i18n.translate('xpack.infra.homePage.settingsTabTitle', { + defaultMessage: 'Settings', + }), + path: '/settings', + }, + ], + }, mount: async (params: AppMountParameters) => { // mount callback should not use setup dependencies, get start dependencies instead const [coreStart, pluginsStart] = await core.getStartServices();