-
Notifications
You must be signed in to change notification settings - Fork 803
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
Partner Compatibility: Adding a unique connection screen for customers who receive a coupon from a Jetpack partner #21813
Conversation
…ceive a coupon from a Jetpack partner
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. Jetpack plugin:
Backup plugin:
Boost 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.
@rcoll, do you think we can perhaps connect-right-partner.png
reduce the size of this image? (e.g.: https://tinypng.com/).
Also, this image looks a lot like the one use in the product description view for backups, so perhaps we can re-use the image from there and show product specific images?
projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-redux-state-helper.php
Outdated
Show resolved
Hide resolved
@rcoll I've addressed some of my own suggestions and done the following:
|
Oi! I've also added three new filters:
Technically these will allow future partners to add backwards compatibility for coupons by adding their name and presets to e.g. a MU plugin for all sites they want to give coupons for. |
projects/plugins/jetpack/_inc/lib/class-jetpack-partner-coupon-helper.php
Outdated
Show resolved
Hide resolved
LGTM! Great job 🙌 |
I gave it another round of tests and everything worked this time! Every possible case
As for the amount of files. I think it's fine - we can navigate the noise of all the boiler plate |
That sounds great @leogermani ! @rcanepa has (indirectly) done manual tests of this PR over at Automattic/wp-calypso#58552 as well which included some edge-cases with sites that had unattached licenses and/or partner ids, so I'm feeling pretty confident we're about there 😄 I'm going to give p9dueE-wa-p2 a go to see why we get the If there's anything else, then please don't hold back! I'm pretty stocked to get this in 10.4 😛 |
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 to me, it should be good to merge! I only have one question, but that's not blocking or anything.
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="false"> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> |
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 don't quite understand why this needs to be removed. Does this change anything here?
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.
It's because it's deprecated 😄 When you run PHPUnit you'll get the following warning:
Warning: Your XML configuration validates against a deprecated schema.
Suggestion: Migrate your XML configuration using "--migrate-configuration"!
Technically we could convert it to <coverage>
instead but I think it's unnecessary 😅 I think we're covered by the <directory prefix="test" suffix=".php">tests/php</directory>
definition (only test
prefixes in PHP files, in the tests/php
directory).
That being said; I'm not a PHPUnit configuration master - more of a general user - so there might be something I'm missing.
<!--
<filter>
<whitelist processUncoveredFilesFromWhitelist="false">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
-->
<coverage processUncoveredFiles="false">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
I cannot reproduce today, the coupon seems to work now. Not sure what I did wrong the last time around, but you can ignore it now :) |
Caution: This PR has changes that must be merged to WordPress.com |
r235750-wpcom |
* master: (22 commits) Update storybook monorepo to v6.4.0 (#21897) Refresh the site's modules and settings after successful product activation (#21886) Plugin Install: Bump MC stat on success or fail. (#21893) Nav Unification: Use correct user capability for the Inbox menu item (#21882) Jetpack: Extend disconnection dialog component to handle multiple steps and accept more props (#21048) Disable CSSTidy property shorthand optimization in the editor or headstart (#21891) Connection UI: Update Composer instructions in README.md (#21890) Partner Compatibility: Adding a unique connection screen for customers who receive a coupon from a Jetpack partner (#21813) Search package: move search dashboard to package - the base (#21865) JITM: wrap CTA below text on small viewports (#21688) Licensing JS Package – fix icon positioning and width (#21878) JITM: new JS and CSS builder (#21874) Support site_intent for `/me/sites` endpoint (#21880) Don't render Critical CSS while generating CritCSS. (#21879) ConnectScreen: make button full width on small screens (#21683) Improve the copy of the license activation banner (#21876) Rename Webpack-built files back from `.min.js` and remove hashes (#21748) Search: Migrate more helper classes to package (#21751) Search: migrate/add search rest API (#21584) Add initial state to the connection package (#21864) ...
Changes proposed in this Pull Request:
Prerequisite
Should be used in conjunction with Jetpack Plans: Add redirect middleware for partner coupon handling wp-calypso#58177Jetpack product discussion
Does this pull request change what data or activity we track or use?
This PR introduces 2 new tracking events:
jetpack_partner_coupon_redeem_view
: This event is triggered whenever the newPartnerCouponRedeem
is rendered (if connected*).jetpack_partner_coupon_redeem_click
: This event is triggered when a user clicks theRedeem <Product name>
button (if connected*).If connected*: the "redeem coupon" component is shown in two instances:
a) Instead of the pre-connection screen so we both connect the site and direct them to checkout with their partner coupon.
b) As a specific screen that can be directly accessed if the site is already connected.
Because we only track events after the user has connected Jetpack, we can only track stats for the latter "connected" scenario.
Needs to be done before merge
tools/project-version.sh -f -u 1.14.0-alpha packages/options
to bump the dependency version of Jetpack options, but it introduces a lot of "noice" (~28 touched files), so we're waiting with this until the rest of the PR has been approved.Testing instructions:
Setup
0-sandbox.php
if you use Jetpack Docker). This will allow the test coupon to be recognised as a valid coupon.Functional test: Pre-connection screen
This assumes that you've done the "setup" steps above.
/wp-admin/admin.php?jetpack-partner-coupon=JPTST_JPTA_123AB
.Functional test: Connected Jetpack
This assumes that you've done the "setup" steps above.
/wp-admin/admin.php?jetpack-partner-coupon=JPTST_JPTA_123AB
.Tracking
If you have completed the Functional test: Connected Jetpack test, you should have automatically triggered both events described in the "Does this pull request change what data or activity we track or use?" section.
You'll probably have to wait between 5-20min before it appears in the live tracks tool: PCYsg-5hv-p2.
Both events should contain the following event properties:
connected
: expected to beyes
with test instruction coupon.coupon
: expected to beJPTST_JPTA_123AB
with test instruction coupon.partner
: expected to beJPTST
with test instruction coupon.preset
: expected to beJPTA
with test instruction coupon.Screenshots
Notice: some of the styling differs from the purposed design since we want to lean into the existing "Connection screen" but all the same messages/ideas should be conveyed as the design.
Pre-connection screen: "desktop"
Pre-connection screen: "tablet"
Pre-connection screen: "phone"
Connected screen: "desktop"
Connected screen: "tablet"
Connected screen: "phone"