Skip to content

Commit

Permalink
Default to named ui/public: a to m (elastic#11200)
Browse files Browse the repository at this point in the history
* Convert remaining export default's in ui/public

* Chunk 2

* Part 3

* Part 4

* Part 5

Note: Must check in https://github.com/elastic/x-pack-kibana/pull/938
first

* Part 6

* Part 6

* Part 8

* Part 9

* address code review comments
  • Loading branch information
stacey-gammon committed Apr 16, 2017
1 parent 077e295 commit 8b573c0
Show file tree
Hide file tree
Showing 264 changed files with 655 additions and 601 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import KbnTopNavControllerProvider from 'ui/kbn_top_nav/kbn_top_nav_controller';
import { KbnTopNavControllerProvider } from 'ui/kbn_top_nav/kbn_top_nav_controller';
import storage from '../storage';

export function SenseTopNavController(Private) {
Expand Down Expand Up @@ -32,8 +32,8 @@ export function SenseTopNavController(Private) {
]);

if (storage.get('version_welcome_shown') !== '@@SENSE_REVISION') {
controller.open('welcome')
controller.open('welcome');
}

return controller
return controller;
}
8 changes: 4 additions & 4 deletions src/core_plugins/kibana/public/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { DashboardViewMode } from './dashboard_view_mode';
import { TopNavIds } from './top_nav/top_nav_ids';
import { ConfirmationButtonTypes } from 'ui/modals/confirm_modal';
import dashboardTemplate from 'plugins/kibana/dashboard/dashboard.html';
import FilterBarQueryFilterProvider from 'ui/filter_bar/query_filter';
import DocTitleProvider from 'ui/doc_title';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
import { DocTitleProvider } from 'ui/doc_title';
import { getTopNavConfig } from './top_nav/get_top_nav_config';
import { DashboardConstants, createDashboardEditUrl } from './dashboard_constants';
import { VisualizeConstants } from 'plugins/kibana/visualize/visualize_constants';
import UtilsBrushEventProvider from 'ui/utils/brush_event';
import FilterBarFilterBarClickHandlerProvider from 'ui/filter_bar/filter_bar_click_handler';
import { FilterBarClickHandlerProvider } from 'ui/filter_bar/filter_bar_click_handler';
import { DashboardState } from './dashboard_state';
import notify from 'ui/notify';

Expand Down Expand Up @@ -71,7 +71,7 @@ uiRoutes

app.directive('dashboardApp', function (Notifier, courier, AppState, timefilter, quickRanges, kbnUrl, confirmModal, Private) {
const brushEvent = Private(UtilsBrushEventProvider);
const filterBarClickHandler = Private(FilterBarFilterBarClickHandlerProvider);
const filterBarClickHandler = Private(FilterBarClickHandlerProvider);

return {
restrict: 'E',
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/dashboard/grid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import $ from 'jquery';
import Binder from 'ui/binder';
import { Binder } from 'ui/binder';
import chrome from 'ui/chrome';
import 'gridster';
import uiModules from 'ui/modules';
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/dashboard/panel/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'ui/visualize';
import 'ui/doc_table';
import * as columnActions from 'ui/doc_table/actions/columns';
import 'plugins/kibana/dashboard/panel/get_object_loaders_for_dashboard';
import FilterManagerProvider from 'ui/filter_manager';
import { FilterManagerProvider } from 'ui/filter_manager';
import uiModules from 'ui/modules';
import panelTemplate from 'plugins/kibana/dashboard/panel/panel.html';
import { savedObjectManagementRegistry } from 'plugins/kibana/management/saved_object_registry';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import _ from 'lodash';
import $ from 'jquery';
import rison from 'rison-node';
import { fieldCalculator } from 'plugins/kibana/discover/components/field_chooser/lib/field_calculator';
import IndexPatternsFieldListProvider from 'ui/index_patterns/_field_list';
import { IndexPatternsFieldListProvider } from 'ui/index_patterns/_field_list';
import uiModules from 'ui/modules';
import fieldChooserTemplate from 'plugins/kibana/discover/components/field_chooser/field_chooser.html';
const app = uiModules.get('apps/discover');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import angular from 'angular';
import moment from 'moment';
import getSort from 'ui/doc_table/lib/get_sort';
import { getSort } from 'ui/doc_table/lib/get_sort';
import * as columnActions from 'ui/doc_table/actions/columns';
import dateMath from '@elastic/datemath';
import 'ui/doc_table';
Expand All @@ -16,11 +16,11 @@ import 'ui/state_management/app_state';
import 'ui/timefilter';
import 'ui/share';
import VisProvider from 'ui/vis';
import DocTitleProvider from 'ui/doc_title';
import { DocTitleProvider } from 'ui/doc_title';
import UtilsBrushEventProvider from 'ui/utils/brush_event';
import PluginsKibanaDiscoverHitSortFnProvider from 'plugins/kibana/discover/_hit_sort_fn';
import FilterBarQueryFilterProvider from 'ui/filter_bar/query_filter';
import FilterManagerProvider from 'ui/filter_manager';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
import { FilterManagerProvider } from 'ui/filter_manager';
import { AggTypesBucketsIntervalOptionsProvider } from 'ui/agg_types/buckets/_interval_options';
import stateMonitorFactory from 'ui/state_management/state_monitor_factory';
import uiRoutes from 'ui/routes';
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/management/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
import appTemplate from 'plugins/kibana/management/app.html';
import landingTemplate from 'plugins/kibana/management/landing.html';
import management from 'ui/management';
import { management } from 'ui/management';
import 'ui/kbn_top_nav';

uiRoutes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fieldNameHtml from './field_name.html';
import fieldTypeHtml from './field_type.html';
import fieldControlsHtml from '../field_controls.html';
import uiModules from 'ui/modules';
import FieldWildcardProvider from 'ui/field_wildcard';
import { FieldWildcardProvider } from 'ui/field_wildcard';
import template from './indexed_fields_table.html';

uiModules.get('apps/management')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'ui/field_editor';
import IndexPatternsFieldProvider from 'ui/index_patterns/_field';
import { IndexPatternsFieldProvider } from 'ui/index_patterns/_field';
import UrlProvider from 'ui/url';
import uiRoutes from 'ui/routes';
import template from './scripted_field_editor.html';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { find, each, escape, invoke, size, without } from 'lodash';

import uiModules from 'ui/modules';
import Notifier from 'ui/notify/notifier';
import FieldWildcardProvider from 'ui/field_wildcard';
import { FieldWildcardProvider } from 'ui/field_wildcard';

import controlsHtml from './controls.html';
import filterHtml from './filter.html';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import management from 'ui/management';
import { management } from 'ui/management';
import './create_index_pattern';
import './edit_index_pattern';
import uiRoutes from 'ui/routes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import angular from 'angular';
import rison from 'rison-node';
import { savedObjectManagementRegistry } from 'plugins/kibana/management/saved_object_registry';
import objectViewHTML from 'plugins/kibana/management/sections/objects/_view.html';
import IndexPatternsCastMappingTypeProvider from 'ui/index_patterns/_cast_mapping_type';
import { IndexPatternsCastMappingTypeProvider } from 'ui/index_patterns/_cast_mapping_type';
import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import management from 'ui/management';
import { management } from 'ui/management';
import 'plugins/kibana/management/sections/objects/_view';
import 'plugins/kibana/management/sections/objects/_objects';
import 'ace';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import { toEditableConfig } from 'plugins/kibana/management/sections/settings/lib/to_editable_config';
import 'plugins/kibana/management/sections/settings/advanced_row';
import management from 'ui/management';
import { management } from 'ui/management';
import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
import indexTemplate from 'plugins/kibana/management/sections/settings/index.html';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import propFilter from 'ui/filters/_prop_filter';
import { propFilter } from 'ui/filters/_prop_filter';
import uiModules from 'ui/modules';

uiModules
Expand Down
8 changes: 4 additions & 4 deletions src/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import chrome from 'ui/chrome';
import angular from 'angular';
import Notifier from 'ui/notify/notifier';
import RegistryVisTypesProvider from 'ui/registry/vis_types';
import DocTitleProvider from 'ui/doc_title';
import { DocTitleProvider } from 'ui/doc_title';
import UtilsBrushEventProvider from 'ui/utils/brush_event';
import FilterBarQueryFilterProvider from 'ui/filter_bar/query_filter';
import FilterBarFilterBarClickHandlerProvider from 'ui/filter_bar/filter_bar_click_handler';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
import { FilterBarClickHandlerProvider } from 'ui/filter_bar/filter_bar_click_handler';
import stateMonitorFactory from 'ui/state_management/state_monitor_factory';
import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
Expand Down Expand Up @@ -70,7 +70,7 @@ function VisEditor($rootScope, $scope, $route, timefilter, AppState, $window, kb
const docTitle = Private(DocTitleProvider);
const brushEvent = Private(UtilsBrushEventProvider);
const queryFilter = Private(FilterBarQueryFilterProvider);
const filterBarClickHandler = Private(FilterBarFilterBarClickHandlerProvider);
const filterBarClickHandler = Private(FilterBarClickHandlerProvider);

const notify = new Notifier({
location: 'Visualization Editor'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import createNewPanel from '../lib/create_new_panel';
import '../directives/vis_editor';
import _ from 'lodash';
import angular from 'angular';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';

const app = modules.get('kibana/metrics_vis', ['kibana']);
app.controller('MetricsEditorController', (
$location,
Expand All @@ -15,7 +17,7 @@ app.controller('MetricsEditorController', (
) => {

$scope.embedded = $location.search().embed === 'true';
const queryFilter = Private(require('ui/filter_bar/query_filter'));
const queryFilter = Private(FilterBarQueryFilterProvider);
const createFetch = Private(require('../lib/fetch'));
const fetch = () => {
const fn = createFetch($scope);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import modules from 'ui/modules';
import 'ui/state_management/app_state';
import '../directives/visualization';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';

const app = modules.get('kibana/metrics_vis');

app.controller('MetricsVisController', (
Expand All @@ -24,7 +26,7 @@ app.controller('MetricsVisController', (
$scope.reversed = Boolean(newValue);
});

const queryFilter = Private(require('ui/filter_bar/query_filter'));
const queryFilter = Private(FilterBarQueryFilterProvider);
const createFetch = Private(require('../lib/fetch'));
const fetch = () => {
const fn = createFetch($scope);
Expand Down
1 change: 1 addition & 0 deletions src/core_plugins/table_vis/public/__tests__/_table_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import expect from 'expect.js';
import ngMock from 'ng_mock';
import VisProvider from 'ui/vis';
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';

describe('Integration', function () {
let $rootScope;
let $compile;
Expand Down
4 changes: 2 additions & 2 deletions src/core_plugins/tagcloud/public/tag_cloud_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import _ from 'lodash';
import uiModules from 'ui/modules';
import TagCloud from 'plugins/tagcloud/tag_cloud';
import AggConfigResult from 'ui/vis/agg_config_result';
import FilterBarFilterBarClickHandlerProvider from 'ui/filter_bar/filter_bar_click_handler';
import { FilterBarClickHandlerProvider } from 'ui/filter_bar/filter_bar_click_handler';

const module = uiModules.get('kibana/tagcloud', ['kibana']);
module.controller('KbnTagCloudController', function ($scope, $element, Private, getAppState) {

const containerNode = $element[0];
const filterBarClickHandler = Private(FilterBarFilterBarClickHandlerProvider);
const filterBarClickHandler = Private(FilterBarClickHandlerProvider);
const maxTagCount = 200;
let truncated = false;

Expand Down
4 changes: 3 additions & 1 deletion src/core_plugins/timelion/public/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import _ from 'lodash';
import moment from 'moment-timezone';

import { DocTitleProvider } from 'ui/doc_title';

require('plugins/timelion/directives/cells/cells');
require('plugins/timelion/directives/fullscreen/fullscreen');
require('plugins/timelion/directives/interval/interval');
Expand Down Expand Up @@ -57,7 +59,7 @@ app.controller('timelion', function (
});

const timezone = Private(require('plugins/timelion/services/timezone'))();
const docTitle = Private(require('ui/doc_title'));
const docTitle = Private(DocTitleProvider);

const defaultExpression = '.es(*)';
const savedSheet = $route.current.locals.savedSheet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import _ from 'lodash';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
require('ui/state_management/app_state');


module.exports = function dashboardContext(Private, getAppState) {
return function () {
const queryFilter = Private(require('ui/filter_bar/query_filter'));
const queryFilter = Private(FilterBarQueryFilterProvider);
const bool = { must: [], must_not: [] };
const filterBarFilters = queryFilter.getFilters();
const queryBarFilter = getAppState().query;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';

define(function (require) {
require('plugins/timelion/directives/chart/chart');
require('plugins/timelion/directives/interval/interval');
Expand All @@ -6,7 +8,7 @@ define(function (require) {
const _ = require('lodash');
const module = require('ui/modules').get('kibana/timelion_vis', ['kibana']);
module.controller('TimelionVisController', function ($scope, $element, Private, Notifier, $http, $rootScope, timefilter) {
const queryFilter = Private(require('ui/filter_bar/query_filter'));
const queryFilter = Private(FilterBarQueryFilterProvider);
const timezone = Private(require('plugins/timelion/services/timezone'))();
const dashboardContext = Private(require('plugins/timelion/services/dashboard_context'));

Expand Down
3 changes: 2 additions & 1 deletion src/fixtures/stubbed_logstash_index_pattern.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import _ from 'lodash';
import TestUtilsStubIndexPatternProvider from 'test_utils/stub_index_pattern';
import IndexPatternsFieldTypesProvider from 'ui/index_patterns/_field_types';
import { IndexPatternsFieldTypesProvider } from 'ui/index_patterns/_field_types';
import FixturesLogstashFieldsProvider from 'fixtures/logstash_fields';

export default function stubbedLogstashIndexPatternService(Private) {
const StubIndexPattern = Private(TestUtilsStubIndexPatternProvider);
const fieldTypes = Private(IndexPatternsFieldTypesProvider);
Expand Down
14 changes: 7 additions & 7 deletions src/test_utils/stub_index_pattern.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import _ from 'lodash';
import sinon from 'sinon';
import Promise from 'bluebird';
import IndexedArray from 'ui/indexed_array';
import IndexPattern from 'ui/index_patterns/_index_pattern';
import formatHit from 'ui/index_patterns/_format_hit';
import getComputedFields from 'ui/index_patterns/_get_computed_fields';
import { IndexedArray } from 'ui/indexed_array';
import { IndexPatternProvider } from 'ui/index_patterns/_index_pattern';
import { formatHit } from 'ui/index_patterns/_format_hit';
import { getComputedFields } from 'ui/index_patterns/_get_computed_fields';
import RegistryFieldFormatsProvider from 'ui/registry/field_formats';
import IndexPatternsFlattenHitProvider from 'ui/index_patterns/_flatten_hit';
import IndexPatternsFieldProvider from 'ui/index_patterns/_field';
import { IndexPatternsFlattenHitProvider } from 'ui/index_patterns/_flatten_hit';
import { IndexPatternsFieldProvider } from 'ui/index_patterns/_field';

export default function (Private) {
const fieldFormats = Private(RegistryFieldFormatsProvider);
Expand All @@ -24,7 +24,7 @@ export default function (Private) {
this.getSourceFiltering = sinon.spy();
this.metaFields = ['_id', '_type', '_source'];
this.fieldFormatMap = {};
this.routes = IndexPattern.routes;
this.routes = IndexPatternProvider.routes;

this.toIndexList = _.constant(Promise.resolve([pattern]));
this.toDetailedIndexList = _.constant(Promise.resolve([
Expand Down
4 changes: 2 additions & 2 deletions src/test_utils/stub_mapper.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import MapperService from 'ui/index_patterns/_mapper';
import { IndexPatternsMapperProvider } from 'ui/index_patterns/_mapper';
import stubbedLogstashFields from 'fixtures/logstash_fields';
import sinon from 'auto-release-sinon';

export function stubMapper(Private, mockLogstashFields = Private(stubbedLogstashFields)) {
const stubbedMapper = Private(MapperService);
const stubbedMapper = Private(IndexPatternsMapperProvider);

sinon.stub(stubbedMapper, 'getFieldsForIndexPattern', function () {
return Promise.resolve(mockLogstashFields.filter(field => field.scripted === false));
Expand Down
9 changes: 5 additions & 4 deletions src/ui/public/agg_types/__tests__/agg_params.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import ngMock from 'ng_mock';
import expect from 'expect.js';
import { AggTypesAggParamsProvider } from 'ui/agg_types/agg_params';
import AggTypesParamTypesBaseProvider from 'ui/agg_types/param_types/base';
import AggTypesParamTypesFieldProvider from 'ui/agg_types/param_types/field';
import AggTypesParamTypesOptionedProvider from 'ui/agg_types/param_types/optioned';
import AggTypesParamTypesRegexProvider from 'ui/agg_types/param_types/regex';
import { AggTypesParamTypesBaseProvider } from 'ui/agg_types/param_types/base';
import { AggTypesParamTypesFieldProvider } from 'ui/agg_types/param_types/field';
import { AggTypesParamTypesOptionedProvider } from 'ui/agg_types/param_types/optioned';
import { AggTypesParamTypesRegexProvider } from 'ui/agg_types/param_types/regex';

describe('AggParams class', function () {

let AggParams;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/agg_types/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import './buckets/_geo_hash';
import './buckets/_range';
import AggTypesIndexProvider from 'ui/agg_types/index';
import { AggTypesBucketsBucketAggTypeProvider } from 'ui/agg_types/buckets/_bucket_agg_type';
import AggTypesMetricsMetricAggTypeProvider from 'ui/agg_types/metrics/metric_agg_type';
import { AggTypesMetricsMetricAggTypeProvider } from 'ui/agg_types/metrics/metric_agg_type';

describe('AggTypesComponent', function () {

Expand Down
16 changes: 8 additions & 8 deletions src/ui/public/agg_types/__tests__/metrics/parent_pipeline.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import expect from 'expect.js';
import ngMock from 'ng_mock';
import DerivativeProvider from 'ui/agg_types/metrics/derivative';
import CumulativeSumProvider from 'ui/agg_types/metrics/cumulative_sum';
import MovingAvgProvider from 'ui/agg_types/metrics/moving_avg';
import SerialDiffProvider from 'ui/agg_types/metrics/serial_diff';
import { AggTypesMetricsDerivativeProvider } from 'ui/agg_types/metrics/derivative';
import { AggTypesMetricsCumulativeSumProvider } from 'ui/agg_types/metrics/cumulative_sum';
import { AggTypesMetricsMovingAvgProvider } from 'ui/agg_types/metrics/moving_avg';
import { AggTypesMetricsSerialDiffProvider } from 'ui/agg_types/metrics/serial_diff';
import VisProvider from 'ui/vis';
import StubbedIndexPattern from 'fixtures/stubbed_logstash_index_pattern';

const metrics = [
{ name: 'derivative', title: 'Derivative', provider: DerivativeProvider },
{ name: 'cumulative_sum', title: 'Cumulative Sum', provider: CumulativeSumProvider },
{ name: 'moving_avg', title: 'Moving Avg', provider: MovingAvgProvider },
{ name: 'serial_diff', title: 'Serial Diff', provider: SerialDiffProvider },
{ name: 'derivative', title: 'Derivative', provider: AggTypesMetricsDerivativeProvider },
{ name: 'cumulative_sum', title: 'Cumulative Sum', provider: AggTypesMetricsCumulativeSumProvider },
{ name: 'moving_avg', title: 'Moving Avg', provider: AggTypesMetricsMovingAvgProvider },
{ name: 'serial_diff', title: 'Serial Diff', provider: AggTypesMetricsSerialDiffProvider },
];

describe('parent pipeline aggs', function () {
Expand Down
Loading

0 comments on commit 8b573c0

Please sign in to comment.