Battery-Intelligence-Lab / galv

An open-source platform for automated storage of battery data with advanced metadata support
https://battery-intelligence-lab.github.io/galv/
Other
33 stars 8 forks source link

validation of inputs (checking strings, numbers etc. with an appropriate error message appearing) #9

Closed martinjrobins closed 1 year ago

martinjrobins commented 2 years ago

The forms in the frontend do not have appropriate input validation and display of errors from the rest api

mjaquiery commented 1 year ago

This is still very much true and should be fixed in version 2.

There's a template of how this can be implemented using Snackbar (aka Toast) elements in the UserProfile.tsx part of the frontend, although currently the frontend API interface doesn't usefully expose errors, so that would need reworking a bit to allow those errors to flow through and be caught.

mjaquiery commented 1 year ago

Initial work on this now pushed to v2.0.0 branch: (uninformative) errors from the Connection._fetch mechanism now feed back to the Core display and are shown as snackbar items. Making the REST API return better errors will now help with this; adding backend label.

mjaquiery commented 1 year ago

This should be sufficiently resolved for now by recent changes to expose the responses from the REST API, along with the backend work which described and validated inputs correctly and improved the descriptiveness of error messages.