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

Show spotlight when switching to variable product type #37413

Merged
merged 13 commits into from Mar 28, 2023

Conversation

mattsherman
Copy link
Contributor

@mattsherman mattsherman commented Mar 24, 2023

All Submissions:

Changes proposed in this Pull Request:

This PR introduces a single step tour (spotlight) when switching to the variable product type.

Screenshot 2023-03-23 at 21 19 14

This only shows a single time for each user (unless the user never interacts with it, in which case it will be shown again). This is stored in the woocommerce_admin_variable_product_tour_shown user preference (wp_usermeta table).

Tracks events are recorded for the tour:

  • wcadmin_variable_product_tour_started
  • wcadmin_variable_product_tour_step_viewed
  • wcadmin_variable_product_tour_completed

Each has a single step prop that is set to attributes. The Tracks events are recorded this way to allow for additional steps to be added in the future and be automatically recorded.

Closes #37149.

How to test the changes in this Pull Request:

  1. Create a new product.
  2. Change the type to "Variable product".
  3. Verify that the spotlight is shown.
  4. Dismiss the spotlight, either by the X or the "Got it" button.
  5. Refresh the page.
  6. Change the type to "Variable product".
  7. Verify that the spotlight is not shown.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?
  • Have you included testing instructions?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@mattsherman mattsherman added type: enhancement The issue is a request for an enhancement. focus: product management Related to product creation and editing. labels Mar 24, 2023
@mattsherman mattsherman requested a review from a team March 24, 2023 01:20
@mattsherman mattsherman self-assigned this Mar 24, 2023
@github-actions github-actions bot added focus: react admin [team:Ghidorah] package: @woocommerce/data issues related to @woocommerce/data plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Mar 24, 2023
@github-actions
Copy link
Contributor

Hi , @woocommerce/mothra-enhancements

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

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #37413 (d70e0e3) into trunk (9c8249f) will decrease coverage by 0.0%.
The diff coverage is 0.0%.

❗ Current head d70e0e3 differs from pull request most recent head e2e2875. Consider uploading reports for the commit e2e2875 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             trunk   #37413     +/-   ##
==========================================
- Coverage     45.7%    45.7%   -0.0%     
- Complexity   17197    17199      +2     
==========================================
  Files          429      429             
  Lines        64918    64923      +5     
==========================================
+ Hits         29696    29698      +2     
- Misses       35222    35225      +3     
Impacted Files Coverage Δ
...ocommerce/includes/abstracts/abstract-wc-order.php 75.8% <ø> (ø)
...ommerce/includes/admin/class-wc-admin-pointers.php 0.0% <0.0%> (ø)

... and 1 file with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2023

Test Results Summary

Commit SHA: e2e2875

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202611m 9s
E2E Tests1870010019713m 57s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@github-actions github-actions bot added the focus: e2e tests Issues related to e2e tests label Mar 24, 2023
@mattsherman mattsherman marked this pull request as ready for review March 24, 2023 07:36
@octaedro octaedro requested review from octaedro and removed request for a team March 24, 2023 16:38
Copy link
Contributor

@octaedro octaedro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job @mattsherman! This is testing well here and the code looks good. I only left a couple of small questions.

@mattsherman mattsherman force-pushed the add/variable-product-type-spotlight branch from d70e0e3 to 2810207 Compare March 24, 2023 20:27
@mattsherman
Copy link
Contributor Author

Removed the step Tracks events. Ready for a re-review, @octaedro !

Copy link
Contributor

@octaedro octaedro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mattsherman for addressing the changes! LGTM 🚀

@mattsherman mattsherman merged commit 30ea6cf into trunk Mar 28, 2023
18 checks passed
@mattsherman mattsherman deleted the add/variable-product-type-spotlight branch March 28, 2023 17:49
@github-actions github-actions bot added this to the 7.7.0 milestone Mar 28, 2023
@octaedro
Copy link
Contributor

octaedro commented Mar 28, 2023

@mattsherman I saw the tests were failing. Do you know why that was happening?

lanej0 pushed a commit that referenced this pull request Mar 29, 2023
* Show variable product tour
* Only show tour when product type is changed to variable
* Only show tour if it hasn't been shown before
* Add variable_product_tour_shown to UserPreferences type
* Store whether tour has been shown in user preferences
* Record Tracks events
* Add docblock for woocommerce_admin_get_user_data_fields filter
* Add test for tour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: e2e tests Issues related to e2e tests focus: product management Related to product creation and editing. package: @woocommerce/data issues related to @woocommerce/data plugin: woocommerce Issues related to the WooCommerce Core plugin. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Show spotlight after switching from another product type to the variable product
2 participants