kibana/test
CJ Cenizal 3ea4c3e0bc
Simplify Courier interface and organize internals (#20060)
**Interface changes**

There are two goals behind the interface changes:

* Make it clearer which courier modules are meant for public consumption by exporting them from the top level.
* Simplify the courier object by removing responsibilities and focusing its responsibility solely on scheduling search requests via the fetch method and timefilter.refreshInterval Angular event.

I did this by taking the following steps:

* Removing redirectWhenMissing, indexPatterns, SearchSource, and SavedObject from the courier object. I also removed some unused methods from its interface.
* redirectWhenMissing is now a service registered on the kibana/url Angular module.
* indexPatterns is now a service registered on the kibana/index_patterns Angular module.
* SearchSourceProvider and SavedObjectProvider are now top-level exports of ui/courier.
* migrateFilter, decorateQuery, buildQueryFromFilters, and luceneStringToDsl are now top-level exports of ui/courier.

**Internal changes**

I also made some internal changes in an effort to organize the code clearly and reduce unnecessary complexity.

* I refactored the async code in CallClient to appear sync with async/await and encapsulated chunks of logic in helper functions. I also used an isAborted flag instead of overwriting the esPromise var with an enum.
* I combined Looper and SearchLooper into a single class and deleted unused functions.
* I reorganized the courier/fetch/request code into SearchRequest, SegmentedSearchRequest, and serializeFetchParams modules.
* Renamed various other methods and variables to improve clarity.
2018-06-27 16:58:19 -07:00
..
api_integration [Management] Relationships API test coverage (#19737) 2018-06-20 15:57:02 -04:00
common [Functional Tests] Use @kbn/test on Kibana CI (#18967) 2018-06-26 18:08:40 -05:00
dev_certs [devServer] include self-signed certificates for testing 2016-01-19 14:19:25 -07:00
functional Simplify Courier interface and organize internals (#20060) 2018-06-27 16:58:19 -07:00
scripts [Functional Tests] Use @kbn/test on Kibana CI (#18967) 2018-06-26 18:08:40 -05:00