diff --git a/frontend/app/work_packages/directives/inplace_editor/inplace-editor-display-pane-directive.js b/frontend/app/work_packages/directives/inplace_editor/inplace-editor-display-pane-directive.js index 4a5e9c0d8f..72631de291 100644 --- a/frontend/app/work_packages/directives/inplace_editor/inplace-editor-display-pane-directive.js +++ b/frontend/app/work_packages/directives/inplace_editor/inplace-editor-display-pane-directive.js @@ -80,12 +80,11 @@ module.exports = function( link: function(scope, element, attrs, fieldController) { scope.fieldController = fieldController; scope.displayPaneController.field = scope.fieldController.field; - scope.templateUrl = '/templates/components/inplace_editor/display/' + - WorkPackageFieldService.getInplaceDisplayStrategy( - EditableFieldsState.workPackage, - fieldController.field - ) + - '.html'; + var type = WorkPackageFieldService.getInplaceDisplayStrategy( + EditableFieldsState.workPackage, + fieldController.field + ) + scope.templateUrl = '/templates/components/inplace_editor/display/' + type +'.html'; // TODO: extract this when more placeholders come if (fieldController.field === 'description') { diff --git a/frontend/app/work_packages/services/work-package-field-service.js b/frontend/app/work_packages/services/work-package-field-service.js index b3e184b1c6..a6e45c09d9 100644 --- a/frontend/app/work_packages/services/work-package-field-service.js +++ b/frontend/app/work_packages/services/work-package-field-service.js @@ -71,7 +71,7 @@ module.exports = function( } function getValue(workPackage, field) { - if(field == 'date') { + if (field === 'date') { return { startDate: workPackage.props['startDate'], dueDate: workPackage.props['dueDate'] @@ -263,6 +263,7 @@ module.exports = function( break; case 'User': displayStrategy = 'user'; + break; case 'DateRange': displayStrategy = 'daterange'; break; diff --git a/frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.js b/frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.js index 938a5de0d6..f32a71b73a 100644 --- a/frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.js +++ b/frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.js @@ -237,11 +237,9 @@ describe('OpenProject', function(){ detailsPaneHelper.showAll(); }); - xit('should render a span with placeholder', function() { + it('should render a span with placeholder', function() { expect( assigneeEditor - // TODO: this selector is wrong, as some of the "no start/end date" - // logic bleeds into the assignee field .$('span.inplace-edit--read-value span') .getText() ).to.eventually.equal('-');