-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Signup: Fix username suggestions not working #10795
Signup: Fix username suggestions not working #10795
Conversation
Username suggestions were broken due to a prop name change in #10599. This PR improves the fetching of the suggested username to use Redux and properly just pass the prop to `SignupForm`
df4db84
to
8f56175
Compare
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.
Works as described 👍
Code also looks good, I've just posted a couple of non-blocking nitpicks that you can feel free to skip and leave for another PR if you wish.
/** | ||
* External dependencies | ||
*/ | ||
import get from 'lodash/get'; |
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.
Here we can use the single member import syntax, which is the recommended one recently:
import { get } from 'lodash';
( state ) => ( { | ||
suggestedUsername: getSuggestedUsername( state ) | ||
} ), | ||
( dispatch ) => ( { |
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.
Dispatch will be mapped to action creators automatically, so:
( dispatch ) => ( {
recordTrackEvent: ( event, data ) => {
dispatch( recordTracksEvent( event, data ) );
}
} )
can be shortened to just:
{ recordTracksEvent }
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.
LGTM
Username suggestions were broken due to a prop name change in #10599.
This PR improves the fetching of the suggested username to use Redux and properly just pass the prop to
SignupForm
To test:
Test free username:
something123455123
)wordpress.com
addressusername
field is properly filled up with the domain slug you wrote.To test a taken username:
kwight
in the domain search boxkwight.me
kwightweb
or something different thankwight
Todo:
cc @kwight :)