Skip to content
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

Merged
merged 8 commits into from May 15, 2024

Conversation

octaedro
Copy link
Contributor

@octaedro octaedro commented May 9, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR adds a few Tracks events:

  • Add wcadmin_product_publish_dropdown_open to track when the user opens the dropdown.
  • Add wcadmin_product_schedule_publish to track when the user selects the dropdown option.
  • Add wcadmin_product_save_draft to track when the user saves a draft product.

Closes #47221.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Make sure the New product is enabled under /wp-admin/admin.php?page=wc-settings&tab=advanced&section=features.
  2. Go to Tools > WCA Test Helper > Tools and enable wc-admin tracking.
  3. Open the browser's devTools and go to the Console tab.
  4. Go to Products > Add New and add a product name.
  5. Press Save draft.
  6. The event wcadmin_product_save_draft should be recorded.
  7. Press the Publish dropdown chevron.
  8. The event wcadmin_product_publish_dropdown_open should be recorded.
  9. Now select Schedule publish.
  10. The event wcadmin_product_schedule_publish should be recorded as soon as selecting the option.
  11. Now Publish the product.
  12. Press Switch to draft.
  13. The event wcadmin_product_switch_draft should be recorded.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

Copy link
Contributor

github-actions bot commented May 9, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

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.

@octaedro octaedro self-assigned this May 13, 2024
@octaedro octaedro requested a review from a team May 13, 2024 16:41
@octaedro octaedro added focus: new product ux revamped product management experience team: Mothra labels May 13, 2024
Copy link
Contributor

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:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@octaedro octaedro marked this pull request as ready for review May 13, 2024 16:42
@octaedro octaedro changed the title Add Tracks events to Publish dropdown and switch to draft Add Tracks events to Publish dropdown and Save draft button May 13, 2024
Copy link
Contributor

@mdperez86 mdperez86 left a 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: {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@octaedro octaedro force-pushed the add/47221_tracks_events_to_publish_dropdown branch from 58d678c to 9c2fab3 Compare May 15, 2024 17:06
@octaedro octaedro merged commit f94d08a into trunk May 15, 2024
25 checks passed
@octaedro octaedro deleted the add/47221_tracks_events_to_publish_dropdown branch May 15, 2024 18:16
@github-actions github-actions bot added this to the 9.0.0 milestone May 15, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label May 15, 2024
@rodelgc rodelgc added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: new product ux revamped product management experience status: analysis complete Indicates if a PR has been analysed by Solaris team: Mothra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish dropdown and switch to draft: add Tracks events
3 participants