Skip to content

Commit

Permalink
Require index for all routes under {discover,visualize,dashboard}
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Jun 22, 2016
1 parent 14ef797 commit af84452
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/plugins/kibana/public/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
import indexTemplate from 'plugins/kibana/dashboard/index.html';



require('ui/saved_objects/saved_object_registry').register(require('plugins/kibana/dashboard/services/saved_dashboard_register'));


const app = uiModules.get('app/dashboard', [
'elasticsearch',
'ngRoute',
Expand All @@ -33,9 +30,11 @@ const app = uiModules.get('app/dashboard', [
]);

uiRoutes
.defaults(/dashboard/, {
requireDefaultIndex: true
})
.when('/dashboard', {
template: indexTemplate,
requireDefaultIndex: true,
resolve: {
dash: function (savedDashboards, config) {
return savedDashboards.get();
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/kibana/public/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ const app = uiModules.get('apps/discover', [
]);

uiRoutes
.defaults(/discover/, {
requireDefaultIndex: true
})
.when('/discover/:id?', {
template: indexTemplate,
reloadOnSearch: false,
requireDefaultIndex: true,
resolve: {
ip: function (Promise, courier, config, $location) {
return courier.indexPatterns.getIds()
Expand Down
1 change: 0 additions & 1 deletion src/plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ 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);
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/kibana/public/visualize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import uiRoutes from 'ui/routes';


uiRoutes
.when('/visualize', {
redirectTo: '/visualize/step/1',
.defaults(/visualize/, {
requireDefaultIndex: true
})
.when('/visualize', {
redirectTo: '/visualize/step/1'
});

// preloading

require('ui/saved_objects/saved_object_registry')
.register(require('plugins/kibana/visualize/saved_visualizations/saved_visualization_register'));

4 changes: 1 addition & 3 deletions src/plugins/kibana/public/visualize/wizard/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ 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')),
requireDefaultIndex: true
template: templateStep(1, require('plugins/kibana/visualize/wizard/step_1.html'))
});

module.controller('VisualizeWizardStep1', function ($scope, $route, $location, timefilter, Private) {
Expand All @@ -37,7 +36,6 @@ 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();
Expand Down

0 comments on commit af84452

Please sign in to comment.