-
Notifications
You must be signed in to change notification settings - Fork 801
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
JITM: Show ToS update notice #14541
JITM: Show ToS update notice #14541
Conversation
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 3, 2020. |
Oh nice, I like this addition. Using D38262-code as a test, I was able to dismiss the banner and see an AJAX call fired. |
@mmtr in the summary for:
We can note that this allows us to create banners for policy or terms of service updates, and anything else that might need an accept button. It's nice to paraphrase reasoning/context to folks if we link to additional internal context. |
This is all perfecto, I <3 it! I do find the slow I was also curious what happens if we click on a CTA button with an invalid action. It's a little confusing for the user, since the button disables, then becomes active again with no real feedback (other than a 400 error for the ajax call in the console), but I don't think we want to go any further handling odd situations like that. Works great! |
Just a note to make sure that from the WPCOM side of things, we're only displaying this JITM to sites that are running Jetpack 8.3+, as older versions will not include this ajax handler and will get errors anytime they try to click. |
Ooooh, that... brings up an interesting point: if we need to show the JITM to users with old JP versions, and can't rely on a client click handler needed for the user to accept, then... are we full-circle and back to the hacky redirect @mmtr ? |
Noting that in the future for other JITMs, we can do version compares in the JITM engine with ->with_CTA_ajax_action( 'jetpack_accept_tos' )
->with_option_matching(
'jetpack_version',
function( $version ) {
return version_compare( $version, '8.3', '>=' );
}
), |
Fallback for sites running older versions of Jetpack available at D38880-code. |
I’m having some trouble with testing these changes. My test site is a JN site running this branch. The TOS JITM displays as expected. However, when I click the CTA, I’m redirected to a plans page. Also, the JITM still displays when I navigate back to a wp-admin page. Is anyone else running into problems when testing this branch? |
That's weird. The click handler should intercept any click on the button and trigger an AJAX action rather than following the CTA link (which ends up redirecting to the plans pages if D38880-code it's not in place). I'll take a look at this to see if I can reproduce your issue.
Yup, this one has been identified by @kwight (D38262-code#771154) since we changed the signature of a function but didn't update its usage in the JITMs. Will prepare a fix for this today. Edit: He beat me to it D38890-code |
Confirmed and fixed the issue in b49281c |
Which has been deployed 👍 |
Fantastic ❤️ |
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 using the provided testing instructions, and everything was successful!
When using this branch, clicking the CTA button triggered the ajax action. When using the master branch, clicking the CTA button caused a redirect to wordpress.com/tos/accept
. In both cases, the ToS was marked as accepted, and the ToS JITM no longer displayed.
* 8.3 release: changelog * Changelog: add #14516 * Changelog: add #14574 * Bring in changes from 8.2.1 and 8.2.2 * Update stable version * Bring in 8.2.3 changes * Changelog: add #14714 * Changelog: add #14639 * Changelog: add #14678 * Changelog: add #14673 * Changelog: add #14687 * Changelog: add #14704 * Changelog: add #14702 * Changelog: add #14541 * Changelog: add #14657 * Changelog: add #14622 * Changelog: add #14582 * Changelog: add #14638 * Changelog: add #14633 * Changelog: add #14571 * Changelog: add #14592 * Changelog: add #14539 * Changelog: add #14514 * Changelog: add #14643 * Changelog: add #14494 * Changelog: add #13739 * Changelog: add #14707 * Changelog: add #14736 * Changelog: add #14706 * Changelog: add #14730 * Changelog: add #14685 * Changelog: add #14727 * Changelog: add #14711 * Changelog: add #14742 * Changelog: add #14746 * Changelog: add #14725 * Changelog: add #13999 * Changelog: add #14740 * Changelog: add #14759 * Changelog: add #14703 * Changelog: add #14753 * Changelog: add #14754 * Changelog: add #14645 * Cahngelog: add #14599
Changes proposed in this Pull Request:
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Enhances the JITMs so they can display legal updates that need to be accepted such as the ToS 2020 update notice. See p58i-8v7-p2
Testing instructions:
tos-test
blog sticker to the JN site.JETPACK__SANDBOX_DOMAIN
to the URL of your WP.com sandbox.jetpack.com/redirect?source=jitm-tos
wordpress.com/tos/accept
which marks ToS as acceptedProposed changelog entry for your changes:
JITM: Show ToS update notice