mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
# Conflicts: # test/functional/apps/visualize/_vertical_bar_chart.js
This commit is contained in:
parent
14bf833a93
commit
fafdaa1e77
1 changed files with 3 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
import _ from 'lodash';
|
||||
import { SearchSourceProvider } from '../../courier/data_source/search_source';
|
||||
import { VisRequestHandlersRegistryProvider } from '../../registry/vis_request_handlers';
|
||||
import { calculateObjectHash } from '../lib/calculate_object_hash';
|
||||
|
||||
const CourierRequestHandlerProvider = function (Private, courier, timefilter) {
|
||||
const SearchSource = Private(SearchSourceProvider);
|
||||
|
@ -72,22 +73,11 @@ const CourierRequestHandlerProvider = function (Private, courier, timefilter) {
|
|||
searchSource.set('query', appState.query);
|
||||
}
|
||||
|
||||
// AggConfig contains circular reference to vis, which contains visualization parameters,
|
||||
// which we should not look at
|
||||
const copyAggs = (aggs) => {
|
||||
return aggs.map(agg => {
|
||||
return {
|
||||
type: agg.type,
|
||||
params: agg.params
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const shouldQuery = () => {
|
||||
if (!searchSource.lastQuery || vis.reload) return true;
|
||||
if (!_.isEqual(_.cloneDeep(searchSource.get('filter')), searchSource.lastQuery.filter)) return true;
|
||||
if (!_.isEqual(_.cloneDeep(searchSource.get('query')), searchSource.lastQuery.query)) return true;
|
||||
if (!_.isEqual(_.cloneDeep(copyAggs(vis.aggs.getRequestAggs())), searchSource.lastQuery.aggs)) return true;
|
||||
if (!_.isEqual(calculateObjectHash(vis.aggs.getRequestAggs()), searchSource.lastQuery.aggs)) return true;
|
||||
if (!_.isEqual(_.cloneDeep(timeRange), searchSource.lastQuery.timeRange)) return true;
|
||||
|
||||
return false;
|
||||
|
@ -100,7 +90,7 @@ const CourierRequestHandlerProvider = function (Private, courier, timefilter) {
|
|||
searchSource.lastQuery = {
|
||||
filter: _.cloneDeep(searchSource.get('filter')),
|
||||
query: _.cloneDeep(searchSource.get('query')),
|
||||
aggs: _.cloneDeep(copyAggs(vis.aggs.getRequestAggs())),
|
||||
aggs: calculateObjectHash(vis.aggs.getRequestAggs()),
|
||||
timeRange: _.cloneDeep(timeRange)
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue