Merge pull request #1880 from opf/fix/15518-links-to-project-in-project-column

Fix project links in work packages table
pull/1887/head
ulferts 10 years ago
commit 895b248e0c
  1. 4
      app/assets/javascripts/angular/helpers/components/path-helper.js
  2. 2
      app/assets/javascripts/angular/helpers/components/work-packages-helper.js
  3. 21
      karma/tests/directives/work_packages/work-package-column-directive-test.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);

@ -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;

@ -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() {

Loading…
Cancel
Save