Open RudiThoeni opened 9 months ago
@RudiThoeni as you correctly mentioned, there is no validation on the frontend for required
fields. At the moment, the Data Browser shows only the results of a failing backend validation.
The reason for the missing frontend validation is, that the rules of emptiness are not always clear and differ sometimes, e.g. are any of the following values always empty?:
""
null
undefined
If we can agree that e.g. all of the above values should show a validation error for required fields, than I can add a frontend validation. Otherwise we must discuss how frontend validation should be done in a generic way.
Meanwhile, the presentation of backend validation errors has improved, no data will be removed in the frontend if a backend error happens.
Something that catched my eye is that the tourism backend seems to return validation errors in different formats. Steps to reproduce:
asd
into the field Shortname
=> the response body contains the following string: "Eventlocation needed". Note that there is no field Eventlocation
, instead it is called EventLocation
(camelCase)
asd
into the field Shortname
=> the response body contains a complete stack trace
Would it be possible to define a single representation for errors in the backend? That way we could present the error information to the user.
@gappc You are right there are some inconsistencies i will try to return all validation errors in the same format, i need some time to go trough this
@RudiThoeni that's fine, thank you. Please let me know when you're done :+1:
The main problem about the error associated to the required fields has been solved. The user now gets an error, but doesn't have to re-input the data again.
We shift this issue to the next milestone, since now we need to do optimization on both side front and back-end to optimize and close everything.
@sseppi what is the status of this issue? Is it still part of the 2.5 milestone?
@gappc we I'm now now collecting the feedback from our internal team to prioritize all issues we already have in Git and feedback we received from the users during the test. After this internal iteration I will re-plan the issues and the single milestones.
I tried to add a EventShort Data without compiling the required fields -Date Start -Date End -Location And i get from the Api the Error Messages
AxiosError: Request failed with status code 400 ("Eventlocation needed"))
orAxiosError: Request failed with status code 400 ("Start + End Time not set correctly"))
The problem is that the inserted data then is gone and i have to reinsert everything.....
Expected Behaviour: If the input components marked with
required: true
are not compiled the Save Method shouldn't even be called, maybe it would be better to show an error "required field" and set the focus to this field.