Browse Source

Remove unneeded flash notices and add a notices on password change (#139)

* Remove unneeded flash notices and add a notices on password change

* Get banner message from mapping
pull/141/head
kosiakkatrina 3 years ago committed by GitHub
parent
commit
6eafb05aca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/controllers/users_controller.rb
  2. 2
      app/views/layouts/application.html.erb
  3. 4
      config/locales/devise.en.yml

1
app/controllers/users_controller.rb

@ -6,6 +6,7 @@ class UsersController < ApplicationController
def update
if current_user.update(user_params)
bypass_sign_in current_user
flash[:notice] = I18n.t("devise.passwords.updated")
redirect_to user_path(current_user)
end
end

2
app/views/layouts/application.html.erb

@ -56,7 +56,7 @@
<%= content_for(:before_content) %>
<main class="govuk-main-wrapper" id="main-content" role="main">
<% if flash.notice %>
<% if flash.notice && !flash.notice.include?('translation missing') %>
<%= govuk_notification_banner(
title_text: 'Success',
success: true, title_heading_level: 3,

4
config/locales/devise.en.yml

@ -45,10 +45,6 @@ en:
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
updated: "Your account has been updated successfully."
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
sessions:
signed_in: "Signed in successfully."
signed_out: "Signed out successfully."
already_signed_out: "Signed out successfully."
unlocks:
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."

Loading…
Cancel
Save