Elasticsearch: Only show numbers in histogram field autocomplete (#38631) (#38652)

(cherry picked from commit b5e4a0a39a)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
This commit is contained in:
Grot (@grafanabot)
2021-08-27 18:44:39 +02:00
committed by GitHub
parent 786174ce94
commit 8cfc6571d8
2 changed files with 7 additions and 0 deletions
@@ -60,6 +60,11 @@ describe('useFields hook', () => {
result.current();
expect(getFields).toHaveBeenLastCalledWith(['date'], timeRange);
// Histrogram only works on numbers
rerender('histogram');
result.current();
expect(getFields).toHaveBeenLastCalledWith(['number'], timeRange);
// Geohash Grid only works on geo_point data
rerender('geohash_grid');
result.current();
@@ -33,6 +33,8 @@ const getFilter = (type: AggregationType) => {
return ['date'];
case 'geohash_grid':
return ['geo_point'];
case 'histogram':
return ['number'];
default:
return [];
}