-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add a link for contacting support in error messages #6364
Conversation
The code looks good. Have you been able to test these messages? I triggered an endpoint in the |
It looks like we aren't displaying errors on |
I've tested the cancel private registration error message on the ui, since it's the only one currently used as far as I can tell, the others aren't displayed anywhere afaik. |
I think we can merge this and add the error displaying to the components later, I'm not sure what you mean by the change in the reducer, why a change is needed? the message already there as far as I can see, it just no accessed from anywhere. |
components: { a: <a href="https://wordpress.com/help/contact"/> } | ||
} ), | ||
PURCHASE_REMOVE_ERROR_MESSAGE = i18n.translate( 'There was an error removing the purchase. Please try again later or {{a}}contact support{{/a}}.', { | ||
components: { a: <a href="https://wordpress.com/help/contact"/> } |
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 should use this constant for all those support links.
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.
Thanks @stephanethomas, fixed that.
@@ -53,7 +59,9 @@ function cancelPrivateRegistration( purchaseId, onComplete ) { | |||
Dispatcher.handleServerAction( { | |||
type: ActionTypes.PRIVACY_PROTECTION_CANCEL_FAILED, | |||
purchaseId, | |||
error: error.message || i18n.translate( 'There was a problem canceling this private registration. Please try again later or contact support.' ) | |||
error: i18n.translate( 'There was a problem canceling this private registration. Please try again later or {{a}}contact support{{/a}}.', { |
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.
What is the rationale behind ignoring error.message
?
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.
@drewblaisdell It's broken - contains <a />
without a href...
and also I believe it's a bit confusing, I don't really sure it's good to tell the user what actually the problem is, I feel that a more general error is more appropriate.
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.
What's the error message? If it's broken we should probably fix it.
I don't necessarily agree, unless the error message is about a technical error that users won't be able to understand. Otherwise I think we should display the message returned by the API, or update it if it doesn't do the job. Note a custom message is also useful for support when they are contacted by users and need to investigate a problem.
In that case, I had one question, but otherwise this LGTM. 👍 Do we not need a product review now?
At least when fetching purchases fails, we don't update the fetching flag when there is an error, resulting in a perpetual loading state. |
In light fo your comments, I think it's best to take another approach here, I'll PR it soon. |
That PR adds links to error messages and fixes #465
Test live: https://calypso.live/?branch=fix/link-contact-support