-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add review modal form #2705
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 review modal form #2705
Conversation
|
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. |
4094797 to
b0bbabc
Compare
f086d3d to
ea69a95
Compare
…il inside the packages/core
ea69a95 to
637acd2
Compare
lucasfp13
left a comment
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.
Raised some discussions, I'm open to talk about them 🤝
packages/core/src/components/reviews/ReviewModal/ReviewModal.tsx
Outdated
Show resolved
Hide resolved
packages/core/src/components/reviews/ReviewModal/ReviewModal.tsx
Outdated
Show resolved
Hide resolved
packages/core/src/components/reviews/ReviewModal/ReviewModal.tsx
Outdated
Show resolved
Hide resolved
| // Handle special scrolling for certain fields | ||
| if ( | ||
| firstInvalidField === 'privacyPolicy' || | ||
| firstInvalidField === 'rating' |
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.
question: out of curiosity when is this scenario? 🤔
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.
In these cases, focusing on the field (when the user doesn't fill the field and click submit)doesn't trigger the native scrolling behavior, so I'm handling it with JavaScript.
hellofanny
left a comment
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.
|
I've created a task to address the TextFieldAre issue. |
>⚠️ 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 PR fixes a visual bug in the TextareaField component where long text would appear underneath the floating label during scroll, making it difficult to read. The issue was identified during the review of [PR #2705](#2705 (review)). Additionally, comprehensive Storybook documentation was added to showcase all TextareaField variations and use cases. https://github.com/user-attachments/assets/a86cd4df-e286-40f4-82b0-271a8bc66a26 ## How it works? **Bug Fix:** - Added `--fs-textarea-field-label-background-color` CSS variable to `packages/ui/src/components/molecules/TextareaField/styles.scss` - Set default value to neutral-0 (white) to prevent text from showing through the label - When the textarea content is long and the user scrolls, the label now has an opaque background, preventing text overlap ## How to test it? **Test the scroll bug fix:** From the project root: ```bash pnpm --filter "@faststore/storybook" dev ``` Or navigate to the storybook package: ```bash cd packages/storybook pnpm dev ``` Then: 1. Open http://localhost:6006 in your browser 2. Navigate to **"TextareaField"** → **"LargeText"** story 3. Scroll inside the textarea content 4. Verify that the text no longer appears underneath the label ## References - **Related Issue:** [PR #2705 - TextareaField label overlap issue identified](#2705 (review)) - **Task:** [SFS-2385 ](https://vtex-dev.atlassian.net/browse/SFS-2385)



What's the purpose of this pull request?
This PR implements the "Add Review" form functionality within the core package.
Note
I also made some adjustments to global components (Rating, Textarea, CheckboxField, InputField). I've included them in this PR for efficiency, but can move them to separate PRs targeting main if preferred.
How it works?
Review Modal Form:
Adjust AddReviewModal.tsx in the core package with form handling, validation, success states, and error management
Integrated
Add new cms configuration in
sections.jsonGraphQL Integration:
Global Component Enhancements:
How to test it?
Starters Deploy Preview
Preview
References
FEATURE BRANCH
Figma
SFS-2082
SFS-2169