-
Notifications
You must be signed in to change notification settings - Fork 34
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
ui: control signup form visibility with configs #169
Conversation
if (config.localUsers && signup) { | ||
return ( | ||
<p> | ||
Already signed up? Go to <Link to="/signin">Sign In</Link> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: In order to keep consistency with "Sign up".
Already signed up? Go to <Link to="/signin">Sign In</Link> | |
Already signed up? Go to <Link to="/signin">Sign in</Link> |
reana-ui/src/pages/signin/Signup.js
Outdated
)} | ||
<SignFormInfo config={config} signup /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that SignFormInfo
component looks a bit convoluted and prints completely different things. What if we keep Signup
component as it was and disable the /singup
route if hideSignup
is true?
Then we can have the logic of SingFormInfo
inside Signin
component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach looks cleaner, but there is one downside. Currently in the App.js
we are waiting for the /api/you response before rendering any pages. If we want to disable the route in this place we will have to wait for /api/config
to arrive, since hideSignup
is stored there. So +1 request to wait for the user before seeing some content. Not sure if this is a big problem, probably noticeable only on a very slow connection, but still something to think about. Because of this reason I took another approach which is not very clean.. Could be that sooner or later we will still have to depend on the configs to render or not some component or page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After playing around a bit, I think it's still better to disable the route, so I changed the code according to your suggestions
34ac5fc
to
451c817
Compare
addresses reanahub/reana#469