zooniverse / Panoptes-Front-End

Front end for zooniverse/Panoptes
https://www.zooniverse.org
Apache License 2.0
65 stars 76 forks source link

Show error message for emails that are already taken #5213

Open mrniaboc opened 5 years ago

mrniaboc commented 5 years ago

If you try and change your email in your Zooniverse setting to one that is already associated with an account you are allowed to do it by the UI with no error message, however the API does not accept the new email address and gives the error "email already taken".

We should also show this error in the UI.

lancesnider commented 5 years ago

It looks like the behavior is the same whether it's a duplicate address or invalid email - when you remove focus from the field, the AutoSave span background turns red.

I figured I could just pass the children to <AutoSave> as render props so that the children could access the error message. Unfortunately, I have no experience with CoffeeScript and couldn't get render props to work. :/

By the way, it's also turning green for addresses like email@email.

srallen commented 5 years ago

@lancesnider generally we've decided that the AutoSave component is a UX mistake and would like to eventually replace all of those forms with explicit submit and cancel buttons. To that end, if it is rewritten, it should be rewritten in modern javascript (ES6/ES7). I understand not wanting to dive into the coffeescript, but if you do try to give it a go, feel free to ask any questions on our github about conversion. We've had some success initially running the coffeescript files through something like decaffeinate and then touch up as needed. If the component is missing tests, adding tests first helps with initial functionality understanding and then making sure something isn't broken in the conversion.