Skip to content

feat: add filter and sort selects to review and ratings - #2713

Merged
artursantiago merged 12 commits into
feat/reviews-and-ratingsfrom
feat/filter-sort-select
Mar 25, 2025
Merged

artursantiago merged 12 commits into
feat/reviews-and-ratingsfrom
feat/filter-sort-select

Conversation

@artursantiago

@artursantiago artursantiago commented Mar 6, 2025 •

Copy link
Copy Markdown
Contributor

⚠️ THIS PR DEPENDS ON: ⚠️

What's the purpose of this pull request?

This pull request introduces the reviews filtering and sorting feature to the ReviewsAndRatings section.

How it works?

New components for filtering and sorting reviews:

Updates to ReviewList and ReviewsAndRatings sections:

Styling updates:

How to test it?

  • Open a PDP and see if the selects are displayed correctly
  • Confirm that CMS-configured content is properly displayed

Starters Deploy Preview

Preview

References

FEATURE BRANCH
Figma
SFS-2171

@codesandbox-ci

codesandbox-ci Bot commented Mar 7, 2025 •

Copy link
Copy Markdown

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.

@artursantiago
artursantiago marked this pull request as ready for review March 7, 2025 14:11
@artursantiago
artursantiago requested a review from a team as a code owner March 7, 2025 14:11
@artursantiago
artursantiago requested review from eduardoformiga and lariciamota and removed request for a team March 7, 2025 14:11
@artursantiago
artursantiago force-pushed the feat/filter-sort-select branch from 989c1d7 to d7f8226 Compare March 12, 2025 17:20

@lucasfp13 lucasfp13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left suggestions.
I don't know if it is expected, but checking the preview and the filter is considering 1 star as the default value instead of "All", that doesn't even appear as a possible value:
Screenshot 2025-03-20 at 14 33 59
Screenshot 2025-03-20 at 14 34 02

@artursantiago

Copy link
Copy Markdown
Contributor Author

Left suggestions. I don't know if it is expected, but checking the preview and the filter is considering 1 star as the default value instead of "All", that doesn't even appear as a possible value: Screenshot 2025-03-20 at 14 33 59 Screenshot 2025-03-20 at 14 34 02

I believe the CMS might not be synced.

Can you see it correctly in this Preview?

@hellofanny

Copy link
Copy Markdown
Contributor

I think it's missing this divider (maybe is the top border of the card)
image

@artursantiago
artursantiago force-pushed the feat/filter-sort-select branch from a87e77a to 46b7fae Compare March 24, 2025 13:35
@artursantiago
artursantiago force-pushed the feat/filter-sort-select branch from 6b99ffb to 9c70c18 Compare March 24, 2025 19:35

@eduardoformiga eduardoformiga left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I guess you will handle the cases (like empty results) in another PR, right?

Screenshot 2025-03-24 at 19 40 38

The CICD is failing, I'm not sure why:

Screenshot 2025-03-24 at 19 56 20

Comment on lines +8 to +11
reviewDateTime_desc: 'Most Recent',
reviewDateTime_asc: 'Oldest',
rating_desc: 'Highest Rated',
rating_asc: 'Lowest Rated',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should choose between camelCase or snake_case, WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@hellofanny

Copy link
Copy Markdown
Contributor

@eduardoformiga answering your question because I have been there 🙈

  1. Yes, the the list will be appear in this PR
  2. Yes, I got the same issue, but it's only in the ci/cd I feel like it's not running a build in the faststore/componentes 🤔

@hellofanny hellofanny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pre-approving these changes 🚀

@artursantiago
artursantiago merged commit 5aa815e into feat/reviews-and-ratings Mar 25, 2025
@artursantiago
artursantiago deleted the feat/filter-sort-select branch March 25, 2025 13:50
artursantiago added a commit that referenced this pull request Mar 28, 2025
>⚠️ 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)


![image](https://github.com/user-attachments/assets/87eed9ef-9250-4191-b610-33377e06b8fa)

![image](https://github.com/user-attachments/assets/84ad9ab5-1dd5-4245-8d6e-8aa2f11ddec3)

![image](https://github.com/user-attachments/assets/ec4a4715-7df4-4750-ada4-aeebcc12fbb6)

![image](https://github.com/user-attachments/assets/1fe1c002-333c-4db7-9e41-b6866023e39c)

---------

Co-authored-by: Fanny Chien <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants