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
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ function AcuantCapture(
{isMobile &&
hasCapture &&
allowUpload &&
formatHTML(t('doc_auth.buttons.take_or_upload_picture'), {
formatHTML(t('doc_auth.buttons.take_or_upload_picture_html'), {
'lg-take-photo': () => null,
'lg-upload': ({ children }) => (
<span className="padding-left-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ function HybridDocCaptureWarning({ className = '' }: HybridDocCaptureWarningProp
const appName = getConfigValue('appName');

const listHeadingText = t('doc_auth.hybrid_flow_warning.only_add_if_text');
const ownAccountItemText = t('doc_auth.hybrid_flow_warning.only_add_own_account_html', {
const ownAccountItemText = t('doc_auth.hybrid_flow_warning.only_add_own_account', {
app_name: appName,
});
const phoneVerifyItemText = t('doc_auth.hybrid_flow_warning.only_add_phone_verify_html', {
const phoneVerifyItemText = t('doc_auth.hybrid_flow_warning.only_add_phone_verify', {
app_name: appName,
});
let spServicesItemText;
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/idv/cancellations_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def exit_description
'idv.cancel.description.exit.with_sp_html',
app_name: APP_NAME,
sp_name: sp_name,
account_page_link: link_to(t('idv.cancel.description.account_page'), account_path),
account_page_link_html: link_to(t('idv.cancel.description.account_page'), account_path),
)
else
t(
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/idv/otp_verification_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(idv_session:)
def phone_number_message
t(
"instructions.mfa.#{otp_delivery_preference}.number_message_html",
number: content_tag(:strong, phone_number),
number_html: content_tag(:strong, phone_number),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify: Does the automated test catch that this should be _html-suffixed, or was it manual? Since the HTML only comes at the runtime code via content_tag

Copy link
Contributor

Choose a reason for hiding this comment

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

Or I suppose you were able to work your way backward on the parent string (e.g. number_message_html) that was otherwise flagged for an unnecessary _html to see why it was in-fact necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct the parent tag had an un-necessary HTML without that

expiration: TwoFactorAuthenticatable::DIRECT_OTP_VALID_FOR_MINUTES,
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/piv_cac_authentication_login_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def heading
end

def info
t('instructions.mfa.piv_cac.sign_in', app_name: APP_NAME)
t('instructions.mfa.piv_cac.sign_in_html', app_name: APP_NAME)
end
end
8 changes: 4 additions & 4 deletions app/presenters/piv_cac_error_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def heading
def description
case error
when 'piv_cac.already_associated'
t('instructions.mfa.piv_cac.already_associated_html', try_again: try_again_link)
t('instructions.mfa.piv_cac.already_associated_html', try_again_html: try_again_link)
when 'user.not_found'
t(
'instructions.mfa.piv_cac.account_not_found_html',
Expand All @@ -57,13 +57,13 @@ def description
create_account: @view.link_to(t('links.create_account'), sign_up_email_url),
)
when 'certificate.none'
t('instructions.mfa.piv_cac.no_certificate_html', try_again: try_again_link)
t('instructions.mfa.piv_cac.no_certificate_html', try_again_html: try_again_link)
when 'certificate.not_auth_cert'
t('instructions.mfa.piv_cac.not_auth_cert_html', please_try_again: please_try_again_link)
t('instructions.mfa.piv_cac.not_auth_cert_html', please_try_again_html: please_try_again_link)
Copy link
Contributor

Choose a reason for hiding this comment

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

[question, nonblocking] why are we sometimes saying please and sometimes not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you asking about the specific copy? I'm not sure. Might be personal differences in how different engineers turn strings into keys

when 'token.http_failure'
t('instructions.mfa.piv_cac.http_failure')
else
t('instructions.mfa.piv_cac.did_not_work_html', please_try_again: please_try_again_link)
t('instructions.mfa.piv_cac.did_not_work_html', please_try_again_html: please_try_again_link)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def header
def help_text
t(
'instructions.mfa.authenticator.confirm_code_html',
app_name: content_tag(:strong, APP_NAME),
app_name_html: content_tag(:strong, APP_NAME),
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def header
def phone_number_message
t(
"instructions.mfa.#{otp_delivery_preference}.number_message_html",
number: content_tag(:strong, phone_number),
number_html: content_tag(:strong, phone_number),
expiration: TwoFactorAuthenticatable::DIRECT_OTP_VALID_FOR_MINUTES,
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def header
def piv_cac_help
if service_provider_mfa_policy.phishing_resistant_required? &&
service_provider_mfa_policy.allow_user_to_switch_method?
t('instructions.mfa.piv_cac.confirm_piv_cac_or_aal3_html')
t('instructions.mfa.piv_cac.confirm_piv_cac_or_aal3')
elsif service_provider_mfa_policy.phishing_resistant_required? ||
service_provider_mfa_policy.piv_cac_required?
t('instructions.mfa.piv_cac.confirm_piv_cac_only_html')
t('instructions.mfa.piv_cac.confirm_piv_cac_only')
else
t('instructions.mfa.piv_cac.confirm_piv_cac_html')
t('instructions.mfa.piv_cac.confirm_piv_cac')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def initialize(data:, view:, service_provider:, remember_device_default: true,
def webauthn_help
if service_provider_mfa_policy.phishing_resistant_required? &&
service_provider_mfa_policy.allow_user_to_switch_method?
t('instructions.mfa.webauthn.confirm_webauthn_or_aal3_html')
t('instructions.mfa.webauthn.confirm_webauthn_or_aal3')
elsif service_provider_mfa_policy.phishing_resistant_required?
t('instructions.mfa.webauthn.confirm_webauthn_only_html')
t('instructions.mfa.webauthn.confirm_webauthn_only')
elsif platform_authenticator?
t('instructions.mfa.webauthn.confirm_webauthn_platform_html', app_name: APP_NAME)
t('instructions.mfa.webauthn.confirm_webauthn_platform', app_name: APP_NAME)
else
t('instructions.mfa.webauthn.confirm_webauthn_html')
t('instructions.mfa.webauthn.confirm_webauthn')
end
end

Expand Down
17 changes: 10 additions & 7 deletions app/presenters/two_factor_login_options_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def first_enabled_option_index
def account_reset_link
t(
'two_factor_authentication.account_reset.text_html',
link: @view.link_to(
link_html: @view.link_to(
t('two_factor_authentication.account_reset.link'),
account_reset_url(locale: LinkLocaleResolver.locale),
),
Expand All @@ -88,12 +88,15 @@ def account_reset_url(locale:)
end

def account_reset_cancel_link
t(
'two_factor_authentication.account_reset.pending_html',
cancel_link: @view.link_to(
t('two_factor_authentication.account_reset.cancel_link'),
account_reset_cancel_url(token: account_reset_token),
),
safe_join(
[
t('two_factor_authentication.account_reset.pending'),
@view.link_to(
t('two_factor_authentication.account_reset.cancel_link'),
account_reset_cancel_url(token: account_reset_token),
),
],
' ',
Comment on lines 90 to 99
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The copy for was like Some sentence. %{cancel_link} so I figured might as well split this out into two separate i18n keys

)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p class="margin-bottom-0">
<%= t(
'account_reset.confirm_delete_account.cta_html',
link: link_to(
link_html: link_to(
t('account_reset.confirm_delete_account.link_text'),
sign_up_email_path,
),
Expand Down
2 changes: 1 addition & 1 deletion app/views/accounts/_identity_item.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% if event.return_to_sp_url.present? %>
<%= t(
'event_types.authenticated_at_html',
service_provider_link: link_to(event.display_name, event.return_to_sp_url),
service_provider_link_html: link_to(event.display_name, event.return_to_sp_url),
) %>
<% else %>
<%= t('event_types.authenticated_at', service_provider: event.display_name) %>
Expand Down
11 changes: 6 additions & 5 deletions app/views/forgot_password/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
<p><%= t('notices.forgot_password.no_email_sent_explanation_start') %>
<%= f.button :button, t('links.resend'), class: 'usa-button--unstyled margin-left-05' %></p>

<% link = link_to(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose to inline this assignment

t('notices.forgot_password.use_diff_email.link'),
sign_up_email_path,
) %>
<p><%= t('notices.forgot_password.use_diff_email.text_html', link: link) %></p>
<p>
<%= t(
'notices.forgot_password.use_diff_email.text_html',
link_html: link_to(t('notices.forgot_password.use_diff_email.link'), sign_up_email_path),
) %>
</p>
<p><%= t('instructions.forgot_password.close_window') %></p>
<% end %>
2 changes: 1 addition & 1 deletion app/views/idv/activated.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<p class="margin-bottom-0">
<%= t(
'idv.messages.activated_html',
link: link_to(t('idv.messages.activated_link'), MarketingSite.contact_url),
link_html: link_to(t('idv.messages.activated_link'), MarketingSite.contact_url),
) %>
</p>
2 changes: 1 addition & 1 deletion app/views/idv/gpo_verify/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<% end %>

<%= render PageHeadingComponent.new.with_content(t('forms.verify_profile.welcome_back')) %>
<%= sanitize t('forms.verify_profile.welcome_back_description'), tags: %w[p strong] %>
<%= t('forms.verify_profile.welcome_back_description_html') %>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the _html does the same marking as HTML-safe that sanitize does basically

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the sanitize would have been stricter about the allowed tags? But I don't think we worry about that with non-user-provided strings like this, or at least we don't elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah with hard coded string I don't think we gain much benefit from sanitize

<hr class="margin-y-4" />
<h2><%= t('forms.verify_profile.title') %></h2>

Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/in_person/ready_to_verify/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<%= render ClickObserverComponent.new(event_name: 'IdV: user clicked sp link on ready to verify page') do %>
<%= t(
'in_person_proofing.body.barcode.return_to_partner_html',
link: link_to(
link_html: link_to(
t(
'in_person_proofing.body.barcode.return_to_partner_link',
sp_name: @presenter.sp_name,
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/in_person/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ locals:
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
link: link_to(
link_html: link_to(
t('doc_auth.headings.capture_scan_warning_link'),
idv_hybrid_handoff_url(redo: true),
'aria-label': t('doc_auth.headings.capture_scan_warning_link'),
Expand Down
4 changes: 2 additions & 2 deletions app/views/idv/please_call/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
heading: t('idv.failure.setup.heading'),
) do %>
<p>
<%= t('idv.failure.setup.fail_date_html', date: I18n.l(@call_by_date, format: I18n.t('time.formats.event_date'))) %>
<%= t('idv.failure.setup.fail_date_html', date_html: I18n.l(@call_by_date, format: I18n.t('time.formats.event_date'))) %>
</p>
<p>
<%= t('idv.failure.setup.fail_html', support_code: IdentityConfig.store.lexisnexis_threatmetrix_support_code, contact_number: IdentityConfig.store.idv_contact_phone_number) %>
<%= t('idv.failure.setup.fail', support_code: IdentityConfig.store.lexisnexis_threatmetrix_support_code, contact_number: IdentityConfig.store.idv_contact_phone_number) %>
</p>
<% end %>
2 changes: 1 addition & 1 deletion app/views/idv/session_errors/exception.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<p>
<%= t(
'idv.failure.exceptions.text_html',
link: link_to(t('idv.failure.exceptions.link'), MarketingSite.contact_url),
link_html: link_to(t('idv.failure.exceptions.link'), MarketingSite.contact_url),
) %>
</p>
<% end %>
2 changes: 1 addition & 1 deletion app/views/idv/unavailable/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<%= t(
'idv.unavailable.next_steps_html',
app_name: APP_NAME,
status_page_link: new_tab_link_to(
status_page_link_html: new_tab_link_to(
t('idv.unavailable.status_page_link'),
StatusPage.base_url,
),
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ locals:
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
link: link_to(
link_html: link_to(
t('doc_auth.headings.capture_scan_warning_link'),
idv_hybrid_handoff_url(redo: true),
'aria-label': t('doc_auth.headings.capture_scan_warning_link'),
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/welcome/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<%= render PageHeadingComponent.new.with_content(t('doc_auth.headings.welcome')) %>
<p>
<%= t('doc_auth.info.welcome_html', sp_name: decorated_session.sp_name || t('doc_auth.info.no_sp_name')) %>
<%= t('doc_auth.info.welcome', sp_name: decorated_session.sp_name || t('doc_auth.info.no_sp_name')) %>
</p>

<h2><%= t('doc_auth.instructions.welcome') %></h2>
Expand Down
6 changes: 4 additions & 2 deletions app/views/partials/personal_key/_key.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<% if local_assigns[:personal_key_generated_at].present? %>
<%= t(
'users.personal_key.generated_on_html',
date: content_tag(:strong, render(TimeComponent.new(time: personal_key_generated_at))),
date_html: content_tag(
:strong, render(TimeComponent.new(time: personal_key_generated_at))
),
) %>
<% else %>
<%= t(
'users.personal_key.generated_on_html',
date: content_tag(:strong, render(TimeComponent.new(time: Time.zone.today))),
date_html: content_tag(:strong, render(TimeComponent.new(time: Time.zone.today))),
) %>
<% end %>
</p>
Expand Down
4 changes: 2 additions & 2 deletions app/views/session_timeout/_warning.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# i18n-tasks-use t('notices.timeout_warning.partially_signed_in.message_html')
'message_html',
scope: modal_presenter.translation_scope,
time_left_in_session: render(
time_left_in_session_html: render(
CountdownComponent.new(
expiration: Time.zone.now,
start_immediately: false,
Expand All @@ -27,7 +27,7 @@
# i18n-tasks-use t('notices.timeout_warning.partially_signed_in.live_region_message_html')
'live_region_message_html',
scope: modal_presenter.translation_scope,
time_left_in_session: render(
time_left_in_session_html: render(
CountdownComponent.new(
expiration: Time.zone.now,
update_interval: 30.seconds,
Expand Down
6 changes: 3 additions & 3 deletions app/views/shared/_recaptcha_disclosure.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<%= t(
'two_factor_authentication.recaptcha.disclosure_statement_html',
app_name: APP_NAME,
google_policy_link: new_tab_link_to(t('two_factor_authentication.recaptcha.google_policy_link'), GooglePolicySite.privacy_url),
google_tos_link: new_tab_link_to(t('two_factor_authentication.recaptcha.google_tos_link'), GooglePolicySite.terms_url),
login_tos_link: new_tab_link_to(t('two_factor_authentication.recaptcha.login_tos_link'), MarketingSite.rules_of_use_url),
google_policy_link_html: new_tab_link_to(t('two_factor_authentication.recaptcha.google_policy_link'), GooglePolicySite.privacy_url),
google_tos_link_html: new_tab_link_to(t('two_factor_authentication.recaptcha.google_tos_link'), GooglePolicySite.terms_url),
login_tos_link_html: new_tab_link_to(t('two_factor_authentication.recaptcha.login_tos_link'), MarketingSite.rules_of_use_url),
) %>
</p>
2 changes: 1 addition & 1 deletion app/views/shared/_ssn_field.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locals:
field_options: {
name: :ssn,
as: :password,
label: t('idv.form.ssn_label_html'),
label: t('idv.form.ssn_label'),
hint: t('forms.example') + ' 123-45-6789',
required: true,
pattern: '^\d{3}-?\d{2}-?\d{4}$',
Expand Down
8 changes: 6 additions & 2 deletions app/views/sign_up/emails/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@
<p><%= t('notices.signed_up_but_unconfirmed.no_email_sent_explanation_start') %>
<%= f.button :button, t('links.resend'), class: 'usa-button--unstyled margin-left-05' %></p>

<% link = link_to(t('notices.use_diff_email.link'), sign_up_email_path) %>
<p><%= t('notices.use_diff_email.text_html', link: link) %></p>
<p>
<%= t(
'notices.use_diff_email.text_html',
link_html: link_to(t('notices.use_diff_email.link'), sign_up_email_path),
) %>
</p>
<p><%= t('devise.registrations.close_window') %></p>

<% if FeatureManagement.enable_load_testing_mode? %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
<%= t(
'two_factor_authentication.opt_in.opted_out_last_30d_html',
phone_number: content_tag(:strong, @phone_configuration.masked_phone),
phone_number_html: content_tag(:strong, @phone_configuration.masked_phone),
) %>
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
<%= t(
'two_factor_authentication.opt_in.opted_out_html',
phone_number: content_tag(:strong, @phone_configuration.masked_phone),
phone_number_html: content_tag(:strong, @phone_configuration.masked_phone),
) %>
</p>

Expand Down
5 changes: 1 addition & 4 deletions app/views/user_mailer/account_rejected.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<p class="lead">
<%= t(
'user_mailer.account_rejected.intro_html',
app_name: APP_NAME,
) %>
<%= t('user_mailer.account_rejected.intro', app_name: APP_NAME) %>
</p>

<table class="spacer">
Expand Down
5 changes: 4 additions & 1 deletion app/views/user_mailer/account_reset_cancel.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<p class="lead">
<%= t('user_mailer.account_reset_cancel.intro_html', app_name: link_to(APP_NAME, IdentityConfig.store.mailer_domain_name, class: 'gray')) %>
<%= t(
'user_mailer.account_reset_cancel.intro_html',
app_name_html: link_to(APP_NAME, IdentityConfig.store.mailer_domain_name, class: 'gray'),
) %>
</p>

<table class="spacer">
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/account_reset_complete.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p class="lead">
<%= t('user_mailer.account_reset_complete.intro_html', app_name: link_to(APP_NAME, IdentityConfig.store.mailer_domain_name, class: 'gray')) %>
<%= t('user_mailer.account_reset_complete.intro_html', app_name_html: link_to(APP_NAME, IdentityConfig.store.mailer_domain_name, class: 'gray')) %>
</p>

<table class="spacer">
Expand Down
Loading