From 1046b728ff8d94446b9dc7a12aba046859d03726 Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 2 Sep 2014 15:42:32 +0200 Subject: [PATCH] add case for details view to handle and display categories. --- .../controllers/details-tab-overview-controller.js | 10 +++++++++- public/templates/work_packages/tabs/overview.html | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/angular/work_packages/controllers/details-tab-overview-controller.js b/app/assets/javascripts/angular/work_packages/controllers/details-tab-overview-controller.js index 14c9c7588e..2cffca8e57 100644 --- a/app/assets/javascripts/angular/work_packages/controllers/details-tab-overview-controller.js +++ b/app/assets/javascripts/angular/work_packages/controllers/details-tab-overview-controller.js @@ -30,6 +30,7 @@ angular.module('openproject.workPackages.controllers') .constant('TEXT_TYPE', 'text') .constant('VERSION_TYPE', 'version') +.constant('CATEGORY_TYPE', 'category') .constant('USER_TYPE', 'user') .constant('USER_FIELDS', ['assignee', 'author', 'responsible']) @@ -39,6 +40,7 @@ angular.module('openproject.workPackages.controllers') 'ConfigurationService', 'TEXT_TYPE', 'VERSION_TYPE', + 'CATEGORY_TYPE', 'USER_TYPE', 'USER_FIELDS', 'CustomFieldHelper', @@ -51,6 +53,7 @@ angular.module('openproject.workPackages.controllers') ConfigurationService, TEXT_TYPE, VERSION_TYPE, + CATEGORY_TYPE, USER_TYPE, USER_FIELDS, CustomFieldHelper, @@ -79,6 +82,9 @@ angular.module('openproject.workPackages.controllers') case USER_TYPE: return $scope.workPackage.embedded[property]; break; + case CATEGORY_TYPE: + return $scope.workPackage.embedded[property]; + break; default: return getFormattedPropertyValue(property); } @@ -170,8 +176,10 @@ angular.module('openproject.workPackages.controllers') function getPropertyFormat(property) { var format = USER_FIELDS.indexOf(property) === -1 ? TEXT_TYPE : USER_TYPE; + format = (property === 'versionName') ? VERSION_TYPE : format; + format = (property === 'category') ? CATEGORY_TYPE : format; - return ((property === 'versionName') ? VERSION_TYPE : format); + return format; } function addWorkPackageProperty(property, index) { diff --git a/public/templates/work_packages/tabs/overview.html b/public/templates/work_packages/tabs/overview.html index 12dff5f946..8eff118017 100644 --- a/public/templates/work_packages/tabs/overview.html +++ b/public/templates/work_packages/tabs/overview.html @@ -20,6 +20,7 @@ work-package="workPackage"> {{propertyData.value.title}} + {{ propertyData.value.props.name }}