kibana/x-pack/plugins/graph
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
..
public Simplify Courier interface and organize internals (#20060) 2018-06-27 16:58:19 -07:00
server Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00
index.js [uiExports] migrate uiApp "uses" to explicit imports in apps (#17828) 2018-05-03 12:18:50 -07:00
mappings.json Migrate x-pack-kibana source to kibana 2018-04-24 13:48:10 -07:00