Skip to content

Commit

Permalink
Merge pull request #2475 from Dpschu2/Dpschu2-form-validation
Browse files Browse the repository at this point in the history
form validation fix
  • Loading branch information
bookernath authored Oct 21, 2024
2 parents d78a6c0 + a7d9f59 commit 3967d64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
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"]',
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

0 comments on commit 3967d64

Please sign in to comment.