Merge pull request #1959 from opf/fix/sort_wp_modal_values

sort available values in wp modals
pull/1963/head
Alex Coles 10 years ago
commit 5c01019eeb
  1. 5
      app/assets/javascripts/angular/controllers/dialogs/columns.js
  2. 5
      app/assets/javascripts/angular/controllers/dialogs/group-by.js
  3. 5
      app/assets/javascripts/angular/controllers/dialogs/sorting.js

@ -51,7 +51,10 @@ angular.module('openproject.workPackages.controllers')
$scope.getObjectsData = function(term, result) {
// Note: This relies on the columns having been cached in the service so they can be instantly available.
result($filter('filter')($scope.availableColumnsData, {label: term}));
var filtered = $filter('filter')($scope.availableColumnsData, {label: term});
sorted = $filter('orderBy')(filtered, 'label');
return result(sorted);
};
// Data conversion for select2

@ -49,7 +49,10 @@ angular.module('openproject.workPackages.controllers')
this.closeMe = groupingModal.deactivate;
$scope.getGroupableColumnsData = function(term, result) {
result($filter('filter')($scope.groupableColumnsData, {label: term}));
var filtered = $filter('filter')($scope.groupableColumnsData, { label: term });
sorted = $filter('orderBy')(filtered, 'label');
return result(sorted);
};
$scope.updateGroupBy = function(){

@ -68,7 +68,10 @@ angular.module('openproject.workPackages.controllers')
// functions exposing available options to select2
$scope.getAvailableColumnsData = function(term, result) {
return result($filter('filter')(getRemainingAvailableColumnsData(), { label: term }));
var filtered = $filter('filter')(getRemainingAvailableColumnsData(), { label: term });
sorted = $filter('orderBy')(filtered, 'label');
return result(sorted);
};
$scope.getDirectionsData = function(term, result) {
return result($filter('filter')($scope.availableDirectionsData, { label: term }));

Loading…
Cancel
Save