mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
Elasticsearch: Name fields after template variables values instead of their name (#36035)
This reverts commit 185bf8f9a2
.
This commit is contained in:
parent
e6e7ba209c
commit
a97259f07d
@ -35,7 +35,6 @@ import {
|
||||
import { bucketAggregationConfig } from './components/QueryEditor/BucketAggregationsEditor/utils';
|
||||
import {
|
||||
BucketAggregation,
|
||||
BucketAggregationWithField,
|
||||
isBucketAggregationWithField,
|
||||
} from './components/QueryEditor/BucketAggregationsEditor/aggregations';
|
||||
import { generate, Observable, of, throwError } from 'rxjs';
|
||||
@ -391,23 +390,7 @@ export class ElasticDatasource extends DataSourceApi<ElasticsearchQuery, Elastic
|
||||
this.templateSrv.replace(JSON.stringify(expandedQueries), scopedVars)
|
||||
);
|
||||
|
||||
// FIXME: with 8.0 we introduced an undocumented breaking change on how we name frames fields.
|
||||
// Although the introduced behavior is correct, it wasn't documented.
|
||||
// The following lines will restore the previous behaviour for 8.0, to be removed with a proper
|
||||
// changelog in 8.1 by returning `finalQueries` without any further modification
|
||||
return finalQueries.map((q, queryIndex) => ({
|
||||
...q,
|
||||
bucketAggs: q.bucketAggs?.map((bucketAgg, aggIndex) => {
|
||||
if (isBucketAggregationWithField(bucketAgg)) {
|
||||
return {
|
||||
...bucketAgg,
|
||||
field: (queries[queryIndex].bucketAggs?.[aggIndex] as BucketAggregationWithField).field,
|
||||
};
|
||||
}
|
||||
|
||||
return bucketAgg;
|
||||
}),
|
||||
}));
|
||||
return finalQueries;
|
||||
}
|
||||
|
||||
testDatasource() {
|
||||
|
Loading…
Reference in New Issue
Block a user