Merge pull request #3835 from oliverguenther/fix/bulk_edit

Restore bulk edit for more than one selected work package
pull/3839/head
ulferts 9 years ago
commit ca3a3e90e8
  1. 27
      frontend/app/work_packages/controllers/menus/work-package-context-menu-controller.js

@ -62,11 +62,7 @@ module.exports = function(
break;
case 'edit':
var params = {
workPackageId: getSelectedWorkPackageId()
}
EditableFieldsState.editAll.start();
$state.transitionTo('work-packages.list.details.overview', params);
editSelectedWorkPackages(link);
break;
default:
@ -81,17 +77,28 @@ module.exports = function(
WorkPackageService.performBulkDelete(getSelectedWorkPackages().map(function(wp) { return wp.id; }), true);
}
function editSelectedWorkPackages(link) {
var selected = getSelectedWorkPackages();
if (selected.length > 1) {
$window.location.href = link;
return;
}
var params = {
workPackageId: selected[0].id
};
EditableFieldsState.editAll.start();
$state.transitionTo('work-packages.list.details.overview', params);
}
function getWorkPackagesFromSelectedRows() {
var selectedRows = WorkPackagesTableHelper.getSelectedRows($scope.rows);
return WorkPackagesTableHelper.getWorkPackagesFromRows(selectedRows);
}
function getSelectedWorkPackageId() {
var selected = getSelectedWorkPackages()[0];
return selected && selected.id;
}
function getSelectedWorkPackages() {
var workPackagefromContext = $scope.row.object;
var workPackagesfromSelectedRows = getWorkPackagesFromSelectedRows();

Loading…
Cancel
Save