fix accessing type on details pane

pull/2701/head
Jens Ulferts 10 years ago
parent f46d10f1a4
commit a4b8cff805
  1. 3
      frontend/app/work_packages/controllers/work-package-details-controller.js
  2. 2
      frontend/public/templates/work_packages.list.details.html
  3. 15
      frontend/tests/unit/tests/work_packages/controllers/work-package-details-controller-test.js

@ -115,6 +115,9 @@ module.exports = function($scope,
$scope.showStaticPagePath = PathHelper.staticWorkPackagePath($scope.workPackage.props.id);
// Type
$scope.type = workPackage.embedded.type;
// Author
$scope.author = workPackage.embedded.author;
$scope.authorPath = PathHelper.staticUserPath($scope.author.props.id);

@ -30,7 +30,7 @@
<span class="hidden-for-sighted" tabindex="-1" focus ng-bind="focusAnchorLabel">
</span>
<div class="select-type">{{ workPackage.props.type }}:&nbsp;</div>
<div class="select-type">{{ type.props.name }}:&nbsp;</div>
<div
class="wp-subject"

@ -185,4 +185,19 @@ describe('WorkPackageDetailsController', function() {
expect(scope.showStaticPagePath).to.eql('/work_packages/99');
});
});
describe('type', function() {
var type = { 'type': 'Type',
'name': 'type0815' };
beforeEach(function() {
workPackage.embedded.type = type;
buildController();
});
it('is the embedded type', function() {
expect(scope.type).to.eql(type);
});
});
});

Loading…
Cancel
Save