Repository navigation
feat: add reviews count to ProductTitle component - #2655
Merged
hellofanny merged 13 commits intoFeb 20, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
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
marked this pull request as ready for review
January 30, 2025 17:42
artursantiago
requested review from
hellofanny and
pedromtec
and removed request for
a team
January 30, 2025 17:42
Guilera
force-pushed
the
feat/add-rating-amount-product-title
branch
from
February 14, 2025 15:19
88b85e9 to
7518315
Compare
Guilera
changed the base branch from
feat/reviews-and-ratings
to
feat/basic-rating-display
February 14, 2025 15:21
Guilera
changed the base branch from
feat/basic-rating-display
to
feat/reviews-and-ratings
February 14, 2025 15:22
Guilera
force-pushed
the
feat/reviews-and-ratings
branch
from
February 18, 2025 19:49
9c2cebb to
736e0f8
Compare
Guilera
force-pushed
the
feat/add-rating-amount-product-title
branch
2 times, most recently
from
February 18, 2025 20:22
622b56f to
3ab33ce
Compare
Guilera
self-requested a review
February 19, 2025 17:24
Guilera
approved these changes
Feb 19, 2025
Guilera
force-pushed
the
feat/reviews-and-ratings
branch
from
February 19, 2025 17:34
cc15cdd to
33db057
Compare
Guilera
force-pushed
the
feat/add-rating-amount-product-title
branch
from
February 19, 2025 17:36
3ab33ce to
5999074
Compare
pedromtec
approved these changes
Feb 19, 2025
pedromtec
reviewed
Feb 19, 2025
lariciamota
reviewed
Feb 19, 2025
hellofanny
reviewed
Feb 20, 2025
hellofanny
reviewed
Feb 20, 2025
hellofanny
reviewed
Feb 20, 2025
hellofanny
reviewed
Feb 20, 2025
hellofanny
reviewed
Feb 20, 2025
hellofanny
reviewed
Feb 20, 2025
Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
lariciamota
reviewed
Feb 20, 2025
Co-authored-by: Larícia Mota <[email protected]>
Merged
hellofanny
reviewed
Feb 20, 2025
| {ratingValue !== undefined && <Rating value={ratingValue} />} | ||
|
|
||
| {reviewsCount !== undefined && ( | ||
| <a href="#reviews-and-ratings" data-fs-product-title-reviews> |
Contributor
There was a problem hiding this comment.
just double checking that this is the fixed id, right?
hellofanny
approved these changes
Feb 20, 2025
pedromtec
pushed a commit
that referenced
this pull request
Mar 11, 2025
## What's the purpose of this pull request? **Adds the number of reviews** next to the **Rating** component in the **ProductTitle**. The review count, as well as the rating, should only be visible if the corresponding flag in the **discovery.config** is enabled in the code. ## How it works? The following props have been added to **ProductTitle**: - **reviewsCount?**: The amount of reviews for the product. - **reviewsSectionId?**: The ID of the reviews section to link to. - **noReviewsText?**: Default text for "No reviews yet." - **reviewsCountText?**: Default text for "X reviews." The review count text should be a link to the reviews section, which will be located further down on the product page. This link will receive the section ID through the **reviewsSectionId** prop. The labels for the text can also be customized via props, but by default, they will be "No reviews yet" and "X reviews." ## How to test it? You can access the preview link and open any pdp. It already should be able to show the reviews count for the product. If the count label don't appear you can run `yarn cms-sync` in the `start.store` [branch](https://github.com/vtex-sites/starter.store/pull/685) <!--- Describe the steps with bullet points. Is there any external link that can be used to better test it or an example? ---> ### Starters Deploy Preview [Preview](https://starter-git-feat-preview-product-title-count-vtex.vercel.app/) <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References [JIRA TASK: SFS-2064](https://vtex-dev.atlassian.net/browse/SFS-2064) [Figma](https://www.figma.com/design/YXU6IX2htN2yg7udpCumZv/Reviews-%26-Ratings?node-id=130-32961&t=sKkz60J8JEjxL8m4-4)   --------- Co-authored-by: gutchenzo <[email protected]> Co-authored-by: Larícia Mota <[email protected]> Co-authored-by: Fanny Chien <[email protected]>
This file contains hidden or 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
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.
What's the purpose of this pull request?
Adds the number of reviews next to the Rating component in the ProductTitle. The review count, as well as the rating, should only be visible if the corresponding flag in the discovery.config is enabled in the code.
How it works?
The following props have been added to ProductTitle:
The review count text should be a link to the reviews section, which will be located further down on the product page. This link will receive the section ID through the reviewsSectionId prop. The labels for the text can also be customized via props, but by default, they will be "No reviews yet" and "X reviews."
How to test it?
You can access the preview link and open any pdp. It already should be able to show the reviews count for the product.
If the count label don't appear you can run
yarn cms-syncin thestart.storebranchStarters Deploy Preview
Preview
References
JIRA TASK: SFS-2064
Figma