-
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
WooCommerce setup improvements #51932
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,8 @@ const TIME_TO_TRANSFER_ACTIVE = 5; | |
const TIME_TO_TRANSFER_UPLOADING = 5; | ||
const TIME_TO_TRANSFER_BACKFILLING = 25; | ||
const TIME_TO_TRANSFER_COMPLETE = 6; | ||
const TIME_TO_PLUGIN_INSTALLATION = 30; | ||
const TIME_TO_PLUGIN_ACTIVATION = 30; | ||
const TIME_TO_PLUGIN_INSTALLATION = 60; | ||
const TIME_TO_PLUGIN_ACTIVATION = 60; | ||
|
||
const transferStatusesToTimes = {}; | ||
|
||
|
@@ -214,6 +214,17 @@ class RequiredPluginsInstallView extends Component { | |
this.timeoutTimer = window.setTimeout( this.timeoutElapsed, durationInSeconds * 1000 ); | ||
}; | ||
|
||
/** | ||
* Sends a track for user contacting support. | ||
* | ||
* @param {string} reason Reason on why user would contact. Values can be 'failure' or 'timeout'. | ||
*/ | ||
trackContactSupport = ( reason ) => { | ||
recordTrack( 'calypso_woocommerce_setup_contact_support', { | ||
reason, | ||
} ); | ||
}; | ||
|
||
doInitialization = () => { | ||
const { fixMode, site, sitePlugins, wporgPlugins } = this.props; | ||
const { workingOn } = this.state; | ||
|
@@ -348,6 +359,7 @@ class RequiredPluginsInstallView extends Component { | |
// Otherwise, if we are working on something presently, see if it has appeared in state yet | ||
const pluginFound = find( sitePlugins, { slug: this.state.workingOn } ); | ||
if ( pluginFound ) { | ||
this.destroyTimeoutTimer(); | ||
this.setState( { | ||
workingOn: '', | ||
progress: this.state.progress + this.getPluginInstallationTime(), | ||
|
@@ -535,7 +547,13 @@ class RequiredPluginsInstallView extends Component { | |
title={ translate( "We can't update your store" ) } | ||
subtitle={ subtitle } | ||
> | ||
<Button primary href={ CALYPSO_CONTACT } target="_blank" rel="noopener noreferrer"> | ||
<Button | ||
onClick={ this.trackContactSupport( 'failure' ) } | ||
primary | ||
href={ CALYPSO_CONTACT } | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{ this.props.translate( 'Get in touch' ) } | ||
</Button> | ||
</SetupHeader> | ||
|
@@ -562,7 +580,13 @@ class RequiredPluginsInstallView extends Component { | |
title={ translate( 'We were unable to set up your store.' ) } | ||
subtitle={ subtitle } | ||
> | ||
<Button primary href={ CALYPSO_CONTACT } target="_blank" rel="noopener noreferrer"> | ||
<Button | ||
onClick={ this.trackContactSupport( 'timeout' ) } | ||
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. Same comment as above. |
||
primary | ||
href={ CALYPSO_CONTACT } | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{ translate( 'Get in touch' ) } | ||
</Button> | ||
</SetupHeader> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 calls
trackContactSupport()
immediately when the contact support message is rendered.What you want is something like...
or
They both create a new function every time the message is rendered. I'd go with the anonymous arrow function, since I think it is more readable and familiar to newer JS devs.
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.
Ah, rookie mistake! Thanks for catching this