-
Notifications
You must be signed in to change notification settings - Fork 682
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
PDPs show intended Product only #2697
Conversation
|
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.
Minor suggestion to future proof this fix a little more. Test coverage to awesome 🙌 thanks for adding that.
return null; | ||
} | ||
|
||
const supportedProducts = data.products.items.filter( |
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.
To future proof this fix (in a distant future where we support grouped products), we can instead just search for the url_key
we intended to query for. const product = data.product.items.find(item => item.url_key === urlKey)
// The product isn't in the cache and we don't have a response from GraphQL yet. | ||
return null; | ||
// Pick the first supported product. | ||
return mapProduct(supportedProducts[0]); |
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 can't believe mapProduct
is still around, it was a compatibility fix for 2.3.1
which is long out of support. I'll create a tech debt task to remove it, which should clean this talon up a little bit.
Description
Venia does not support Grouped, Bundled, or Virtual products yet, but the Venia sample data does include them.
This PR adds a bit of filtering logic into the
useProduct
root component talon to only return theproduct
we requested (byurl_key
).Related Issue
Closes PWA-895.
Acceptance
Verification Stakeholders
Specification
Verification Steps
MAGENTO_BACKEND_URL
to a2.4.1+
backend (this PR deployment may be that already)/gold-veritas-cuff-set.html
pageScreenshots / Screen Captures (if appropriate)
Checklist