Commit d3c37bda by Torkel Ödegaard

Graphite: Fix for nested complex queries, where a query references a query that…

Graphite: Fix for nested complex queries, where a query references a query that references another query (ie the #[A-Z] syntax), Fixes #1372
parent 5cef7333
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
- [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query - [Issue #1298](https://github.com/grafana/grafana/issues/1298). InfluxDB: Fix handling of empty array in templating variable query
- [Issue #1309](https://github.com/grafana/grafana/issues/1309). Graph: Fixed issue when using zero as a grid threshold - [Issue #1309](https://github.com/grafana/grafana/issues/1309). Graph: Fixed issue when using zero as a grid threshold
- [Issue #1345](https://github.com/grafana/grafana/issues/1345). UI: Fixed position of confirm modal when scrolled down - [Issue #1345](https://github.com/grafana/grafana/issues/1345). UI: Fixed position of confirm modal when scrolled down
- [Issue #1372](https://github.com/grafana/grafana/issues/1372). Graphite: Fix for nested complex queries, where a query references a query that references another query (ie the #[A-Z] syntax)
**Tech** **Tech**
- [Issue #1311](https://github.com/grafana/grafana/issues/1311). Tech: Updated Font-Awesome from 3.2 to 4.2 - [Issue #1311](https://github.com/grafana/grafana/issues/1311). Tech: Updated Font-Awesome from 3.2 to 4.2
......
...@@ -276,6 +276,7 @@ function (angular, _, $, config, kbn, moment) { ...@@ -276,6 +276,7 @@ function (angular, _, $, config, kbn, moment) {
targetValue = targets[this._seriesRefLetters[i]]; targetValue = targets[this._seriesRefLetters[i]];
targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer); targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);
targets[this._seriesRefLetters[i]] = targetValue;
clean_options.push("target=" + encodeURIComponent(targetValue)); clean_options.push("target=" + encodeURIComponent(targetValue));
} }
......
...@@ -74,6 +74,13 @@ define([ ...@@ -74,6 +74,13 @@ define([
expect(results[2]).to.be('target=asPercent(series1%2Cseries2)'); expect(results[2]).to.be('target=asPercent(series1%2Cseries2)');
}); });
it('should replace target placeholder when nesting query references', function() {
var results = ctx.ds.buildGraphiteParams({
targets: [{target: 'series1'}, {target: 'sumSeries(#A)'}, {target: 'asPercent(#A,#B)'}]
});
expect(results[2]).to.be('target=' + encodeURIComponent("asPercent(series1,sumSeries(series1))"));
});
it('should fix wrong minute interval parameters', function() { it('should fix wrong minute interval parameters', function() {
var results = ctx.ds.buildGraphiteParams({ var results = ctx.ds.buildGraphiteParams({
targets: [{target: "summarize(prod.25m.count, '25m', 'sum')" }] targets: [{target: "summarize(prod.25m.count, '25m', 'sum')" }]
......
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