fix(templating): fixed unique filter after regex pass, fixes #6086
This commit is contained in:
@@ -115,14 +115,14 @@ export class QueryVariable implements Variable {
|
||||
if (!matches) { continue; }
|
||||
if (matches.length > 1) {
|
||||
value = matches[1];
|
||||
text = value;
|
||||
text = matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
options.push({text: text, value: value});
|
||||
}
|
||||
|
||||
options = _.uniq(options, 'value');
|
||||
options = _.uniqBy(options, 'value');
|
||||
return this.sortVariableValues(options, this.sort);
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ describe('VariableSrv', function() {
|
||||
describeUpdateVariable('regex pattern remove duplicates', function(scenario) {
|
||||
scenario.setup(function() {
|
||||
scenario.variableModel = {type: 'query', query: 'apps.*', name: 'test'};
|
||||
scenario.variableModel.regex = 'backend_01';
|
||||
scenario.variableModel.regex = '/backend_01/';
|
||||
scenario.queryResult = [{text: 'apps.backend.backend_01.counters.req'}, {text: 'apps.backend.backend_01.counters.req'}];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user