add case for details view to handle and display categories.

pull/1818/head
Richard 10 years ago
parent 2e7651611f
commit 1046b728ff
  1. 10
      app/assets/javascripts/angular/work_packages/controllers/details-tab-overview-controller.js
  2. 1
      public/templates/work_packages/tabs/overview.html

@ -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) {

@ -20,6 +20,7 @@
work-package="workPackage">
</span>
<span ng-switch-when="version"><a ng-href="{{propertyData.value.href}}">{{propertyData.value.title}}</a></span>
<span ng-switch-when="category">{{ propertyData.value.props.name }}</span>
<span ng-switch-default ng-bind="(propertyData.value !== undefined) ? propertyData.value : '-'"/>
</span>
</li>

Loading…
Cancel
Save