Commit 586399a8 by Torkel Ödegaard

Graphite: Fix for graphite expressions parser failure when metric expressions…

Graphite: Fix for graphite expressions parser failure when metric expressions starts with curly brace segment, Fixes #528
parent 867186fd
......@@ -25,6 +25,7 @@
- [Issue #545](https://github.com/grafana/grafana/issues/545). Chart: Fix formatting negative values (axis formats, legend values)
- [Issue #460](https://github.com/grafana/grafana/issues/460). Chart: fix for max legend value when max value is zero
- [Issue #628](https://github.com/grafana/grafana/issues/628). Filtering: Fix for nested filters, changing a child filter could result in infinite recursion in some cases
- [Issue #528](https://github.com/grafana/grafana/issues/528). Graphite: Fix for graphite expressions parser failure when metric expressions starts with curly brace segment
# 1.6.1 (2014-06-24)
......
......@@ -97,7 +97,10 @@ define([
},
metricExpression: function() {
if (!this.match('templateStart') && !this.match('identifier') && !this.match('number')) {
if (!this.match('templateStart') &&
!this.match('identifier') &&
!this.match('number') &&
!this.match('{')) {
return null;
}
......@@ -221,4 +224,4 @@ define([
};
return Parser;
});
\ No newline at end of file
});
......@@ -140,7 +140,7 @@ define([
expect(rootNode.type).to.be('function');
});
it('handle float function arguments', function() {
it('handle float function arguments', function() {
var parser = new Parser('scale(test, 0.002)');
var rootNode = parser.getAst();
expect(rootNode.type).to.be('function');
......@@ -148,6 +148,14 @@ define([
expect(rootNode.params[1].value).to.be(0.002);
});
it('handle curly brace pattern at start', function() {
var parser = new Parser('{apps}.test');
var rootNode = parser.getAst();
expect(rootNode.type).to.be('metric');
expect(rootNode.segments[0].value).to.be('{apps}');
expect(rootNode.segments[1].value).to.be('test');
});
});
});
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