woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
47 stars 21 forks source link

Limits steps in onboarding based on previously completed state #2568

Open dsawardekar opened 2 months ago

dsawardekar commented 2 months ago

Changes proposed in this Pull Request:

Closes #2493

This PR hides the confirm registration step if the user has sufficient data filled in already. If the user was on the confirm registration step previously, they are sent to the next step.

Screenshots:

With incomplete store requirements: (Confirm store requirements is present) image

With complete store requirements: (Confirm store requirements is absent) image

Detailed test instructions:

  1. Start the onboarding process with incomplete store data.
  2. You should see the Step no. 3 Confirm Store Requirements
  3. Reset your env, and delete some store data (eg:- Delete City under WooCommerce Store Address)
  4. Restart the onboarding process
  5. You should not see the Step no. 3

Additional details:

Update: Hides the Confirm Store Requirements step when feasible

Changelog entry

Update: Hides the Confirm Store Requirements step when feasible

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 40.81633% with 29 lines in your changes missing coverage. Please review.

Project coverage is 63.0%. Comparing base (766e351) to head (b3d8730). Report is 319 commits behind head on feature/2458-streamline-onboarding.

Files with missing lines Patch % Lines
js/src/hooks/useStoreAddress.js 26.1% 8 Missing and 9 partials :warning:
js/src/hooks/useGoogleMCPhoneNumber.js 40.0% 6 Missing and 3 partials :warning:
.../src/setup-mc/setup-stepper/saved-setup-stepper.js 72.7% 3 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568/graphs/tree.svg?width=650&height=150&src=pr&token=UROWUPF1LX&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) ```diff @@ Coverage Diff @@ ## feature/2458-streamline-onboarding #2568 +/- ## ==================================================================== - Coverage 63.8% 63.0% -0.8% ==================================================================== Files 326 321 -5 Lines 5088 5116 +28 Branches 1232 1255 +23 ==================================================================== - Hits 3247 3225 -22 - Misses 1673 1708 +35 - Partials 168 183 +15 ``` | [Flag](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [js-unit-tests](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | `63.0% <40.8%> (-0.8%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [.../src/setup-mc/setup-stepper/saved-setup-stepper.js](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568?src=pr&el=tree&filepath=js%2Fsrc%2Fsetup-mc%2Fsetup-stepper%2Fsaved-setup-stepper.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-anMvc3JjL3NldHVwLW1jL3NldHVwLXN0ZXBwZXIvc2F2ZWQtc2V0dXAtc3RlcHBlci5qcw==) | `84.3% <72.7%> (-3.5%)` | :arrow_down: | | [js/src/hooks/useGoogleMCPhoneNumber.js](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568?src=pr&el=tree&filepath=js%2Fsrc%2Fhooks%2FuseGoogleMCPhoneNumber.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-anMvc3JjL2hvb2tzL3VzZUdvb2dsZU1DUGhvbmVOdW1iZXIuanM=) | `47.1% <40.0%> (ø)` | | | [js/src/hooks/useStoreAddress.js](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568?src=pr&el=tree&filepath=js%2Fsrc%2Fhooks%2FuseStoreAddress.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-anMvc3JjL2hvb2tzL3VzZVN0b3JlQWRkcmVzcy5qcw==) | `34.6% <26.1%> (ø)` | | ... and [62 files with indirect coverage changes](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2568/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)
dsawardekar commented 2 months ago

@joemcgill This is working but I needed to move the implementation to the parent container component. Having the logic inside the SavedSetupStepper was causing a broken UX like below when the user already had completed store requirements.

Screenshot from 2024-08-21 16-31-16

Can you review and let me know if this looks good to proceed on the e2e tests?

Thanks!

dsawardekar commented 2 months ago

@joemcgill I've added the e2e tests for this, but I need assistance with mocking the email and mc account address. When I try to set mockMCSetup to use 'complete', it redirects to the Home page, and skips the onboarding flow completely.

image

Test File: https://github.com/woocommerce/google-listings-and-ads/blob/31a3ba5017434a3d4f6995f89839dd64546eb888/tests/e2e/specs/setup-mc/step-3-hide-store-requirements.test.js

Can you please take a look? Thanks!

dsawardekar commented 2 months ago

@joemcgill That might work, but the UX would be less than ideal. Maybe we need to consider folding the things that in that extra dissapearing step into sections inside Step 2 / 3. Then if the user has sufficient data, we could hide that section.