-
Notifications
You must be signed in to change notification settings - Fork 2k
Skip domain step if launch-site triggered from wp-admin #103746
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
Skip domain step if launch-site triggered from wp-admin #103746
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~66 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. 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. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
Tested per the instructions, and it works. Took me ages to test. I haven't tested other flows though, whether this would have any effect on them (I see some more general changes, not launch-site
specific). Left a couple of comments for clarity, but otherwise the outlined example tests out.
p.s. This flow will need to migrate to Stepper, so left a relevant comment on that too.
const domainCart = undefined; | ||
|
||
submitSignupStep( { stepName, domainItem }, { domainItem } ); | ||
submitSignupStep( { stepName, domainItem }, { domainItem, domainCart } ); | ||
recordExcludeStepEvent( stepName, tracksEventValue ); | ||
|
||
fulfilledDependencies = [ 'domainItem', 'siteId', 'siteSlug', 'themeItem' ]; | ||
fulfilledDependencies = [ 'domainItem', 'domainCart' ]; |
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 don't understand what these changes do. Why do we add the undefined domainCart
item in the submit-step call?
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.
Boils down to the function with the very-generic name isDomainFulfilled, which is only used for the launch-site flow. If domainCart is not fulfilled, it doesn't exclude the step.
So, why is the domainCart a dependency for the domain step? It doesn't need to be. However, we already have the code for domainItem written this way, and it just doesn't work because of the second dependency. Why undefined - not sure, I followed what's already done for domainItem.
// Add celebrateLaunch=true for launch-site flow so the celebration modal shows after checkout | ||
const isLaunchSiteFlow = flowName === 'launch-site'; | ||
const finalCheckoutBackUrl = isLaunchSiteFlow | ||
? addQueryArgs( { skippedCheckout: 1, celebrateLaunch: 'true' }, checkoutBackUrl ) |
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.
Would Stepper handle this any differently, meaning without using a query arg? cc @alshakero The logic here and below is it shows a celebratory modal when sent to /home
after having launched the site.
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.
Hmm actually, I think maybe it doesn't matter - or come into the picture of "no query args". The way I understand this, the flow itself isn't accepting any args, just sending back with an arg.
client/signup/main.jsx
Outdated
// Re-check fulfilled steps when siteDomains data changes | ||
// This ensures that isDomainFulfilled is called again when domain data loads | ||
if ( siteDomains !== prevProps.siteDomains ) { | ||
this.removeFulfilledSteps( this.props ); | ||
} |
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.
Would this affect other flows?
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.
Removing fulfilled steps shouldn't (why would fulfilled steps be still there?) but it might be a good idea to restrict to the launch-site flow to ensure we don't need to test them. Nice find.
94e0163
to
3e6b999
Compare
Part of DOTCOM-13180
Proposed Changes
Why are these changes being made?
Testing Instructions
These are the launch buttons in the settings page, they are two and do the same:

This is the modal that's currently only displayed if we launch from Calypso:

Pre-merge Checklist