Repository navigation
feat: add filter and sort selects to review and ratings - #2713
Conversation
ea78c84 to
1ffce0e
Compare
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
989c1d7 to
d7f8226
Compare
I believe the CMS might not be synced. Can you see it correctly in this Preview? |
a87e77a to
46b7fae
Compare
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Lucas Feijó <[email protected]>
6b99ffb to
9c70c18
Compare
| reviewDateTime_desc: 'Most Recent', | ||
| reviewDateTime_asc: 'Oldest', | ||
| rating_desc: 'Highest Rated', | ||
| rating_asc: 'Lowest Rated', |
There was a problem hiding this comment.
I think we should choose between camelCase or snake_case, WDYT?
There was a problem hiding this comment.
I believe that when Gut did it he thought that the _ would indicate the separation of the ordering and not just the snake_case. But we can continue with only one, in this case it could be snake_case since it is used in other endpoints too. But I believe it is better to create another PR for this. Because we can unlock this PR and #2724 which depends on this one. WDYT?
|
@eduardoformiga answering your question because I have been there 🙈
|
hellofanny
left a comment
There was a problem hiding this comment.
I'm pre-approving these changes 🚀
>⚠️ THIS PR DEPENDS ON:⚠️ > - #2705 > - #2713 ## What's the purpose of this pull request? This PR adds the `ReviewList` with its listing functionality, loading state, filters, and sorting. ## How it works? - By default, the list will display 6 reviews. If more reviews are available, a "Load More" button will appear. Clicking it will load 6 additional reviews at a time. - If there are no reviews for the product, a message will be displayed along with a button to open the ReviewModal. - If a filter is applied but no reviews match the selected criteria, a different message will appear with a button to reset the filters. ## How to test it? - Test scenarios where reviews exist and where they do not. - Test cases with more than 6 reviews and fewer than 6 reviews. - Apply filters that result in no matching reviews. - Verify that sorting works correctly. ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> [Preview](https://starter-git-feat-review-list-vtex.vercel.app/) ## References [JIRA SFS-2072](https://vtex-dev.atlassian.net/browse/SFS-2072) [Figma](https://www.figma.com/design/YXU6IX2htN2yg7udpCumZv/Reviews-%26-Ratings?node-id=130-32955&t=5KOdS0Qx4MBzhrNq-4) [FEATURE BRANCH](#2676)     --------- Co-authored-by: Fanny Chien <[email protected]>







What's the purpose of this pull request?
This pull request introduces the reviews filtering and sorting feature to the
ReviewsAndRatingssection.How it works?
New components for filtering and sorting reviews:
packages/core/src/components/reviews/FilterProductReviews/FilterProductReviews.tsx: IntroducedFilterProductReviewscomponent to filter reviews by rating.packages/core/src/components/reviews/SortProductReviews/SortProductReviews.tsx: IntroducedSortProductReviewscomponent to sort reviews by different criteria.Updates to
ReviewListandReviewsAndRatingssections:packages/core/src/components/reviews/ReviewList/ReviewList.tsx: AddedReviewListcomponent to display reviews with sorting and filtering options.packages/core/src/components/sections/ReviewsAndRatings/ReviewsAndRatings.tsx: UpdatedReviewsAndRatingssection to include the newReviewListcomponent and handle its props. [1] [2] [3]Styling updates:
packages/core/src/components/sections/ReviewsAndRatings/section.module.scss: Updated styles to support the new review list and its header.How to test it?
Starters Deploy Preview
Preview
References
FEATURE BRANCH
Figma
SFS-2171