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

Search: Add pricing and tier information to Plans page #15125

Merged

Conversation

jsnmoon
Copy link
Contributor

@jsnmoon jsnmoon commented Mar 25, 2020

Jetpack equivalent to Automattic/wp-calypso#40306.

Changes proposed in this Pull Request:

  • Adds support for /sites/<id>/products API route via <QuerySiteProducts />, site-products state handling, and jetpack/v4/site/products local API route.
  • Adds handling for showing Search plan tiers
  • Adds handling for showing Search plan prices

Is this a new feature or does it add/remove features to an existing part of Jetpack?

  • Yes, this adds support for showing Search plan tiers to the wp-admin Jetpack plans page. This is being merged into a feature branch, however.

Testing instructions:

  1. You must apply Phabricator diff 153244 to your sandbox. This is a variant of D38944-code.

  2. Apply changes from this PR to your Jetpack installation. If you're running a dockerized instance, you may need to update your extra_hosts to properly sandbox the WPCOM API.

  3. Navigate to the Jetpack Plans page at /wp-admin/admin.php?page=jetpack#/plans.

  4. Ensure that both the record counts and the tier information render as expected.

Screen Shot 2020-03-25 at 6 10 37 PM

Proposed changelog entry for your changes:

  • None for now.

@jsnmoon jsnmoon added [Feature] Search For all things related to Search Plans Instant Search [Status] Needs Team Review Obsolete. Use Needs Review instead. labels Mar 25, 2020
@jsnmoon jsnmoon requested review from DavidRothstein, keoshi, gibrown, AnnaMag and a team March 25, 2020 22:12
@jsnmoon jsnmoon self-assigned this Mar 25, 2020
@jsnmoon
Copy link
Contributor Author

jsnmoon commented Mar 25, 2020

@keoshi: Due to the slower response times for the Tiers API, I split out the loading states for Backups and Search. Unfortunately, that means this is now possible:

Screen Shot 2020-03-25 at 4 27 43 PM

Should I unify the loading states for Backups and Search so that we could avoid this misalignment?

Copy link
Member

@gibrown gibrown left a comment

Choose a reason for hiding this comment

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

Minor copy/design comments...

@jsnmoon jsnmoon force-pushed the update/search-plan-api-with-pricing-and-tiers branch from e68eef7 to 33e1b3b Compare March 25, 2020 23:34
@jsnmoon
Copy link
Contributor Author

jsnmoon commented Mar 26, 2020

  • Updated to include monthly and yearly pricing options. The monthly upgrade button doesn't redirect correctly at the moment.
  • Added a snippet about how much the customer is saving or would save using the yearly pricing option.

Copy link
Contributor

@DavidRothstein DavidRothstein left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me (with the caveat that I didn't actually test it). However, I think there's one thing that may be broken -- see inline comment.

@keoshi
Copy link
Contributor

keoshi commented Mar 26, 2020

@jsnmoon

Should I unify the loading states for Backups and Search so that we could avoid this misalignment?

I don't if there's prior art in doing something like this or a best practice in terms of performance, but I'd personally much rather see them show up at the same time, yes! :)

@gibrown
Copy link
Member

gibrown commented Mar 26, 2020

This is looking good to me, I think we are waiting for the wp.com deploy anyways, so will hold off on a final review until that lands.

@@ -256,11 +256,14 @@ export default connect( state => {
multisite: isMultisite( state ),
products: getProducts( state ),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in one of the earlier comments you mentioned this component got slower to load (due to the extra API endpoint)...

I think you can actually eliminate this products property from the component (and the isFetchingProducts property below) and just pass siteProducts in to SingleProductBackup instead -- this should work fine since the two have the same structure (and for Jetpack Backup, the exact same data).

In that case, you can probably also avoid calling QueryProducts on this page entirely, which would avoid having to hit that API endpoint at all.

Copy link
Member

@gibrown gibrown left a comment

Choose a reason for hiding this comment

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

Tested this along with D40938 and it seems to all work well. The redirects are currently not working because we need to move the search plans to staging, but they all look correct based on inspection.

@gibrown gibrown added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Team Review Obsolete. Use Needs Review instead. labels Mar 27, 2020
@gibrown gibrown merged commit d3538e1 into add/search-plan Mar 27, 2020
@gibrown gibrown deleted the update/search-plan-api-with-pricing-and-tiers branch March 27, 2020 18:46
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Mar 27, 2020
gibrown added a commit that referenced this pull request Mar 30, 2020
* Search: Add Search plan to wp-admin Plans/My-Plans pages (#15011)
* Add Instant Search feature gate
* Add Jetpack Search to the Plans page
* Instant Search: Add support in glance and performance sections (#15043)
* Search: Add instant search auto config (#15026)
* Significant refactoring of Plans pages, especially for Backups
* Update the copy for search module. (#15123)
* Search: Add search plan to my-plans page (#15095)
* Search: Add pricing and tier information to Plans page (#15125)
* Search: Fix search plan detection (#15156)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Search For all things related to Search Plans
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants