Skip to content

Commit

Permalink
commit to the ui/ module prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Jul 22, 2015
1 parent 9e02c78 commit a228174
Show file tree
Hide file tree
Showing 169 changed files with 202 additions and 196 deletions.
4 changes: 2 additions & 2 deletions STYLEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ Kibana is written in Angular, and uses several utility methods to make using Ang
Angular modules are defined using a custom require module named `module`. It is used as follows:

```js
var app = require('modules').get('app/namespace');
var app = require('ui/modules').get('app/namespace');
```

`app` above is a reference to an Angular module, and can be used to define controllers, providers and anything else used in Angular.
Expand Down Expand Up @@ -849,7 +849,7 @@ app.service('CustomService', function(Promise, otherDeps) {
Angular routes are defined using a custom require modules named `routes` that remove much of the required boilerplate.

```js
require('routes')
require('ui/routes')
.when('/my/object/route/:id?', {
// angular route code goes here
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var module = require('modules').get('kibana');
var module = require('ui/modules').get('kibana');

module.directive('lineInterpolationOption', function ($parse, $compile) {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var module = require('modules').get('kibana');
var module = require('ui/modules').get('kibana');
require('ui/directives/inequality');

module.directive('pointSeriesOptions', function ($parse, $compile) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var module = require('modules').get('kibana');
var module = require('ui/modules').get('kibana');

module.directive('vislibBasicOptions', function ($parse, $compile) {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(function (require) {
var moment = require('moment');
var $ = require('jquery');
require('modules')
require('ui/modules')
.get('app/dashboard')
.directive('dashboardPanel', function (savedVisualizations, savedSearches, Notifier, Private, $injector) {
var _ = require('lodash');
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/dashboard/directives/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function (require) {

require('gridster');

var app = require('modules').get('app/dashboard');
var app = require('ui/modules').get('app/dashboard');

app.directive('dashboardGrid', function ($compile, Notifier) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define(function (require) {
require('plugins/kibana/dashboard/services/saved_dashboards');
require('plugins/kibana/dashboard/styles/main.less');

var app = require('modules').get('app/dashboard', [
var app = require('ui/modules').get('app/dashboard', [
'elasticsearch',
'ngRoute',
'kibana/courier',
Expand All @@ -25,7 +25,7 @@ define(function (require) {
'kibana/typeahead'
]);

require('routes')
require('ui/routes')
.when('/dashboard', {
template: require('plugins/kibana/dashboard/index.html'),
resolve: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
var module = require('modules').get('app/dashboard');
var module = require('ui/modules').get('app/dashboard');
var _ = require('lodash');
var moment = require('moment');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
var module = require('modules').get('app/dashboard');
var module = require('ui/modules').get('app/dashboard');
var _ = require('lodash');
// bring in the factory
require('plugins/kibana/dashboard/services/_saved_dashboard');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define(function (require) {
var $ = require('jquery');
var app = require('modules').get('apps/discover');
var app = require('ui/modules').get('apps/discover');
var html = require('plugins/kibana/discover/components/field_chooser/discover_field.html');
var _ = require('lodash');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
var app = require('modules').get('apps/discover');
var app = require('ui/modules').get('apps/discover');

require('ui/directives/css_truncate');
require('ui/directives/field_name');
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/discover/controllers/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ define(function (require) {
require('ui/timefilter/timefilter');
require('ui/highlight/highlight_tags');

var app = require('modules').get('apps/discover', [
var app = require('ui/modules').get('apps/discover', [
'kibana/notify',
'kibana/courier',
'kibana/index_patterns'
]);

require('routes')
require('ui/routes')
.when('/discover/:id?', {
template: require('plugins/kibana/discover/index.html'),
reloadOnSearch: false,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/discover/directives/timechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define(function (require) {
var $ = require('jquery');
var vislib = require('ui/vislib/index');

var app = require('modules').get('apps/discover');
var app = require('ui/modules').get('apps/discover');

app.directive('discoverTimechart', function ($compile) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define(function (require) {

require('ui/notify/notify');

var module = require('modules').get('discover/saved_searches', [
var module = require('ui/modules').get('discover/saved_searches', [
'kibana/notify',
'kibana/courier'
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function (require) {
require('plugins/kibana/discover/saved_searches/_saved_search');
require('ui/notify/notify');

var module = require('modules').get('discover/saved_searches', [
var module = require('ui/modules').get('discover/saved_searches', [
'kibana/notify'
]);

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/doc/controllers/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(function (require) {
require('ui/doc_viewer/doc_viewer');
require('ui/index_patterns/index_patterns');

var app = require('modules').get('apps/doc', [
var app = require('ui/modules').get('apps/doc', [
'kibana/notify',
'kibana/courier',
'kibana/index_patterns'
Expand All @@ -21,7 +21,7 @@ define(function (require) {
}
};

require('routes')
require('ui/routes')
.when('/doc/:indexPattern/:index/:type/:id', {
template: html,
resolve: resolveIndexPattern
Expand Down
11 changes: 10 additions & 1 deletion src/plugins/kibana/public/kibana.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ define(function (require) {
require('plugins/kibana/settings/index');
require('plugins/kibana/doc/index');

require('routes')
// enable prefetching for faster webpack builds
require('ui/vislib/index');
require('ui/vislib/vis');
require('ui/vislib/lib/handler/handler');
require('ui/vislib/lib/layout/layout');
require('ui/vislib/visualizations/tile_map');
require('ui/vislib/lib/handler/types/point_series');
// end prefetching

require('ui/routes')
.otherwise({
redirectTo: '/discover'
});
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ define(function (require, module, exports) {
require('plugins/kibana/settings/styles/main.less');
require('ui/filters/start_from');

require('routes')
require('ui/routes')
.when('/settings', {
redirectTo: '/settings/indices'
});

var sections = require('plugins/kibana/settings/sections/index');

require('modules')
require('ui/modules')
.get('apps/settings')
.directive('kbnSettingsApp', function (Private, $route, timefilter) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/settings/sections/about/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
define(function (require) {
var _ = require('lodash');

require('routes')
require('ui/routes')
.when('/settings/about', {
template: require('plugins/kibana/settings/sections/about/index.html')
});

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.controller('settingsAbout', function ($scope, kbnVersion, buildNum, commitSha) {
$scope.kbnVersion = kbnVersion;
$scope.buildNum = buildNum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(function (require) {
var _ = require('lodash');
require('ui/elastic_textarea');

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('advancedRow', function (config, Notifier, Private) {
return {
restrict: 'A',
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/settings/sections/advanced/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ define(function (require) {

require('plugins/kibana/settings/sections/advanced/advanced_row');

require('routes')
require('ui/routes')
.when('/settings/advanced', {
template: require('plugins/kibana/settings/sections/advanced/index.html')
});

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('kbnSettingsAdvanced', function (config, Notifier, Private, $rootScope) {
return {
restrict: 'E',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
define(function (require) {
var _ = require('lodash');
var moment = require('moment');
var errors = require('errors');
var errors = require('ui/errors');

require('ui/directives/validate_index_name');
require('ui/directives/auto_select_if_only_one');

require('routes')
require('ui/routes')
.when('/settings/indices/', {
template: require('plugins/kibana/settings/sections/indices/_create.html')
});

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.controller('settingsIndicesCreate', function ($scope, kbnUrl, Private, Notifier, indexPatterns, es, config, Promise) {
var notify = new Notifier();
var MissingIndices = errors.IndexPatternMissingIndices;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/settings/sections/indices/_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function (require) {
require('plugins/kibana/settings/sections/indices/_scripted_fields');
require('plugins/kibana/settings/sections/indices/_index_header');

require('routes')
require('ui/routes')
.when('/settings/indices/:indexPatternId', {
template: require('plugins/kibana/settings/sections/indices/_edit.html'),
resolve: {
Expand All @@ -15,7 +15,7 @@ define(function (require) {
}
});

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.controller('settingsIndicesEdit', function ($scope, $location, $route, config, courier, Notifier, Private, AppState, docTitle) {

var notify = new Notifier();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(function (require) {
require('ui/field_editor/field_editor');
require('plugins/kibana/settings/sections/indices/_index_header');

require('routes')
require('ui/routes')
.when('/settings/indices/:indexPatternId/field/:fieldName', { mode: 'edit' })
.when('/settings/indices/:indexPatternId/create-field/', { mode: 'create' })
.defaults(/settings\/indices\/[^\/]+\/(field|create-field)(\/|$)/, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
require('modules')
require('ui/modules')
.get('apps/settings')
.directive('kbnSettingsIndexHeader', function (config) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(function (require) {
var _ = require('lodash');
require('ui/paginated_table/paginated_table');

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('indexedFields', function ($filter) {
var yesTemplate = '<i class="fa fa-check" aria-label="yes"></i>';
var noTemplate = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(function (require) {
var _ = require('lodash');
require('ui/paginated_table/paginated_table');

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('scriptedFields', function (kbnUrl, Notifier, $filter) {
var rowScopes = []; // track row scopes, so they can be destroyed as needed
var popularityHtml = require('plugins/kibana/settings/sections/indices/_field_popularity.html');
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/settings/sections/indices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define(function (require) {
require('plugins/kibana/settings/sections/indices/_field_editor');

// add a dependency to all of the subsection routes
require('routes')
require('ui/routes')
.defaults(/settings\/indices/, {
resolve: {
indexPatternIds: function (courier) {
Expand All @@ -16,7 +16,7 @@ define(function (require) {
});

// wrapper directive, which sets some global stuff up like the left nav
require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('kbnSettingsIndices', function ($route, config, kbnUrl) {
return {
restrict: 'E',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ define(function (require) {

require('ui/directives/file_upload');

require('routes')
require('ui/routes')
.when('/settings/objects', {
template: objectIndexHTML
});

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('kbnSettingsObjects', function (kbnIndex, Notifier, Private, kbnUrl) {
return {
restrict: 'E',
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana/public/settings/sections/objects/_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ define(function (require) {
var registry = require('plugins/kibana/settings/saved_object_registry');
var objectViewHTML = require('plugins/kibana/settings/sections/objects/_view.html');

require('routes')
require('ui/routes')
.when('/settings/objects/:service/:id', {
template: objectViewHTML
});

require('modules').get('apps/settings')
require('ui/modules').get('apps/settings')
.directive('kbnSettingsObjectsView', function (kbnIndex, Notifier) {
return {
restrict: 'E',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define(function (require) {
require('ui/directives/confirm_click');

// add the module deps to this module
require('modules').get('apps/settings', ['ui.ace', 'monospaced.elastic']);
require('ui/modules').get('apps/settings', ['ui.ace', 'monospaced.elastic']);

return {
name: 'objects',
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/visualize/editor/agg.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
require('modules')
require('ui/modules')
.get('app/visualize')
.directive('visEditorAgg', function ($compile, $parse, $filter, Private, Notifier) {
require('plugins/kibana/visualize/editor/agg_params');
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/visualize/editor/agg_add.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(function (require) {
require('modules')
require('ui/modules')
.get('kibana')
.directive('visEditorAggAdd', function (Private) {
var AggConfig = Private(require('ui/vis/AggConfig'));
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana/public/visualize/editor/agg_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(function (require) {
var _ = require('lodash');
var propFilter = require('ui/filters/_prop_filter');

require('modules')
require('ui/modules')
.get('kibana')
.filter('aggFilter', function () {
return propFilter('name');
Expand Down
Loading

0 comments on commit a228174

Please sign in to comment.