From 52adeda39869b5bb6d768576a03933f9a8ddf3bb Mon Sep 17 00:00:00 2001 From: Dmitri Perunov Date: Sat, 26 Nov 2022 00:40:31 +0400 Subject: [PATCH] Update product review validation's notInRangeMessage --- UPGRADE-1.13.md | 2 ++ .../product_review_validation.feature | 2 +- src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php | 6 +++--- .../Resources/config/validation/AddProductReview.xml | 4 +--- .../CoreBundle/Resources/translations/validators.de.yml | 2 -- .../CoreBundle/Resources/translations/validators.de_CH.yml | 2 -- .../CoreBundle/Resources/translations/validators.en.yml | 2 +- .../CoreBundle/Resources/translations/validators.fr.yml | 2 -- 8 files changed, 8 insertions(+), 14 deletions(-) diff --git a/UPGRADE-1.13.md b/UPGRADE-1.13.md index 3bb459fcf6..c6b4ee384e 100644 --- a/UPGRADE-1.13.md +++ b/UPGRADE-1.13.md @@ -98,3 +98,5 @@ 1. The `sylius.http_client` has become an alias to `psr18.http_client` service. 1. The `sylius.payum.http_client` has become a service ID of newly created `Sylius\Bundle\PayumBundle\HttpClient\HttpClient`. + +1. Validation translation key `sylius.review.rating.range` was renamed to `sylius.review.rating.not_in_range`. diff --git a/features/product/adding_product_reviews/product_review_validation.feature b/features/product/adding_product_reviews/product_review_validation.feature index a9da7f172b..0c7070bf8f 100644 --- a/features/product/adding_product_reviews/product_review_validation.feature +++ b/features/product/adding_product_reviews/product_review_validation.feature @@ -72,4 +72,4 @@ Feature: Product review validation And I leave a comment "This book made me sad, but plot was fine.", titled "Not good, not bad" as "example@example.com" And I rate it with 6 points And I try to add it - Then I should be notified that rate must be an integer in the range 1-5 + Then I should be notified that rating must be between 1 and 5 diff --git a/src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php b/src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php index 6f5e20316b..a317d0d493 100644 --- a/src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php +++ b/src/Sylius/Behat/Context/Api/Shop/ProductReviewContext.php @@ -214,11 +214,11 @@ final class ProductReviewContext implements Context } /** - * @Then I should be notified that rate must be an integer in the range 1-5 + * @Then I should be notified that rating must be between 1 and 5 */ - public function iShouldBeNotifiedThatRateMustBeAnIntegerInTheRange15(): void + public function iShouldBeNotifiedThatRatingMustBeBetween1And5(): void { - $this->assertViolation('Review rating must be an integer in the range 1-5.', 'rating'); + $this->assertViolation('Review rating must be between 1 and 5.', 'rating'); } private function hasReviewsWithTitles(array $titles): bool diff --git a/src/Sylius/Bundle/ApiBundle/Resources/config/validation/AddProductReview.xml b/src/Sylius/Bundle/ApiBundle/Resources/config/validation/AddProductReview.xml index 5f980d4c77..32d2fa966e 100644 --- a/src/Sylius/Bundle/ApiBundle/Resources/config/validation/AddProductReview.xml +++ b/src/Sylius/Bundle/ApiBundle/Resources/config/validation/AddProductReview.xml @@ -23,9 +23,7 @@ - - - + diff --git a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de.yml b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de.yml index aa4fef4d96..285d8fa6e9 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de.yml @@ -100,8 +100,6 @@ sylius: review: author: not_blank: Bitte geben Sie Ihre E-Mail-Adresse ein. - rating: - range: Bewertung muss eine Ganzzahl im Bereich 1-5 sein. taxon_image: file: max_size: Das Bild ist zu groß - {{ size }}{{ suffix }}. Maximal zulässige Größe {{ limit }}{{ suffix }}. diff --git a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de_CH.yml b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de_CH.yml index 3f0cca789e..5c23433d40 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de_CH.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.de_CH.yml @@ -100,8 +100,6 @@ sylius: review: author: not_blank: Bitte geben Sie Ihre E-Mail-Adresse ein. - rating: - range: Bewertung muss eine Ganzzahl im Bereich 1-5 sein. taxon_image: file: max_size: Das Bild ist zu groß - {{ size }}{{ suffix }}. Maximal zulässige Größe {{ limit }}{{ suffix }}. diff --git a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml index e27da4c978..953c312124 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.en.yml @@ -126,7 +126,7 @@ sylius: author: not_blank: Please enter your email. rating: - range: Review rating must be an integer in the range 1-5. + not_in_range: Review rating must be between {{ min }} and {{ max }}. taxon_image: file: max_size: The image is too big - {{ size }}{{ suffix }}. Maximum allowed size is {{ limit }}{{ suffix }}. diff --git a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.fr.yml b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.fr.yml index 9ad2e106ac..e2ba46d7c1 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.fr.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/translations/validators.fr.yml @@ -90,8 +90,6 @@ sylius: review: author: not_blank: Veuillez saisir votre adresse email. - rating: - range: La note de l'avis doit être un entier entre 1 et 5. taxon_image: file: max_size: L'image est trop grande - {{ size }}{{ suffix }}. La taille maximum autorisée est de {{ limit }}{{ suffix }}.