Commit 871b98c0 by Torkel Ödegaard

graphite: minor fix for PR #10142 the query was being sent for every segmen t…

graphite: minor fix for PR #10142 the query was being sent for every segmen t you selected before you completed the metric path
parent bb52f367
...@@ -120,6 +120,10 @@ export default class GraphiteQuery { ...@@ -120,6 +120,10 @@ export default class GraphiteQuery {
this.segments.push({value: "select metric"}); this.segments.push({value: "select metric"});
} }
hasSelectMetric() {
return this.segments[this.segments.length - 1].value === 'select metric';
}
addFunction(newFunc) { addFunction(newFunc) {
this.functions.push(newFunc); this.functions.push(newFunc);
this.moveAliasFuncLast(); this.moveAliasFuncLast();
......
...@@ -218,7 +218,7 @@ export class GraphiteQueryCtrl extends QueryCtrl { ...@@ -218,7 +218,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
var oldTarget = this.queryModel.target.target; var oldTarget = this.queryModel.target.target;
this.updateModelTarget(); this.updateModelTarget();
if (this.queryModel.target !== oldTarget) { if (this.queryModel.target !== oldTarget && !this.queryModel.hasSelectMetric()) {
this.panelCtrl.refresh(); this.panelCtrl.refresh();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment