fix(templating): fixed unique filter after regex pass, fixes #6086

pull/6108/head
Torkel Ödegaard 9 years ago
parent b4111d78e1
commit 9e26a4cfcb
  1. 4
      public/app/features/templating/query_variable.ts
  2. 2
      public/app/features/templating/specs/variable_srv_specs.ts

@ -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'}];
});

Loading…
Cancel
Save