From 5e592ca3391be9a6e64e6c39aea527a6e88c9b16 Mon Sep 17 00:00:00 2001 From: Mihail Maxacov <0xf013@gmail.com> Date: Thu, 5 Mar 2015 18:11:53 +0200 Subject: [PATCH] hack-ish fix for stringobject --- .../controllers/details-tab-overview-controller.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/app/work_packages/controllers/details-tab-overview-controller.js b/frontend/app/work_packages/controllers/details-tab-overview-controller.js index 636b8d16c0..41fd6a8a5e 100644 --- a/frontend/app/work_packages/controllers/details-tab-overview-controller.js +++ b/frontend/app/work_packages/controllers/details-tab-overview-controller.js @@ -143,12 +143,19 @@ module.exports = function($scope, prop.type.toLowerCase(); } - function getValue(workPackage, propName) { + function getValue(workPackage, prop, propName) { if (workPackage.props[propName]) { return workPackage.props[propName].raw; } if (workPackage.embedded[propName]) { - return workPackage.embedded[propName].props.id; + // this is here for compatibility with other code + // TODO: rewrite all this file when custom fields + // are editable + if (prop.type == 'User' || prop.type == 'Version') { + return workPackage.embedded[propName].props.id; + } else { + return workPackage.embedded[propName].props.value; + } } return null; } @@ -161,7 +168,7 @@ module.exports = function($scope, return { name: prop.name, format: getFormat(workPackage, prop, propName), - value: getValue(workPackage, propName) + value: getValue(workPackage, prop, propName) }; } return false;