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
2 changes: 2 additions & 0 deletions app/controllers/idv/phone_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class PhoneErrorsController < ApplicationController
include StepIndicatorConcern
include Idv::AbTestAnalyticsConcern
include Idv::VerifyByMailConcern
include PhoneFormatter

before_action :confirm_step_allowed, except: [:failure]
before_action :set_gpo_letter_available
Expand All @@ -20,6 +21,7 @@ def warning
@country_code = idv_session.previous_phone_step_params[:international_code]
end

@formatted_phone = PhoneFormatter.format(@phone, country_code: @country_code)
track_event(type: :warning)
end

Expand Down
3 changes: 1 addition & 2 deletions app/views/idv/phone_errors/warning.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

<% if @phone %>
<p>
<%= t('idv.failure.phone.warning.you_entered') %>
<strong class='text-no-wrap'><%= PhoneFormatter.format(@phone, country_code: @country_code) %></strong>
<%= t('idv.failure.phone.warning.you_entered_html', formatted_phone: @formatted_phone) %>
</p>
<% end %>

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ idv.failure.phone.warning.heading: We couldn’t match you to this number
idv.failure.phone.warning.learn_more_link: Learn more about what phone number to use
idv.failure.phone.warning.next_steps_html: Try <strong>another</strong> number that you use often and have used for a long time. This can be a work or home number.
idv.failure.phone.warning.try_again_button: Try another number
idv.failure.phone.warning.you_entered: 'We couldn’t find a record of you using this number:'
idv.failure.phone.warning.you_entered_html: "We couldn’t find a record of you using this number: <strong class='text-no-wrap'>%{formatted_phone}</strong>"
idv.failure.sessions.exception: There was an internal error processing your request.
idv.failure.sessions.fail_html: For your security, we limit the number of times you can attempt to verify personal information online. <strong>Try again in %{timeout}.</strong>
idv.failure.sessions.heading: We couldn’t find records matching your personal information
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ idv.failure.phone.warning.heading: No pudimos asociarlo a este número
idv.failure.phone.warning.learn_more_link: Obtenga más información sobre el número de teléfono que debe usar
idv.failure.phone.warning.next_steps_html: Intente con <strong>otro</strong> número que use a menudo y haya usado por mucho tiempo. Puede ser el número del trabajo o de casa.
idv.failure.phone.warning.try_again_button: Intentar con otro número
idv.failure.phone.warning.you_entered: 'No pudimos encontrar su registro con este número:'
idv.failure.phone.warning.you_entered_html: "No pudimos encontrar su registro con este número: <strong class='text-no-wrap'>%{formatted_phone}</strong>"
idv.failure.sessions.exception: Hubo un error interno al procesar su solicitud.
idv.failure.sessions.fail_html: Por su seguridad, limitamos el número de veces que puede intentar verificar la información personal en línea. <strong>Vuelva a intentarlo en %{timeout}.</strong>
idv.failure.sessions.heading: No encontramos registros que coincidan con sus datos personales
Expand Down
4 changes: 2 additions & 2 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ idv.failure.phone.warning.heading: Nous n’avons pas pu vous associer à ce num
idv.failure.phone.warning.learn_more_link: En savoir plus sur quel numéro de téléphone utiliser
idv.failure.phone.warning.next_steps_html: Essayez <strong>un autre</strong> numéro que vous utilisez souvent et depuis longtemps. Il peut s’agir d’un numéro professionnel ou personnel.
idv.failure.phone.warning.try_again_button: Essayez un autre numéro
idv.failure.phone.warning.you_entered: 'Nous n’avons pas trouvé de données vous associant au numéro suivant :'
idv.failure.phone.warning.you_entered_html: "Nous n’avons pas trouvé de données vous associant au numéro suivant: <strong class='text-no-wrap'>%{formatted_phone}</strong>"
idv.failure.sessions.exception: Une erreur interne s’est produite lors du traitement de votre demande.
idv.failure.sessions.fail_html: Pour votre sécurité, nous limitons le nombre de fois où vous pouvez tenter de vérifier des renseignements personnels en ligne. <strong>Réessayez dans %{timeout}.</strong>
idv.failure.sessions.heading: Nous n’avons pas trouvé de dossiers correspondant à vos informations personnelles
Expand All @@ -1138,7 +1138,7 @@ idv.failure.verify.fail_link_html: Obtenez de l’aide auprès de <strong>%{sp_n
idv.failure.verify.fail_text: pour accéder aux services.
idv.failure.verify.heading: Nous n’avons pas pu confirmer votre identité
idv.failure.warning.attempts_html.one: Vous avez encore <strong>un essai.</strong> Vous devrez ensuite attendre 6 heures avant de réessayer.
idv.failure.warning.attempts_html.other: Vous pouvez encore essayer <strong>%{count} fois de plus.</strong> Ensuite vous devrez ensuite attendre 6 heures avant de réessayer.
idv.failure.warning.attempts_html.other: Vous pouvez encore essayer <strong>%{count} fois de plus.</strong> Ensuite, vous devrez attendre 6 heures avant de réessayer.
idv.forgot_password.link_text: Mot de passe oublié?
idv.forgot_password.modal_header: Êtes-vous sûr de ne pas pouvoir vous souvenir de votre mot de passe?
idv.forgot_password.reset_password: Réinitialiser le mot de passe
Expand Down
8 changes: 4 additions & 4 deletions config/locales/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ idv.failure.phone.warning.heading: 我们无法将你与该号码匹配。
idv.failure.phone.warning.learn_more_link: 了解有关使用什么号码的更多信息。
idv.failure.phone.warning.next_steps_html: 尝试 <strong>另一个</strong> 你经常使用并用了很久的号码。 工作或住宅号码都行。
idv.failure.phone.warning.try_again_button: 尝试另一个号码
idv.failure.phone.warning.you_entered: 我们找不到你使用此号码的记录:
idv.failure.phone.warning.you_entered_html: "我们找不到你使用: <strong class='text-no-wrap'>%{formatted_phone}</strong> 电话号码的记录"
idv.failure.sessions.exception: 处理你的请求时内部出错。
idv.failure.sessions.fail_html: 出于安全考虑,我们限制你在网上尝试验证个人信息的次数。<strong> %{timeout}后再试。</strong>
idv.failure.sessions.heading: 我们找不到与你个人信息匹配的记录
Expand All @@ -1150,8 +1150,8 @@ idv.failure.verify.exit: 退出 %{app_name}
idv.failure.verify.fail_link_html: 在<strong>%{sp_name}</strong> 得到
idv.failure.verify.fail_text: 帮助以获得服务。
idv.failure.verify.heading: 我们无法验证你的身份证件。
idv.failure.warning.attempts_html.one: 您可以再试<strong>1次。</strong>然后您必须等6个小时才能再试
idv.failure.warning.attempts_html.other: 您可以再试<strong>%{count}次。</strong>然后您必须等6个小时才能再试
idv.failure.warning.attempts_html.one: 你可以再试<strong>1次。</strong>你后您必须等6个小时才能再试
idv.failure.warning.attempts_html.other: 你可以再试<strong>%{count}次。</strong>你后您必须等6个小时才能再试
idv.forgot_password.link_text: 忘了密码?
idv.forgot_password.modal_header: 你确定不记得密码吗?
idv.forgot_password.reset_password: 重设密码
Expand Down Expand Up @@ -1664,7 +1664,7 @@ step_indicator.flows.idv.go_to_the_post_office: 去邮局
step_indicator.flows.idv.re_enter_password: 重新输入你的密码
step_indicator.flows.idv.secure_account: 保护你账户的安全
step_indicator.flows.idv.verify_address: 验证你的地址
step_indicator.flows.idv.verify_id: 验证你的身份证件
step_indicator.flows.idv.verify_id: 验证你的ID
step_indicator.flows.idv.verify_info: 验证你的信息
step_indicator.flows.idv.verify_phone: 验证你的电话号码
step_indicator.status.complete: 完成了
Expand Down
11 changes: 9 additions & 2 deletions spec/views/idv/phone_errors/warning.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
assign(:remaining_submit_attempts, remaining_submit_attempts)
assign(:country_code, country_code)
assign(:phone, phone)
assign(:formatted_phone, formatted_phone)

render
end
Expand All @@ -26,7 +27,9 @@
end

it 'shows number entered' do
expect(rendered).to have_text(t('idv.failure.phone.warning.you_entered'))
expect(rendered).to have_content(
strip_tags(t('idv.failure.phone.warning.you_entered_html', formatted_phone: formatted_phone)),
)
expect(rendered).to have_text(formatted_phone)
end

Expand Down Expand Up @@ -104,7 +107,11 @@
context 'no phone' do
let(:phone) { nil }
it 'does not render "You entered:"' do
expect(rendered).not_to have_text(t('idv.failure.phone.warning.you_entered'))
expect(rendered).not_to have_content(
strip_tags(
t('idv.failure.phone.warning.you_entered_html', formatted_phone: formatted_phone),
),
)
end
end
end