-
Notifications
You must be signed in to change notification settings - Fork 21
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
Hide Tax UI during onboarding & keep in edit campaign #2542
Hide Tax UI during onboarding & keep in edit campaign #2542
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/2458-streamline-onboarding #2542 +/- ##
=======================================================================
- Coverage 65.2% 62.7% -2.5%
=======================================================================
Files 800 319 -481
Lines 22899 5063 -17836
Branches 1230 1233 +3
=======================================================================
- Hits 14928 3173 -11755
+ Misses 7803 1716 -6087
- Partials 168 174 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…selection-ui-onboarding
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've left one suggestion inline. Otherwise, the main thing that needs to be addressed is that I see an E2E test that's failing related to the validation logic that happens in the SetupFreeListings
component:
google-listings-and-ads/js/src/components/free-listings/setup-free-listings/index.js
Lines 104 to 114 in 7acafdf
const handleValidate = ( values ) => { | |
const countries = resolveFinalCountries( values ); | |
const { shipping_country_times: shippingTimesData } = values; | |
return checkErrors( | |
values, | |
shippingTimesData, | |
countries, | |
storeCountryCode | |
); | |
}; |
The checkErrors()
function includes this logic to validate the tax_rate
value for 'US' based stores:
google-listings-and-ads/js/src/components/free-listings/configure-product-listings/checkErrors.js
Lines 109 to 120 in 7acafdf
/** | |
* Check tax rate (required for U.S. only). | |
*/ | |
if ( | |
( storeCountryCode === 'US' || finalCountryCodes.includes( 'US' ) ) && | |
! validTaxRateSet.has( values.tax_rate ) | |
) { | |
errors.tax_rate = __( | |
'Please specify tax rate option.', | |
'google-listings-and-ads' | |
); | |
} |
We're setting this default for tax rates via the API in #2491, so we need to update this so that the validation for tax_rates
only runs if hideTaxRates
is false
.
To verify this locally, set your store location to 'United States' and try completing this form. You will be able to click the "Continue" button, but nothing will happen and no errors will be shown.
@joemcgill I've addressed the PR feedback, can you take another look? thx |
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.
LGTM 💯
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 traced down the E2E test failure that I was seeing since I couldn't reproduce it anymore now that 57ecc5d got merged into this branch. Turns out the default settings get mocked in these tests and needed to be updated in here.
I went ahead and cleaned up a few more test methods that are no longer used after these changes—something to keep an eye going forward when deleting tests.
QA/Test Report- ✅Testing Environment -
Test Results -
Functional Demo / Screencast - Recording.809.mp4Plugin file with this PR related code to test google-listings-and-ads.zip |
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.
Thanks for the change! It works well.
Could you help with removing an unused method?
google-listings-and-ads/tests/e2e/utils/pages/setup-mc/step-2-product-listings.js
Lines 138 to 148 in 4870093
/** | |
* Get non-destination-based tax rate radio row. | |
* | |
* @return {import('@playwright/test').Locator} Get non-destination-based tax rate radio row. | |
*/ | |
getNonDestinationBasedTaxRateRadioRow() { | |
return this.page.getByRole( 'radio', { | |
name: 'My store does not use destination-based tax rates.', | |
exact: true, | |
} ); | |
} |
js/src/components/free-listings/setup-free-listings/form-content.js
Outdated
Show resolved
Hide resolved
…ithub.com:woocommerce/google-listings-and-ads into update/2490-hide-tax-rate-selection-ui-onboarding
@eason9487 I think this is ready for a second review. |
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.
Thanks for the update!
Although there are JSDoc and code conflict need to be adjusted, I believe it should not need another round of code reviews after resolving them.
js/src/components/free-listings/setup-free-listings/form-content.js
Outdated
Show resolved
Hide resolved
…de-tax-rate-selection-ui-onboarding
@joemcgill I have updated the jsdoc and fixed the merge conflict. Assigning to you to take another look. |
Change LGTM @dsawardekar . As per @eason9487 's comment, I'am reassigning the ticket to @fblascogarma for UAT. |
Since this has been approved, I'm merging into the feature branch. |
8eb1fff
into
feature/2458-streamline-onboarding
Changes proposed in this Pull Request:
Closes #2490
This PR removes the tax rates UI during the onboarding steps. The UI is preserved for the edit campaign flow.
Note: This PR depends on the work in https://github.com/woocommerce/google-listings-and-ads/pull/2543/files.
Screenshots:
Onboarding:
Edit Campaign:
Detailed test instructions:
Dependency:
Merge https://github.com/woocommerce/google-listings-and-ads/pull/2543/files into your local branch before testing this feature. Without this you will not be able to continue to Step 3.
Additional details:
Update - Hides tax rate UI during onboarding
Changelog entry