From 28d0d8edd1958ed8fe75d31556d753ac9a77b891 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 5 Jun 2023 14:00:32 -0400 Subject: [PATCH 01/21] First pass at screen updates --- app/views/idv/phone_errors/failure.html.erb | 17 ++++++++++++++--- config/locales/idv/en.yml | 10 +++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 43e8895946a..e22b11e806e 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -26,10 +26,21 @@ ), ) %>

+ <%= t('idv.failure.phone.rate_limited.options_header') %> + + <% if @gpo_letter_available %> -

- <%= t('idv.failure.phone.rate_limited.gpo.prompt') %> -

<%= render ButtonComponent.new( action: ->(**tag_options, &block) { link_to idv_gpo_path, **tag_options, &block }, diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index d3d9185aabf..0d402a79de3 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -97,13 +97,17 @@ en: Please try again. rate_limited: body: For security reasons, we limit the number of times you can attempt to - verify your phone number online. You will need to wait %{time_left} - and start over before trying to verify by phone again. + verify your phone number online. + # You will need to wait %{time_left} + # and start over before trying to verify by phone again. gpo: button: Verify by mail prompt: Continue now by verifying by mail, which typically takes 3 - 7 business days. heading: 'We couldn’t verify your identity by phone' + options_header: 'You can:' + option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' + option_cancel: Cancel and start over again after %{time_left} timeout: Our request to verify your information timed out. Please try again. warning: attempts: @@ -276,7 +280,7 @@ en: state_id: cancel_button: Exit %{app_name} explanation: | - Unfortunately, we’re experiencing technical difficulties + Unfortunately, we’re experiencing technical difficulties with IDs from your state and are currently unable to verify your information. heading: We are working to resolve an error next_steps: From c71bd1364643f22646aded236d0ef0c364fe418a Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 5 Jun 2023 14:41:24 -0400 Subject: [PATCH 02/21] Lint --- app/views/idv/phone_errors/failure.html.erb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index e22b11e806e..2cbdd80b8e9 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -31,12 +31,15 @@ <% if @gpo_letter_available %>
  • <%= t('idv.failure.phone.rate_limited.option_verify_by_mail_html') %>
  • <% end %> -
  • <%= - t('idv.failure.phone.rate_limited.option_cancel', - time_left: distance_of_time_in_words(Time.zone.now, - [@expires_at, Time.zone.now].compact.max, - except: :seconds)) - %> +
  • + <%= t( + 'idv.failure.phone.rate_limited.option_cancel', + time_left: distance_of_time_in_words( + Time.zone.now, + [@expires_at, Time.zone.now].compact.max, + except: :seconds, + ), + ) %>
  • From a20a470962f4e8c787f70e0ef3bab487b860b8ef Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 6 Jun 2023 12:36:16 -0400 Subject: [PATCH 03/21] French and Spanish translations --- config/locales/idv/en.yml | 6 ++---- config/locales/idv/es.yml | 13 +++++++------ config/locales/idv/fr.yml | 8 +++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 0d402a79de3..2c41e425f9e 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -98,16 +98,14 @@ en: rate_limited: body: For security reasons, we limit the number of times you can attempt to verify your phone number online. - # You will need to wait %{time_left} - # and start over before trying to verify by phone again. gpo: button: Verify by mail prompt: Continue now by verifying by mail, which typically takes 3 - 7 business days. heading: 'We couldn’t verify your identity by phone' - options_header: 'You can:' - option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' option_cancel: Cancel and start over again after %{time_left} + option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' + options_header: 'You can:' timeout: Our request to verify your information timed out. Please try again. warning: attempts: diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 430b351365d..760d29fa6ec 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -103,14 +103,15 @@ es: Vuelve a intentarlo. rate_limited: body: Por motivos de seguridad, se limita el número de veces que puede intentar - verificar su número de teléfono por Internet. Tendrás que esperar - %{time_left} y volver a empezar antes de volver a intentar la - verificación por teléfono. + verificar su número de teléfono por Internet. gpo: button: Verificar por correo - prompt: Continúa ahora con la verificación por correo, que suele tardar entre 3 - y 7 días laborables. - heading: 'No hemos podido verificar su identidad por teléfono' + prompt: Continúa ahora con la verificación por correo, que suele tardar entre + 3 y 7 días laborables. + heading: No pudimos asociarlo a este número + option_cancel: Cancelar y empezar de nuevo transcurridas %{time_left} + option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' + options_header: 'Puede:' timeout: Nuestra solicitud para verificar tu información ha caducado. Vuelve a intentarlo. warning: diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index a25b86cfbe0..a43b26ba45b 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -109,14 +109,16 @@ fr: pour le moment. Veuillez réessayer. rate_limited: body: Pour des raisons de sécurité, nous limitons le nombre de tentatives de - vérification de votre numéro de téléphone en ligne. Vous devrez - attendre %{time_left} et recommencer avant d’essayer à nouveau de - vérifier votre identité par téléphone. + vérification de votre numéro de téléphone en ligne. gpo: button: Vérifier par courrier prompt: Continuez maintenant en vérifiant par courrier, ce qui prend généralement de 3 à 7 jours ouvrables. heading: Nous n’avons pas pu vérifier votre identité par téléphone + option_cancel: Annuler et recommencer après %{time_left} + option_verify_by_mail_html: Vérifier par courrier, ce qui prend généralement de + trois à sept jours ouvrables. + options_header: 'Vous Pouvez :' timeout: Notre demande de vérification de vos renseignements a expiré. Veuillez réessayer. warning: From 7ba7df89ef6236408f9241b33e2ae2cad9417fbb Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 6 Jun 2023 13:52:19 -0400 Subject: [PATCH 04/21] Fixed specs and removed unused strings --- config/locales/idv/en.yml | 2 -- config/locales/idv/es.yml | 4 +--- config/locales/idv/fr.yml | 2 -- spec/views/idv/phone_errors/failure.html.erb_spec.rb | 4 +++- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 2c41e425f9e..cb90162e476 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -100,8 +100,6 @@ en: verify your phone number online. gpo: button: Verify by mail - prompt: Continue now by verifying by mail, which typically takes 3 - 7 business - days. heading: 'We couldn’t verify your identity by phone' option_cancel: Cancel and start over again after %{time_left} option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 760d29fa6ec..1c7ebdf121a 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -106,11 +106,9 @@ es: verificar su número de teléfono por Internet. gpo: button: Verificar por correo - prompt: Continúa ahora con la verificación por correo, que suele tardar entre - 3 y 7 días laborables. heading: No pudimos asociarlo a este número option_cancel: Cancelar y empezar de nuevo transcurridas %{time_left} - option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' + option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' options_header: 'Puede:' timeout: Nuestra solicitud para verificar tu información ha caducado. Vuelve a intentarlo. diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index a43b26ba45b..6aca4a69cd7 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -112,8 +112,6 @@ fr: vérification de votre numéro de téléphone en ligne. gpo: button: Vérifier par courrier - prompt: Continuez maintenant en vérifiant par courrier, ce qui prend - généralement de 3 à 7 jours ouvrables. heading: Nous n’avons pas pu vérifier votre identité par téléphone option_cancel: Annuler et recommencer après %{time_left} option_verify_by_mail_html: Vérifier par courrier, ce qui prend généralement de diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index 4fc735ba668..a29c800d95f 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -43,7 +43,9 @@ end it 'describes GPO as an alternative' do - expect(rendered).to have_text(t('idv.failure.phone.rate_limited.gpo.prompt')) + raw_expected_text = t('idv.failure.phone.rate_limited.option_verify_by_mail_html') + expected_text = ActionView::Base.full_sanitizer.sanitize(raw_expected_text) + expect(rendered).to have_text(expected_text) end it 'includes a link to GPO flow' do From 1f0be94c7da04262af2df86204c30c5e54d25eff Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 6 Jun 2023 14:17:03 -0400 Subject: [PATCH 05/21] Strings nit --- config/locales/idv/es.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 1c7ebdf121a..05d025babe9 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -108,7 +108,8 @@ es: button: Verificar por correo heading: No pudimos asociarlo a este número option_cancel: Cancelar y empezar de nuevo transcurridas %{time_left} - option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' + option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 + a 7 días hábiles' options_header: 'Puede:' timeout: Nuestra solicitud para verificar tu información ha caducado. Vuelve a intentarlo. From 01a2b6d490b56ea1342ae09b444dd354ebb79017 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 6 Jun 2023 14:50:36 -0400 Subject: [PATCH 06/21] Fixed spec --- spec/features/idv/steps/phone_step_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/features/idv/steps/phone_step_spec.rb b/spec/features/idv/steps/phone_step_spec.rb index 4ed28ba7da1..15183c001e9 100644 --- a/spec/features/idv/steps/phone_step_spec.rb +++ b/spec/features/idv/steps/phone_step_spec.rb @@ -246,7 +246,8 @@ let(:gpo_enabled) { false } it 'does not link out to GPO flow' do - expect(page).not_to have_content(t('idv.failure.phone.rate_limited.gpo.prompt')) + prompt_text = t('idv.failure.phone.rate_limited.option_verify_by_mail_html') + expect(page).not_to have_content(prompt_text) expect(page).not_to have_content(t('idv.failure.phone.rate_limited.gpo.button')) end end From d53610a32b5cd9dc7c5bb735a0e30f664dd15441 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Wed, 7 Jun 2023 11:01:15 -0400 Subject: [PATCH 07/21] More spec fixes changelog: User-Facing Improvements,text updates,Improved UX on phone rate-limiting --- spec/views/idv/phone_errors/failure.html.erb_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index a29c800d95f..b380168fa0c 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -59,7 +59,10 @@ let(:gpo_letter_available) { false } it 'does not describe GPO as an alternative' do - expect(rendered).not_to have_text(t('idv.failure.phone.rate_limited.gpo.prompt')) + raw_gpo_alternative = t('idv.failure.phone.rate_limited.option_verify_by_mail_html') + gpo_alternative = ActionView::Base.full_sanitizer.sanitize(raw_gpo_alternative) + + expect(rendered).not_to have_text(gpo_alternative) end it 'does not include a link to GPO flow' do From 3a9eedb08a5a7af22f281f71758e71586e4110bb Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Thu, 8 Jun 2023 10:31:10 -0400 Subject: [PATCH 08/21] Cancel link --- app/views/idv/phone_errors/failure.html.erb | 10 +++++----- config/locales/idv/en.yml | 1 + config/locales/idv/es.yml | 1 + config/locales/idv/fr.yml | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 2cbdd80b8e9..98e80f6a723 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -4,16 +4,16 @@ heading: t('idv.failure.phone.rate_limited.heading'), current_step: :verify_phone_or_address, options: [ - decorated_session.sp_name && { - url: return_to_sp_failure_to_proof_path(step: 'phone', location: request.params[:action]), - text: t('idv.troubleshooting.options.get_help_at_sp', sp_name: decorated_session.sp_name), - new_tab: true, - }, { url: MarketingSite.contact_url, text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), new_tab: true, }, + decorated_session.sp_name && { + url: return_to_sp_failure_to_proof_path(step: 'phone', location: request.params[:action]), + text: t('idv.failure.phone.rate_limited.option_cancel_and_return_to_sp'), + new_tab: true, + }, ].select(&:present?), ) do %>

    diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index cb90162e476..6c8ba559399 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -102,6 +102,7 @@ en: button: Verify by mail heading: 'We couldn’t verify your identity by phone' option_cancel: Cancel and start over again after %{time_left} + option_cancel_and_return_to_sp: Cancel option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' options_header: 'You can:' timeout: Our request to verify your information timed out. Please try again. diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 05d025babe9..820fb2594b8 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -108,6 +108,7 @@ es: button: Verificar por correo heading: No pudimos asociarlo a este número option_cancel: Cancelar y empezar de nuevo transcurridas %{time_left} + option_cancel_and_return_to_sp: Cancelar option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' options_header: 'Puede:' diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index 6aca4a69cd7..238a3a9bec9 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -114,6 +114,7 @@ fr: button: Vérifier par courrier heading: Nous n’avons pas pu vérifier votre identité par téléphone option_cancel: Annuler et recommencer après %{time_left} + option_cancel_and_return_to_sp: Annuler option_verify_by_mail_html: Vérifier par courrier, ce qui prend généralement de trois à sept jours ouvrables. options_header: 'Vous Pouvez :' From 61c79086452aec072a6e562a7c1870271abacf86 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Thu, 8 Jun 2023 15:12:22 -0400 Subject: [PATCH 09/21] Fixed Cancel link spec --- spec/views/idv/phone_errors/failure.html.erb_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index b380168fa0c..37c9df21b10 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -22,7 +22,7 @@ it 'renders a list of troubleshooting options' do expect(rendered).to have_link( - t('idv.troubleshooting.options.get_help_at_sp', sp_name: sp_name), + t('idv.failure.phone.rate_limited.option_cancel_and_return_to_sp'), href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), ) expect(rendered).to have_link( From 5396be3dcca6ff854ef357962957e7e8c62dd881 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 9 Jun 2023 10:40:20 -0400 Subject: [PATCH 10/21] Made cancel link not open a new tab --- app/views/idv/phone_errors/failure.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 98e80f6a723..9b7342c10b6 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -12,7 +12,7 @@ decorated_session.sp_name && { url: return_to_sp_failure_to_proof_path(step: 'phone', location: request.params[:action]), text: t('idv.failure.phone.rate_limited.option_cancel_and_return_to_sp'), - new_tab: true, + new_tab: false, }, ].select(&:present?), ) do %> From 20bd35d8be3ed93463e2e1d830939dbe145f6550 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 27 Jun 2023 11:33:37 -0400 Subject: [PATCH 11/21] Checkin to change branches --- app/views/idv/phone_errors/failure.html.erb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 9b7342c10b6..bc3e817bec6 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -31,16 +31,6 @@ <% if @gpo_letter_available %>

  • <%= t('idv.failure.phone.rate_limited.option_verify_by_mail_html') %>
  • <% end %> -
  • - <%= t( - 'idv.failure.phone.rate_limited.option_cancel', - time_left: distance_of_time_in_words( - Time.zone.now, - [@expires_at, Time.zone.now].compact.max, - except: :seconds, - ), - ) %> -
  • <% if @gpo_letter_available %> @@ -53,3 +43,6 @@
    <% end %> <% end %> + <%= link_to(t('idv.failure.phone.rate_limited.option_cancel'), + return_to_sp_cancel_url) %> + From 71cbfa99f08b7f539ccfb8f55ff7382aa35b765b Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 27 Jun 2023 12:14:49 -0400 Subject: [PATCH 12/21] Moved cancel link --- app/views/idv/phone_errors/failure.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index bc3e817bec6..e22be40a886 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -43,6 +43,5 @@ <% end %> <% end %> - <%= link_to(t('idv.failure.phone.rate_limited.option_cancel'), - return_to_sp_cancel_url) %> + <%= link_to(t('links.cancel'), return_to_sp_cancel_url) %> From bb3165e7b4158312b636c308388048c2a2cc39b2 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 27 Jun 2023 13:18:46 -0400 Subject: [PATCH 13/21] Removed unused string. --- config/locales/idv/en.yml | 1 - config/locales/idv/es.yml | 1 - config/locales/idv/fr.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index 6c8ba559399..f6638f96e70 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -101,7 +101,6 @@ en: gpo: button: Verify by mail heading: 'We couldn’t verify your identity by phone' - option_cancel: Cancel and start over again after %{time_left} option_cancel_and_return_to_sp: Cancel option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' options_header: 'You can:' diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 820fb2594b8..6dffb45ab52 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -107,7 +107,6 @@ es: gpo: button: Verificar por correo heading: No pudimos asociarlo a este número - option_cancel: Cancelar y empezar de nuevo transcurridas %{time_left} option_cancel_and_return_to_sp: Cancelar option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index 238a3a9bec9..d85894ab0eb 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -113,7 +113,6 @@ fr: gpo: button: Vérifier par courrier heading: Nous n’avons pas pu vérifier votre identité par téléphone - option_cancel: Annuler et recommencer après %{time_left} option_cancel_and_return_to_sp: Annuler option_verify_by_mail_html: Vérifier par courrier, ce qui prend généralement de trois à sept jours ouvrables. From 5a3f7b6882764bc465569c10a25371244b4d2909 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Thu, 13 Jul 2023 12:50:24 -0400 Subject: [PATCH 14/21] Review comments --- app/views/idv/phone_errors/failure.html.erb | 25 +++++++++------------ config/locales/idv/en.yml | 2 +- config/locales/idv/es.yml | 2 +- config/locales/idv/fr.yml | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index e22be40a886..9cc6afdc165 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -9,28 +9,23 @@ text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), new_tab: true, }, - decorated_session.sp_name && { - url: return_to_sp_failure_to_proof_path(step: 'phone', location: request.params[:action]), - text: t('idv.failure.phone.rate_limited.option_cancel_and_return_to_sp'), - new_tab: false, - }, ].select(&:present?), ) do %>

    - <%= t( - 'idv.failure.phone.rate_limited.body', - time_left: distance_of_time_in_words( - Time.zone.now, - [@expires_at, Time.zone.now].compact.max, - except: :seconds, - ), - ) %> + <%= t('idv.failure.phone.rate_limited.body') %>

    <%= t('idv.failure.phone.rate_limited.options_header') %>
      <% if @gpo_letter_available %>
    • <%= t('idv.failure.phone.rate_limited.option_verify_by_mail_html') %>
    • <% end %> +
    • + <%= t('idv.failure.phone.rate_limited.option_try_again_later', + time_left: distance_of_time_in_words(Time.zone.now, + [@expires_at, Time.zone.now].compact.max, + except: :seconds) + ) %> +
    <% if @gpo_letter_available %> @@ -43,5 +38,7 @@ <% end %> <% end %> - <%= link_to(t('links.cancel'), return_to_sp_cancel_url) %> + <%= render PageFooterComponent.new do %> + <%= link_to(t('links.cancel'), return_to_sp_cancel_url) %> + <% end %> diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index f6638f96e70..e4e6fd87ec4 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -101,7 +101,7 @@ en: gpo: button: Verify by mail heading: 'We couldn’t verify your identity by phone' - option_cancel_and_return_to_sp: Cancel + option_try_again_later: Cancel and start over again after %{time_left} option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' options_header: 'You can:' timeout: Our request to verify your information timed out. Please try again. diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 6dffb45ab52..9975dad7072 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -107,7 +107,7 @@ es: gpo: button: Verificar por correo heading: No pudimos asociarlo a este número - option_cancel_and_return_to_sp: Cancelar + option_try_again_later: Cancelar y empezar de nuevo transcurridas %{time_left} option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' options_header: 'Puede:' diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index d85894ab0eb..925f797810f 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -113,7 +113,7 @@ fr: gpo: button: Vérifier par courrier heading: Nous n’avons pas pu vérifier votre identité par téléphone - option_cancel_and_return_to_sp: Annuler + option_try_again_later: Annuler et recommencer après %{time_left} option_verify_by_mail_html: Vérifier par courrier, ce qui prend généralement de trois à sept jours ouvrables. options_header: 'Vous Pouvez :' From d25f0ed8f5449a49e2da14a850af6d9d8ec6db51 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Thu, 13 Jul 2023 13:49:58 -0400 Subject: [PATCH 15/21] Spec fix --- app/views/idv/phone_errors/failure.html.erb | 7 ++++++- .../idv/phone_errors/failure.html.erb_spec.rb | 20 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 9cc6afdc165..f88dae7a2aa 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -39,6 +39,11 @@ <% end %> <% end %> <%= render PageFooterComponent.new do %> - <%= link_to(t('links.cancel'), return_to_sp_cancel_url) %> + <%= + link_to( + t('links.cancel'), + return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), + ) + %> <% end %> diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index 37c9df21b10..45548f54ab0 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -21,16 +21,28 @@ end it 'renders a list of troubleshooting options' do - expect(rendered).to have_link( - t('idv.failure.phone.rate_limited.option_cancel_and_return_to_sp'), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), - ) expect(rendered).to have_link( t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), href: MarketingSite.contact_url, ) end + it 'tells them they can try again later' do + expect(rendered).to have_text( + t( + 'idv.failure.phone.rate_limited.option_try_again_later', + time_left: distance_of_time_in_words(Time.zone.now, @expires_at, except: :seconds), + ), + ) + end + + it 'renders a cancel link' do + expect(rendered).to have_link( + t('links.cancel'), + href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), + ) + end + it 'includes a message instructing when they can try again' do expect(rendered).to have_text( strip_tags( From e237467169a51c0f72688d28d4161639755bebc6 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Jul 2023 11:30:05 -0400 Subject: [PATCH 16/21] lint --- app/views/idv/phone_errors/failure.html.erb | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index f88dae7a2aa..2d2bc304d50 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -20,10 +20,13 @@
  • <%= t('idv.failure.phone.rate_limited.option_verify_by_mail_html') %>
  • <% end %>
  • - <%= t('idv.failure.phone.rate_limited.option_try_again_later', - time_left: distance_of_time_in_words(Time.zone.now, - [@expires_at, Time.zone.now].compact.max, - except: :seconds) + <%= t( + 'idv.failure.phone.rate_limited.option_try_again_later', + time_left: distance_of_time_in_words( + Time.zone.now, + [@expires_at, Time.zone.now].compact.max, + except: :seconds, + ), ) %>
  • @@ -39,11 +42,9 @@ <% end %> <% end %> <%= render PageFooterComponent.new do %> - <%= - link_to( - t('links.cancel'), - return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), - ) - %> + <%= link_to( + t('links.cancel'), + return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), + ) %> <% end %> From dc4bbfba4bdef8e464ef23a7337da7de34894875 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Jul 2023 11:46:54 -0400 Subject: [PATCH 17/21] Bolded remaining time before user can try again. --- app/views/idv/phone_errors/failure.html.erb | 2 +- config/locales/idv/en.yml | 2 +- config/locales/idv/es.yml | 2 +- config/locales/idv/fr.yml | 2 +- spec/views/idv/phone_errors/failure.html.erb_spec.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 2d2bc304d50..70a80997d7c 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -21,7 +21,7 @@ <% end %>
  • <%= t( - 'idv.failure.phone.rate_limited.option_try_again_later', + 'idv.failure.phone.rate_limited.option_try_again_later_html', time_left: distance_of_time_in_words( Time.zone.now, [@expires_at, Time.zone.now].compact.max, diff --git a/config/locales/idv/en.yml b/config/locales/idv/en.yml index e4e6fd87ec4..b2dda934e7d 100644 --- a/config/locales/idv/en.yml +++ b/config/locales/idv/en.yml @@ -101,7 +101,7 @@ en: gpo: button: Verify by mail heading: 'We couldn’t verify your identity by phone' - option_try_again_later: Cancel and start over again after %{time_left} + option_try_again_later_html: 'Cancel and start over again after %{time_left}' option_verify_by_mail_html: 'Verify by mail, which typically takes 3-7 business days' options_header: 'You can:' timeout: Our request to verify your information timed out. Please try again. diff --git a/config/locales/idv/es.yml b/config/locales/idv/es.yml index 9975dad7072..17b75fdc0a7 100644 --- a/config/locales/idv/es.yml +++ b/config/locales/idv/es.yml @@ -107,7 +107,7 @@ es: gpo: button: Verificar por correo heading: No pudimos asociarlo a este número - option_try_again_later: Cancelar y empezar de nuevo transcurridas %{time_left} + option_try_again_later_html: 'Cancelar y empezar de nuevo transcurridas %{time_left}' option_verify_by_mail_html: 'Verificar por correo, lo que suele demorar de 3 a 7 días hábiles' options_header: 'Puede:' diff --git a/config/locales/idv/fr.yml b/config/locales/idv/fr.yml index 925f797810f..6efea3e336b 100644 --- a/config/locales/idv/fr.yml +++ b/config/locales/idv/fr.yml @@ -113,7 +113,7 @@ fr: gpo: button: Vérifier par courrier heading: Nous n’avons pas pu vérifier votre identité par téléphone - option_try_again_later: Annuler et recommencer après %{time_left} + option_try_again_later_html: 'Annuler et recommencer après %{time_left}' option_verify_by_mail_html: Vérifier par courrier, ce qui prend généralement de trois à sept jours ouvrables. options_header: 'Vous Pouvez :' diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index 45548f54ab0..615d7d9fcea 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -30,7 +30,7 @@ it 'tells them they can try again later' do expect(rendered).to have_text( t( - 'idv.failure.phone.rate_limited.option_try_again_later', + 'idv.failure.phone.rate_limited.option_try_again_later_html', time_left: distance_of_time_in_words(Time.zone.now, @expires_at, except: :seconds), ), ) From cef9aff79973b578cd29335a5972519e68d719f4 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 14 Jul 2023 12:27:42 -0400 Subject: [PATCH 18/21] Spec fix --- spec/views/idv/phone_errors/failure.html.erb_spec.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index 615d7d9fcea..1bb20bed2a4 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -28,12 +28,13 @@ end it 'tells them they can try again later' do - expect(rendered).to have_text( - t( - 'idv.failure.phone.rate_limited.option_try_again_later_html', - time_left: distance_of_time_in_words(Time.zone.now, @expires_at, except: :seconds), - ), + raw_expected_text = t( + 'idv.failure.phone.rate_limited.option_try_again_later_html', + time_left: distance_of_time_in_words(Time.zone.now, @expires_at, except: :seconds), ) + expected_text = ActionView::Base.full_sanitizer.sanitize(raw_expected_text) + + expect(rendered).to have_text(expected_text) end it 'renders a cancel link' do From 92e4e182ce7a2f120070997d043cfc64a43a30c5 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 28 Jul 2023 12:35:37 -0400 Subject: [PATCH 19/21] Changed cancel link to be the usual one, instead of returning to sp. --- app/views/idv/phone_errors/failure.html.erb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 70a80997d7c..594d7837e8f 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -42,9 +42,6 @@ <% end %> <% end %> <%= render PageFooterComponent.new do %> - <%= link_to( - t('links.cancel'), - return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), - ) %> + <%= link_to(t('links.cancel'), idv_cancel_path) %> <% end %> From bf7fd9be06b702a6cc62580ffb7b675a370c8f83 Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Fri, 28 Jul 2023 12:52:29 -0400 Subject: [PATCH 20/21] Spec fix. --- spec/views/idv/phone_errors/failure.html.erb_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index 1bb20bed2a4..c1beaa6a718 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -40,7 +40,7 @@ it 'renders a cancel link' do expect(rendered).to have_link( t('links.cancel'), - href: return_to_sp_failure_to_proof_path(step: 'phone', location: 'failure'), + href: idv_cancel_path, ) end From 665a547f445cc23c4fa9bf27a805f12746d6984a Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Tue, 1 Aug 2023 11:40:42 -0400 Subject: [PATCH 21/21] Review comment. Added a feature spec to make sure that canceling IdV from the throttled phone page takes you to the correct page. --- spec/features/idv/steps/phone_step_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/features/idv/steps/phone_step_spec.rb b/spec/features/idv/steps/phone_step_spec.rb index 15183c001e9..442ace21ef3 100644 --- a/spec/features/idv/steps/phone_step_spec.rb +++ b/spec/features/idv/steps/phone_step_spec.rb @@ -235,6 +235,11 @@ click_idv_continue_for_step(:phone) end + it 'takes them to the IdV cancel screen if they hit cancel', js: true do + click_on 'Cancel' + expect(current_path).to eq(idv_cancel_path) + end + it 'still lets them access the GPO flow and return to the error' do click_on t('idv.failure.phone.rate_limited.gpo.button') expect(page).to have_content(t('idv.titles.mail.verify'))