Specification second property row on wp overview tab

=> https://www.openproject.org/work_packages/8732
pull/1551/head
Till Breuer 10 years ago
parent e9e2879b53
commit 1aa2df2f0b
  1. 15
      app/assets/javascripts/angular/work_packages/controllers/work-package-details-controller.js

@ -80,13 +80,24 @@ angular.module('openproject.workPackages.controllers')
}); });
} }
var minimumNumberOfDisplayedProperties = 3; function secondRowToBeDisplayed() {
return !!workPackageProperties
.slice(3, 6)
.map(function(property) {
return workPackage.props[property];
})
.reduce(function(a, b) {
return a || b;
});
}
angular.forEach(workPackageProperties, function(property, index) { angular.forEach(workPackageProperties, function(property, index) {
var label = I18n.t('js.work_packages.properties.' + property), var label = I18n.t('js.work_packages.properties.' + property),
value = getFormattedPropertyValue(property); value = getFormattedPropertyValue(property);
if (!!value || index < minimumNumberOfDisplayedProperties) { if (!!value ||
index < 3 ||
index < 6 && secondRowToBeDisplayed()) {
addFormattedValueToPresentProperties(property, label, value); addFormattedValueToPresentProperties(property, label, value);
} else { } else {
$scope.emptyWorkPackageProperties.push(label); $scope.emptyWorkPackageProperties.push(label);

Loading…
Cancel
Save