Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Remove access to 'Register as delegate' form for delegates #946

Closed
ginacontrino opened this issue Nov 2, 2017 · 3 comments
Closed

Remove access to 'Register as delegate' form for delegates #946

ginacontrino opened this issue Nov 2, 2017 · 3 comments

Comments

@ginacontrino
Copy link
Contributor

ginacontrino commented Nov 2, 2017

Expected behaviour

A delegate should not be able to see the "Register as delegate" form

Actual behaviour

If a delegate visits main/voting/register-delegate the form pops up

Steps to reproduce

screen shot 2017-11-02 at 14 20 26

@joerodrig
Copy link
Contributor

joerodrig commented Nov 15, 2017

I would like to help with this. Are there any resources showing a way to simulate the delegate account state and coins?

@joerodrig
Copy link
Contributor

joerodrig commented Nov 16, 2017

@ginacontrino It appears that this form disables the "register" button if the account is already a delegate. See registerDelegate.js - line 70. Could this be the expected behavior and there just aren't specs written for that case? That check shouldn't be necessary if the form shouldn't appear if the user is a delegate.

joerodrig added a commit to joerodrig/lisk-nano that referenced this issue Nov 16, 2017
Solves LiskArchive#946.

Initially I attempted a redirect to the root page here so the modal
wouldn’t load if the user is a delegate. Due to the way this dialog is
opened though, that caused the dialog to quickly animate onto the page,
then disappear after the redirect was triggered. This is a quick
compromise for the UX.
@ginacontrino
Copy link
Contributor Author

@joerodrig Hey, yes that's correct. The button is correctly disabled, because in this case, the user is already a delegate. In general, they shouldn't be able to access this form at all though, so it's better to instead display a message that informs the user about why they can't visit the route 'main/voting/register-delegate'. A test that checks that the error message is displayed, would be nice of course :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants