Update the layout of the move-experiment-modal when there are errors [SCI-7676]

This commit is contained in:
sboursen-scinote 2023-01-30 12:00:33 +01:00
parent eced08e365
commit 42eae72d2a
3 changed files with 10 additions and 2 deletions

View file

@ -42,8 +42,9 @@ var renderFormError = function(ev, input, errMsgs, clearErr, errAttributes) {
}
var $errSpan = "<span class='help-block'" +
errAttributes + '>' + errorText + '</span>';
errAttributes + '>' + errorText + '.' + '</span>';
$(input).after($errSpan);
$(input).closest('.modal').modal('handleUpdate');
}
var $parent;

View file

@ -4,3 +4,10 @@
color: $brand-danger;
}
}
.form-group.has-error {
margin-bottom: 0;
div.form-control {
height: auto;
}
}

View file

@ -310,7 +310,7 @@ class ExperimentsController < ApplicationController
view_type = view_state.state['my_modules']['view_type'] || 'canvas'
path = view_mode_redirect_url(view_type)
else
message = service.errors.values.join(', ')
message = "#{service.errors.values.join('. ')}."
status = :unprocessable_entity
end