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
Create shipping fee field block and initial shipping section #37642
Conversation
Hi @joshuatf, 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: |
Test Results SummaryCommit SHA: 118cda4
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. |
734d855
to
44b99a6
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #37642 +/- ##
==========================================
- Coverage 51.6% 51.6% -0.0%
Complexity 17260 17260
==========================================
Files 429 429
Lines 79863 79939 +76
==========================================
+ Hits 41211 41212 +1
- Misses 38652 38727 +75
|
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.
Looks great and no issues with testing! Left one comment about reusing the radio control block component, but otherwise LGTM.
<div className="wp-block-column"> | ||
<RadioControl | ||
label={ | ||
<span className="wp-block-woocommerce-product-radio__title"> |
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.
So that we reduce the possibility of introducing breaking changes in the future, could we use the actual block radio component here?
The pattern I've seen in GB and WC Blocks is to extract this portion into a separate block.tsx
file so that we can reuse in both the radio control's Edit
component and here.
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 would like to suggest to not reuse a part of another block if that part is within the same block folder. I think blocks should be reused only via templates and inner blocks. If we want to have shared parts then we should create components outside of each block that are gonna be using the shared parts.
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.
done -> ae58d28
const { title } = attributes; | ||
|
||
const blockProps = useBlockProps( { | ||
className: 'wp-block-woocommerce-product-shipping-fee-fields', |
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.
Same question as other PR regarding manually overriding class names.
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.
see -> #37683 (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.
Responded here. Please let me know if I misunderstood or if there's a different reason we need to add the class name.
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, done -> 0036e1e
0036e1e
to
bf35856
Compare
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! Nice work 🎉
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
Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes #37406
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
/wp-admin/tools.php?page=woocommerce-admin-test-helper
block-editor-feature-enabled
/wp-admin/admin.php?page=wc-admin&path=/add-product
Screen.Recording.2023-04-10.at.2.21.34.PM.mov