-
Notifications
You must be signed in to change notification settings - Fork 808
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
License activation: Add helpful error messages & display help steps on error response. #39333
License activation: Add helpful error messages & display help steps on error response. #39333
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
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. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! |
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.
The testing plan worked correctly, nice work! I just had some comments on one of the error messages as well as a few things I found in the code
case LICENSE_ERRORS.NOT_SAME_OWNER: | ||
return { | ||
errorMessage: __( | ||
'The account that purchased the plan and the account managing this site are different.', |
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 think this sounds needlessly complicated personally. On the support page we link to here, the error is This license key is owned by a different user.
Perhaps we could go with that instead?
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.
Yeah this ⬆️ is the error message that displayed prior to this PR, and it is specifically the error that is resulting in regular support tickets and churn.
Because ideally what we need to get across to the user is: the (wordpress.com) user account that their site is using for the Jetpack connection is not the same (wordpress.com) user account that was used to purchase the product/license.
You see, there has been various discussion about this: p1HpG7-rfm-p2, and there is an upcoming project: pbNhbs-aGG-p2 to more throughly handle this issue, but for now as quick improvement, this is what design came up with.
Here are my thoughts: TBH, I agree that this error copy could be improved, but at the same time, I'm not necessarily eager to strike up a back and forth feedback loop of copy suggestion, because 1. This is merely a maintenance task, not a project, 2. there has already been quite a bit of discussion about this, 3. this will all be changed or removed in the near future when we are able to work on the upcoming planned project, and 4. Regardless of whether we could improve on the error message or not, I believe all these changes as a whole are quite a good improvement (with limited time investment), especially with the additional help steps/hints that go along with the error.
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.
That makes sense, and especially since we are changing it soon, I think we can go ahead and keep it this way. Thank you for explaining that 😄
projects/js-packages/licensing/components/activation-screen-error/use-get-error-content.tsx
Outdated
Show resolved
Hide resolved
projects/js-packages/licensing/components/activation-screen-error/index.tsx
Outdated
Show resolved
Hide resolved
projects/js-packages/licensing/components/activation-screen-error/index.tsx
Outdated
Show resolved
Hide resolved
}; | ||
|
||
const ActivationScreenError: FC< Props > = ( { licenseError, errorType } ) => { | ||
const hasLicenseError = licenseError !== null && licenseError !== undefined; |
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.
You might think about just checking if ! licenseError
here 🤔
If the licenseError
was an empty string I think we could assume that there is no error as well. Same with 0 but that's less likely 😆
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.
Hmm, yeah. I just copied this over from the previous existing code.. But now looking at it, I'm not sure it makes sense to have the hasLicenseError
variable at all! The prop licenseError
will either have an error in it (string) or it won't (null). Therefore I can just check the prop directly with if ( licenseError )
or if ( ! licenseError )
, with no need for a different hasLicenseError
variable.
Or is that what you are already saying in your feedback?
Anyway, I believe I can remove hasLicenseError
and just check the licenseError
prop instead. Same goes for in the activation-screen-controls/index.jsx
file where it was originally located. And also in the use-get-error-content-.tsx
file. 👍
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.
Yes I think we are on the same page, thanks for updating that 😄
projects/js-packages/licensing/components/activation-screen-error/use-get-error-content.tsx
Outdated
Show resolved
Hide resolved
} | ||
|
||
span { | ||
font-size: 13px; |
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 see we have a --font-body-extra-small
which is 12px and --font-body-small
which is 14px. My gut tells me we should use one of those just to avoid having too many different font sizes. I understand if design thinks differently though
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.
Yeah, my only hesitation here is that I believe Design used this specific font size along with the reduced letter spacing so that all errors remain within one line (on desktop anyway). If I change the font size up to 14px, a couple of the errors span over 2 lines (with orphan), and if I drop down the size to 12px, then the error seems a bit too small.
I think i'll stick with the Design specified font size in this instance.. Just because of the reason above, and also because (as mentioned in another comment), this change may not remain in the codebase too long due to the upcoming related project.
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.
In my experience updating font size just to avoid lines overlapping is not best practices, but like you said this will be changing soon so I think it's fine for now 😅
color: var(--jp-gray-80); | ||
font-size: var(--font-body-small); | ||
line-height: calc(var(--font-title-small) - 2px); | ||
border: 1px solid #F0F0F0; |
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.
We have a lot of grays already in the variables, I wonder if we really need to add a new one for this border specifically 🤔 Another thing that design would have a better feel for
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.
Yeah, I don't want --jp-gray-0 because it's the same color as the background color, and --jp-gray stands out a bit too dark, imo. But actually, --jp-green-0 (#f0f2eb) is very close to #F0F0F0, and with it being only a 1px border, it's almost impossible to tell the difference with the naked eye. It's the closest thing, so I'll use that! 👍😉
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.
Oh nice! I know I always try and suggest using existing variables, hopefully it's not too annoying 😅
Thank you!
projects/js-packages/licensing/components/activation-screen-error/style.scss
Outdated
Show resolved
Hide resolved
projects/js-packages/licensing/components/activation-screen-controls/index.jsx
Outdated
Show resolved
Hide resolved
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 think this all looks good and the testing plan still works, thanks for those updates!
This PR updates the various error messages and displays error help steps upon license key activation error.
You can view the Figma designs here: B09ms2D7kgqRmn10LL9lsL-fi-4387_6302
Fixes: https://github.com/Automattic/jetpack-marketing/issues/967
Proposed changes:
Other information:
Jetpack product discussion
https://github.com/Automattic/jetpack-marketing/issues/967
Does this pull request change what data or activity we track or use?
Adds a new tracking event, tracks when error message is viewed and tracks the type of error thrown.
Testing instructions:
That way you can stay logged in to your A11N WordPress.com account in your other, non-incognito browser window.
Additional notes:
[multisite_incompatibility]
error cannot be thrown (and tested) at this time, because My Jetpack was removed from multisite sites and therefore cannot activate licenses on multisite sites. There may be some issues concerning this, but it is not in scope of this PR.[attached_license]
error ("This license is already active on another website.") also is not thrown anymore. The[not_same_owner]
error is thrown instead. Still, I'm leaving the front-end code for this error in place because in the near future when we implement the "Error flow for Owned by different user": pbNhbs-aGG-p2, we will need this error message.