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
Fix password confirm validation error message #11625
Fix password confirm validation error message #11625
Conversation
@greenwoodt I check out this error and I saw that this is actually done because we're using full_messages and adding the error message in the flash alert. For what I could see, this is something that we're only doing in this form, so for consistency we should leave the generic error message in the flash alert. Mind that the validation error is shown in the form itself: For changing this, you need to change the diff --git a/decidim-core/app/controllers/decidim/devise/registrations_controller.rb b/decidim-core/app/controllers/decidim/devise/registrations_controller.rb
index ba62d5330b..17744906f9 100644
--- a/decidim-core/app/controllers/decidim/devise/registrations_controller.rb
+++ b/decidim-core/app/controllers/decidim/devise/registrations_controller.rb
@@ -39,7 +39,7 @@ module Decidim
end
on(:invalid) do
- flash.now[:alert] = @form.errors.full_messages.join(", ") if @form.errors.full_messages.any?
+ flash.now[:alert] = t("error", scope: "decidim.devise.registrations.create")
render :new
end
end
diff --git a/decidim-core/config/locales/en.yml b/decidim-core/config/locales/en.yml
index 25a425f31b..3ad9735657 100644
--- a/decidim-core/config/locales/en.yml
+++ b/decidim-core/config/locales/en.yml
@@ -534,6 +534,8 @@ en:
subtitle: Please fill in the following form in order to complete the sign up
username_help: Public name that appears on your posts. With the aim of guaranteeing the anonymity, can be any name.
registrations:
+ create:
+ error: There was a problem creating your account.
new:
already_have_an_account?: Already have an account?
newsletter: Receive an occasional newsletter with relevant information |
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 have a couple suggestions and also a change in the flash alert. Can you check it out please?
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
… registrations controller
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.
Functionality checked, and works as advertised.
@greenwoodt, can you have a look on failing specs?
@alecslupu and @andreslucena Apologies for taking some time ironing out the tests on this PR but upon closer inspection the release/0.27-stable branch is actually broken with a Catalan translation to "Sign in" on the Core (system specs) / Tests this should be fixed with commit: 2a37840 |
Changes have made also been made to the flash error message to simplify the Rspec test in the Feel free to review anytime @alecslupu |
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.
Just a small change and we're good to go
Also, as we're changing how we're handling the errors in this form, I think we should also change how this flash alert works in
We can do it once this is merged |
Ok! |
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
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.
LGTM! As I was involved in the code, I'll ask for @alecslupu review before merging
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.
01dfd49
into
decidim:release/0.27-stable
* Password confirm validation * changes to password confirm message * pushing whats been changed * updated changes to add quotes to error message on pw * normalisation of i18n strings in locales * Update decidim-core/spec/forms/account_form_spec.rb Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com> * Added test in registeration_form_spec and change in flash.now[:alert] registrations controller * test failure changes * Fixing of SPEC failures * rspec tests fix * test * Broken test with Catalan translation for sign-in fix * Registration form spec fix * fixes to rspec registerations controller on flash message * Update decidim-core/config/locales/ca.yml Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com> --------- Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
🎩 What? Why?
This is a password confirmation alert message change to allow the alert to be more clearer according to the original issuer #11283.
An original PR to this issue was moved from 0.28 to 0.27: #11534
📌 Related Issues
Link your PR to an issue
Testing
📷 Screenshots