hack-ish fix for stringobject

pull/2550/head
Mihail Maxacov 10 years ago
parent 8f1b5156b1
commit 5e592ca339
  1. 13
      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;

Loading…
Cancel
Save