From 0bcb85f0b0114b1fbf303757ddb92e028aebda81 Mon Sep 17 00:00:00 2001 From: Spencer Date: Tue, 4 Dec 2018 12:37:48 -0800 Subject: [PATCH] [errors][dev tools] implement k7Breadcrumbs (#26598) * [devTools] set k7Breadcrumbs * [errors] add k7Breadcrumbs to error routes * revert changes to error templates for style * fix br tags --- src/legacy/core_plugins/console/public/console.js | 2 +- src/legacy/core_plugins/kibana/public/dev_tools/index.js | 9 +++++++++ .../error_allow_explicit_index.js | 5 ++++- .../error_auto_create_index/error_auto_create_index.js | 5 ++++- src/ui/public/error_url_overflow/error_url_overflow.js | 1 + 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/legacy/core_plugins/console/public/console.js b/src/legacy/core_plugins/console/public/console.js index 1b586162f4501..c16458c878d7d 100644 --- a/src/legacy/core_plugins/console/public/console.js +++ b/src/legacy/core_plugins/console/public/console.js @@ -36,5 +36,5 @@ require('./src/directives/sense_welcome'); uiRoutes.when('/dev_tools/console', { controller: 'SenseController', - template + template, }); diff --git a/src/legacy/core_plugins/kibana/public/dev_tools/index.js b/src/legacy/core_plugins/kibana/public/dev_tools/index.js index f46369a1b9215..d7a8df57cd23d 100644 --- a/src/legacy/core_plugins/kibana/public/dev_tools/index.js +++ b/src/legacy/core_plugins/kibana/public/dev_tools/index.js @@ -32,6 +32,15 @@ uiRoutes } }); +uiRoutes.defaults(/^\/dev_tools(\/|$)/, { + k7Breadcrumbs: () => [ + { + text: 'Dev Tools', + href: '#/dev_tools' + } + ] +}); + FeatureCatalogueRegistryProvider.register(() => { return { id: 'console', diff --git a/src/ui/public/error_allow_explicit_index/error_allow_explicit_index.js b/src/ui/public/error_allow_explicit_index/error_allow_explicit_index.js index f9f02e167d98b..1cff9607b8842 100644 --- a/src/ui/public/error_allow_explicit_index/error_allow_explicit_index.js +++ b/src/ui/public/error_allow_explicit_index/error_allow_explicit_index.js @@ -26,7 +26,10 @@ import './error_allow_explicit_index.less'; import template from './error_allow_explicit_index.html'; uiRoutes - .when('/error/multi.allow_explicit_index', { template }); + .when('/error/multi.allow_explicit_index', { + template, + k7Breadcrumbs: () => [{ text: 'Error' }], + }); export function ErrorAllowExplicitIndexProvider(Private, Promise) { const kbnUrl = Private(KbnUrlProvider); diff --git a/src/ui/public/error_auto_create_index/error_auto_create_index.js b/src/ui/public/error_auto_create_index/error_auto_create_index.js index e812a3f23cbcd..c95fedbe63469 100644 --- a/src/ui/public/error_auto_create_index/error_auto_create_index.js +++ b/src/ui/public/error_auto_create_index/error_auto_create_index.js @@ -25,7 +25,10 @@ import './error_auto_create_index.less'; import template from './error_auto_create_index.html'; uiRoutes - .when('/error/action.auto_create_index', { template }); + .when('/error/action.auto_create_index', { + template, + k7Breadcrumbs: () => [{ text: 'Error' }], + }); export function isAutoCreateIndexError(error) { return ( diff --git a/src/ui/public/error_url_overflow/error_url_overflow.js b/src/ui/public/error_url_overflow/error_url_overflow.js index 2ca1049b6e91b..87cbf61264115 100644 --- a/src/ui/public/error_url_overflow/error_url_overflow.js +++ b/src/ui/public/error_url_overflow/error_url_overflow.js @@ -29,6 +29,7 @@ export * from './url_overflow_service'; uiRoutes .when('/error/url-overflow', { template, + k7Breadcrumbs: () => [{ text: 'Error' }], controllerAs: 'controller', controller: class OverflowController { constructor(Private, config, $scope) {