From 1aa2df2f0b2805a59b7c840fa2835c0662de7d64 Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Fri, 4 Jul 2014 16:46:04 +0200 Subject: [PATCH] Specification second property row on wp overview tab => https://www.openproject.org/work_packages/8732 --- .../work-package-details-controller.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/angular/work_packages/controllers/work-package-details-controller.js b/app/assets/javascripts/angular/work_packages/controllers/work-package-details-controller.js index 622947b972..8e3286d126 100644 --- a/app/assets/javascripts/angular/work_packages/controllers/work-package-details-controller.js +++ b/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) { var label = I18n.t('js.work_packages.properties.' + property), value = getFormattedPropertyValue(property); - if (!!value || index < minimumNumberOfDisplayedProperties) { + if (!!value || + index < 3 || + index < 6 && secondRowToBeDisplayed()) { addFormattedValueToPresentProperties(property, label, value); } else { $scope.emptyWorkPackageProperties.push(label);