-
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
Expose Hosting Trial: Allow starting free trial from themes upload page #86878
Conversation
Yeah it should redirect to |
Let's no redirect If we start the trial on this page. There's a bunch of redirect happening as it seems the atomic platform is not fully setup so |
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.
By design from previous comment it should redirect to wp-admin theme if I refresh. You should be able to upload a theme though without refreshing the page, I think what happened in this case the request site runs before the site is fully atomic on the backend so the isAtomic flag is still false and so the drop zone is disabled. I think I need to keep running requestSite until it returns isAtomic is true. I wait for 2 seconds before requesting site but sometimes it still seem to be too early |
client/my-sites/plans/trials/trial-acknowledge/with-onclick-trial-request.tsx
Outdated
Show resolved
Hide resolved
isUserEligibleForFreeHostingTrial( state ) && | ||
site.plan.is_free && | ||
config.isEnabled( 'hosting-trial' ); | ||
isUserEligibleForFreeHostingTrial( state ) && site && site.plan?.is_free; | ||
config.isEnabled( 'hosting-trial' ); |
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.
What's happening here? The trial check went over to a new line :) Can we also replace the site check with site?.plan?.is_free
?
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 well!
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.
It's working as expected, nice work @vykes-mac! I was able to start my trial, submit a theme file and activate it. All at the same flow!
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/11099086 Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @vykes-mac for including a screenshot in the description! This is really helpful for our translators. |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~96 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~16915 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. Async-loaded Components (~13742 bytes removed 📉 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
Translation for this Pull Request has now been finished. |
…ge (#86878) * all user to start free trial from themes upload page * do not redirect to wp-admin themes upload if a trial was requested * fix issue with theme upload not show when adding free trial * poll site request if transfer complete and site is not atomic * Removed unnecessary config check and merged trunk * Keeping plugin config check as same as trunk --------- Co-authored-by: Paulo Trentin <paulo@paulotrentin.com.br>
Related to https://github.com/Automattic/dotcom-forge/issues/5097
Proposed Changes
This PR allow the user to start a free trial from the themes upload page. There is an issue where we gets redirected to crowdsignal after the atomic transfer. what should happen is that we should be redirected to
/wp-admin/theme-install.php
Testing Instructions
/themes/upload/simple_site
Pre-merge Checklist