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 all 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)
- Fix GH build action & added package version and short commit hash to artifact names in GitHub Actions workflow for improved traceability and uniqueness. ([#2494](https://github.com/bigcommerce/cornerstone/pull/2494))
- Bump stencil-utils to 6.18.0 ([#2493](https://github.com/bigcommerce/cornerstone/pull/2493))
- Bump other GH actions to fix warnings related to old versions. ([#2495](https://github.com/bigcommerce/cornerstone/pull/2495))
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