Skip to content
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

form validation fix #2475

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- Adding missing product reviews form validation [#2475](https://github.com/bigcommerce/cornerstone/pull/2475)
- Adding mobile nav dropdown focusTrap [#2465](https://github.com/bigcommerce/cornerstone/pull/2465)
- Remove remote_api_scripts to avoid double firing Meta Pixel analytics [#2467](https://github.com/bigcommerce/cornerstone/pull/2467)
- Prevent flow outside page container on account pages [#2462](https://github.com/bigcommerce/cornerstone/pull/2462)
Expand Down
4 changes: 4 additions & 0 deletions assets/js/theme/product/reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export default class {
selector: '[name="revtitle"]',
validate: 'presence',
errorMessage: safeString(this.context.reviewSubject),
}, {
selector: '[name="revfromname"]',
bc-azvierieva marked this conversation as resolved.
Show resolved Hide resolved
validate: 'presence',
errorMessage: safeString(this.context.reviewName),
}, {
selector: '[name="revtext"]',
validate: 'presence',
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@
"reviews": {
"rating": "The 'Rating' field cannot be blank.",
"title": "The 'Review Subject' field cannot be blank.",
"name": "The 'Name' field cannot be blank.",
"comment": "The 'Comments' field cannot be blank."
}
}
Expand Down
1 change: 1 addition & 0 deletions templates/components/products/modals/writeReview.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div id="modal-review-form" class="modal" data-reveal>
{{inject 'reviewRating' (lang 'forms.validate.reviews.rating')}}
{{inject 'reviewSubject' (lang 'forms.validate.reviews.title')}}
{{inject 'reviewName' (lang 'forms.validate.reviews.name')}}
{{inject 'reviewComment' (lang 'forms.validate.reviews.comment')}}
{{inject 'reviewEmail' (lang 'forms.validate.common.email_address')}}
<div class="modal-header">
Expand Down
Loading