diff --git a/app/assets/javascripts/angular/helpers/components/path-helper.js b/app/assets/javascripts/angular/helpers/components/path-helper.js index d182e7369f..4dd9702766 100644 --- a/app/assets/javascripts/angular/helpers/components/path-helper.js +++ b/app/assets/javascripts/angular/helpers/components/path-helper.js @@ -252,8 +252,8 @@ angular.module('openproject.helpers') staticEditWorkPackagePath: function(workPackageId){ return PathHelper.staticWorkPackagePath(workPackageId) + '/edit'; }, - staticProjectPath: function(projectId) { - return PathHelper.staticBase + PathHelper.projectPath(projectId); + staticProjectPath: function(projectIdentifier) { + return PathHelper.staticBase + PathHelper.projectPath(projectIdentifier); }, staticVersionPath: function(versionId) { return PathHelper.staticBase + PathHelper.versionPath(versionId); diff --git a/app/assets/javascripts/angular/helpers/components/work-packages-helper.js b/app/assets/javascripts/angular/helpers/components/work-packages-helper.js index cae81b6eea..9f812e7637 100644 --- a/app/assets/javascripts/angular/helpers/components/work-packages-helper.js +++ b/app/assets/javascripts/angular/helpers/components/work-packages-helper.js @@ -96,7 +96,7 @@ angular.module('openproject.workPackages.helpers') id = object.parent_id; break; case 'project': - id = object.project_id; + id = object.project.identifier; break; case 'subject': id = object.id; diff --git a/karma/tests/directives/work_packages/work-package-column-directive-test.js b/karma/tests/directives/work_packages/work-package-column-directive-test.js index 6c8fc9b3e2..939ee293cd 100644 --- a/karma/tests/directives/work_packages/work-package-column-directive-test.js +++ b/karma/tests/directives/work_packages/work-package-column-directive-test.js @@ -200,11 +200,30 @@ describe('workPackageColumn Directive', function() { sheep: 10, parent: { id: 1, subject: 'Test child work package' }, parent_id: 1, - custom_values: [ { custom_field_id: 1, field_format: 'string', value: 'asdf1234'} ] + custom_values: [ { custom_field_id: 1, field_format: 'string', value: 'asdf1234'} ], + project: { + id: 29, + identifier: 'project-dream-team' + } }; scope.displayType = 'link'; }); + describe('to project', function() { + beforeEach(function() { + scope.column = { + meta_data: { data_type: 'object', link: { display: true, model_type: 'project'} }, + name: 'project' + } + compile(); + }); + + it('should have correct href', function() { + var content = element.find('a').last(); + expect(content.attr('href')).to.equal('/projects/project-dream-team'); + }); + }); + describe('to parent work package', function() { beforeEach(function() {