The PartContainer's for ShoppingData were always rendered, resulting in whitespace within the Google Preview when no ShoppingData was presented. This needed fixing.
This PR can be summarized in the following changelog entry:
[@yoast/search-metadata-previews] Fixes an unreleased bug where whitespace was erroneously rendered within the Google Preview when product data was absent, which is always the case on posts and terms.
Relevant technical choices:
Placed the PartContainer components for the ShoppingData within the render function that has a safety check.
Since ParctContainer needs to be available, it's passed to the render function as an argument.
Test instructions
This PR can be tested by following these steps:
Check posts and pages in the 3 editors
The whitespace from above screenshot shouldn't be visible in all cases
When using this branch in conjunction with P1-345 of Free and WooCommerce SEO, or latest trunk of both, ShoppingData should be displayed like in the test instructions for P1-345
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
*
UI changes
[ ] This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.
Quality assurance
[X] I have tested this code to the best of my abilities
[ ] I have added unittests to verify the code works as intended
Summary
The PartContainer's for ShoppingData were always rendered, resulting in whitespace within the Google Preview when no ShoppingData was presented. This needed fixing.
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
This PR can be tested by following these steps:
Impact check
UI changes
Quality assurance
Fixes P1-485