-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Working add shipping class option and modal #37968
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
Conversation
Test Results SummaryCommit SHA: 442b974
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. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #37968 +/- ##
==========================================
- Coverage 51.5% 51.2% -0.2%
- Complexity 17281 17409 +128
==========================================
Files 430 440 +10
Lines 80030 80576 +546
==========================================
+ Hits 41215 41295 +80
- Misses 38815 39281 +466
|
fd52b8b to
1412686
Compare
louwie17
left a comment
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.
Nice work @joelclimbsthings, this tested well! Although I did encounter a strange problem with the No shipping class option, where it auto selected the free shipping after selecting that.
I assume this was slightly un-expected behaviour after adding the No shipping class option? This could be addressed in a follow up, it seemed like the rest tested fine.
| const FREE_SHIPPING_OPTION_VALUE = 'free_shipping'; | ||
|
|
||
| export const DEFAULT_SHIPPING_CLASS_OPTIONS: SelectControl.Option[] = [ | ||
| { value: '', label: __( 'No shipping class', 'woocommerce' ) }, |
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.
It seems like when we select this now, the Free Shipping button gets auto selected. Is this what we decided on?
It feels kinda strange, maybe we want to update that useEffect on line 174 to fix this.
6a36360 to
68016b8
Compare
|
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: |
joshuatf
left a comment
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.
Code looks good to me. Left one comment about a translatable string and then same question as @louwie17 on the behavior.
.../product-editor/src/components/add-new-shipping-class-modal/add-new-shipping-class-modal.tsx
Outdated
Show resolved
Hide resolved
louwie17
left a comment
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.
This tested well this time around, nice work @joelclimbsthings 👍
I did notice that No shipping class is shown as an invalid option, disabling the form:

This is not a blocker for me in this PR, but curious if that was the expected behaviour we intended? cc: @jarekmorawski
|
Thanks @louwie17 , I assumed this was correct when "follow class" selected under shipping fee, since it wouldn't make sense if no shipping class is selected. Definitely up to change via a follow-up pending @jarekmorawski 's thoughts! |
|
Updated testing instructions for this PR:
|
Submission Review Guidelines:
Changes proposed in this Pull Request:
Adding "create new shipping class" option in Shipping class dropdown on product block editor, as well as modal.
Closes #37886 .
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
product-block-editorfeature flag with the WCA Test Helper plugin.