-
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
Coming soon: add coming soon page selector #45892
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~32 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~1359 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 (~146 bytes added 📈 [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. |
c5e3b82
to
ff1bb33
Compare
client/state/sites/reducer.js
Outdated
@@ -133,7 +133,7 @@ export const items = withSchemaValidation( sitesSchema, ( state = null, action ) | |||
let nextSite = site; | |||
|
|||
return reduce( | |||
[ 'blog_public', 'wpcom_coming_soon', 'site_icon' ], | |||
[ 'blog_public', 'wpcom_public_coming_soon', 'site_icon' ], |
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.
Is it possible to leave the old version in play concurrently?
In #45606 I'm putting things that access these states behind config.isEnabled('coming-soon-v2')
checks so having both floating around should be fine.
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.
Is it possible to leave the old version in play concurrently?
Good question. I'll look into this. I haven't yet put too much deep though into that.
behind config.isEnabled('coming-soon-v2')
I've been using the editing-toolkit/coming-soon
flag. Could we use that to keep things consistent??
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 caved. Switched to coming-soon-v2
in this PR
0d4788f
to
e927805
Compare
case 'wpcom_public_coming_soon': { | ||
const isComingSoon = | ||
parseInt( settings.wpcom_public_coming_soon, 10 ) === 1 || | ||
parseInt( settings.wpcom_coming_soon, 10 ) === 1; |
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.
Will launching a site remove wpcom_coming_soon option as well as wpcom_public_coming_soon site options?
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.
My first response, without thinking too deeply, would be YES
.
If we're turning off coming soon for everyone as soon as they launch without the possibility of turning it back on (controversial) then yes.
Also, we don't want any regression to v1 so when and if we do allow folks to toggle coming soon mode on and off we'll want them to use wpcom_public_coming_soon
from v2 and cast v1 options into the fiery pit of oblivion.
Do you see anything missing here that doesn't take that into account? 🤔
e927805
to
a191d0c
Compare
…o showing a coming soon badge.
Checking for v1 coming soon mode flag so we can cater for existing coming soon users
a191d0c
to
765f3bb
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.
I tested this with and without the feature flag and LGTM! I found a strange existing bug which I'll make a task for shortly but doesn't effect this
|
||
// records whether a page has been set as 'coming soon' | ||
// and the paid plan slug | ||
this.props.recordTracksEvent( 'calypso_coming_soon_set_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.
todo: this will have to be registered
|
||
return ( | ||
<> | ||
<MenuSeparator key="separator" /> |
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.
👍 these seperators
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/4638616 Thank you @ramonjd for including a screenshot in the description! This is really helpful for our translators. |
…ng Soon page selector to the page list. We don't need the page selector feature right now but might need them later, in which case we'll re-add them. We've also deleted the unused selectors. `isComingSoonModeActive` might be useful in the future but, for now we're not using it.
…ng Soon page selector to the page list. (#46228) We don't need the page selector feature right now but might need them later, in which case we'll re-add them. We've also deleted the unused selectors. `isComingSoonModeActive` might be useful in the future but, for now we're not using it.
Translation for this Pull Request has now been finished. |
Changes proposed in this Pull Request
This PR splits out the page selector functionality in #45606.
We're adding a coming soon page selector to the ellipsis menu for sites with a paid plan.
We're also showing a coming soon badge to indicate that a page has been selected as coming soon.
Testing instructions
Make sure your test site as a paid upgrade, e.g., a personal plan.
Ensure that the new coming soon mode is activated on your test site, e.g.,
Go to http://calypso.localhost:3000/pages/{your_site}?flags=coming-soon-v2
Assign a site to be your coming soon page
Check that we're firing the coming soon page set toggle tracks event
calypso_coming_soon_set_page
:Check that the badge is assigned
Also make sure the network request to
public-api.wordpress.com/rest/v1.1/sites/{site_id}/homepage
is fired with the correct page ID:Refresh the page to check that the page id has been saved. Also run:
Now switch off the feature flag (Go to http://calypso.localhost:3000/pages/{your_site}) and make sure the coming soon ellipsis menu and page badge are not visible.
Repeat the above steps with a free site. You shouldn't see the coming soon options at all in the ellipsis menu.
Fixes: #45022