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

Coming soon: add coming soon page selector #45892

Merged
merged 5 commits into from
Oct 2, 2020

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Sep 24, 2020

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.,

wp option --url=your_site add wpcom_public_coming_soon 1

Go to http://calypso.localhost:3000/pages/{your_site}?flags=coming-soon-v2

Assign a site to be your coming soon page

Screen Shot 2020-09-24 at 3 02 40 pm

Check that we're firing the coming soon page set toggle tracks event calypso_coming_soon_set_page:

Screen Shot 2020-09-30 at 11 44 16 am

Check that the badge is assigned

Screen Shot 2020-09-24 at 3 13 56 pm

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:

Screen Shot 2020-09-24 at 3 04 27 pm

Refresh the page to check that the page id has been saved. Also run:

wp option --url=your_site get wpcom_public_coming_soon_page_id

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

@ramonjd ramonjd added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Coming Soon labels Sep 24, 2020
@ramonjd ramonjd requested review from lsl, roo2 and a team September 24, 2020 05:17
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Sep 24, 2020

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

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

name        parsed_size           gzip_size
entry-main       +138 B  (+0.0%)      +32 B  (+0.0%)

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])

name                  parsed_size           gzip_size
pages                     +2883 B  (+1.1%)     +545 B  (+0.7%)
woocommerce                +142 B  (+0.0%)      +38 B  (+0.0%)
themes                     +142 B  (+0.0%)      +46 B  (+0.0%)
settings-writing           +142 B  (+0.0%)      +39 B  (+0.0%)
settings-security          +142 B  (+0.0%)      +39 B  (+0.0%)
settings-performance       +142 B  (+0.0%)      +39 B  (+0.0%)
settings-discussion        +142 B  (+0.1%)      +39 B  (+0.1%)
settings                   +142 B  (+0.0%)      +39 B  (+0.0%)
scan                       +142 B  (+0.0%)      +46 B  (+0.1%)
post-editor                +142 B  (+0.0%)      +39 B  (+0.0%)
plugins                    +142 B  (+0.0%)      +46 B  (+0.0%)
media                      +142 B  (+0.0%)      +39 B  (+0.0%)
marketing                  +142 B  (+0.0%)      +39 B  (+0.0%)
hosting                    +142 B  (+0.1%)      +46 B  (+0.1%)
home                       +142 B  (+0.0%)      +47 B  (+0.0%)
gutenberg-editor           +142 B  (+0.0%)      +51 B  (+0.0%)
comments                   +142 B  (+0.0%)      +40 B  (+0.0%)
checkout                   +142 B  (+0.0%)      +47 B  (+0.0%)
backup                     +142 B  (+0.0%)      +46 B  (+0.0%)
activity                   +142 B  (+0.0%)      +49 B  (+0.0%)

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])

name                                   parsed_size           gzip_size
async-load-signup-steps-clone-point         +142 B  (+0.1%)      +49 B  (+0.1%)
async-load-design-blocks                    +142 B  (+0.0%)      +46 B  (+0.0%)
async-load-blocks-calendar-popover          +142 B  (+0.1%)      +40 B  (+0.1%)
async-load-blocks-inline-help-popover        +35 B  (+0.0%)      +11 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.

@ramonjd ramonjd force-pushed the add/coming-soon-v2-page-selector branch from c5e3b82 to ff1bb33 Compare September 24, 2020 05:22
@@ -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' ],
Copy link
Contributor

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.

Copy link
Member Author

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??

Copy link
Member Author

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

@ramonjd ramonjd force-pushed the add/coming-soon-v2-page-selector branch from 0d4788f to e927805 Compare September 28, 2020 10:10
@ramonjd ramonjd self-assigned this Sep 28, 2020
case 'wpcom_public_coming_soon': {
const isComingSoon =
parseInt( settings.wpcom_public_coming_soon, 10 ) === 1 ||
parseInt( settings.wpcom_coming_soon, 10 ) === 1;
Copy link
Contributor

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?

Copy link
Member Author

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? 🤔

@ramonjd ramonjd force-pushed the add/coming-soon-v2-page-selector branch from e927805 to a191d0c Compare September 29, 2020 09:07
@ramonjd ramonjd force-pushed the add/coming-soon-v2-page-selector branch from a191d0c to 765f3bb Compare September 30, 2020 01:47
Copy link
Contributor

@roo2 roo2 left a 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', {
Copy link
Contributor

@roo2 roo2 Oct 1, 2020

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" />
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 these seperators

@ramonjd ramonjd merged commit 6e9c6f0 into master Oct 2, 2020
@ramonjd ramonjd deleted the add/coming-soon-v2-page-selector branch October 2, 2020 02:16
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 2, 2020
@a8ci18n
Copy link

a8ci18n commented Oct 2, 2020

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.

ramonjd added a commit that referenced this pull request Oct 7, 2020
…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.
ramonjd added a commit that referenced this pull request Oct 8, 2020
…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.
@a8ci18n
Copy link

a8ci18n commented Oct 8, 2020

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coming Soon: add coming soon to the page selector
5 participants