fix type for field in question

This fixes a issue where the daterange type bled into the User type for editable
fields.
pull/2817/head
Florian Kraft 10 years ago
parent 9907f2673b
commit a05dfd172a
  1. 11
      frontend/app/work_packages/directives/inplace_editor/inplace-editor-display-pane-directive.js
  2. 3
      frontend/app/work_packages/services/work-package-field-service.js
  3. 4
      frontend/tests/integration/specs/work-packages/details-pane/details-pane-editable-spec.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') {

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

@ -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('-');

Loading…
Cancel
Save