Explore: Fix showing of results of queries in table (#24018)

* Fix: Show results of instant queries in Explore tables

* Add PreferredVisualisationType to meta

* Implement visualisation exception for Prometheus

* Implement visualisation exception for Elastic
This commit is contained in:
Ivana Huckova
2020-04-30 12:41:03 +02:00
committed by GitHub
parent f2254081c2
commit e2436b29c0
6 changed files with 41 additions and 8 deletions

View File

@@ -452,7 +452,11 @@ export class ElasticResponse {
this.nameSeries(tmpSeriesList, target);
for (let y = 0; y < tmpSeriesList.length; y++) {
const series = toDataFrame(tmpSeriesList[y]);
let series = toDataFrame(tmpSeriesList[y]);
// When log results, show aggregations only in graph. Log fields are then going to be shown in table.
series = addPreferredVisualisationType(series, 'graph');
dataFrame.push(series);
}
}
@@ -568,3 +572,14 @@ const createEmptyDataFrame = (
return series;
};
const addPreferredVisualisationType = (series: any, type: string) => {
let s = series;
s.meta
? (s.meta.preferredVisualisationType = type)
: (s.meta = {
preferredVisualisationType: type,
});
return s;
};