From 945316cc154823444b9d0b921661017d914a2204 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Thu, 13 Apr 2017 16:22:42 -0400 Subject: [PATCH] Default to named export conversion: Courier (#11165) * Default to named export conversion: Courier - Part 1 * Part 2 --- src/ui/public/agg_types/buckets/filters.js | 3 ++- .../public/courier/__tests__/request_queue.js | 12 +++++----- .../public/courier/__tests__/saved_object.js | 8 +++---- src/ui/public/courier/_error_handlers.js | 2 +- .../public/courier/_redirect_when_missing.js | 2 +- src/ui/public/courier/_request_queue.js | 2 +- src/ui/public/courier/courier.js | 22 +++++++++---------- .../data_source/__tests__/decorate_query.js | 2 +- .../data_source/__tests__/doc_source.js | 8 +++---- .../__tests__/normalize_sort_request.js | 2 +- .../data_source/__tests__/search_source.js | 8 +++---- .../public/courier/data_source/_abstract.js | 10 ++++----- .../data_source/_abstract_doc_source.js | 10 ++++----- .../courier/data_source/_decorate_query.js | 2 +- .../courier/data_source/_doc_send_to_es.js | 6 ++--- .../data_source/_normalize_sort_request.js | 2 +- .../data_source/_root_search_source.js | 4 ++-- .../courier/data_source/admin_doc_source.js | 14 ++++++------ .../public/courier/data_source/doc_source.js | 12 +++++----- .../courier/data_source/search_source.js | 16 +++++++------- src/ui/public/courier/fetch/__tests__/doc.js | 6 ++--- .../public/courier/fetch/__tests__/fetch.js | 6 ++--- .../courier/fetch/__tests__/fetch_these.js | 13 ++++++----- src/ui/public/courier/fetch/call_client.js | 8 +++---- .../courier/fetch/call_response_handlers.js | 8 +++---- .../courier/fetch/continue_incomplete.js | 4 ++-- src/ui/public/courier/fetch/fetch.js | 10 ++++----- src/ui/public/courier/fetch/fetch_these.js | 16 +++++++------- .../public/courier/fetch/for_each_strategy.js | 2 +- src/ui/public/courier/fetch/is_request.js | 4 ++-- .../courier/fetch/merge_duplicate_requests.js | 6 ++--- src/ui/public/courier/fetch/notifier.js | 2 +- src/ui/public/courier/fetch/req_status.js | 2 +- .../fetch/request/__tests__/segmented.js | 6 ++--- .../__tests__/segmented_create_queue.js | 2 +- .../__tests__/segmented_index_selection.js | 2 +- .../__tests__/segmented_size_picking.js | 2 +- .../courier/fetch/request/_abstract_doc.js | 4 ++-- .../public/courier/fetch/request/doc_admin.js | 8 +++---- .../public/courier/fetch/request/doc_data.js | 8 +++---- .../courier/fetch/request/error_handler.js | 4 ++-- .../public/courier/fetch/request/request.js | 6 ++--- src/ui/public/courier/fetch/request/search.js | 6 ++--- .../public/courier/fetch/request/segmented.js | 6 ++--- .../courier/fetch/request/segmented_handle.js | 2 +- .../fetch/strategy/__tests__/search.js | 4 ++-- .../courier/fetch/strategy/doc_admin.js | 2 +- .../public/courier/fetch/strategy/doc_data.js | 2 +- .../public/courier/fetch/strategy/search.js | 2 +- src/ui/public/courier/looper/_looper.js | 2 +- src/ui/public/courier/looper/doc_admin.js | 10 ++++----- src/ui/public/courier/looper/doc_data.js | 10 ++++----- src/ui/public/courier/looper/search.js | 10 ++++----- .../courier/saved_object/saved_object.js | 8 +++---- .../__tests__/_index_pattern.js | 4 ++-- .../public/index_patterns/_index_pattern.js | 4 ++-- src/ui/public/parse_query/lib/from_user.js | 3 ++- 57 files changed, 178 insertions(+), 173 deletions(-) diff --git a/src/ui/public/agg_types/buckets/filters.js b/src/ui/public/agg_types/buckets/filters.js index 3d319be213ca2..39e43582a3f8a 100644 --- a/src/ui/public/agg_types/buckets/filters.js +++ b/src/ui/public/agg_types/buckets/filters.js @@ -1,8 +1,9 @@ import _ from 'lodash'; import angular from 'angular'; + import { AggTypesBucketsBucketAggTypeProvider } from 'ui/agg_types/buckets/_bucket_agg_type'; import { AggTypesBucketsCreateFilterFiltersProvider } from 'ui/agg_types/buckets/create_filter/filters'; -import DecorateQueryProvider from 'ui/courier/data_source/_decorate_query'; +import { DecorateQueryProvider } from 'ui/courier/data_source/_decorate_query'; import filtersTemplate from 'ui/agg_types/controls/filters.html'; export function AggTypesBucketsFiltersProvider(Private, Notifier) { diff --git a/src/ui/public/courier/__tests__/request_queue.js b/src/ui/public/courier/__tests__/request_queue.js index e693852231acc..5eb7104b412e5 100644 --- a/src/ui/public/courier/__tests__/request_queue.js +++ b/src/ui/public/courier/__tests__/request_queue.js @@ -2,9 +2,9 @@ import ngMock from 'ng_mock'; import expect from 'expect.js'; import sinon from 'auto-release-sinon'; -import RequestQueueProv from '../_request_queue'; -import SearchStrategyProv from '../fetch/strategy/search'; -import DocStrategyProv from '../fetch/strategy/doc_data'; +import { RequestQueueProvider } from '../_request_queue'; +import { SearchStrategyProvider } from '../fetch/strategy/search'; +import { DocDataStrategyProvider } from '../fetch/strategy/doc_data'; describe('Courier Request Queue', function () { let docStrategy; @@ -13,9 +13,9 @@ describe('Courier Request Queue', function () { beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { - docStrategy = Private(DocStrategyProv); - requestQueue = Private(RequestQueueProv); - searchStrategy = Private(SearchStrategyProv); + docStrategy = Private(DocDataStrategyProvider); + requestQueue = Private(RequestQueueProvider); + searchStrategy = Private(SearchStrategyProvider); })); class MockReq { diff --git a/src/ui/public/courier/__tests__/saved_object.js b/src/ui/public/courier/__tests__/saved_object.js index ddf15e20e78de..c9c36ab545a12 100644 --- a/src/ui/public/courier/__tests__/saved_object.js +++ b/src/ui/public/courier/__tests__/saved_object.js @@ -3,9 +3,9 @@ import expect from 'expect.js'; import sinon from 'auto-release-sinon'; import BluebirdPromise from 'bluebird'; -import SavedObjectFactory from '../saved_object/saved_object'; +import { SavedObjectProvider } from '../saved_object/saved_object'; import IndexPatternFactory from 'ui/index_patterns/_index_pattern'; -import DocSourceProvider from '../data_source/admin_doc_source'; +import { AdminDocSourceProvider } from '../data_source/admin_doc_source'; import { stubMapper } from 'test_utils/stub_mapper'; @@ -97,11 +97,11 @@ describe('Saved Object', function () { ); beforeEach(ngMock.inject(function (es, esAdmin, Private, $window) { - SavedObject = Private(SavedObjectFactory); + SavedObject = Private(SavedObjectProvider); IndexPattern = Private(IndexPatternFactory); esAdminStub = esAdmin; esDataStub = es; - DocSource = Private(DocSourceProvider); + DocSource = Private(AdminDocSourceProvider); window = $window; mockEsService(); diff --git a/src/ui/public/courier/_error_handlers.js b/src/ui/public/courier/_error_handlers.js index dbb30e30deb7e..b829f7fd5bcee 100644 --- a/src/ui/public/courier/_error_handlers.js +++ b/src/ui/public/courier/_error_handlers.js @@ -1,4 +1,4 @@ -export default function ErrorHandlerList() { +export function ErrorHandlersProvider() { /** * Queue of pending error handlers, they are removed as * they are resolved. diff --git a/src/ui/public/courier/_redirect_when_missing.js b/src/ui/public/courier/_redirect_when_missing.js index 41ed5fa85051a..f1df776c5e5ae 100644 --- a/src/ui/public/courier/_redirect_when_missing.js +++ b/src/ui/public/courier/_redirect_when_missing.js @@ -1,6 +1,6 @@ import { SavedObjectNotFound } from 'ui/errors'; -export default function RedirectWhenMissingFn($location, kbnUrl, Notifier, Promise) { +export function RedirectWhenMissingProvider($location, kbnUrl, Notifier, Promise) { const notify = new Notifier(); /** diff --git a/src/ui/public/courier/_request_queue.js b/src/ui/public/courier/_request_queue.js index abd85e6f07a14..a0ae5e81c85c4 100644 --- a/src/ui/public/courier/_request_queue.js +++ b/src/ui/public/courier/_request_queue.js @@ -1,4 +1,4 @@ -export default function PendingRequestList() { +export function RequestQueueProvider() { /** * Queue of pending requests, requests are removed as diff --git a/src/ui/public/courier/courier.js b/src/ui/public/courier/courier.js index 8c99924da7041..f16d245896065 100644 --- a/src/ui/public/courier/courier.js +++ b/src/ui/public/courier/courier.js @@ -6,17 +6,17 @@ import 'ui/index_patterns'; import uiModules from 'ui/modules'; import Notifier from 'ui/notify/notifier'; -import DocSourceProvider from './data_source/doc_source'; -import SearchSourceProvider from './data_source/search_source'; -import SearchStrategyProvider from './fetch/strategy/search'; -import RequestQueueProvider from './_request_queue'; -import FetchProvider from './fetch'; -import DocDataLooperProvider from './looper/doc_data'; -import DocAdminLooperProvider from './looper/doc_admin'; -import SearchLooperProvider from './looper/search'; -import RootSearchSourceProvider from './data_source/_root_search_source'; -import SavedObjectProvider from './saved_object'; -import RedirectWhenMissingProvider from './_redirect_when_missing'; +import { DocSourceProvider } from './data_source/doc_source'; +import { SearchSourceProvider } from './data_source/search_source'; +import { SearchStrategyProvider } from './fetch/strategy/search'; +import { RequestQueueProvider } from './_request_queue'; +import { FetchProvider } from './fetch'; +import { DocDataLooperProvider } from './looper/doc_data'; +import { DocAdminLooperProvider } from './looper/doc_admin'; +import { SearchLooperProvider } from './looper/search'; +import { RootSearchSourceProvider } from './data_source/_root_search_source'; +import { SavedObjectProvider } from './saved_object'; +import { RedirectWhenMissingProvider } from './_redirect_when_missing'; uiModules.get('kibana/courier') diff --git a/src/ui/public/courier/data_source/__tests__/decorate_query.js b/src/ui/public/courier/data_source/__tests__/decorate_query.js index 4054f02720065..a78244441958f 100644 --- a/src/ui/public/courier/data_source/__tests__/decorate_query.js +++ b/src/ui/public/courier/data_source/__tests__/decorate_query.js @@ -1,6 +1,6 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; -import DecorateQueryProvider from 'ui/courier/data_source/_decorate_query'; +import { DecorateQueryProvider } from 'ui/courier/data_source/_decorate_query'; describe('Query decorator', function () { let config; diff --git a/src/ui/public/courier/data_source/__tests__/doc_source.js b/src/ui/public/courier/data_source/__tests__/doc_source.js index 7be2fbc7496eb..c0dd270a69ab2 100644 --- a/src/ui/public/courier/data_source/__tests__/doc_source.js +++ b/src/ui/public/courier/data_source/__tests__/doc_source.js @@ -2,8 +2,8 @@ import ngMock from 'ng_mock'; import expect from 'expect.js'; import sinon from 'auto-release-sinon'; -import RequestQueueProv from '../../_request_queue'; -import DocSourceProv from '../doc_source'; +import { RequestQueueProvider } from '../../_request_queue'; +import { DocSourceProvider } from '../doc_source'; describe('DocSource', function () { require('test_utils/no_digest_promises').activateForSuite(); @@ -13,8 +13,8 @@ describe('DocSource', function () { beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { - requestQueue = Private(RequestQueueProv); - DocSource = Private(DocSourceProv); + requestQueue = Private(RequestQueueProvider); + DocSource = Private(DocSourceProvider); })); describe('#onUpdate()', function () { diff --git a/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js b/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js index 8ed3ab799dc40..7fb97c420dc4c 100644 --- a/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js +++ b/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js @@ -1,7 +1,7 @@ import 'ui/private'; import ngMock from 'ng_mock'; import expect from 'expect.js'; -import NormalizeSortRequestProvider from 'ui/courier/data_source/_normalize_sort_request'; +import { NormalizeSortRequestProvider } from 'ui/courier/data_source/_normalize_sort_request'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import _ from 'lodash'; diff --git a/src/ui/public/courier/data_source/__tests__/search_source.js b/src/ui/public/courier/data_source/__tests__/search_source.js index 60cd240bc4fca..f73a195776751 100644 --- a/src/ui/public/courier/data_source/__tests__/search_source.js +++ b/src/ui/public/courier/data_source/__tests__/search_source.js @@ -2,8 +2,8 @@ import ngMock from 'ng_mock'; import expect from 'expect.js'; import sinon from 'auto-release-sinon'; -import RequestQueueProv from '../../_request_queue'; -import SearchSourceProv from '../search_source'; +import { RequestQueueProvider } from '../../_request_queue'; +import { SearchSourceProvider } from '../search_source'; import StubIndexPatternProv from 'test_utils/stub_index_pattern'; describe('SearchSource', function () { @@ -16,8 +16,8 @@ describe('SearchSource', function () { beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { - requestQueue = Private(RequestQueueProv); - SearchSource = Private(SearchSourceProv); + requestQueue = Private(RequestQueueProvider); + SearchSource = Private(SearchSourceProvider); const IndexPattern = Private(StubIndexPatternProv); indexPattern = new IndexPattern('test-*', null, []); diff --git a/src/ui/public/courier/data_source/_abstract.js b/src/ui/public/courier/data_source/_abstract.js index 1e9cce106ce1d..67d5c6a1d44ba 100644 --- a/src/ui/public/courier/data_source/_abstract.js +++ b/src/ui/public/courier/data_source/_abstract.js @@ -3,14 +3,14 @@ import angular from 'angular'; import 'ui/promises'; -import RequestQueueProvider from '../_request_queue'; -import ErrorHandlersProvider from '../_error_handlers'; -import FetchProvider from '../fetch'; -import DecorateQueryProvider from './_decorate_query'; +import { RequestQueueProvider } from '../_request_queue'; +import { ErrorHandlersProvider } from '../_error_handlers'; +import { FetchProvider } from '../fetch'; +import { DecorateQueryProvider } from './_decorate_query'; import FieldWildcardProvider from '../../field_wildcard'; import { getHighlightRequestProvider } from '../../highlight'; -export default function SourceAbstractFactory(Private, Promise, PromiseEmitter) { +export function AbstractDataSourceProvider(Private, Promise, PromiseEmitter) { const requestQueue = Private(RequestQueueProvider); const errorHandlers = Private(ErrorHandlersProvider); const courierFetch = Private(FetchProvider); diff --git a/src/ui/public/courier/data_source/_abstract_doc_source.js b/src/ui/public/courier/data_source/_abstract_doc_source.js index fe74d379fc1aa..5d6d24d02f8e8 100644 --- a/src/ui/public/courier/data_source/_abstract_doc_source.js +++ b/src/ui/public/courier/data_source/_abstract_doc_source.js @@ -13,14 +13,14 @@ import _ from 'lodash'; import 'ui/es'; import 'ui/storage'; -import DocSendToEsProvider from './_doc_send_to_es'; -import AbstractDataSourceProvider from './_abstract'; -import DocRequestProvider from '../fetch/request/_abstract_doc'; +import { DocSendToEsProvider } from './_doc_send_to_es'; +import { AbstractDataSourceProvider } from './_abstract'; +import { AbstractDocRequestProvider } from '../fetch/request/_abstract_doc'; -export default function AbstractDocSourceFactory(Private, Promise, es, sessionStorage) { +export function AbstractDocSourceProvider(Private, Promise, es, sessionStorage) { const sendToEs = Private(DocSendToEsProvider); const SourceAbstract = Private(AbstractDataSourceProvider); - const DocRequest = Private(DocRequestProvider); + const DocRequest = Private(AbstractDocRequestProvider); _.class(AbstractDocSource).inherits(SourceAbstract); function AbstractDocSource(initialState, strategy) { diff --git a/src/ui/public/courier/data_source/_decorate_query.js b/src/ui/public/courier/data_source/_decorate_query.js index deb8ee907857d..7f1c512837217 100644 --- a/src/ui/public/courier/data_source/_decorate_query.js +++ b/src/ui/public/courier/data_source/_decorate_query.js @@ -1,6 +1,6 @@ import _ from 'lodash'; -export default function DecorateQuery(config) { +export function DecorateQueryProvider(config) { /** * Decorate queries with default parameters * @param {query} query object diff --git a/src/ui/public/courier/data_source/_doc_send_to_es.js b/src/ui/public/courier/data_source/_doc_send_to_es.js index 6d3fa0bd6a2f5..2205f3e650871 100644 --- a/src/ui/public/courier/data_source/_doc_send_to_es.js +++ b/src/ui/public/courier/data_source/_doc_send_to_es.js @@ -8,10 +8,10 @@ import _ from 'lodash'; import { VersionConflict, RequestFailure } from 'ui/errors'; -import RequestQueueProvider from 'ui/courier/_request_queue'; -import FetchProvider from 'ui/courier/fetch/fetch'; +import { RequestQueueProvider } from 'ui/courier/_request_queue'; +import { FetchProvider } from 'ui/courier/fetch/fetch'; -export default function (Promise, Private, es, esAdmin, kbnIndex) { +export function DocSendToEsProvider(Promise, Private, es, esAdmin, kbnIndex) { const requestQueue = Private(RequestQueueProvider); const courierFetch = Private(FetchProvider); diff --git a/src/ui/public/courier/data_source/_normalize_sort_request.js b/src/ui/public/courier/data_source/_normalize_sort_request.js index e66d2faf74a72..9c104d68838d9 100644 --- a/src/ui/public/courier/data_source/_normalize_sort_request.js +++ b/src/ui/public/courier/data_source/_normalize_sort_request.js @@ -1,6 +1,6 @@ import _ from 'lodash'; -export default function normalizeSortRequest(config) { +export function NormalizeSortRequestProvider(config) { const defaultSortOptions = config.get('sort:options'); /** diff --git a/src/ui/public/courier/data_source/_root_search_source.js b/src/ui/public/courier/data_source/_root_search_source.js index 807ec1de990db..8da67efb59f25 100644 --- a/src/ui/public/courier/data_source/_root_search_source.js +++ b/src/ui/public/courier/data_source/_root_search_source.js @@ -1,6 +1,6 @@ -import SearchSourceProvider from 'ui/courier/data_source/search_source'; +import { SearchSourceProvider } from 'ui/courier/data_source/search_source'; -export default function RootSearchSource(Private, $rootScope, timefilter) { +export function RootSearchSourceProvider(Private, $rootScope, timefilter) { const SearchSource = Private(SearchSourceProvider); const globalSource = new SearchSource(); diff --git a/src/ui/public/courier/data_source/admin_doc_source.js b/src/ui/public/courier/data_source/admin_doc_source.js index 52cdac3762cb3..087f06821f044 100644 --- a/src/ui/public/courier/data_source/admin_doc_source.js +++ b/src/ui/public/courier/data_source/admin_doc_source.js @@ -1,11 +1,11 @@ -import AbstractDocSourceProvider from './_abstract_doc_source'; -import DocStrategyProvider from '../fetch/strategy/doc_admin'; -import DocRequestProvider from '../fetch/request/doc_admin'; +import { AbstractDocSourceProvider } from './_abstract_doc_source'; +import { DocAdminStrategyProvider } from '../fetch/strategy/doc_admin'; +import { AdminDocRequestProvider } from '../fetch/request/doc_admin'; -export default function DocSourceFactory(Private) { +export function AdminDocSourceProvider(Private) { const AbstractDocSource = Private(AbstractDocSourceProvider); - const docStrategy = Private(DocStrategyProvider); - const DocRequest = Private(DocRequestProvider); + const docStrategy = Private(DocAdminStrategyProvider); + const AdminDocRequest = Private(AdminDocRequestProvider); class AdminDocSource extends AbstractDocSource { constructor(initialState) { @@ -13,7 +13,7 @@ export default function DocSourceFactory(Private) { } _createRequest(defer) { - return new DocRequest(this, defer); + return new AdminDocRequest(this, defer); } } diff --git a/src/ui/public/courier/data_source/doc_source.js b/src/ui/public/courier/data_source/doc_source.js index db2bc3e0aea4e..58fc3a22b2cc5 100644 --- a/src/ui/public/courier/data_source/doc_source.js +++ b/src/ui/public/courier/data_source/doc_source.js @@ -1,11 +1,11 @@ -import AbstractDocSourceProvider from './_abstract_doc_source'; -import DocStrategyProvider from '../fetch/strategy/doc_data'; -import DocRequestProvider from '../fetch/request/doc_data'; +import { AbstractDocSourceProvider } from './_abstract_doc_source'; +import { DocDataStrategyProvider } from '../fetch/strategy/doc_data'; +import { DocDataRequestProvider } from '../fetch/request/doc_data'; -export default function DocSourceFactory(Private) { +export function DocSourceProvider(Private) { const AbstractDocSource = Private(AbstractDocSourceProvider); - const docStrategy = Private(DocStrategyProvider); - const DocRequest = Private(DocRequestProvider); + const docStrategy = Private(DocDataStrategyProvider); + const DocRequest = Private(DocDataRequestProvider); class DocSource extends AbstractDocSource { constructor(initialState) { diff --git a/src/ui/public/courier/data_source/search_source.js b/src/ui/public/courier/data_source/search_source.js index 8b092ca1a5861..4cea7952ac71a 100644 --- a/src/ui/public/courier/data_source/search_source.js +++ b/src/ui/public/courier/data_source/search_source.js @@ -52,14 +52,14 @@ import _ from 'lodash'; -import NormalizeSortRequestProvider from './_normalize_sort_request'; -import rootSearchSource from './_root_search_source'; -import AbstractDataSourceProvider from './_abstract'; -import SearchRequestProvider from '../fetch/request/search'; -import SegmentedRequestProvider from '../fetch/request/segmented'; -import SearchStrategyProvider from '../fetch/strategy/search'; +import { NormalizeSortRequestProvider } from './_normalize_sort_request'; +import { RootSearchSourceProvider } from './_root_search_source'; +import { AbstractDataSourceProvider } from './_abstract'; +import { SearchRequestProvider } from '../fetch/request/search'; +import { SegmentedRequestProvider } from '../fetch/request/segmented'; +import { SearchStrategyProvider } from '../fetch/strategy/search'; -export default function SearchSourceFactory(Promise, Private, config) { +export function SearchSourceProvider(Promise, Private, config) { const SourceAbstract = Private(AbstractDataSourceProvider); const SearchRequest = Private(SearchRequestProvider); const SegmentedRequest = Private(SegmentedRequestProvider); @@ -152,7 +152,7 @@ export default function SearchSourceFactory(Promise, Private, config) { const self = this; if (self._parent === false) return; if (self._parent) return self._parent; - return onlyHardLinked ? undefined : Private(rootSearchSource).get(); + return onlyHardLinked ? undefined : Private(RootSearchSourceProvider).get(); }; /** diff --git a/src/ui/public/courier/fetch/__tests__/doc.js b/src/ui/public/courier/fetch/__tests__/doc.js index e33a14273dbeb..1a3da7cd08179 100644 --- a/src/ui/public/courier/fetch/__tests__/doc.js +++ b/src/ui/public/courier/fetch/__tests__/doc.js @@ -2,8 +2,8 @@ import sinon from 'auto-release-sinon'; import expect from 'expect.js'; import ngMock from 'ng_mock'; -import DocSourceProvider from '../../data_source/doc_source'; -import DocRequestProvider from '../request/doc_data'; +import { DocSourceProvider } from '../../data_source/doc_source'; +import { DocDataRequestProvider } from '../request/doc_data'; describe('Courier DocFetchRequest class', function () { let storage; @@ -16,7 +16,7 @@ describe('Courier DocFetchRequest class', function () { beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, Promise, $injector) { const DocSource = Private(DocSourceProvider); - const DocFetchRequest = Private(DocRequestProvider); + const DocFetchRequest = Private(DocDataRequestProvider); storage = $injector.get('localStorage').store = diff --git a/src/ui/public/courier/fetch/__tests__/fetch.js b/src/ui/public/courier/fetch/__tests__/fetch.js index 3979228cd97cd..976fd1f4fcd13 100644 --- a/src/ui/public/courier/fetch/__tests__/fetch.js +++ b/src/ui/public/courier/fetch/__tests__/fetch.js @@ -5,9 +5,9 @@ import sinon from 'auto-release-sinon'; import IndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import searchResp from 'fixtures/search_response'; -import FetchProvider from '../fetch'; -import DocSourceProvider from '../../data_source/doc_source'; -import SearchSourceProvider from '../../data_source/search_source'; +import { FetchProvider } from '../fetch'; +import { DocSourceProvider } from '../../data_source/doc_source'; +import { SearchSourceProvider } from '../../data_source/search_source'; describe('Fetch service', function () { require('test_utils/no_digest_promises').activateForSuite(); diff --git a/src/ui/public/courier/fetch/__tests__/fetch_these.js b/src/ui/public/courier/fetch/__tests__/fetch_these.js index 677726fd946a9..161afc9ffad85 100644 --- a/src/ui/public/courier/fetch/__tests__/fetch_these.js +++ b/src/ui/public/courier/fetch/__tests__/fetch_these.js @@ -2,9 +2,12 @@ import sinon from 'auto-release-sinon'; import expect from 'expect.js'; import ngMock from 'ng_mock'; -import FetchTheseProvider from '../fetch_these'; +import { CallClientProvider } from 'ui/courier/fetch/call_client'; +import { CallResponseHandlersProvider } from 'ui/courier/fetch/call_response_handlers'; +import { ContinueIncompleteProvider } from 'ui/courier/fetch/continue_incomplete'; +import { FetchTheseProvider } from '../fetch_these'; -describe('ui/courier/fetch/_fetch_these', () => { +describe('FetchTheseProvider', () => { let Promise; let $rootScope; @@ -23,9 +26,9 @@ describe('ui/courier/fetch/_fetch_these', () => { return fakeResponses; } - PrivateProvider.swap(require('ui/courier/fetch/call_client'), FakeResponsesProvider); - PrivateProvider.swap(require('ui/courier/fetch/call_response_handlers'), FakeResponsesProvider); - PrivateProvider.swap(require('ui/courier/fetch/continue_incomplete'), FakeResponsesProvider); + PrivateProvider.swap(CallClientProvider, FakeResponsesProvider); + PrivateProvider.swap(CallResponseHandlersProvider, FakeResponsesProvider); + PrivateProvider.swap(ContinueIncompleteProvider, FakeResponsesProvider); })); beforeEach(ngMock.inject((Private, $injector) => { diff --git a/src/ui/public/courier/fetch/call_client.js b/src/ui/public/courier/fetch/call_client.js index d753dee9a3b9f..ff40182d9f968 100644 --- a/src/ui/public/courier/fetch/call_client.js +++ b/src/ui/public/courier/fetch/call_client.js @@ -1,10 +1,10 @@ import _ from 'lodash'; -import IsRequestProvider from './is_request'; -import MergeDuplicatesRequestProvider from './merge_duplicate_requests'; -import ReqStatusProvider from './req_status'; +import { IsRequestProvider } from './is_request'; +import { MergeDuplicatesRequestProvider } from './merge_duplicate_requests'; +import { ReqStatusProvider } from './req_status'; -export default function CourierFetchCallClient(Private, Promise, esAdmin, es) { +export function CallClientProvider(Private, Promise, esAdmin, es) { const isRequest = Private(IsRequestProvider); const mergeDuplicateRequests = Private(MergeDuplicatesRequestProvider); diff --git a/src/ui/public/courier/fetch/call_response_handlers.js b/src/ui/public/courier/fetch/call_response_handlers.js index 5f694532d40ae..c7d328f8310a4 100644 --- a/src/ui/public/courier/fetch/call_response_handlers.js +++ b/src/ui/public/courier/fetch/call_response_handlers.js @@ -1,12 +1,12 @@ import { RequestFailure, SearchTimeout, ShardFailure } from 'ui/errors'; -import ReqStatusProvider from './req_status'; -import NotifierProvider from './notifier'; +import { ReqStatusProvider } from './req_status'; +import { CourierNotifierProvider } from './notifier'; -export default function CourierFetchCallResponseHandlers(Private, Promise) { +export function CallResponseHandlersProvider(Private, Promise) { const ABORTED = Private(ReqStatusProvider).ABORTED; const INCOMPLETE = Private(ReqStatusProvider).INCOMPLETE; - const notify = Private(NotifierProvider); + const notify = Private(CourierNotifierProvider); function callResponseHandlers(requests, responses) { diff --git a/src/ui/public/courier/fetch/continue_incomplete.js b/src/ui/public/courier/fetch/continue_incomplete.js index f11448a0e18a6..77fc5e32d336c 100644 --- a/src/ui/public/courier/fetch/continue_incomplete.js +++ b/src/ui/public/courier/fetch/continue_incomplete.js @@ -1,6 +1,6 @@ -import ReqStatusProvider from './req_status'; +import { ReqStatusProvider } from './req_status'; -export default function CourierFetchContinueIncompleteRequests(Private) { +export function ContinueIncompleteProvider(Private) { const INCOMPLETE = Private(ReqStatusProvider).INCOMPLETE; function continueIncompleteRequests(strategy, requests, responses, fetchWithStrategy) { diff --git a/src/ui/public/courier/fetch/fetch.js b/src/ui/public/courier/fetch/fetch.js index c90a8808069e6..2a459082ef6d2 100644 --- a/src/ui/public/courier/fetch/fetch.js +++ b/src/ui/public/courier/fetch/fetch.js @@ -1,11 +1,11 @@ import _ from 'lodash'; -import RequestQueueProvider from '../_request_queue'; -import FetchTheseProvider from './fetch_these'; -import CallResponseHandlersProvider from './call_response_handlers'; -import ReqStatusProvider from './req_status'; +import { RequestQueueProvider } from '../_request_queue'; +import { FetchTheseProvider } from './fetch_these'; +import { CallResponseHandlersProvider } from './call_response_handlers'; +import { ReqStatusProvider } from './req_status'; -export default function fetchService(Private, Promise) { +export function FetchProvider(Private, Promise) { const requestQueue = Private(RequestQueueProvider); const immediatelyFetchThese = Private(FetchTheseProvider); diff --git a/src/ui/public/courier/fetch/fetch_these.js b/src/ui/public/courier/fetch/fetch_these.js index 1c2b07b7fc660..7016729bb0ab4 100644 --- a/src/ui/public/courier/fetch/fetch_these.js +++ b/src/ui/public/courier/fetch/fetch_these.js @@ -1,12 +1,12 @@ -import NotifierProvider from './notifier'; -import ForEachStrategyProvider from './for_each_strategy'; -import CallClientProvider from './call_client'; -import CallResponseHandlersProvider from './call_response_handlers'; -import ContinueIncompleteProvider from './continue_incomplete'; -import ReqStatusProvider from './req_status'; +import { CourierNotifierProvider } from './notifier'; +import { ForEachStrategyProvider } from './for_each_strategy'; +import { CallClientProvider } from './call_client'; +import { CallResponseHandlersProvider } from './call_response_handlers'; +import { ContinueIncompleteProvider } from './continue_incomplete'; +import { ReqStatusProvider } from './req_status'; -export default function FetchTheseProvider(Private, Promise) { - const notify = Private(NotifierProvider); +export function FetchTheseProvider(Private, Promise) { + const notify = Private(CourierNotifierProvider); const forEachStrategy = Private(ForEachStrategyProvider); // core tasks diff --git a/src/ui/public/courier/fetch/for_each_strategy.js b/src/ui/public/courier/fetch/for_each_strategy.js index 82225c85d1019..3f99898344707 100644 --- a/src/ui/public/courier/fetch/for_each_strategy.js +++ b/src/ui/public/courier/fetch/for_each_strategy.js @@ -1,6 +1,6 @@ import _ from 'lodash'; -export default function FetchForEachRequestStrategy(Private, Promise) { +export function ForEachStrategyProvider(Private, Promise) { function forEachStrategy(requests, block) { block = Promise.method(block); const sets = []; diff --git a/src/ui/public/courier/fetch/is_request.js b/src/ui/public/courier/fetch/is_request.js index 8ce9d5398ddd5..3a26a4b452747 100644 --- a/src/ui/public/courier/fetch/is_request.js +++ b/src/ui/public/courier/fetch/is_request.js @@ -1,6 +1,6 @@ -import AbstractRequestProvider from './request'; +import { AbstractRequestProvider } from './request'; -export default function IsRequestProvider(Private) { +export function IsRequestProvider(Private) { const AbstractRequest = Private(AbstractRequestProvider); return function isRequest(obj) { diff --git a/src/ui/public/courier/fetch/merge_duplicate_requests.js b/src/ui/public/courier/fetch/merge_duplicate_requests.js index e785633329c12..45f35d459bdc1 100644 --- a/src/ui/public/courier/fetch/merge_duplicate_requests.js +++ b/src/ui/public/courier/fetch/merge_duplicate_requests.js @@ -1,7 +1,7 @@ -import IsRequestProvider from './is_request'; -import ReqStatusProvider from './req_status'; +import { IsRequestProvider } from './is_request'; +import { ReqStatusProvider } from './req_status'; -export default function FetchMergeDuplicateRequests(Private) { +export function MergeDuplicatesRequestProvider(Private) { const isRequest = Private(IsRequestProvider); const DUPLICATE = Private(ReqStatusProvider).DUPLICATE; diff --git a/src/ui/public/courier/fetch/notifier.js b/src/ui/public/courier/fetch/notifier.js index 8f00d4a1d4ba0..5a0b1bff22c54 100644 --- a/src/ui/public/courier/fetch/notifier.js +++ b/src/ui/public/courier/fetch/notifier.js @@ -1,6 +1,6 @@ import Notifier from 'ui/notify/notifier'; -export default function CourierFetchNotifier() { +export function CourierNotifierProvider() { return new Notifier({ location: 'Courier Fetch' }); diff --git a/src/ui/public/courier/fetch/req_status.js b/src/ui/public/courier/fetch/req_status.js index 9c29751641bef..cf6a1874bcfc6 100644 --- a/src/ui/public/courier/fetch/req_status.js +++ b/src/ui/public/courier/fetch/req_status.js @@ -1,4 +1,4 @@ -export default function CourierFetchRequestStatus() { +export function ReqStatusProvider() { return { ABORTED: { CourierFetchRequestStatus: 'aborted' }, DUPLICATE: { CourierFetchRequestStatus: 'duplicate' }, diff --git a/src/ui/public/courier/fetch/request/__tests__/segmented.js b/src/ui/public/courier/fetch/request/__tests__/segmented.js index e98286e04a902..78409d67e0821 100644 --- a/src/ui/public/courier/fetch/request/__tests__/segmented.js +++ b/src/ui/public/courier/fetch/request/__tests__/segmented.js @@ -2,10 +2,10 @@ import sinon from 'auto-release-sinon'; import expect from 'expect.js'; import ngMock from 'ng_mock'; -import SegmentedRequestProvider from '../segmented'; -import SearchRequestProvider from '../search'; +import { SegmentedRequestProvider } from '../segmented'; +import { SearchRequestProvider } from '../search'; -describe('ui/courier/fetch/request/segmented', () => { +describe('SegmentedRequestProvider', () => { let Promise; let SegmentedReq; let segmentedReq; diff --git a/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js b/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js index 2a652e47f9d09..8e428b24664f0 100644 --- a/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js +++ b/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js @@ -4,7 +4,7 @@ import ngMock from 'ng_mock'; import StubbedSearchSourceProvider from 'fixtures/stubbed_search_source'; -import SegmentedRequestProvider from '../segmented'; +import { SegmentedRequestProvider } from '../segmented'; describe('ui/courier/fetch/request/segmented/_createQueue', () => { let Promise; diff --git a/src/ui/public/courier/fetch/request/__tests__/segmented_index_selection.js b/src/ui/public/courier/fetch/request/__tests__/segmented_index_selection.js index 4a92d30aa5738..f90ad48fb63fb 100644 --- a/src/ui/public/courier/fetch/request/__tests__/segmented_index_selection.js +++ b/src/ui/public/courier/fetch/request/__tests__/segmented_index_selection.js @@ -7,7 +7,7 @@ import HitSortFnProv from 'plugins/kibana/discover/_hit_sort_fn'; import NoDigestPromises from 'test_utils/no_digest_promises'; import StubbedSearchSourceProvider from 'fixtures/stubbed_search_source'; -import SegmentedRequestProvider from '../segmented'; +import { SegmentedRequestProvider } from '../segmented'; describe('Segmented Request Index Selection', function () { let Promise; diff --git a/src/ui/public/courier/fetch/request/__tests__/segmented_size_picking.js b/src/ui/public/courier/fetch/request/__tests__/segmented_size_picking.js index e74c279223cfc..69ea3bba925c0 100644 --- a/src/ui/public/courier/fetch/request/__tests__/segmented_size_picking.js +++ b/src/ui/public/courier/fetch/request/__tests__/segmented_size_picking.js @@ -5,7 +5,7 @@ import HitSortFnProv from 'plugins/kibana/discover/_hit_sort_fn'; import NoDigestPromises from 'test_utils/no_digest_promises'; import StubbedSearchSourceProvider from 'fixtures/stubbed_search_source'; -import SegmentedRequestProvider from '../segmented'; +import { SegmentedRequestProvider } from '../segmented'; describe('Segmented Request Size Picking', function () { let SegmentedReq; diff --git a/src/ui/public/courier/fetch/request/_abstract_doc.js b/src/ui/public/courier/fetch/request/_abstract_doc.js index d0cdb6916d10f..b39c8dde06486 100644 --- a/src/ui/public/courier/fetch/request/_abstract_doc.js +++ b/src/ui/public/courier/fetch/request/_abstract_doc.js @@ -1,6 +1,6 @@ -import AbstractRequestProvider from './request'; +import { AbstractRequestProvider } from './request'; -export default function DocRequestProvider(Private) { +export function AbstractDocRequestProvider(Private) { const AbstractRequest = Private(AbstractRequestProvider); diff --git a/src/ui/public/courier/fetch/request/doc_admin.js b/src/ui/public/courier/fetch/request/doc_admin.js index 9549766cbd36b..bb679f9e76d52 100644 --- a/src/ui/public/courier/fetch/request/doc_admin.js +++ b/src/ui/public/courier/fetch/request/doc_admin.js @@ -1,9 +1,9 @@ -import DocStrategyProvider from '../strategy/doc_admin'; -import AbstractDocRequestProvider from './_abstract_doc'; +import { DocAdminStrategyProvider } from '../strategy/doc_admin'; +import { AbstractDocRequestProvider } from './_abstract_doc'; -export default function DocRequestProvider(Private) { +export function AdminDocRequestProvider(Private) { - const docStrategy = Private(DocStrategyProvider); + const docStrategy = Private(DocAdminStrategyProvider); const AbstractDocRequest = Private(AbstractDocRequestProvider); class AdminDocRequest extends AbstractDocRequest { diff --git a/src/ui/public/courier/fetch/request/doc_data.js b/src/ui/public/courier/fetch/request/doc_data.js index 832e31e3c9770..f93d54015c3d3 100644 --- a/src/ui/public/courier/fetch/request/doc_data.js +++ b/src/ui/public/courier/fetch/request/doc_data.js @@ -1,9 +1,9 @@ -import DocStrategyProvider from '../strategy/doc_data'; -import AbstractDocRequestProvider from './_abstract_doc'; +import { DocDataStrategyProvider } from '../strategy/doc_data'; +import { AbstractDocRequestProvider } from './_abstract_doc'; -export default function DocRequestProvider(Private) { +export function DocDataRequestProvider(Private) { - const docStrategy = Private(DocStrategyProvider); + const docStrategy = Private(DocDataStrategyProvider); const AbstractDocRequest = Private(AbstractDocRequestProvider); class DataDocRequest extends AbstractDocRequest { diff --git a/src/ui/public/courier/fetch/request/error_handler.js b/src/ui/public/courier/fetch/request/error_handler.js index 19070a6642641..88595e6c096c7 100644 --- a/src/ui/public/courier/fetch/request/error_handler.js +++ b/src/ui/public/courier/fetch/request/error_handler.js @@ -1,8 +1,8 @@ import Notifier from 'ui/notify/notifier'; -import ErrorHandlersProvider from '../../_error_handlers'; +import { ErrorHandlersProvider } from '../../_error_handlers'; -export default function RequestErrorHandlerFactory(Private) { +export function ErrorHandlerRequestProvider(Private) { const errHandlers = Private(ErrorHandlersProvider); const notify = new Notifier({ diff --git a/src/ui/public/courier/fetch/request/request.js b/src/ui/public/courier/fetch/request/request.js index 5aec3e328506c..124c11a0b676a 100644 --- a/src/ui/public/courier/fetch/request/request.js +++ b/src/ui/public/courier/fetch/request/request.js @@ -1,10 +1,10 @@ import _ from 'lodash'; import moment from 'moment'; -import RequestQueueProvider from '../../_request_queue'; -import ErrorHandlerRequestProvider from './error_handler'; +import { RequestQueueProvider } from '../../_request_queue'; +import { ErrorHandlerRequestProvider } from './error_handler'; -export default function AbstractReqProvider(Private, Promise) { +export function AbstractRequestProvider(Private, Promise) { const requestQueue = Private(RequestQueueProvider); const requestErrorHandler = Private(ErrorHandlerRequestProvider); diff --git a/src/ui/public/courier/fetch/request/search.js b/src/ui/public/courier/fetch/request/search.js index a571923ef8c11..9fa4518789633 100644 --- a/src/ui/public/courier/fetch/request/search.js +++ b/src/ui/public/courier/fetch/request/search.js @@ -1,7 +1,7 @@ -import SearchStrategyProvider from '../strategy/search'; -import AbstractRequestProvider from './request'; +import { SearchStrategyProvider } from '../strategy/search'; +import { AbstractRequestProvider } from './request'; -export default function SearchReqProvider(Private) { +export function SearchRequestProvider(Private) { const searchStrategy = Private(SearchStrategyProvider); const AbstractRequest = Private(AbstractRequestProvider); diff --git a/src/ui/public/courier/fetch/request/segmented.js b/src/ui/public/courier/fetch/request/segmented.js index 4689b88923121..4d06617f99255 100644 --- a/src/ui/public/courier/fetch/request/segmented.js +++ b/src/ui/public/courier/fetch/request/segmented.js @@ -3,10 +3,10 @@ import { isNumber } from 'lodash'; import Notifier from 'ui/notify/notifier'; -import SearchRequestProvider from './search'; -import SegmentedHandleProvider from './segmented_handle'; +import { SearchRequestProvider } from './search'; +import { SegmentedHandleProvider } from './segmented_handle'; -export default function SegmentedReqProvider(es, Private, Promise, timefilter, config) { +export function SegmentedRequestProvider(es, Private, Promise, timefilter, config) { const SearchReq = Private(SearchRequestProvider); const SegmentedHandle = Private(SegmentedHandleProvider); diff --git a/src/ui/public/courier/fetch/request/segmented_handle.js b/src/ui/public/courier/fetch/request/segmented_handle.js index 095167032369b..3430da8104bcb 100644 --- a/src/ui/public/courier/fetch/request/segmented_handle.js +++ b/src/ui/public/courier/fetch/request/segmented_handle.js @@ -1,6 +1,6 @@ import { EventsProvider } from 'ui/events'; -export default function CourierSegmentedReqHandle(Private) { +export function SegmentedHandleProvider(Private) { const Events = Private(EventsProvider); const segmentedRequest = Symbol('Actual Segmented Request'); diff --git a/src/ui/public/courier/fetch/strategy/__tests__/search.js b/src/ui/public/courier/fetch/strategy/__tests__/search.js index cedffd6b2efbe..406105f45ca09 100644 --- a/src/ui/public/courier/fetch/strategy/__tests__/search.js +++ b/src/ui/public/courier/fetch/strategy/__tests__/search.js @@ -2,10 +2,10 @@ import _ from 'lodash'; import expect from 'expect.js'; import ngMock from 'ng_mock'; -import SearchStrategyProvider from '../search'; +import { SearchStrategyProvider } from '../search'; import StubIndexPatternProvider from 'test_utils/stub_index_pattern'; -describe('ui/courier/fetch/strategy/search', () => { +describe('SearchStrategyProvider', () => { require('test_utils/no_digest_promises').activateForSuite(); let search; diff --git a/src/ui/public/courier/fetch/strategy/doc_admin.js b/src/ui/public/courier/fetch/strategy/doc_admin.js index 8bd768dc2d60a..7253474c40390 100644 --- a/src/ui/public/courier/fetch/strategy/doc_admin.js +++ b/src/ui/public/courier/fetch/strategy/doc_admin.js @@ -1,4 +1,4 @@ -export default function FetchStrategyForDoc(Promise) { +export function DocAdminStrategyProvider(Promise) { return { id: 'doc_admin', clientMethod: 'mget', diff --git a/src/ui/public/courier/fetch/strategy/doc_data.js b/src/ui/public/courier/fetch/strategy/doc_data.js index 1949e07dc1d25..f1ba613df6332 100644 --- a/src/ui/public/courier/fetch/strategy/doc_data.js +++ b/src/ui/public/courier/fetch/strategy/doc_data.js @@ -1,4 +1,4 @@ -export default function FetchStrategyForDoc(Promise) { +export function DocDataStrategyProvider(Promise) { return { clientMethod: 'mget', diff --git a/src/ui/public/courier/fetch/strategy/search.js b/src/ui/public/courier/fetch/strategy/search.js index 3805c0ecc4269..0f0d21883b649 100644 --- a/src/ui/public/courier/fetch/strategy/search.js +++ b/src/ui/public/courier/fetch/strategy/search.js @@ -3,7 +3,7 @@ import angular from 'angular'; import { toJson } from 'ui/utils/aggressive_parse'; -export default function FetchStrategyForSearch(Private, Promise, timefilter, kbnIndex, sessionId) { +export function SearchStrategyProvider(Private, Promise, timefilter, kbnIndex, sessionId) { return { clientMethod: 'msearch', diff --git a/src/ui/public/courier/looper/_looper.js b/src/ui/public/courier/looper/_looper.js index db8e23ea09fda..3f7244ea2264b 100644 --- a/src/ui/public/courier/looper/_looper.js +++ b/src/ui/public/courier/looper/_looper.js @@ -3,7 +3,7 @@ import _ from 'lodash'; import 'ui/promises'; import Notifier from 'ui/notify/notifier'; -export default function LooperFactory($timeout, Promise) { +export function LooperProvider($timeout, Promise) { const notify = new Notifier(); function Looper(ms, fn) { diff --git a/src/ui/public/courier/looper/doc_admin.js b/src/ui/public/courier/looper/doc_admin.js index 09ef5ef568ea5..9201594c0621b 100644 --- a/src/ui/public/courier/looper/doc_admin.js +++ b/src/ui/public/courier/looper/doc_admin.js @@ -1,11 +1,11 @@ -import FetchProvider from '../fetch'; -import LooperProvider from './_looper'; -import DocStrategyProvider from '../fetch/strategy/doc_admin'; +import { FetchProvider } from '../fetch'; +import { LooperProvider } from './_looper'; +import { DocAdminStrategyProvider } from '../fetch/strategy/doc_admin'; -export default function DocLooperService(Private) { +export function DocAdminLooperProvider(Private) { const fetch = Private(FetchProvider); const Looper = Private(LooperProvider); - const DocStrategy = Private(DocStrategyProvider); + const DocStrategy = Private(DocAdminStrategyProvider); /** * The Looper which will manage the doc fetch interval diff --git a/src/ui/public/courier/looper/doc_data.js b/src/ui/public/courier/looper/doc_data.js index 9420adb26cf0f..9d0ea02e84bd7 100644 --- a/src/ui/public/courier/looper/doc_data.js +++ b/src/ui/public/courier/looper/doc_data.js @@ -1,11 +1,11 @@ -import FetchProvider from '../fetch'; -import LooperProvider from './_looper'; -import DocStrategyProvider from '../fetch/strategy/doc_data'; +import { FetchProvider } from '../fetch'; +import { LooperProvider } from './_looper'; +import { DocDataStrategyProvider } from '../fetch/strategy/doc_data'; -export default function DocLooperService(Private) { +export function DocDataLooperProvider(Private) { const fetch = Private(FetchProvider); const Looper = Private(LooperProvider); - const DocStrategy = Private(DocStrategyProvider); + const DocStrategy = Private(DocDataStrategyProvider); /** * The Looper which will manage the doc fetch interval diff --git a/src/ui/public/courier/looper/search.js b/src/ui/public/courier/looper/search.js index 6bcb61a92034c..ec03ee4a7b4f6 100644 --- a/src/ui/public/courier/looper/search.js +++ b/src/ui/public/courier/looper/search.js @@ -1,9 +1,9 @@ -import FetchProvider from '../fetch'; -import SearchStrategyProvider from '../fetch/strategy/search'; -import RequestQueueProvider from '../_request_queue'; -import LooperProvider from './_looper'; +import { FetchProvider } from '../fetch'; +import { SearchStrategyProvider } from '../fetch/strategy/search'; +import { RequestQueueProvider } from '../_request_queue'; +import { LooperProvider } from './_looper'; -export default function SearchLooperService(Private, Promise, Notifier, $rootScope) { +export function SearchLooperProvider(Private, Promise, Notifier, $rootScope) { const fetch = Private(FetchProvider); const searchStrategy = Private(SearchStrategyProvider); const requestQueue = Private(RequestQueueProvider); diff --git a/src/ui/public/courier/saved_object/saved_object.js b/src/ui/public/courier/saved_object/saved_object.js index acabadd5fd166..7e7642bb40ee0 100644 --- a/src/ui/public/courier/saved_object/saved_object.js +++ b/src/ui/public/courier/saved_object/saved_object.js @@ -16,8 +16,8 @@ import { SavedObjectNotFound } from 'ui/errors'; import uuid from 'node-uuid'; import MappingSetupProvider from 'ui/utils/mapping_setup'; -import DocSourceProvider from '../data_source/admin_doc_source'; -import SearchSourceProvider from '../data_source/search_source'; +import { AdminDocSourceProvider } from '../data_source/admin_doc_source'; +import { SearchSourceProvider } from '../data_source/search_source'; import { getTitleAlreadyExists } from './get_title_already_exists'; /** @@ -40,9 +40,9 @@ function isErrorNonFatal(error) { return error.message === OVERWRITE_REJECTED || error.message === SAVE_DUPLICATE_REJECTED; } -export default function SavedObjectFactory(esAdmin, kbnIndex, Promise, Private, Notifier, confirmModalPromise, indexPatterns) { +export function SavedObjectProvider(esAdmin, kbnIndex, Promise, Private, Notifier, confirmModalPromise, indexPatterns) { - const DocSource = Private(DocSourceProvider); + const DocSource = Private(AdminDocSourceProvider); const SearchSource = Private(SearchSourceProvider); const mappingSetup = Private(MappingSetupProvider); diff --git a/src/ui/public/index_patterns/__tests__/_index_pattern.js b/src/ui/public/index_patterns/__tests__/_index_pattern.js index 97f159e1d3500..e03562354ca78 100644 --- a/src/ui/public/index_patterns/__tests__/_index_pattern.js +++ b/src/ui/public/index_patterns/__tests__/_index_pattern.js @@ -7,7 +7,7 @@ import { DuplicateField } from 'ui/errors'; import IndexedArray from 'ui/indexed_array'; import FixturesLogstashFieldsProvider from 'fixtures/logstash_fields'; import FixturesStubbedDocSourceResponseProvider from 'fixtures/stubbed_doc_source_response'; -import DocSourceProvider from 'ui/courier/data_source/admin_doc_source'; +import { AdminDocSourceProvider } from 'ui/courier/data_source/admin_doc_source'; import UtilsMappingSetupProvider from 'ui/utils/mapping_setup'; import IndexPatternsIntervalsProvider from 'ui/index_patterns/_intervals'; import IndexPatternsIndexPatternProvider from 'ui/index_patterns/_index_pattern'; @@ -33,7 +33,7 @@ describe('index pattern', function () { mockLogstashFields = Private(FixturesLogstashFieldsProvider); docSourceResponse = Private(FixturesStubbedDocSourceResponseProvider); - DocSource = Private(DocSourceProvider); + DocSource = Private(AdminDocSourceProvider); sinon.stub(DocSource.prototype, 'doIndex'); sinon.stub(DocSource.prototype, 'fetch'); mapper = stubMapper(Private, mockLogstashFields); diff --git a/src/ui/public/index_patterns/_index_pattern.js b/src/ui/public/index_patterns/_index_pattern.js index bb3a92e9107b2..a2ca581578f82 100644 --- a/src/ui/public/index_patterns/_index_pattern.js +++ b/src/ui/public/index_patterns/_index_pattern.js @@ -7,7 +7,7 @@ import RegistryFieldFormatsProvider from 'ui/registry/field_formats'; import IndexPatternsGetIdsProvider from 'ui/index_patterns/_get_ids'; import IndexPatternsMapperProvider from 'ui/index_patterns/_mapper'; import IndexPatternsIntervalsProvider from 'ui/index_patterns/_intervals'; -import DocSourceProvider from 'ui/courier/data_source/admin_doc_source'; +import { AdminDocSourceProvider } from 'ui/courier/data_source/admin_doc_source'; import UtilsMappingSetupProvider from 'ui/utils/mapping_setup'; import IndexPatternsFieldListProvider from 'ui/index_patterns/_field_list'; import IndexPatternsFlattenHitProvider from 'ui/index_patterns/_flatten_hit'; @@ -19,7 +19,7 @@ export default function IndexPatternFactory(Private, Notifier, config, kbnIndex, const getIds = Private(IndexPatternsGetIdsProvider); const mapper = Private(IndexPatternsMapperProvider); const intervals = Private(IndexPatternsIntervalsProvider); - const DocSource = Private(DocSourceProvider); + const DocSource = Private(AdminDocSourceProvider); const mappingSetup = Private(UtilsMappingSetupProvider); const FieldList = Private(IndexPatternsFieldListProvider); const flattenHit = Private(IndexPatternsFlattenHitProvider); diff --git a/src/ui/public/parse_query/lib/from_user.js b/src/ui/public/parse_query/lib/from_user.js index c0802b5e79206..b8b7d5db50c81 100644 --- a/src/ui/public/parse_query/lib/from_user.js +++ b/src/ui/public/parse_query/lib/from_user.js @@ -1,5 +1,6 @@ import _ from 'lodash'; -import DecorateQueryProvider from 'ui/courier/data_source/_decorate_query'; +import { DecorateQueryProvider } from 'ui/courier/data_source/_decorate_query'; + export default function GetQueryFromUser(es, Private) { const decorateQuery = Private(DecorateQueryProvider);