-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: Add a featured sort option for CatalogItems and paginate #4980
Conversation
41f6e50
to
93ed66d
Compare
b31f120
to
7bfcdba
Compare
d68e007
to
2071e12
Compare
7dca82f
to
38a7bc8
Compare
8791555
to
e6029e9
Compare
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.
imports/plugins/core/catalog/server/no-meteor/queries/catalogItemsAggregate.js
Show resolved
Hide resolved
imports/plugins/core/catalog/server/no-meteor/resolvers/Query/catalogItems.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
…ts by featuredProductIds list. Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
Signed-off-by: Machiko Yasuda <[email protected]>
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.
👍
imports/plugins/core/graphql/server/no-meteor/util/applyPaginationToMongoAggregation.js
Show resolved
Hide resolved
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.
- Products pagination in tag admin works
- Query results for
catalogItems
are in correct order and seem to paginate correctly
Soooo... lgtm 👍
Thank youuuu @rosshadden + @mikemurray + @aldeed ! |
closes #4983
closes #5004
Currently, the
catalogItems
query returns a tag's products in order by newest products first. Now that the operator tag management tool is finished and deployed, a developer should be able to query for a tag'scatalogItems
in the order set in atag
. This ticket modifies the query to add afeatured
as a sorting option, and also makesfeatured
the default option.Technical specs
featured
toCatalogItemSortByField
catalogItemsAggregate()
method to thecatalogItems()
resolver that returnscatalogItems
in the order of its tag'sfeaturedProductIds
, passed through togetPaginatedAggregateResponse
getPaginatedAggregateResponse()
andapplyPaginationToMongoAggregation()
to so thatcatalogItems
andproductsByTagId
queries paginate correctlycatalogItems
queryproductsByTagId
queryTest cases:
after
Testing
After this ticket is merged, reactioncommerce/example-storefront#498 can be tested and merged to display the products in the Starter-Kit with this query with the
featured
sorting option. This Starter Kit PR can also be used to test both the front-end and back-end:0
to the Priority column. Save.Test on GraphQL with a query variable:
"slugOrId": "shop"
.First, confirm a Tag's
featuredProductIds
with this query for a tag,You should get something like:
Then, pass
featured
into thecatalogItems
query:This query should return the products in order of
featuredProductIds
.Example
Croakies
andOne by Optic
to the 0 and 1 spots in Admin:featured-desc
in Starter Kit: