mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Run request when Raw Data tto Raw Document switch
This commit is contained in:
parent
b2b04dd1b1
commit
b6e7609172
@ -51,9 +51,15 @@ export class ElasticQueryCtrl extends QueryCtrl {
|
||||
}
|
||||
|
||||
queryUpdated() {
|
||||
// As Raw Data and Raw Document have the same request, we need to run refresh if they are updated
|
||||
const isPossiblyRawDataSwitch = this.target.metrics.some(
|
||||
(metric: any) => metric.type === 'raw_data' || metric.type === 'raw_document'
|
||||
);
|
||||
const newJson = angular.toJson(this.datasource.queryBuilder.build(this.target), true);
|
||||
if (this.rawQueryOld && newJson !== this.rawQueryOld) {
|
||||
this.refresh();
|
||||
} else if (isPossiblyRawDataSwitch) {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
this.rawQueryOld = newJson;
|
||||
|
Loading…
Reference in New Issue
Block a user