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

BB-544: Improve Editor form and error handling #542

Merged
merged 5 commits into from
Jan 13, 2021
Merged

Conversation

MonkeyDo
Copy link
Member

@MonkeyDo MonkeyDo commented Dec 7, 2020

Problem

https://tickets.metabrainz.org/browse/BB-544
Errors thrown are being completely swallowed by the editor profile edit form on the server and front-end, leaving the user with a spinning loader and nothing else.

Solution

First, since we're here, a bit of cleanup and renovating, moving to using await/async and fetch and such.
Second, on the server, do some validation and return better error messages.
Finally show said error messages to the user in the profile form.

Show errors, use async/await and fetch instead of superagent and promise chains, imrpove UI
Errors weren't being returned, and we needed a custom "name already in use" message.
Use state properly with onChanged events instead of using refs.
This allows us to do some silmple validation on the client side.
Also do some simple validation on server side.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 60.856% when pulling 9273018 on editor-form-fixes into 5ad0e62 on master.

@MonkeyDo MonkeyDo merged commit 64bd4ca into master Jan 13, 2021
@MonkeyDo MonkeyDo deleted the editor-form-fixes branch January 13, 2021 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants