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 Tracks events to Publish dropdown and Save draft button #47320
Conversation
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Hi , @woocommerce/mothra Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
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.
Hey @octaedro I left one comment, it is not required to be implemented but I think const definitions when their values don't change should be outside of any function.
@@ -86,6 +87,18 @@ export function useSaveDraft( { | |||
} | |||
); | |||
|
|||
const statusMap: { |
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 can be moved outside of the useSaveDraft
function since its value does not change.
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.
Good call! Done in d4b5721
58d678c
to
9c2fab3
Compare
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR adds a few
Tracks
events:wcadmin_product_publish_dropdown_open
to track when the user opens the dropdown.wcadmin_product_schedule_publish
to track when the user selects the dropdown option.wcadmin_product_save_draft
to track when the user saves adraft
product.Closes #47221.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
.Console
tab.Save draft
.wcadmin_product_save_draft
should be recorded.wcadmin_product_publish_dropdown_open
should be recorded.Schedule publish
.wcadmin_product_schedule_publish
should be recorded as soon as selecting the option.Switch to draft
.wcadmin_product_switch_draft
should be recorded.Changelog entry
Significance
Type
Message
Comment