From bc5df6e05134dab66461c656f6f5d0672e10e41b Mon Sep 17 00:00:00 2001 From: Tim Habermaas Date: Fri, 14 Aug 2015 16:12:12 +0200 Subject: [PATCH] Point work package link from table to new angular show view. --- .../templates/work_packages/work_package_column.html | 1 + .../directives/work-package-column-directive.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/app/templates/work_packages/work_package_column.html b/frontend/app/templates/work_packages/work_package_column.html index ae6a170e15..a9422bc776 100644 --- a/frontend/app/templates/work_packages/work_package_column.html +++ b/frontend/app/templates/work_packages/work_package_column.html @@ -5,6 +5,7 @@ {{ displayText }} + {{ displayText }} {{ displayText }} diff --git a/frontend/app/work_packages/directives/work-package-column-directive.js b/frontend/app/work_packages/directives/work-package-column-directive.js index 37c0d70c28..0879bf0bc0 100644 --- a/frontend/app/work_packages/directives/work-package-column-directive.js +++ b/frontend/app/work_packages/directives/work-package-column-directive.js @@ -114,14 +114,18 @@ module.exports = function(PathHelper, WorkPackagesHelper, UserService){ function displayDataAsLink(id) { // Example of how we can look to the provided meta data to format the column // This relies on the meta being sent from the server - scope.displayType = 'link'; - scope.url = getLinkFor(id, scope.column.meta_data.link); + var link_meta = scope.column.meta_data.link; + if (link_meta.model_type === 'work_package') { + scope.displayType = 'ref'; + scope.stateRef = 'work-packages.show.activity({workPackageId: ' + id + '})'; + } else { + scope.displayType = 'link'; + scope.url = getLinkFor(id, link_meta); + } } function getLinkFor(id, link_meta){ switch (link_meta.model_type) { - case 'work_package': - return PathHelper.workPackagePath(id); case 'user': if (scope.workPackage[scope.column.name] && scope.workPackage[scope.column.name].type == 'Group') { // if it's a group, we have nothing to link to