Skip to content

Commit

Permalink
LG-11007: Update "Request another letter" screen (#9275)
Browse files Browse the repository at this point in the history
* First crack at cleanup of "Request another letter?" screen

No translations yet

* Update RequestLetterPresenter spec

* Update gpo_step_spec.rb

* Update i18n references in specs

* Update translations

* Add back translations that are still used

* changelog: User-Facing Improvements, Identity verification, Simplify and clarify 'request another letter' screen

* Update vertical margin around button

* Update config/locales/idv/fr.yml

Co-authored-by: Sonia Connolly <[email protected]>

* Update config/locales/idv/en.yml

Co-authored-by: Sonia Connolly <[email protected]>

* Update config/locales/idv/es.yml

Co-authored-by: Sonia Connolly <[email protected]>

* Normalize YAML

---------

Co-authored-by: Sonia Connolly <[email protected]>
  • Loading branch information
matthinz and soniaconnolly authored Oct 2, 2023
1 parent d83dcae commit 3302e56
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 62 deletions.
12 changes: 10 additions & 2 deletions app/presenters/idv/by_mail/request_letter_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
60 changes: 34 additions & 26 deletions app/views/idv/by_mail/request_letter/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@
<% end %>

<% if @presenter.resend_requested? %>
<%= render StatusPageComponent.new(status: :warning) do |c| %>
<% c.with_header { @presenter.title } %>
<p>
<%= t('idv.messages.gpo.resend_timeframe_html') %>
</p>
<p>
<%= t('idv.messages.gpo.resend_code_warning') %>
</p>
<% end %>
<%= render PageHeadingComponent.new.with_content(@presenter.title) %>
<p>
<%= t('idv.gpo.request_another_letter.instructions_html') %>
</p>
<p>
<%= 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,
),
) %>
</p>
<% else %>
<%= render AlertComponent.new(message: t('idv.messages.gpo.info_alert'), class: 'margin-bottom-4') %>
<%= render PageHeadingComponent.new.with_content(@presenter.title) %>
Expand All @@ -28,28 +34,30 @@
</p>
<% end %>

<div class="margin-top-6 margin-bottom-5">
<div class="margin-y-5">
<%= button_to @presenter.button,
idv_request_letter_path,
method: 'put',
class: 'usa-button usa-button--big usa-button--wide' %>
</div>

<%= 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 %>
13 changes: 7 additions & 6 deletions config/locales/idv/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -195,6 +194,13 @@ en:
code below. </p><p>If your letter hasn’t arrived yet, please be patient
as letters take up to <strong>10 days</strong> to arrive. Thank you for
your patience.</p>'
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 <strong>5 to 10 days</strong>
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?
Expand Down Expand Up @@ -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 <strong>5 to 10 days</strong> to arrive.
timeframe_html: Letters are sent the next business day via USPS First-Class Mail
and arrive in <strong>5 to 10 days</strong>.
gpo_reminder:
Expand Down Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions config/locales/idv/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -203,6 +202,14 @@ es:
continuación.</p> <p>Si su carta aún no ha llegado, tenga paciencia, ya
que las cartas tardan hasta <strong>10 días</strong> en llegar. Gracias
por su paciencia.</p>'
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 <strong>5 y 10 días</strong>
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?
Expand Down Expand Up @@ -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 <strong>5 y 10 días</strong> en llegar.
timeframe_html: Las cartas se envían al siguiente día hábil por USPS First-Class
Mail y tardan entre <strong>5 y 10 días</strong> en llegar.
gpo_reminder:
Expand Down Expand Up @@ -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
Expand Down
15 changes: 8 additions & 7 deletions config/locales/idv/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -212,6 +211,14 @@ fr:
arrivée, veuillez être patient car les lettres mettent jusqu’à
<strong>10 jours</strong> pour arriver. Nous vous remercions de votre
patience.</p>'
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 <strong>5 et 10
jours</strong> 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?
Expand Down Expand Up @@ -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 <strong>5 à 10 jours</strong> 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
<strong>5 à 10 jours</strong>.
Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions spec/features/idv/steps/gpo_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'))
Expand Down
4 changes: 2 additions & 2 deletions spec/features/saml/ial2_sso_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/presenters/idv/by_mail/request_letter_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/idv_examples/clearing_and_restarting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/idv_examples/gpo_otp_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
27 changes: 24 additions & 3 deletions spec/views/idv/by_mail/request_letter/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3302e56

Please sign in to comment.