From d3c74e5a2caba8f44353afa40414152b8948c55e Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 22 Dec 2022 15:50:07 -0600 Subject: [PATCH 1/3] Fix untranslated email input in password reset changelog: Bug Fixes, Internationalization, Fix untranslated email input in password reset --- app/views/devise/passwords/new.html.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 50a540f6f98..a4718dc20b6 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -14,10 +14,14 @@ url: user_password_path, html: { autocomplete: 'off', method: :post }, ) do |f| %> - <%= f.input :email, - required: true, - input_html: { autocorrect: 'off', - aria: { invalid: false, describedby: 'email-description' } } %> + <%= render ValidatedFieldComponent.new( + form: f, + name: :email, + label: t('account.index.email'), + required: true, + input_html: { autocorrect: 'off', + aria: { invalid: false, describedby: 'email-description' } }, + ) %> <%= f.input :request_id, as: :hidden, input_html: { value: request_id } %> <%= f.submit t('forms.buttons.continue'), class: 'display-block margin-y-5' %> <% end %> From 05493f9fe7f7f8bc34031703af0688959f946204 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 22 Dec 2022 16:17:08 -0600 Subject: [PATCH 2/3] fix specs --- spec/features/multiple_emails/reset_password_spec.rb | 6 +++--- spec/features/users/sign_in_spec.rb | 2 +- spec/features/visitors/password_recovery_spec.rb | 10 +++++----- spec/support/features/personal_key_helper.rb | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/features/multiple_emails/reset_password_spec.rb b/spec/features/multiple_emails/reset_password_spec.rb index 71b18b5b894..6f032d1d922 100644 --- a/spec/features/multiple_emails/reset_password_spec.rb +++ b/spec/features/multiple_emails/reset_password_spec.rb @@ -7,7 +7,7 @@ visit root_path click_link t('links.passwords.forgot') - fill_in 'Email', with: email1 + fill_in t('account.index.email'), with: email1 click_button t('forms.buttons.continue') expect_delivered_email_count(1) @@ -20,7 +20,7 @@ visit root_path click_link t('links.passwords.forgot') - fill_in 'Email', with: email2 + fill_in t('account.index.email'), with: email2 click_button t('forms.buttons.continue') expect_delivered_email_count(2) @@ -42,7 +42,7 @@ visit root_path click_link t('links.passwords.forgot') - fill_in 'Email', with: unconfirmed_email_address.email + fill_in t('account.index.email'), with: unconfirmed_email_address.email click_button t('forms.buttons.continue') expect_delivered_email_count(1) diff --git a/spec/features/users/sign_in_spec.rb b/spec/features/users/sign_in_spec.rb index 31614b5eda7..fc650729d3e 100644 --- a/spec/features/users/sign_in_spec.rb +++ b/spec/features/users/sign_in_spec.rb @@ -362,7 +362,7 @@ allow(Devise).to receive(:timeout_in).and_return(1) user = create(:user) visit root_path - fill_in 'Email', with: user.email + fill_in t('account.index.email'), with: user.email fill_in 'Password', with: user.password expect(page).to have_content( diff --git a/spec/features/visitors/password_recovery_spec.rb b/spec/features/visitors/password_recovery_spec.rb index 8d2ec6fe37f..26d6eb91e65 100644 --- a/spec/features/visitors/password_recovery_spec.rb +++ b/spec/features/visitors/password_recovery_spec.rb @@ -11,7 +11,7 @@ visit root_path click_link t('links.passwords.forgot') - fill_in 'Email', with: user.email + fill_in t('account.index.email'), with: user.email expect(PushNotification::HttpPush).to receive(:deliver). with(PushNotification::RecoveryActivatedEvent.new(user: user)) @@ -99,7 +99,7 @@ before do user = create(:user) visit new_user_password_path - fill_in 'Email', with: user.email + fill_in t('account.index.email'), with: user.email click_button t('forms.buttons.continue') visit edit_user_password_path(reset_password_token: 'invalid_token') end @@ -143,7 +143,7 @@ @user = create(:user, :signed_up) visit new_user_password_path - fill_in 'Email', with: @user.email + fill_in t('account.index.email'), with: @user.email click_button t('forms.buttons.continue') raw_reset_token, db_confirmation_token = @@ -226,7 +226,7 @@ user = create(:user, :signed_up) visit new_user_password_path - fill_in 'Email', with: user.email + fill_in t('account.index.email'), with: user.email click_button t('forms.buttons.continue') user.reset_password_sent_at = @@ -261,7 +261,7 @@ def submit_email_for_password_reset(email) visit new_user_password_path - fill_in 'Email', with: email + fill_in t('account.index.email'), with: email click_button t('forms.buttons.continue') end end diff --git a/spec/support/features/personal_key_helper.rb b/spec/support/features/personal_key_helper.rb index a773b451412..8135f275641 100644 --- a/spec/support/features/personal_key_helper.rb +++ b/spec/support/features/personal_key_helper.rb @@ -21,7 +21,7 @@ def personal_key_from_pii(user, pii) def trigger_reset_password_and_click_email_link(email) visit new_user_password_path - fill_in 'Email', with: email + fill_in t('account.index.email'), with: email click_button t('forms.buttons.continue') open_last_email click_email_link_matching(/reset_password_token/) From e7498fe4ca0a55bb86fc60fd3326b664c710e89e Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Fri, 23 Dec 2022 11:47:33 -0600 Subject: [PATCH 3/3] Update app/views/devise/passwords/new.html.erb Co-authored-by: Andrew Duthie --- app/views/devise/passwords/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index a4718dc20b6..0d4020656ad 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -20,7 +20,7 @@ label: t('account.index.email'), required: true, input_html: { autocorrect: 'off', - aria: { invalid: false, describedby: 'email-description' } }, + aria: { describedby: 'email-description' } }, ) %> <%= f.input :request_id, as: :hidden, input_html: { value: request_id } %> <%= f.submit t('forms.buttons.continue'), class: 'display-block margin-y-5' %>