add an empty option for the grouping modal

this uses a no value label for the empty option

Signed-off-by: Florian Kraft <f.kraft@finn.de>
pull/3171/head
Florian Kraft 9 years ago
parent 32a6d8fa8e
commit 7bc05b339e
  1. 17
      frontend/app/work_packages/controllers/dialogs/group-by.js
  2. 1
      frontend/app/work_packages/controllers/index.js

@ -26,11 +26,20 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
module.exports = function($scope, $filter, groupingModal, QueryService, WorkPackagesTableService) {
module.exports = function($scope,
$filter,
groupingModal,
QueryService,
WorkPackagesTableService,
I18n) {
this.name = 'GroupBy';
this.closeMe = groupingModal.deactivate;
var emptyOption = {
title: I18n.t('js.inplace.null_value_label')
};
$scope.vm = {};
$scope.updateGroupBy = function(){
@ -42,9 +51,11 @@ module.exports = function($scope, $filter, groupingModal, QueryService, WorkPack
$scope.workPackageTableData = WorkPackagesTableService.getWorkPackagesTableData();
$scope.$watch('workPackageTableData.groupableColumns', function(groupableColumns) {
if (!groupableColumns) return;
if (!groupableColumns) {
return;
}
$scope.vm.groupableColumns = [{}].concat(groupableColumns);
$scope.vm.groupableColumns = [emptyOption].concat(groupableColumns);
$scope.vm.selectedColumnName = QueryService.getGroupBy();
});

@ -159,6 +159,7 @@ angular.module('openproject.workPackages.controllers')
'groupingModal',
'QueryService',
'WorkPackagesTableService',
'I18n',
require('./dialogs/group-by')
])
.factory('saveModal', ['btfModal', function(btfModal) {

Loading…
Cancel
Save