Merge pull request #1480 from opf/feature/blank-options-8746

Add blank option to group dialog drop down
pull/1426/merge
manwithtwowatches 11 years ago
commit 9695eb11b3
  1. 13
      app/assets/javascripts/angular/controllers/dialogs/group-by.js

@ -59,13 +59,20 @@ angular.module('openproject.workPackages.controllers')
$scope.workPackageTableData = WorkPackagesTableService.getWorkPackagesTableData();
function buildOptions() {
var blankOption = { id: null, label: ' ', other: null };
$scope.groupableColumnsData = $scope.groupableColumns.map(function(column){
return { id: column.name, label: column.title, other: column.title };
});
$scope.groupableColumnsData.unshift(blankOption);
}
$scope.$watch('workPackageTableData.groupableColumns', function(groupableColumns){
if (!groupableColumns) return;
$scope.groupableColumns = groupableColumns;
$scope.groupableColumnsData = groupableColumns.map(function(column){
return { id: column.name, label: column.title, other: column.title };
});
buildOptions();
var currentGroupBy = $scope.groupableColumnsData.filter(function(column){
return column.id == QueryService.getGroupBy();

Loading…
Cancel
Save