Commit fb9f9548 by Torkel Ödegaard

fix(graphite): Fix for bug when using series ref (#A-Z) and referenced series is…

fix(graphite): Fix for bug when using series ref (#A-Z) and referenced series is hidden in query editor. fixes #2484
parent 95cad91b
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- [Issue #2446](https://github.com/grafana/grafana/issues/2446). InfluxDB: Fix for using template vars inside alias field (InfluxDB 0.9) - [Issue #2446](https://github.com/grafana/grafana/issues/2446). InfluxDB: Fix for using template vars inside alias field (InfluxDB 0.9)
- [Issue #2460](https://github.com/grafana/grafana/issues/2460). SinglestatPanel: Fix to handle series with no data points - [Issue #2460](https://github.com/grafana/grafana/issues/2460). SinglestatPanel: Fix to handle series with no data points
- [Issue #2461](https://github.com/grafana/grafana/issues/2461). LDAP: Fix for ldap users with empty email address - [Issue #2461](https://github.com/grafana/grafana/issues/2461). LDAP: Fix for ldap users with empty email address
- [Issue #2484](https://github.com/grafana/grafana/issues/2484). Graphite: Fix bug when using series ref (#A-Z) and referenced series is hidden in query editor.
# 2.1.0 (2015-08-04) # 2.1.0 (2015-08-04)
......
...@@ -270,7 +270,7 @@ function (angular, _, $, config, kbn, moment) { ...@@ -270,7 +270,7 @@ function (angular, _, $, config, kbn, moment) {
for (i = 0; i < options.targets.length; i++) { for (i = 0; i < options.targets.length; i++) {
target = options.targets[i]; target = options.targets[i];
if (!target.target || target.hide) { if (!target.target) {
continue; continue;
} }
...@@ -278,8 +278,10 @@ function (angular, _, $, config, kbn, moment) { ...@@ -278,8 +278,10 @@ function (angular, _, $, config, kbn, moment) {
targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer); targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);
targets[this._seriesRefLetters[i]] = targetValue; targets[this._seriesRefLetters[i]] = targetValue;
if (!target.hide) {
clean_options.push("target=" + encodeURIComponent(targetValue)); clean_options.push("target=" + encodeURIComponent(targetValue));
} }
}
_.each(options, function (value, key) { _.each(options, function (value, key) {
if ($.inArray(key, graphite_options) === -1) { return; } if ($.inArray(key, graphite_options) === -1) { return; }
......
...@@ -79,6 +79,13 @@ define([ ...@@ -79,6 +79,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 for hidden series', function() {
var results = ctx.ds.buildGraphiteParams({
targets: [{target: 'series1', hide: true}, {target: 'sumSeries(#A)', hide: true}, {target: 'asPercent(#A,#B)'}]
});
expect(results[0]).to.be('target=' + encodeURIComponent('asPercent(series1,sumSeries(series1))'));
});
it('should replace target placeholder when nesting query references', function() { it('should replace target placeholder when nesting query references', function() {
var results = ctx.ds.buildGraphiteParams({ var results = ctx.ds.buildGraphiteParams({
targets: [{target: 'series1'}, {target: 'sumSeries(#A)'}, {target: 'asPercent(#A,#B)'}] targets: [{target: 'series1'}, {target: 'sumSeries(#A)'}, {target: 'asPercent(#A,#B)'}]
......
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