diff --git a/app/presenters/idv/by_mail/request_letter_presenter.rb b/app/presenters/idv/by_mail/request_letter_presenter.rb index c95619606dd..08498229e7f 100644 --- a/app/presenters/idv/by_mail/request_letter_presenter.rb +++ b/app/presenters/idv/by_mail/request_letter_presenter.rb @@ -11,11 +11,15 @@ def initialize(current_user, url_options) end def title - resend_requested? ? I18n.t('idv.titles.mail.resend') : I18n.t('idv.titles.mail.verify') + resend_requested? ? + I18n.t('idv.gpo.request_another_letter.title') : + I18n.t('idv.titles.mail.verify') end def button - resend_requested? ? I18n.t('idv.buttons.mail.resend') : I18n.t('idv.buttons.mail.send') + resend_requested? ? + I18n.t('idv.gpo.request_another_letter.button') : + I18n.t('idv.buttons.mail.send') end def fallback_back_path @@ -43,6 +47,10 @@ def back_or_cancel_parameters end end + def show_troubleshooting_options? + !resend_requested? + end + private def user_needs_address_otp_verification? diff --git a/app/views/idv/by_mail/request_letter/index.html.erb b/app/views/idv/by_mail/request_letter/index.html.erb index 52107ed33ef..5d63de58182 100644 --- a/app/views/idv/by_mail/request_letter/index.html.erb +++ b/app/views/idv/by_mail/request_letter/index.html.erb @@ -10,15 +10,21 @@ <% end %> <% if @presenter.resend_requested? %> - <%= render StatusPageComponent.new(status: :warning) do |c| %> - <% c.with_header { @presenter.title } %> -

- <%= t('idv.messages.gpo.resend_timeframe_html') %> -

-

- <%= t('idv.messages.gpo.resend_code_warning') %> -

- <% end %> + <%= render PageHeadingComponent.new.with_content(@presenter.title) %> +

+ <%= t('idv.gpo.request_another_letter.instructions_html') %> +

+

+ <%= new_tab_link_to( + t('idv.gpo.request_another_letter.learn_more_link'), + help_center_redirect_url( + category: 'verify-your-identity', + article: 'verify-your-address-by-mail', + flow: :idv, + step: :gpo_send_letter, + ), + ) %> +

<% else %> <%= render AlertComponent.new(message: t('idv.messages.gpo.info_alert'), class: 'margin-bottom-4') %> <%= render PageHeadingComponent.new.with_content(@presenter.title) %> @@ -28,28 +34,30 @@

<% end %> -
+
<%= button_to @presenter.button, idv_request_letter_path, method: 'put', class: 'usa-button usa-button--big usa-button--wide' %>
-<%= render( - 'shared/troubleshooting_options', - heading: t('components.troubleshooting_options.default_heading'), - options: [ - { - url: help_center_redirect_url( - category: 'verify-your-identity', - article: 'verify-your-address-by-mail', - flow: :idv, - step: :gpo_send_letter, - ), - text: t('idv.troubleshooting.options.learn_more_verify_by_mail'), - new_tab: true, - }, - ], - ) %> +<% if @presenter.show_troubleshooting_options? %> + <%= render( + 'shared/troubleshooting_options', + heading: t('components.troubleshooting_options.default_heading'), + options: [ + { + url: help_center_redirect_url( + category: 'verify-your-identity', + article: 'verify-your-address-by-mail', + flow: :idv, + step: :gpo_send_letter, + ), + text: t('idv.troubleshooting.options.learn_more_verify_by_mail'), + new_tab: true, + }, + ], + ) %> +<% end %> <%= render @presenter.back_or_cancel_partial, @presenter.back_or_cancel_parameters %> diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 6b499dbb8f6..f8dc1e77926 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -10,7 +10,6 @@ en: change_state_id_label: Update state ID continue_plain: Continue mail: - resend: Send another letter send: Request a letter cancel: actions: @@ -195,6 +194,13 @@ en: code below.

If your letter hasn’t arrived yet, please be patient as letters take up to 10 days to arrive. Thank you for your patience.

' + request_another_letter: + button: Request another letter + instructions_html: Request a new letter if you have issues with your current + letter or it never arrived. Letters take 5 to 10 days + to arrive. + learn_more_link: Learn more about verifying your address by mail + title: Request another letter? return_to_profile: Return to your profile title: Welcome back wrong_address: Not the right address? @@ -227,10 +233,6 @@ en: verifying your identity. letter_on_the_way: We are sending you a letter resend: Send me another letter - resend_code_warning: If you request a new letter now, the one-time code from - your current letter will remain valid for a limited time. You may - still use the one-time code from either letter. - resend_timeframe_html: Letters take 5 to 10 days to arrive. timeframe_html: Letters are sent the next business day via USPS First-Class Mail and arrive in 5 to 10 days. gpo_reminder: @@ -279,7 +281,6 @@ en: activated: Your identity has already been verified come_back_later: Your letter is on the way mail: - resend: Send another letter? verify: Verify your address otp_delivery_method: How should we send a code? review: Review and submit diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 002c6de32a4..b1a6cbf0651 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -11,7 +11,6 @@ es: change_state_id_label: Actualizar la información de su cédula de identidad continue_plain: Continuar mail: - resend: Enviar otra carta send: Solicitar una carta cancel: actions: @@ -203,6 +202,14 @@ es: continuación.

Si su carta aún no ha llegado, tenga paciencia, ya que las cartas tardan hasta 10 días en llegar. Gracias por su paciencia.

' + request_another_letter: + button: Solicitar otra carta + instructions_html: Solicite una nueva carta si tiene problemas con la actual o + si nunca llegó. Las cartas tardan entre 5 y 10 días + en llegar. + learn_more_link: Obtenga más información sobre la verificación de su dirección + por correo + title: ¿Solicitar otra carta? return_to_profile: Regrese a su perfil title: Bienvenido de nuevo wrong_address: ¿La dirección no es correcta? @@ -236,11 +243,6 @@ es: verificar su identidad. letter_on_the_way: Te enviaremos una carta resend: Envíeme otra carta - resend_code_warning: Si solicitas una nueva carta ahora, el código de una sola - vez de tu carta actual seguirá siendo válido durante un tiempo - limitado. Puedes seguir utilizando el código de una sola vez de - cualquiera de las dos cartas. - resend_timeframe_html: Las cartas tardan entre 5 y 10 días en llegar. timeframe_html: Las cartas se envían al siguiente día hábil por USPS First-Class Mail y tardan entre 5 y 10 días en llegar. gpo_reminder: @@ -293,7 +295,6 @@ es: activated: Ya se verificó tu identidad. come_back_later: Su carta está en camino mail: - resend: '¿Enviar otra carta?' verify: Verifique su dirección otp_delivery_method: '¿Cómo debemos enviar un código?' review: Revise y envíe diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index a9dfd7f1ce2..df4505db784 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -11,7 +11,6 @@ fr: change_state_id_label: Mettre à jour les informations figurant sur votre document d’identité continue_plain: Continuer mail: - resend: Envoyer une autre lettre send: Demander une lettre cancel: actions: @@ -212,6 +211,14 @@ fr: arrivée, veuillez être patient car les lettres mettent jusqu’à 10 jours pour arriver. Nous vous remercions de votre patience.

' + request_another_letter: + button: Faire une nouvelle demande + instructions_html: Vous pouvez demander à faire une nouvelle demande si vous + avez des problèmes avec votre lettre actuelle ou si elle n’est pas + parvenue à destination. Les lettres mettent entre 5 et 10 + jours pour arriver. + learn_more_link: En savoir plus sur la vérification de votre adresse par courrier + title: Voulez-vous faire une nouvelle demande? return_to_profile: Retourner à votre profil title: Content de vous revoir wrong_address: Pas la bonne adresse? @@ -248,11 +255,6 @@ fr: vérification de votre identité. letter_on_the_way: Nous vous envoyons une lettre resend: Envoyez-moi une autre lettre - resend_code_warning: Si vous demandez une nouvelle lettre maintenant, le code à - usage unique de votre lettre actuelle restera valable pendant une - période limitée. Vous pouvez toujours utiliser le code à usage unique - de l’une ou l’autre lettre. - resend_timeframe_html: Les lettres mettent 5 à 10 jours pour arriver. timeframe_html: Les lettres sont envoyées le jour ouvrable suivant par le courrier de première classe d’USPS et arrivent dans un délai de 5 à 10 jours. @@ -308,7 +310,6 @@ fr: activated: Votre identité a déjà été vérifiée come_back_later: Votre lettre est en route mail: - resend: Envoyer une autre lettre? verify: Vérifiez votre adresse otp_delivery_method: Comment envoyer un code? review: Réviser et soumettre diff --git a/spec/features/idv/steps/gpo_step_spec.rb b/spec/features/idv/steps/gpo_step_spec.rb index d5a4a649d22..b2459aa7b70 100644 --- a/spec/features/idv/steps/gpo_step_spec.rb +++ b/spec/features/idv/steps/gpo_step_spec.rb @@ -63,10 +63,11 @@ # Confirm that we show the correct content on # the GPO page for users requesting re-send - expect(page).to have_content(t('idv.titles.mail.resend')) - expect(page).to have_content(strip_tags(t('idv.messages.gpo.resend_timeframe_html'))) - expect(page).to have_content(t('idv.messages.gpo.resend_code_warning')) - expect(page).to have_content(t('idv.buttons.mail.resend')) + expect(page).to have_content(t('idv.gpo.request_another_letter.title')) + expect(page).to have_content( + strip_tags(t('idv.gpo.request_another_letter.instructions_html')), + ) + expect(page).to have_content(t('idv.gpo.request_another_letter.button')) expect(page).to_not have_content(t('idv.messages.gpo.info_alert')) # Ensure user can go back from this page @@ -77,7 +78,7 @@ click_on t('idv.messages.gpo.resend') # And then actually ask for a resend - expect { click_on t('idv.buttons.mail.resend') }. + expect { click_on t('idv.gpo.request_another_letter.button') }. to change { GpoConfirmation.count }.from(1).to(2) expect_user_to_be_unverified(user) expect(page).to have_content(t('idv.messages.gpo.another_letter_on_the_way')) diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index acf814f1716..f3fde109c6b 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -40,7 +40,7 @@ def expected_gpo_return_to_sp_url end def update_mailing_address - click_on t('idv.buttons.mail.resend') + click_on t('idv.gpo.request_another_letter.button') fill_in t('idv.form.password'), with: user.password click_continue click_link t('idv.cancel.actions.exit', app_name: APP_NAME) @@ -136,7 +136,7 @@ def sign_out_user expect(user.events.account_verified.size).to be(0) expect(current_path).to eq(idv_request_letter_path) - click_button(t('idv.buttons.mail.resend')) + click_button(t('idv.gpo.request_another_letter.button')) expect(current_path).to eq(idv_letter_enqueued_path) end diff --git a/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb index 547e54e3db6..629b02c76d0 100644 --- a/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb +++ b/spec/presenters/idv/by_mail/request_letter_presenter_spec.rb @@ -26,7 +26,7 @@ create_letter_send_event expect(subject.title).to eq( - I18n.t('idv.titles.mail.resend'), + I18n.t('idv.gpo.request_another_letter.title'), ) end end @@ -59,7 +59,7 @@ it 'provides text to resend' do create_letter_send_event expect(subject.button).to eq( - I18n.t('idv.buttons.mail.resend'), + I18n.t('idv.gpo.request_another_letter.button'), ) end end diff --git a/spec/support/idv_examples/clearing_and_restarting.rb b/spec/support/idv_examples/clearing_and_restarting.rb index 92277910e01..a35a4084aa1 100644 --- a/spec/support/idv_examples/clearing_and_restarting.rb +++ b/spec/support/idv_examples/clearing_and_restarting.rb @@ -25,7 +25,7 @@ if page.has_button?(t('idv.buttons.mail.send')) click_on t('idv.buttons.mail.send') else - click_on t('idv.buttons.mail.resend') + click_on t('idv.gpo.request_another_letter.button') end fill_in 'Password', with: user.password click_idv_continue diff --git a/spec/support/idv_examples/gpo_otp_verification.rb b/spec/support/idv_examples/gpo_otp_verification.rb index f7a303f6380..62cfe696866 100644 --- a/spec/support/idv_examples/gpo_otp_verification.rb +++ b/spec/support/idv_examples/gpo_otp_verification.rb @@ -55,7 +55,7 @@ expect_step_indicator_current_step(t('step_indicator.flows.idv.get_a_letter')) - click_on t('idv.buttons.mail.resend') + click_on t('idv.gpo.request_another_letter.button') expect(GpoConfirmation.count).to eq(1) expect(GpoConfirmationCode.count).to eq(1) diff --git a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb index 68cb59df75f..04f4520d0c4 100644 --- a/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb +++ b/spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb @@ -42,9 +42,30 @@ context 'letter already sent' do let(:resend_requested) { true } - it 'prompts to send another letter' do - expect(rendered).to have_content(I18n.t('idv.titles.mail.resend')) - expect(rendered).to have_button(I18n.t('idv.buttons.mail.resend')) + it 'has the right title' do + expect(rendered).to have_css('h1', text: t('idv.gpo.request_another_letter.title')) + end + + it 'has the right body' do + expect(rendered).to have_text( + strip_tags(t('idv.gpo.request_another_letter.instructions_html')), + ) + end + + it 'includes link to help' do + expect(rendered).to have_link( + t('idv.gpo.request_another_letter.learn_more_link'), + href: help_center_redirect_url( + category: 'verify-your-identity', + article: 'verify-your-address-by-mail', + flow: :idv, + step: :gpo_send_letter, + ), + ) + end + + it 'does not include troubleshooting options' do + expect(rendered).not_to have_css('.troubleshooting-options') end end