From 8282e7f7677e81ab262a5bd963b679a14e4f75c9 Mon Sep 17 00:00:00 2001 From: Josh Dover <1813008+joshdover@users.noreply.github.com> Date: Fri, 2 Apr 2021 15:00:27 +0200 Subject: [PATCH] Add searchDeepLinks for APM --- .../app/Main/route_config/index.tsx | 3 +++ x-pack/plugins/apm/public/plugin.ts | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+) 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 a7cbd7a79b4a7..c5022702cc349 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 @@ -174,6 +174,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', @@ -182,6 +183,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', @@ -335,6 +337,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 382053f133950..47acedb1b4927 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 { ConfigSchema } from '.'; import { FetchDataParams, @@ -138,6 +139,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