-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
*/ | ||
import debugFactory from 'debug'; | ||
import i18n from 'i18n-calypso'; | ||
import React from 'react'; | ||
|
||
/** | ||
* Internal dependencies | ||
|
@@ -16,8 +17,12 @@ import wp from 'lib/wp'; | |
const debug = debugFactory( 'calypso:upgrades:actions:purchases' ), | ||
wpcom = wp.undocumented(); | ||
|
||
const PURCHASES_FETCH_ERROR_MESSAGE = i18n.translate( 'There was an error retrieving purchases.' ), | ||
PURCHASE_REMOVE_ERROR_MESSAGE = i18n.translate( 'There was an error removing the purchase.' ); | ||
const PURCHASES_FETCH_ERROR_MESSAGE = i18n.translate( 'There was an error retrieving purchases. Please try again later or {{a}}contact support{{/a}}.', { | ||
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"/> } | ||
} ); | ||
|
||
function cancelPurchase( purchaseId, onComplete ) { | ||
wpcom.cancelPurchase( purchaseId, ( error, data ) => { | ||
|
@@ -53,7 +58,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 commentThe reason will be displayed to describe this comment to others. Learn more. What is the rationale behind ignoring There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @drewblaisdell It's broken - contains There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
components: { a: <a href="https://wordpress.com/help/contact"/> } | ||
} ) | ||
} ); | ||
} | ||
|
||
|
@@ -88,7 +95,9 @@ function deleteStoredCard( card, onComplete ) { | |
} else { | ||
Dispatcher.handleServerAction( { | ||
type: ActionTypes.STORED_CARDS_DELETE_FAILED, | ||
error: error.message || i18n.translate( 'There was a problem deleting the stored card. Please try again later or contact support.' ) | ||
error: i18n.translate( 'There was a problem deleting the stored card. Please try again later or {{a}}contact support{{/a}}.', { | ||
components: { a: <a href="https://wordpress.com/help/contact"/> } | ||
} ) | ||
} ); | ||
} | ||
|
||
|
@@ -136,7 +145,9 @@ function fetchStoredCards() { | |
} else if ( error ) { | ||
Dispatcher.handleServerAction( { | ||
type: ActionTypes.STORED_CARDS_FETCH_FAILED, | ||
error: error.message || i18n.translate( 'There was a problem retrieving stored cards. Please try again later or contact support.' ) | ||
error: i18n.translate( 'There was a problem retrieving stored cards. 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.