-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Duplicate
-
Affects Version/s: 10.10
-
Fix Version/s: None
-
Component/s: Web UI
Why do we need it?
As a user, I want to create a document which type as resolvers, maybe custom resolvers. When the validation process fails server side, it returns a 400 error with a JSON message as:
{ "entity-type":"validation_report", "has_error":true, "number":1, "violations":[ { "message":"The field very_restricted field must be unique accross the platform", "invalid_value":"my_invalidValue", "constraint":{ "entity-type":"validation_constraint", "name":"myCustomResolver", "parameters":{ "validation":"true" } }, "path":[ { "field_name":"my_schema:very_restricted", "is_list_item":false } ] } ] }
Currently, the nuxeo-document-create layout wrapper only catches error without a specific error code and shows a generic error message in the _create function
.catch(function(err) { this.set('creating', false); this.fire('notify', {message: this.i18n('documentCreationForm.createError')}); console.error(err); }
What do we expect?
We need to manage the 400 error and display all violations.message if it has has_error=true in the toast component
- duplicates
-
NXP-27982 Web UI - Leverage validation report client side and allow async layout validation
- Resolved