mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Elasticsearch: Only show numbers in histogram field autocomplete (#38631)
This commit is contained in:
@@ -60,6 +60,11 @@ describe('useFields hook', () => {
|
|||||||
result.current();
|
result.current();
|
||||||
expect(getFields).toHaveBeenLastCalledWith(['date'], timeRange);
|
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
|
// Geohash Grid only works on geo_point data
|
||||||
rerender('geohash_grid');
|
rerender('geohash_grid');
|
||||||
result.current();
|
result.current();
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ const getFilter = (type: AggregationType) => {
|
|||||||
return ['date'];
|
return ['date'];
|
||||||
case 'geohash_grid':
|
case 'geohash_grid':
|
||||||
return ['geo_point'];
|
return ['geo_point'];
|
||||||
|
case 'histogram':
|
||||||
|
return ['number'];
|
||||||
default:
|
default:
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user