mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(templating): fixed issue with detecting data source variable in other template variable definition, fixes #5165
This commit is contained in:
parent
8c2b6b532d
commit
0daadc954c
@ -103,7 +103,7 @@ function (angular, _) {
|
||||
}
|
||||
|
||||
variableName = regexEscape(variableName);
|
||||
var findVarRegex = new RegExp('\\$(' + variableName + ')[\\W|$]|\\[\\[(' + variableName + ')\\]\\]', 'g');
|
||||
var findVarRegex = new RegExp('\\$(' + variableName + ')(?:\\W|$)|\\[\\[(' + variableName + ')\\]\\]', 'g');
|
||||
var match = findVarRegex.exec(str);
|
||||
return match !== null;
|
||||
};
|
||||
|
@ -205,6 +205,10 @@ define([
|
||||
expect(contains).to.be(true);
|
||||
});
|
||||
|
||||
it('should find it its the only thing', function() {
|
||||
var contains = _templateSrv.containsVariable('$env', 'env');
|
||||
expect(contains).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('updateTemplateData with simple value', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user