-
Notifications
You must be signed in to change notification settings - Fork 800
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
Display notice when user has unactivated product license keys #21474
Display notice when user has unactivated product license keys #21474
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Beta plugin:
Jetpack plugin:
Debug Helper plugin:
Backup plugin:
Vaultpress plugin:
Boost plugin:
Search plugin:
|
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.
LGTM.
In a follow-up PR we can improve the behavior of the dismiss button and make the CTA point to the right place.
@jeherve, we will release these changes as part of version 10.4. I wanted to tag this PR with that milestone tag but I couldn't find it. Will it get added once 10.3 gets released? |
So the status of this PR is that all the essential functionality is in place, working correctly, and ready for Crew re-review. @jeherve Then after this PR is merged, we'll need to add into #21551 a function call to Doing this will make sure that the "You have an inactive product. Activate now." notice gets dismissed every time the user submits(activates) their license key (even if the user owns additional unattached licenses). The notice will then stay dismissed until either: the user obtains a new license key for a new product, or if the user still has any unattched licenses that have not been attached for over 2 weeks (reminding them that they have an unused product license key waiting to be activated). |
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.
This looks good and tests well for me. I only have one question left, but I'll approve this PR anyway since I think this can be addressed in a follow-up PR.
projects/plugins/jetpack/_inc/client/components/jetpack-notices/index.jsx
Show resolved
Hide resolved
Great news! One last step: head over to your WordPress.com diff, D68751-code, and commit it. Thank you! |
* master: (22 commits) VideoPress: reload block on rating change (#21653) Assets: Changelog for package version 1.12.0 (#21744) assets: Add `wp_register_script` wrapper (and then use it everywhere) (#21689) eslint-config-target-es: Configure mirror repo (#21731) Use monorepo `validate-es` script to validate Webpack builds (#21729) Backup: Replace daily backup references/upsell links with new real-time products (#21715) Likes: reimplement non-admin portions without jQuery (#21726) Autoloader: Not activated autoload queue is false (#21517) Sync: add a new method, do_only_first_initial_sync (#21676) webpack-config: Configure minifier to preserve translator comments (#21667) webpack-config: Use `@automattic/babel-plugin-preserve-i18n` (#21700) Create eslint-config-target-es JS package (#21660) webpack-config: Fork calypso-build's mini-css-with-rtl plugin (#21595) Allow /sites/${site}/external-media/copy/pexels to insert post meta data (#21659) jetpack: Don't set Webpack's `output.pathinfo` in production builds (#21727) Boost: Implement support for loading stylesheets when JavaScript is disabled in the context Critical CSS being enabled (#21713) RNA: export the Connection store (#21388) Display notice when user has unactivated product license keys (#21474) Gardening: ensure it can use Composer (#21712) Nav Unification: Display the stats sparkline on WP Admin for Atomic sites (#21655) ...
r234892-wpcom |
This PR displays a ""You have an inactive product. Activate now" notice in the dashboard if the user has unactivated product license keys available.
Note: This PR is a "re-do", based off #21426 which was closed because of complications with failing build checks. You can reference #21426 to view the original comments.
Changes proposed in this Pull Request:
Does this pull request change what data or activity we track or use?
No
Testing instructions:
add_filter( 'jetpack_licensing_ui_enabled', '__return_true' );
into Jetpack./wp-admin/?page=jetpack#/dashboard#/my-plan
(aka "My plan" page)Now obtain a 'user' product license key:
wp-content/mu-plugins/0-sandbox.php
add:add_filter( 'jetpack_license_checkout_m2_enabled', '__return_true' );
. (Enabling this flag makes Jetpack checkout issue you a license when completing checkout).tail -f /tmp/php-errors
public-api.wordpress.com
to your sandbox IP (in your hosts file).Jetpack user license was created for subscription_id:17829922, belonging to user_id:78351100 and blog_id:198416894
, but with different id values corresponding to your user and site. And you'll also see,License key is: jetpack_scan_monthly_oRhIEF4ckyVP6mCuHaD1vYnw5
, but with your unique key.public-api.wordpress.com
.Now test that the notice appears now that you have been provisioned a detached license
/wp-admin/?page=jetpack#/dashboard#/my-plan
(aka "My plan" page).Now test the notice dismiss behavior:
Prerequisite: You'll need Redux DevTools installed into your browser for this.
state.licensing.activationNoticeDismiss
last_detached_count
andlast_dismissed_time
are updated.detached
with the value of <last_detached_count + 1>.activationNoticeDismissed
values in state. The notice should currently be dismissed from when you clicked dismiss(x) button before.last_dismissed_time
to over 2 weeks ago: (2021-10-13T16:59:22+00:00
)last_dismiss_date
is set to over 2 weeks ago).Now test the notice disappears when you activate(submit) a license key:
wp-shell
: (If using jurassic.ninja, ssh into the site using the ssh user and pass that is displayed in the Dashboard, then runwpsh
. If using local docker env, runjetpack docker wp shell
)update_option('jetpack_licensing_activation_notice_dismiss', array('last_detached_count' => null, 'last_dismissed_time' => null) );
. This will reset the dismiss notice./wp-admin/?page=jetpack#/dashboard#/my-plan
(aka "My plan" page). Verify the activation notice is visible.Screenshot showing the new notice ("You have an inactive product. Activate now"):