Commit 4a937661 by Chris Ross Committed by Daniel Lee

Add case-insensitive sort for variables.

parent a6c76355
...@@ -23,6 +23,8 @@ export class VariableEditorCtrl { ...@@ -23,6 +23,8 @@ export class VariableEditorCtrl {
{ value: 2, text: 'Alphabetical (desc)' }, { value: 2, text: 'Alphabetical (desc)' },
{ value: 3, text: 'Numerical (asc)' }, { value: 3, text: 'Numerical (asc)' },
{ value: 4, text: 'Numerical (desc)' }, { value: 4, text: 'Numerical (desc)' },
{ value: 5, text: 'Alphabetical (case-insensitive, asc)' },
{ value: 6, text: 'Alphabetical (case-insensitive, desc)' },
]; ];
$scope.hideOptions = [{ value: 0, text: '' }, { value: 1, text: 'Label' }, { value: 2, text: 'Variable' }]; $scope.hideOptions = [{ value: 0, text: '' }, { value: 1, text: 'Label' }, { value: 2, text: 'Variable' }];
......
...@@ -197,6 +197,8 @@ export class QueryVariable implements Variable { ...@@ -197,6 +197,8 @@ export class QueryVariable implements Variable {
return parseInt(matches[1], 10); return parseInt(matches[1], 10);
} }
}); });
} else if (sortType === 3) {
options = _.sortBy(options, opt => { return _.toLower(opt.text); });
} }
if (reverseSort) { if (reverseSort) {
......
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