Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required Fields Check before Save #478

Open
RudiThoeni opened this issue Dec 13, 2023 · 6 comments
Open

Required Fields Check before Save #478

RudiThoeni opened this issue Dec 13, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@RudiThoeni
Copy link
Member

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")) or
AxiosError: 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.

@RudiThoeni RudiThoeni assigned RudiThoeni, gappc and sseppi and unassigned RudiThoeni Dec 13, 2023
@sseppi sseppi added the bug Something isn't working label Dec 13, 2023
@sseppi sseppi added this to the Data Browser 2.4 - Beta milestone Dec 13, 2023
@gappc
Copy link
Collaborator

gappc commented Jan 11, 2024

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

Frontend

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?:

  • the empty string ""
  • 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.

Backend

Meanwhile, the presentation of backend validation errors has improved, no data will be removed in the frontend if a backend error happens.

Backend error response

Something that catched my eye is that the tourism backend seems to return validation errors in different formats. Steps to reproduce:

  1. Example

=> the response body contains the following string: "Eventlocation needed". Note that there is no field Eventlocation, instead it is called EventLocation (camelCase)

  1. Example

=> 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.

@RudiThoeni
Copy link
Member Author

@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

@gappc
Copy link
Collaborator

gappc commented Jan 12, 2024

@RudiThoeni that's fine, thank you. Please let me know when you're done 👍

@sseppi
Copy link
Contributor

sseppi commented Jan 23, 2024

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.

@gappc
Copy link
Collaborator

gappc commented Apr 21, 2024

@sseppi what is the status of this issue? Is it still part of the 2.5 milestone?

@sseppi
Copy link
Contributor

sseppi commented Apr 23, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants