diff --git a/src/plugins/kibana/public/dashboard/index.html b/src/plugins/kibana/public/dashboard/index.html index 042f90b7aba60..304950296b29f 100644 --- a/src/plugins/kibana/public/dashboard/index.html +++ b/src/plugins/kibana/public/dashboard/index.html @@ -14,47 +14,47 @@ -
+ - +

Ready to get started?

-

Click the button in the menu bar above to add a visualization to the dashboard.
If you haven't setup a visualization yet visit the "Visualize" tab to create your first visualization.

+

Click the button in the menu bar above to add a visualization to the dashboard.
If you haven't setup a visualization yet visit the "Visualize" tab to create your first visualization.

diff --git a/src/plugins/kibana/public/dashboard/index.js b/src/plugins/kibana/public/dashboard/index.js index ec86550d73467..da92505861adf 100644 --- a/src/plugins/kibana/public/dashboard/index.js +++ b/src/plugins/kibana/public/dashboard/index.js @@ -1,7 +1,6 @@ import _ from 'lodash'; import $ from 'jquery'; import angular from 'angular'; -import ConfigTemplate from 'ui/config_template'; import chrome from 'ui/chrome'; import 'ui/directives/config'; import 'ui/courier'; @@ -100,7 +99,7 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, }); $scope.$watch('state.options.darkTheme', setDarkTheme); - $scope.configTemplate = new ConfigTemplate({ + $scope.configTemplates = { save: require('plugins/kibana/dashboard/partials/save_dashboard.html'), load: require('plugins/kibana/dashboard/partials/load_dashboard.html'), share: require('plugins/kibana/dashboard/partials/share.html'), @@ -108,7 +107,7 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, options: require('plugins/kibana/dashboard/partials/options.html'), filter: require('ui/chrome/config/filter.html'), interval: require('ui/chrome/config/interval.html') - }); + }; $scope.refresh = _.bindKey(courier, 'fetch'); @@ -198,7 +197,7 @@ app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, dash.save() .then(function (id) { - $scope.configTemplate.close('save'); + $scope.kbnTopNavbar.close('save'); if (id) { notify.info('Saved Dashboard as "' + dash.title + '"'); if (dash.id !== $routeParams.id) { diff --git a/src/plugins/kibana/public/discover/controllers/discover.js b/src/plugins/kibana/public/discover/controllers/discover.js index 9790b05e60f32..ac8aee55ff100 100644 --- a/src/plugins/kibana/public/discover/controllers/discover.js +++ b/src/plugins/kibana/public/discover/controllers/discover.js @@ -1,7 +1,6 @@ import _ from 'lodash'; import angular from 'angular'; import moment from 'moment'; -import ConfigTemplate from 'ui/config_template'; import getSort from 'ui/doc_table/lib/get_sort'; import rison from 'ui/utils/rison'; import dateMath from 'ui/utils/date_math'; @@ -97,13 +96,13 @@ app.controller('discover', function ($scope, config, courier, $route, $window, N $scope.showInterval = !$scope.showInterval; }; // config panel templates - $scope.configTemplate = new ConfigTemplate({ + $scope.configTemplates = { load: require('plugins/kibana/discover/partials/load_search.html'), save: require('plugins/kibana/discover/partials/save_search.html'), share: require('plugins/kibana/discover/partials/share_search.html'), filter: require('ui/chrome/config/filter.html'), interval: require('ui/chrome/config/interval.html') - }); + }; $scope.timefilter = timefilter; @@ -287,7 +286,7 @@ app.controller('discover', function ($scope, config, courier, $route, $window, N return savedSearch.save() .then(function (id) { - $scope.configTemplate.close('save'); + $scope.kbnTopNavbar.close('save'); if (id) { notify.info('Saved Data Source "' + savedSearch.title + '"'); diff --git a/src/plugins/kibana/public/discover/index.html b/src/plugins/kibana/public/discover/index.html index bf39d0e25d9de..0aa73c00897ad 100644 --- a/src/plugins/kibana/public/discover/index.html +++ b/src/plugins/kibana/public/discover/index.html @@ -16,37 +16,33 @@ New -
+ - +
diff --git a/src/plugins/kibana/public/visualize/editor/editor.html b/src/plugins/kibana/public/visualize/editor/editor.html index 141d7c06d66c8..59d435d369a41 100644 --- a/src/plugins/kibana/public/visualize/editor/editor.html +++ b/src/plugins/kibana/public/visualize/editor/editor.html @@ -12,10 +12,10 @@ @@ -25,18 +25,18 @@ Save @@ -45,14 +45,13 @@ aria-label="Refresh"> Refresh -
+
- - + templates="configTemplates"> +
diff --git a/src/plugins/kibana/public/visualize/editor/editor.js b/src/plugins/kibana/public/visualize/editor/editor.js index 275b9d4164825..df3337165c4c4 100644 --- a/src/plugins/kibana/public/visualize/editor/editor.js +++ b/src/plugins/kibana/public/visualize/editor/editor.js @@ -7,7 +7,6 @@ import 'ui/visualize'; import 'ui/collapsible_sidebar'; import 'ui/share'; import angular from 'angular'; -import ConfigTemplate from 'ui/config_template'; import Notifier from 'ui/notify/notifier'; import RegistryVisTypesProvider from 'ui/registry/vis_types'; import DocTitleProvider from 'ui/doc_title'; @@ -81,13 +80,13 @@ uiModules const searchSource = savedVis.searchSource; // config panel templates - const configTemplate = new ConfigTemplate({ + $scope.configTemplates = { save: require('plugins/kibana/visualize/editor/panels/save.html'), load: require('plugins/kibana/visualize/editor/panels/load.html'), share: require('plugins/kibana/visualize/editor/panels/share.html'), filter: require('ui/chrome/config/filter.html'), interval: require('ui/chrome/config/interval.html') - }); + }; if (savedVis.id) { docTitle.change(savedVis.title); @@ -129,7 +128,6 @@ uiModules $scope.uiState = $state.makeStateful('uiState'); $scope.timefilter = timefilter; $scope.opts = _.pick($scope, 'doSave', 'savedVis', 'shareData', 'timefilter'); - $scope.configTemplate = configTemplate; editableVis.listeners.click = vis.listeners.click = filterBarClickHandler($state); editableVis.listeners.brush = vis.listeners.brush = brushEvent; @@ -235,7 +233,7 @@ uiModules savedVis.save() .then(function (id) { - configTemplate.close('save'); + $scope.kbnTopNavbar.close('save'); if (id) { notify.info('Saved Visualization "' + savedVis.title + '"'); diff --git a/src/ui/public/autoload/modules.js b/src/ui/public/autoload/modules.js index 5919a14605474..32aef92c482e3 100644 --- a/src/ui/public/autoload/modules.js +++ b/src/ui/public/autoload/modules.js @@ -1,6 +1,5 @@ import 'angular'; import 'ui/chrome'; -import 'ui/chrome/context'; import 'ui/bind'; import 'ui/bound_to_config_obj'; import 'ui/config'; diff --git a/src/ui/public/chrome/__tests__/kbn_loading_indicator.js b/src/ui/public/chrome/__tests__/kbn_loading_indicator.js new file mode 100644 index 0000000000000..f24f88d60a2c1 --- /dev/null +++ b/src/ui/public/chrome/__tests__/kbn_loading_indicator.js @@ -0,0 +1,47 @@ +import ngMock from 'ng_mock'; +import expect from 'expect.js'; +import uiModules from 'ui/modules'; +import $ from 'jquery'; + +import '../directives/kbn_loading_indicator'; + + +describe('kbnLoadingIndicator', function () { + let compile; + + beforeEach(() => { + ngMock.module('kibana'); + ngMock.inject(function ($compile, $rootScope) { + compile = function (hasActiveConnections) { + $rootScope.chrome = { + httpActive: (hasActiveConnections ? [1] : []) + }; + const $el = $('
'); + $rootScope.$apply(); + $compile($el)($rootScope); + return $el; + }; + }); + + }); + + it('injects a loading .spinner into the element', function () { + const $el = compile(); + expect($el.find('.spinner')).to.have.length(1); + }); + // Doesn't work... + xit('applies the ng-hide class when there are no connections', function () { + const $el = compile(false); + expect($el.find('.spinner.ng-hide')).to.have.length(1); + }); + it('applies removes ng-hide class when there are connections', function () { + const $el = compile(true); + expect($el.find('.spinner.ng-hide')).to.have.length(0); + }); + + it('doesn\'t modify the contents of what the elment already has', function () { + const $el = compile(); + expect($el.find('#other-content')).to.have.length(1); + }); + +}); diff --git a/src/ui/public/chrome/chrome.html b/src/ui/public/chrome/chrome.html index 465b9525c5fdd..75cbaaf9ee49f 100644 --- a/src/ui/public/chrome/chrome.html +++ b/src/ui/public/chrome/chrome.html @@ -1,6 +1,6 @@
-