-
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
[feature] Add products to wishlist from peregrine gallery #3182
Conversation
|
35592a7
to
57cdfb1
Compare
Signed-off-by: sirugh <rugh@adobe.com>
4ae89af
to
911fff8
Compare
data: { customerWishlistProducts } | ||
} = useQuery(operations.getProductsInWishlistsQuery); | ||
|
||
useQuery(operations.getWishlistItemsQuery, { |
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.
It's possible that this hook is called multiple times on a single page by different components, for example if a carousel is rendered on a category page.
In that event, we should be safe to assume that the onCompleted
callbacks are invoked synchronously, and would result in the same list of skus regardless of order.
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 have checked on the page with multiple instances of PageBuilder Carousels and it seems no problems
QA Approved |
Hi guys recently i updated the venia version and got add to wishlist error there i found a bug and tried to debug it, Replace this:
with this:
Hope this helps anyone with the same kind of error that I got |
Description
In #3105 the
Gallery
andGalleryItem
components were augmented with logic and functionality to:This PR takes the majority of that logic, specifically the first bullet above, and moves it into a re-useable hook,
useCustomerWishlistSkus
that can be run in a component to "prep" the cache array for comparison by some child component such as the GalleryButton.Because of how Pagebuilder's
Products
component was implemented (it renders either a "SlickSlider" or venia'sGallery
component) I didn't want to call the shared hook directly as that could potentially result in duplicate calls (once inProducts
and once inGallery
). Instead, there is a newCarousel
component which calls this new shared hook and does a minimal amount of work to fetch thestoreConfig
to pass to theGalleryItems
it renders.Potential breaking changes
If this PR is released with #3105 then it is not breaking, but if it goes out in a subsequent release it would be breaking as the operations have moved to a new hook from
useGallery
.Related Issue
Closes PWA-1672.
Acceptance
Verification Stakeholders
Specification
Verification Steps
Screenshots / Screen Captures (if appropriate)
Checklist