Honor hidden property of cart item data and add support for experimenal property #3732
Conversation
Size Change: -3.77 kB (0%) Total Size: 1.18 MB
ℹ️ View Unchanged
|
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.
Tests great, approving 👌🏼 I left a comment, feel free to address it if you think it is necessary to do so.
@@ -12,6 +12,8 @@ import './style.scss'; | |||
|
|||
// Component to display cart item data and variations. | |||
const ProductDetails = ( { details = [] } ) => { | |||
details = details.filter( ( detail ) => ! detail.hidden ); |
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.
Are we worried about checking if details
is arraylike here? I know it defaults to one, but what if a non-arraylike is passed in?
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.
Good point. I also took the chance to add snapshot testing.
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.
Cool! This looks great now 🙌🏻
This PR makes it so:
hidden
property set to true, it will be hidden.hidden
can be overridden with the__experimental_woocommerce_blocks_hidden
property, which only has effect in blocks.Screenshots
How to test the changes in this Pull Request:
fix/details-disappearing
branch in WC Subscriptions (see relevant PR: 3968-gh-woocommerce/woocommerce-subscriptions).Changelog