diff --git a/CHANGELOG.md b/CHANGELOG.md index 8215e325a1f..77e6019a60c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ - [Issue #672](https://github.com/grafana/grafana/issues/672). Dashboard: panel fullscreen & edit state is present in url, can now link to graph in edit & fullscreen mode. **Fixes** -- [Issue #696](https://github.com/grafana/grafana/issues/696). Graph: fix for y-axis format 'none' when values are in scientific notation (ex 2.3e-13) +- [Issue #696](https://github.com/grafana/grafana/issues/696). Graph: Fix for y-axis format 'none' when values are in scientific notation (ex 2.3e-13) +- [Issue #697](https://github.com/grafana/grafana/issues/697). Graphite: Fix for Glob syntax in graphite queries ([1-9] and ?) that made the query editor / parser bail and fallback to a text box. **Tech** - Upgraded from angularjs 1.1.5 to 1.3 beta 17; diff --git a/src/app/directives/ngModelOnBlur.js b/src/app/directives/ngModelOnBlur.js index 2a107e71808..0e9d94a282e 100644 --- a/src/app/directives/ngModelOnBlur.js +++ b/src/app/directives/ngModelOnBlur.js @@ -7,13 +7,14 @@ function (angular) { .directive('ngModelOnblur', function() { return { restrict: 'A', + priority: 1, require: 'ngModel', link: function(scope, elm, attr, ngModelCtrl) { if (attr.type === 'radio' || attr.type === 'checkbox') { return; } - elm.unbind('input').unbind('keydown').unbind('change'); + elm.off('input keydown change'); elm.bind('blur', function() { scope.$apply(function() { ngModelCtrl.$setViewValue(elm.val()); @@ -22,4 +23,4 @@ function (angular) { } }; }); -}); \ No newline at end of file +}); diff --git a/src/app/services/graphite/lexer.js b/src/app/services/graphite/lexer.js index 718d5206ee9..05249b9bff9 100644 --- a/src/app/services/graphite/lexer.js +++ b/src/app/services/graphite/lexer.js @@ -124,6 +124,9 @@ define([ i === 45 || // - i === 42 || // * i === 58 || // : + i === 91 || // templateStart [ + i === 93 || // templateEnd ] + i === 63 || // ? i === 37 || // % i >= 97 && i <= 122; // a-z } diff --git a/src/test/specs/lexer-specs.js b/src/test/specs/lexer-specs.js index 92dbb2c6931..04531423802 100644 --- a/src/test/specs/lexer-specs.js +++ b/src/test/specs/lexer-specs.js @@ -71,10 +71,17 @@ define([ it('should tokenize metric with template parameter', function() { var lexer = new Lexer("metric.[[server]].test"); var tokens = lexer.tokenize(); - expect(tokens[2].type).to.be('templateStart'); - expect(tokens[3].type).to.be('identifier'); - expect(tokens[3].value).to.be('server'); - expect(tokens[4].type).to.be('templateEnd'); + expect(tokens[2].type).to.be('identifier'); + expect(tokens[2].value).to.be('[[server]]'); + expect(tokens[4].type).to.be('identifier'); + }); + + it('should tokenize metric with question mark', function() { + var lexer = new Lexer("metric.server_??.test"); + var tokens = lexer.tokenize(); + expect(tokens[2].type).to.be('identifier'); + expect(tokens[2].value).to.be('server_??'); + expect(tokens[4].type).to.be('identifier'); }); it('should handle error with unterminated string', function() { diff --git a/src/test/specs/parser-specs.js b/src/test/specs/parser-specs.js index feb5367711d..802474a5814 100644 --- a/src/test/specs/parser-specs.js +++ b/src/test/specs/parser-specs.js @@ -106,8 +106,8 @@ define([ expect(rootNode.message).to.be(undefined); expect(rootNode.params[0].type).to.be('metric'); - expect(rootNode.params[0].segments[1].type).to.be('template'); - expect(rootNode.params[0].segments[1].value).to.be('server'); + expect(rootNode.params[0].segments[1].type).to.be('segment'); + expect(rootNode.params[0].segments[1].value).to.be('[[server]]'); }); it('invalid metric expression', function() {