Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/images/carat-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/variables/_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $line-height: 1.5 !default;
$bold-font-weight: bold !default;
$heading-font-family: $serif-font-family !default;
$heading-font-weight: bold !default;
$heading-line-height: 1.3 !default;
$heading-line-height: 1.5 !default;
$caps-letter-spacing: 1px !default;

$line-height-0: .75 !default; // For when a tighter-than-normal leading is desired.
Expand Down
4 changes: 4 additions & 0 deletions app/decorators/service_provider_session_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ def cancel_link_url
view_context.sign_up_start_url(request_id: sp_session[:request_id])
end

def failure_to_proof_url
sp.failure_to_proof_url || sp_return_url
end

def sp_alert?(path)
sp_alert.present? && !sp_alert[:exclude_paths]&.include?(path)
end
Expand Down
2 changes: 2 additions & 0 deletions app/decorators/session_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def cancel_link_url
view_context.root_url
end

def failure_to_proof_url; end

def sp_name; end

def sp_agency; end
Expand Down
19 changes: 1 addition & 18 deletions app/presenters/idv/idv_failure_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,7 @@ def message
end

def next_steps
[help_step, sp_step, profile_step].compact
end

private

def help_step
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we missed these. I just amended the commit to catch them. I'm watching CI and will approve once that goes green.

link_to t('idv.messages.help_center_html'), MarketingSite.help_url
end

def sp_step
return unless (sp_name = decorated_session.sp_name)
link = link_to(sp_name, decorated_session.sp_return_url)
t('idv.messages.jurisdiction.sp_support', link: link)
end

def profile_step
link = link_to(t('idv.messages.jurisdiction.profile_link'), account_path)
t('idv.messages.jurisdiction.profile', link: link)
[]
end
end
end
18 changes: 1 addition & 17 deletions app/presenters/idv/jurisdiction_failure_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,13 @@ def message
end

def next_steps
[try_again_step, sp_step, profile_step].compact
[]
end

private

def i18n_args
jurisdiction ? { state: state_name_for_abbrev(jurisdiction) } : {}
end

def try_again_step
link = link_to(t('idv.messages.jurisdiction.try_again_link'), idv_jurisdiction_path)
t('idv.messages.jurisdiction.try_again', link: link)
end

def sp_step
return unless (sp_name = decorated_session.sp_name)
link = link_to(sp_name, decorated_session.sp_return_url)
t('idv.messages.jurisdiction.sp_support', link: link)
end

def profile_step
link = link_to(t('idv.messages.jurisdiction.profile_link'), account_path)
t('idv.messages.jurisdiction.profile', link: link)
end
end
end
23 changes: 1 addition & 22 deletions app/presenters/idv/max_attempts_failure_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,7 @@ def message
end

def next_steps
[sp_step, help_step, profile_step].compact
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably go ahead and clean up these methods since they're dead code, right?

end

private

def sp_step
return unless (sp_name = decorated_session.sp_name)
link = link_to(sp_name, decorated_session.sp_return_url)
t('idv.messages.jurisdiction.sp_support', link: link)
end

def help_step
link = link_to(
t('idv.messages.read_about_security_and_privacy.link'),
MarketingSite.help_privacy_and_security_url
)
t('idv.messages.read_about_security_and_privacy.text', link: link)
end

def profile_step
link = link_to(t('idv.messages.jurisdiction.profile_link'), account_path)
t('idv.messages.jurisdiction.profile', link: link)
[]
end
end
end
2 changes: 1 addition & 1 deletion app/presenters/idv/ssn_failure_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def message
end

def next_steps
[try_again_step, sign_out_step, profile_step]
[]
end

private
Expand Down
9 changes: 9 additions & 0 deletions app/views/idv/shared/_failure_to_proof_url.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- if decorated_session.sp_name
hr
.mb2.mt2
.right = link_to image_tag(asset_url('carat-right.svg'), size: '10'),
decorated_session.failure_to_proof_url, class: 'bold block btn-link text-decoration-none'
= link_to t('idv.failure.help.get_help_html', sp_name: decorated_session.sp_name),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful 🌅

decorated_session.failure_to_proof_url,
class: 'block btn-link text-decoration-none'
hr
6 changes: 4 additions & 2 deletions app/views/idv/shared/verification_failure.html.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
= render 'shared/failure', presenter: presenter
p == presenter.warning_message

.mt4
= link_to presenter.button_text, presenter.button_path, class: 'btn btn-primary'
= render 'idv/shared/failure_to_proof_url', presenter: presenter

.mt3
= link_to presenter.button_text, presenter.button_path, class: 'btn btn-primary btn-link'
1 change: 1 addition & 0 deletions app/views/shared/_failure.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ p == presenter.description

- if presenter.message.present?
h2.h4.mb2.mt3.my0 = presenter.message
= render 'idv/shared/failure_to_proof_url', presenter: presenter

- presenter.next_steps.each do |step|
p == step
Expand Down
8 changes: 2 additions & 6 deletions config/locales/idv/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ en:
errors:
link: please contact us
text: If you keep getting these errors, %{link}, or try again tomorrow.
help:
get_help_html: Get help at <strong>%{sp_name}</strong>
phone:
fail: For your security, identity verification for your account is <strong>locked
for 24 hours</strong>.
Expand Down Expand Up @@ -108,14 +110,11 @@ en:
dupe_ssn2_link: sign out now and sign back in
hardfail: We can't log you in right now, but you can try verifying your identity
again in %{hours} hours.
help_center_html: Visit our <strong>Help Center</strong> to learn more about
verifying your account.
jurisdiction:
no_id: I don't have a state-issued ID
no_id_failure: We're working hard to add more ways to verify your identity.
profile: To access your account in the future, you can %{link}.
profile_link: view your account here
sp_support: Visit %{link} for more information.
try_again: Make a mistake? You can %{link}.
try_again_link: try again
unsupported_jurisdiction_failure: We're working hard to add more states and
Expand All @@ -136,9 +135,6 @@ en:
- in your name, or a family member's name
- not a virtual phone (such as Google Voice or Skype)
- a U.S. number
read_about_security_and_privacy:
link: read about how login.gov keeps your information safe
text: You can %{link} on our help page.
return_to_profile: "‹ Return to your login.gov profile"
return_to_sp_html: You can now log into <strong>%{sp}</strong>.
review:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/idv/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ es:
errors:
link: contáctanos
text: Si sigues recibiendo estos errores, %{link} o vuelve a intentarlo mañana.
help:
get_help_html: Obtener ayuda en <strong>%{sp_name}</strong>
phone:
fail: Para su seguridad, la verificación de identidad de su cuenta está <strong>bloqueada
durante 24 horas</strong>.
Expand Down Expand Up @@ -105,15 +107,12 @@ es:
dupe_ssn2_html: Por favor %{link} con el email que utilizó originalmente.
dupe_ssn2_link: Cerrar ahora y volver a iniciar sesión
hardfail: NOT TRANSLATED YET
help_center_html: Visite nuestro <strong>Centro de Ayuda</strong> para obtener
más información sobre la verificación de su cuenta.
jurisdiction:
no_id: No tengo una identificación emitida por el estado
no_id_failure: Estamos trabajando arduamente para agregar más formas de verificar
su identidad.
profile: Para acceder a su cuenta en el futuro, puede %{link}.
profile_link: mira tu cuenta aquí
sp_support: Visita %{link} para obtener más información.
try_again: "¿Cometer un error? Puedes %{link}."
try_again_link: intentarlo de nuevo
unsupported_jurisdiction_failure: Estamos trabajando duro para agregar más
Expand All @@ -136,9 +135,6 @@ es:
- no es un teléfono virtual (como Google Voice o Skype)
- no es un número de teléfono prepago
- un número de EE. UU.
read_about_security_and_privacy:
link: leer sobre cómo login.gov mantiene su información segura
text: Puede %{link} en nuestra página de ayuda.
return_to_profile: NOT TRANSLATED YET
return_to_sp_html: NOT TRANSLATED YET
review:
Expand Down
8 changes: 2 additions & 6 deletions config/locales/idv/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ fr:
errors:
link: contactez-nous
text: Si vous continuez à recevoir ces erreurs, %{link} ou réessayez demain.
help:
get_help_html: Obtenir de l'aide à <strong>%{sp_name}</strong>
phone:
fail: Pour votre sécurité, la vérification d'identité de votre compte est
<strong>verrouillée pendant 24 heures</strong>.
Expand Down Expand Up @@ -111,15 +113,12 @@ fr:
originalement.
dupe_ssn2_link: déconnectez-vous puis connectez-vous à nouveau
hardfail: NOT TRANSLATED YET
help_center_html: Visitez notre <strong>Centre d'aide</strong> pour en apprendre
davantage sur la façon dont nous vérifions votre compte.
jurisdiction:
no_id: Je n'ai pas de carte d'identité officielle
no_id_failure: Nous travaillons dur pour ajouter plus de moyens de vérifier
votre identité.
profile: Pour accéder à votre compte dans le futur, vous pouvez %{link}.
profile_link: voir votre compte ici
sp_support: Visitez %{link} pour plus d'informations.
try_again: Faire une erreur? Vous pouvez %{link}.
try_again_link: réessayer
unsupported_jurisdiction_failure: Nous travaillons dur pour ajouter plus d'états
Expand All @@ -143,9 +142,6 @@ fr:
- pas un téléphone virtuel (comme Google Voice ou Skype)
- pas un numéro de téléphone prépayé
- un numéro américain
read_about_security_and_privacy:
link: lire comment login.gov protège vos informations
text: Vous pouvez %{link} sur notre page d'aide.
return_to_profile: NOT TRANSLATED YET
return_to_sp_html: NOT TRANSLATED YET
review:
Expand Down
15 changes: 15 additions & 0 deletions spec/decorators/service_provider_session_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,19 @@
to eq 'https://www.example.com/sign_up/start'
end
end

describe '#failure_to_proof_url' do
it 'returns the failure_to_proof_url if present on the sp' do
url = 'https://www.example.com/fail'
allow_any_instance_of(ServiceProvider).to receive(:failure_to_proof_url).and_return(url)
expect(subject.failure_to_proof_url).to eq url
end

it 'returns the return_to_sp_url if the failure_to_proof_url is not present on the sp' do
url = 'https://www.example.com/'
allow_any_instance_of(ServiceProvider).to receive(:failure_to_proof_url).and_return(nil)
allow_any_instance_of(ServiceProvider).to receive(:return_to_sp_url).and_return(url)
expect(subject.failure_to_proof_url).to eq url
end
end
end
34 changes: 2 additions & 32 deletions spec/presenters/idv/idv_failure_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,8 @@
describe '#next_steps' do
subject { presenter.next_steps }

it 'includes `help_step`, `sp_step`, and `profile_step`' do
expect(subject).to eq(
[
presenter.send(:help_step),
presenter.send(:sp_step),
presenter.send(:profile_step),
]
)
end
end

describe '#help_step' do
subject { presenter.send(:help_step) }

it 'includes help url' do
expect(subject).to include(MarketingSite.help_url)
end
end

describe '#sp_step' do
subject { presenter.send(:sp_step) }

it 'includes sp url' do
expect(subject).to include(decorated_session.sp_return_url)
end
end

describe '#profile_step' do
subject { presenter.send(:profile_step) }

it 'includes profile url' do
expect(subject).to include(view_context.account_path)
it 'is empty' do
expect(subject).to eq([])
end
end

Expand Down
10 changes: 2 additions & 8 deletions spec/presenters/idv/ssn_failure_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@
describe '#next_steps' do
subject { presenter.next_steps }

it 'includes `try_again_step`, `sign_out_step`, and `profile_step`' do
expect(subject).to eq(
[
presenter.send(:try_again_step),
presenter.send(:sign_out_step),
presenter.send(:profile_step),
]
)
it 'is empty' do
expect(subject).to eq([])
end
end

Expand Down