diff --git a/src/plugins/kibana/public/dashboard/index.js b/src/plugins/kibana/public/dashboard/index.js index e8322ea212c16..4a1aac707f928 100644 --- a/src/plugins/kibana/public/dashboard/index.js +++ b/src/plugins/kibana/public/dashboard/index.js @@ -35,6 +35,7 @@ const app = uiModules.get('app/dashboard', [ uiRoutes .when('/dashboard', { template: indexTemplate, + requireDefaultIndex: true, resolve: { dash: function (savedDashboards, config) { return savedDashboards.get(); diff --git a/src/plugins/kibana/public/discover/controllers/discover.js b/src/plugins/kibana/public/discover/controllers/discover.js index 87ce5f4f74e0b..2d4b690af3308 100644 --- a/src/plugins/kibana/public/discover/controllers/discover.js +++ b/src/plugins/kibana/public/discover/controllers/discover.js @@ -39,6 +39,7 @@ uiRoutes .when('/discover/:id?', { template: indexTemplate, reloadOnSearch: false, + requireDefaultIndex: true, resolve: { ip: function (Promise, courier, config, $location) { return courier.indexPatterns.getIds() diff --git a/src/plugins/kibana/public/management/index.js b/src/plugins/kibana/public/management/index.js index a2dbc1fffe369..7b33fb4af0aed 100644 --- a/src/plugins/kibana/public/management/index.js +++ b/src/plugins/kibana/public/management/index.js @@ -16,8 +16,7 @@ import management from 'ui/management'; uiRoutes .when('/management', { - template: landingTemplate, - requireDefaultIndex: false + template: landingTemplate }); require('ui/index_patterns/route_setup/load_default')({ diff --git a/src/plugins/kibana/public/management/sections/indices/index.js b/src/plugins/kibana/public/management/sections/indices/index.js index 7f80d13d02b81..bd68680435f9c 100644 --- a/src/plugins/kibana/public/management/sections/indices/index.js +++ b/src/plugins/kibana/public/management/sections/indices/index.js @@ -17,13 +17,12 @@ const indexPatternsResolutions = { uiRoutes .defaults(/management\/kibana\/indices/, { resolve: indexPatternsResolutions, - requireDefaultIndex: false + requireDefaultIndex: true }); uiRoutes .defaults(/management\/data\/index/, { - resolve: indexPatternsResolutions, - requireDefaultIndex: false + resolve: indexPatternsResolutions }); // wrapper directive, which sets some global stuff up like the left nav diff --git a/src/plugins/kibana/public/management/sections/indices/upload/index.js b/src/plugins/kibana/public/management/sections/indices/upload/index.js index 902a65f48c5ac..2a01be59ec229 100644 --- a/src/plugins/kibana/public/management/sections/indices/upload/index.js +++ b/src/plugins/kibana/public/management/sections/indices/upload/index.js @@ -4,8 +4,7 @@ import template from 'plugins/kibana/management/sections/indices/upload/index.ht import './directives/upload_wizard'; routes.when('/management/data/csv/', { - template: template, - requireDefaultIndex: false + template: template }); management.getSection('data').register('csv', { diff --git a/src/plugins/kibana/public/visualize/editor/editor.js b/src/plugins/kibana/public/visualize/editor/editor.js index 580bbb0aec632..1506650533142 100644 --- a/src/plugins/kibana/public/visualize/editor/editor.js +++ b/src/plugins/kibana/public/visualize/editor/editor.js @@ -21,6 +21,7 @@ import editorTemplate from 'plugins/kibana/visualize/editor/editor.html'; uiRoutes .when('/visualize/create', { template: editorTemplate, + requireDefaultIndex: true, resolve: { savedVis: function (savedVisualizations, courier, $route, Private) { const visTypes = Private(RegistryVisTypesProvider); diff --git a/src/plugins/kibana/public/visualize/index.js b/src/plugins/kibana/public/visualize/index.js index 88f684f59ccb9..8942f9b4103e7 100644 --- a/src/plugins/kibana/public/visualize/index.js +++ b/src/plugins/kibana/public/visualize/index.js @@ -21,7 +21,8 @@ import uiRoutes from 'ui/routes'; uiRoutes .when('/visualize', { - redirectTo: '/visualize/step/1' + redirectTo: '/visualize/step/1', + requireDefaultIndex: true }); // preloading diff --git a/src/plugins/kibana/public/visualize/wizard/wizard.js b/src/plugins/kibana/public/visualize/wizard/wizard.js index 64d71203d56bb..d895a3b0963bc 100644 --- a/src/plugins/kibana/public/visualize/wizard/wizard.js +++ b/src/plugins/kibana/public/visualize/wizard/wizard.js @@ -18,7 +18,8 @@ const module = uiModules.get('app/visualize', ['kibana/courier']); /** Wizard Step 1 /********/ routes.when('/visualize/step/1', { - template: templateStep(1, require('plugins/kibana/visualize/wizard/step_1.html')) + template: templateStep(1, require('plugins/kibana/visualize/wizard/step_1.html')), + requireDefaultIndex: true }); module.controller('VisualizeWizardStep1', function ($scope, $route, $location, timefilter, Private) { @@ -36,6 +37,7 @@ module.controller('VisualizeWizardStep1', function ($scope, $route, $location, t /********/ routes.when('/visualize/step/2', { template: templateStep(2, require('plugins/kibana/visualize/wizard/step_2.html')), + requireDefaultIndex: true, resolve: { indexPatternIds: function (courier) { return courier.indexPatterns.getIds(); diff --git a/src/ui/public/routes/__tests__/_route_manager.js b/src/ui/public/routes/__tests__/_route_manager.js index 68ff072579f6c..c854d88325400 100644 --- a/src/ui/public/routes/__tests__/_route_manager.js +++ b/src/ui/public/routes/__tests__/_route_manager.js @@ -101,14 +101,14 @@ describe('routes/route_manager', function () { expect($rp.when.lastCall.args[1]).to.have.property('reloadOnSearch', true); }); - it('sets route.requireDefaultIndex to true by default', function () { + it('sets route.requireDefaultIndex to false by default', function () { routes.when('/nothing-set'); routes.when('/no-index-required', { requireDefaultIndex: false }); routes.when('/index-required', { requireDefaultIndex: true }); routes.config($rp); expect($rp.when.callCount).to.be(3); - expect($rp.when.firstCall.args[1]).to.have.property('requireDefaultIndex', true); + expect($rp.when.firstCall.args[1]).to.have.property('requireDefaultIndex', false); expect($rp.when.secondCall.args[1]).to.have.property('requireDefaultIndex', false); expect($rp.when.lastCall.args[1]).to.have.property('requireDefaultIndex', true); }); diff --git a/src/ui/public/routes/route_manager.js b/src/ui/public/routes/route_manager.js index 44e8ceb51893f..e06c9fc6e55d5 100644 --- a/src/ui/public/routes/route_manager.js +++ b/src/ui/public/routes/route_manager.js @@ -27,7 +27,7 @@ function RouteManager() { } if (route.requireDefaultIndex === void 0) { - route.requireDefaultIndex = true; + route.requireDefaultIndex = false; } wrapRouteWithPrep(route, setup);