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

Login block: Accept the user email as a prop #41799

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

DanReyLop
Copy link
Contributor

Changes proposed in this Pull Request

In 3bec7b8, added an optional userEmail prop to the LoginBlock. If present, the form will be prefilled with that email instead of relying on the current route querystring.

In 9f540c3, moved the styles for the social divider (this) to the login block styles, since that block can be used outside of wp-login.

How to test

This is just a refactor, there shouldn't be any regression. At this moment, LoginBlock is never called with a userEmail prop. The "social divider" is only used in the WooCommerce login flow, so to test that the styles still look good, go to http://calypso.localhost:3000/log-in?from=woocommerce-onboarding.

Note: This is a required refactor for the new "Woo DNA" flow, implemented in #41798

@DanReyLop DanReyLop added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Login labels May 5, 2020
@DanReyLop DanReyLop requested a review from a team May 5, 2020 13:03
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented May 5, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~11 bytes added 📈 [gzipped])

name         parsed_size           gzip_size
entry-login        +41 B  (+0.0%)      +11 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Async-loaded Components (~3 bytes added 📈 [gzipped])

name                      parsed_size           gzip_size
async-load-design-blocks        +41 B  (+0.0%)       +3 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@v18 v18 added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 29, 2020
@@ -69,6 +69,7 @@ class Login extends Component {
twoFactorEnabled: PropTypes.bool,
twoFactorNotificationSent: PropTypes.string,
isSecurityKeySupported: PropTypes.bool,
userEmail: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is userEmail coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally it's coming from the page's querystring (see here). So you'll land in the login flow with an URL like /login?...&email_address=foo@bar.com, and the Email field will be prefilled with foo@bar.com.

What I've made in this PR is to have the possibility to override that value. So the LoginBlock could be rendered like:

<LoginBlock userEmail="asdf@aaa.com" />

And the prefilled Email field will be asdf@aaa.com, regardless of the URL the user landed on. Because the whole login/signup/authorize Woo flow is implemented in a single page (without the URL ever changing), this was a needed addition.

@v18 v18 added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 29, 2020
@DanReyLop DanReyLop force-pushed the woodna/login-block-enhancements branch from 8389cd2 to 00921f4 Compare June 8, 2020 12:04
@DanReyLop DanReyLop merged commit 1e3891b into master Jun 9, 2020
@DanReyLop DanReyLop deleted the woodna/login-block-enhancements branch June 9, 2020 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants