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
Request attributes conditionally #47361
Conversation
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Hi @mdperez86, 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: |
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.
Hey @octaedro nice job here. I left one comment.
packages/js/product-editor/src/blocks/product-fields/variation-options/edit.tsx
Outdated
Show resolved
Hide resolved
Thank you @mdperez86, for reviewing this. I just added your suggestion. |
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 left one comment on this @octaedro I think we need to prevent the other /terms
request from the Organization
tab
packages/js/product-editor/src/blocks/product-fields/variation-options/edit.tsx
Show resolved
Hide resolved
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.
Since the AttributeContainer
no longer has any logic and is not reused elsewhere apart form the attributes block. I think is better to remove it.
packages/js/product-editor/src/blocks/product-fields/attributes/edit.tsx
Outdated
Show resolved
Hide resolved
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 @octaedro nice job!!
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR adds the changes to request the available attributes conditionally when they will be used under the
Variations
tab.Before
After
Closes #47357.
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features
.Network
tab.terms?attribute_id=
) when the component is not visible.Variations
tab and verify the request was made.Organization
tab and Add a new attribute. Remember that the REST API request is only made under theVariations
tab.Attributes
section.Changelog entry
Significance
Type
Message
Comment