parent
a905586569
commit
4ad8fbe911
@ -1,7 +1,7 @@ |
||||
angular.module('openproject.workPackages.filters') |
||||
|
||||
// work packages
|
||||
.filter('columnContent', ['WorkPackagesTableHelper', function(WorkPackagesTableHelper){ |
||||
return WorkPackagesTableHelper.getRowObjectContent; |
||||
.filter('columnContent', ['WorkPackagesHelper', function(WorkPackagesHelper){ |
||||
return WorkPackagesHelper.getRowObjectContent; |
||||
}]); |
||||
|
||||
|
@ -0,0 +1,20 @@ |
||||
angular.module('openproject.uiComponents') |
||||
|
||||
.factory('WorkPackagesHelper', [function() { |
||||
var WorkPackagesHelper = { |
||||
getRowObjectContent: function(object, option) { |
||||
var content = object[option]; |
||||
|
||||
switch(typeof(content)) { |
||||
case 'string': |
||||
return content; |
||||
case 'object': |
||||
return content.name; |
||||
default: |
||||
return ''; |
||||
} |
||||
} |
||||
}; |
||||
|
||||
return WorkPackagesHelper; |
||||
}]); |
Loading…
Reference in new issue