-
Notifications
You must be signed in to change notification settings - Fork 91
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
[framework] [frontend-api] universal product list #2901
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
7 times, most recently
from
October 31, 2023 15:18
8b535f2
to
c89b228
Compare
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
6 times, most recently
from
November 3, 2023 12:50
0fa7d50
to
455f80d
Compare
sebaholesz
force-pushed
the
rv-fw-1880-product-list
branch
from
November 14, 2023 11:33
455f80d
to
4f58846
Compare
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
from
November 15, 2023 11:17
4f58846
to
070c09e
Compare
sebaholesz
force-pushed
the
rv-fw-1880-product-list
branch
from
November 15, 2023 16:34
070c09e
to
6fba261
Compare
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
from
November 15, 2023 16:44
6fba261
to
85cb2f5
Compare
vitek-rostislav
commented
Nov 16, 2023
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
from
November 16, 2023 09:05
dadf0a2
to
6f7fd02
Compare
vitek-rostislav
changed the title
WIP: universal product list
[framework] [frontend-api] universal product list
Nov 16, 2023
vitek-rostislav
changed the base branch from
14.0
to
tv-FW-1896-add-additional-skeletons
November 16, 2023 09:07
vitek-rostislav
added
the
DX & Refactoring
Requests for DX improvements and refactorings
label
Nov 16, 2023
tvikito
reviewed
Nov 16, 2023
project-base/storefront/graphql/requests/productLists/fragments/ComparisonFragment.graphql
Outdated
Show resolved
Hide resolved
...se/storefront/graphql/requests/productLists/mutations/AddProductToComparisonMutation.graphql
Outdated
Show resolved
Hide resolved
project-base/storefront/hooks/productLists/comparison/useComparison.tsx
Outdated
Show resolved
Hide resolved
project-base/storefront/hooks/productLists/comparison/useComparison.tsx
Outdated
Show resolved
Hide resolved
project-base/storefront/hooks/productLists/comparison/useComparison.tsx
Outdated
Show resolved
Hide resolved
project-base/storefront/hooks/productLists/useProductListUuids.ts
Outdated
Show resolved
Hide resolved
sebaholesz
force-pushed
the
rv-fw-1880-product-list
branch
from
November 16, 2023 15:01
be10d19
to
95eab81
Compare
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
2 times, most recently
from
November 16, 2023 16:32
63dfc80
to
60fa05c
Compare
TomasLudvik
requested changes
Nov 20, 2023
packages/framework/src/Model/Product/List/ProductListRepository.php
Outdated
Show resolved
Hide resolved
packages/frontend-api/src/Resources/config/graphql-types/QueryDecorator.types.yaml
Outdated
Show resolved
Hide resolved
packages/frontend-api/src/Model/Mutation/ProductList/ProductListMutation.php
Show resolved
Hide resolved
project-base/app/src/DataFixtures/Demo/ProductListDataFixture.php
Outdated
Show resolved
Hide resolved
packages/frontend-api/src/Resources/config/graphql-types/MutationDecorator.types.yaml
Outdated
Show resolved
Hide resolved
packages/framework/src/Model/Product/List/ProductListRepository.php
Outdated
Show resolved
Hide resolved
tvikito
reviewed
Nov 20, 2023
project-base/storefront/components/Pages/ProductComparison/ProductComparisonContent.tsx
Outdated
Show resolved
Hide resolved
sebaholesz
force-pushed
the
rv-fw-1880-product-list
branch
from
November 20, 2023 15:20
60fa05c
to
a959d8d
Compare
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
from
December 1, 2023 12:52
ae707de
to
fd854e7
Compare
- ProductListTypeEnum defines the available types of the list - at the moment, there are two types of the product lists - a wishlist and a comparison
- MultipleSearchQuery + Factory moved to the FE API package - ProductBatchLoader:load*ByIds moved to the FE API package (the new class is now a parent of ProductBatchLoader from project-base) - ProductBatchLoader::getTotalByBatchLoadDataId moved to the FE API package (the new class is now a parent of ProductBatchLoader from project-base) - ProductElasticsearchProvider::getBatched*ByProductIds moved to a new class "ProductElasticsearchBatchProvider" in FE API package - ProductElasticsearchRepository::getBatchedProductsAndTotalsByFilterQueries moved to a new class "ProductElasticsearchBatchRepository" in FE API package - ProductElasticsearchRepository::PRODUCTS_KEY and TOTALS_KEY constants moved to a new class "ProductElasticsearchBatchRepository" in FE API package
- for not logged customer, product list type and uuid must be provided - for logged customer, product list type must be provided, and uuid optionally - user error is thrown when uuid is not provided by not logged user - products of the product list are fetched using data loader
- this is available for logged customer users only
- when the list does not exist, new one is created
…C order - i.e. from the most recetly added
- when the removed product is the last one in the list, the list is removed
- thanks to that, it is now possible to easily modify validation for a particular product list type - eg. if the input for WISHLIST should be validated in a custom way (eg. a customer user must be logged in), developer just needs to override WishlistInputValidator::validateInput
- they are already replaced by the general product lists - added migration for migrating data from the old wishlists and comparisons to the new product lists
- useGetAllProductListUuids was added as a wrapper to easily access all product list UUIDs which are necessary when registering /logging in - product-list-related queries were moved to a common folder called productLists - added cache updates for cleaning of product lists (manual clean or removal of the last product) - added optimistic update for cleaning of product lists
- new useProductList hook was added which now contains all shared logic for working with product lists - this hook was used inside useComparison and useWishlist to extract common logic - comparison and wishlist hooks were moved to hooks/productList so they are near the file containing the shared logic - handleClear<ProductList> was renamed to clear<ProductList>
…dded - useGetAllProductListUuids was renamed to useProductListUuids and extended to contain removeAllProductListUuids as well, which simplifies cleaning of product list UUIDs during various operations - getAllProductListUuids is now only used inside useAuth and useRegistration and is not needed in places where login or register are called - all product list UUIDs are cleared both on login (registration) and logout, as we want to merge them with current user's lists and use their UUIDs - so the list UUIDs are updated at all times, both useComparison and useWishlist contain a useEffect hook to update the UUID on any change
… fetches - with this change, the list is not fetch right after first adding to it - the cache is updated and the unnecessary fetch is skipped
- optimistic updates and manual updates are now in separate files - generic cache helpers are in a separate file
- all lists now use the same mutations, queries, and fragments - useProductList now includes essentially all the logic needed for a product list, and only requires a provided type and callbacks - zustand store now stores a dictionary (object) of product list UUIDs which simplified the code and made it more generic - useProductListUuids was removed as it was unnecessary - useUpdateProductListUuid was introduced as a helper to generically update a product list UUID given its type - additionally renamed productsCompare to comparedProducts as it is a more suitable and overall better name
vitek-rostislav
force-pushed
the
rv-fw-1880-product-list
branch
from
December 1, 2023 12:56
fd854e7
to
02989db
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌐 Live Preview: