Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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: 1 addition & 1 deletion app/components/javascript_required_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ul class="usa-list">
<% browser_resources.each do |resource| %>
<li><%= new_window_link_to resource[:name], resource[:url] %></li>
<li><%= new_tab_link_to resource[:name], resource[:url] %></li>
<% end %>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion app/components/vendor_outage_alert_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% if content %>
<%= render(AlertComponent.new(type: :error, class: 'margin-bottom-4')) do %>
<%= content %>
<%= new_window_link_to t('vendor_outage.get_updates'), StatusPage.base_url %>
<%= new_tab_link_to t('vendor_outage.get_updates'), StatusPage.base_url %>
<% end %>
<% end %>
4 changes: 2 additions & 2 deletions app/helpers/link_helper.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# frozen_string_literal: true

module LinkHelper
def new_window_link_to(name = nil, options = nil, html_options = nil, &block)
def new_tab_link_to(name = nil, options = nil, html_options = nil, &block)
html_options, options, name = options, name, capture(&block) if block

html_options ||= {}
html_options[:target] = '_blank'
html_options[:class] = [*html_options[:class], 'usa-link--external']

name = ERB::Util.unwrapped_html_escape(name).rstrip.html_safe # rubocop:disable Rails/OutputSafety
name << content_tag('span', t('links.new_window'), class: 'usa-sr-only')
name << content_tag('span', t('links.new_tab'), class: 'usa-sr-only')

link_to(name, options, html_options)
end
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/packages/components/link.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('Link', () => {
</Link>,
);

const link = getByRole('link', { name: 'Example links.new_window' }) as HTMLAnchorElement;
const link = getByRole('link', { name: 'Example links.new_tab' }) as HTMLAnchorElement;

expect(link).to.exist();
});
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/packages/components/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Link({
return (
<a href={href} {...newTabProps} {...anchorProps} className={classes}>
{children}
{isNewTab && <span className="usa-sr-only">{t('links.new_window')}</span>}
{isNewTab && <span className="usa-sr-only">{t('links.new_tab')}</span>}
</a>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('TroubleshootingOptions', () => {
const links = getAllByRole('link') as HTMLAnchorElement[];

expect(links).to.have.lengthOf(2);
expect(links[0].textContent).to.equal('Option 1links.new_window');
expect(links[0].textContent).to.equal('Option 1links.new_tab');
expect(links[0].getAttribute('href')).to.equal(`/1`);
expect(links[0].target).to.equal('_blank');
expect(links[1].textContent).to.equal('Option 2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ describe('DocumentCaptureTroubleshootingOptions', () => {

expect(links).to.have.lengthOf(2);
expect(links[0].textContent).to.equal(
'idv.troubleshooting.options.doc_capture_tipslinks.new_window',
'idv.troubleshooting.options.doc_capture_tipslinks.new_tab',
);
expect(links[0].getAttribute('href')).to.equal(
'https://example.com/redirect/?category=verify-your-identity&article=how-to-add-images-of-your-state-issued-id&location=document_capture_troubleshooting_options',
);
expect(links[0].target).to.equal('_blank');
expect(links[1].textContent).to.equal(
'idv.troubleshooting.options.supported_documentslinks.new_window',
'idv.troubleshooting.options.supported_documentslinks.new_tab',
);
expect(links[1].getAttribute('href')).to.equal(
'https://example.com/redirect/?category=verify-your-identity&article=accepted-state-issued-identification&location=document_capture_troubleshooting_options',
Expand All @@ -65,21 +65,21 @@ describe('DocumentCaptureTroubleshootingOptions', () => {

expect(links).to.have.lengthOf(3);
expect(links[0].textContent).to.equal(
'idv.troubleshooting.options.doc_capture_tipslinks.new_window',
'idv.troubleshooting.options.doc_capture_tipslinks.new_tab',
);
expect(links[0].getAttribute('href')).to.equal(
'https://example.com/redirect/?category=verify-your-identity&article=how-to-add-images-of-your-state-issued-id&location=document_capture_troubleshooting_options',
);
expect(links[0].target).to.equal('_blank');
expect(links[1].textContent).to.equal(
'idv.troubleshooting.options.supported_documentslinks.new_window',
'idv.troubleshooting.options.supported_documentslinks.new_tab',
);
expect(links[1].getAttribute('href')).to.equal(
'https://example.com/redirect/?category=verify-your-identity&article=accepted-state-issued-identification&location=document_capture_troubleshooting_options',
);
expect(links[1].target).to.equal('_blank');
expect(links[2].textContent).to.equal(
'idv.troubleshooting.options.get_help_at_splinks.new_window',
'idv.troubleshooting.options.get_help_at_splinks.new_tab',
);
expect(links[2].href).to.equal(
'http://example.test/url/to/failure-to-proof?location=document_capture_troubleshooting_options',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('InPersonPrepareStep', () => {
expect(getByText('in_person_proofing.body.prepare.privacy_disclaimer')).to.exist();
expect(
queryByRole('link', {
name: 'in_person_proofing.body.prepare.privacy_disclaimer_link links.new_window',
name: 'in_person_proofing.body.prepare.privacy_disclaimer_link links.new_tab',
}),
).not.to.exist();
});
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('InPersonPrepareStep', () => {
const { getByRole } = render(<InPersonPrepareStep {...DEFAULT_PROPS} />, { wrapper });

const link = getByRole('link', {
name: 'in_person_proofing.body.prepare.privacy_disclaimer_link links.new_window',
name: 'in_person_proofing.body.prepare.privacy_disclaimer_link links.new_tab',
}) as HTMLAnchorElement;

expect(link.href).to.equal(securityAndPrivacyHowItWorksURL);
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@
</div>

<p class="margin-y-1">
<%= new_window_link_to(
<%= new_tab_link_to(
t('notices.privacy.security_and_privacy_practices'),
MarketingSite.security_and_privacy_practices_url,
) %>
</p>

<p class="margin-y-1">
<%= new_window_link_to(
<%= new_tab_link_to(
t('notices.privacy.privacy_act_statement'),
MarketingSite.privacy_act_statement_url,
) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/doc_auth/agreement.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
required: true,
) %>
<p class="margin-top-2">
<%= new_window_link_to(
<%= new_tab_link_to(
t('doc_auth.instructions.learn_more'),
MarketingSite.security_and_privacy_practices_url,
) %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/idv/doc_auth/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<li><%= bullet_item %></li>
<% end %>
</ul>
<%= new_window_link_to(
<%= new_tab_link_to(
t('idv.troubleshooting.options.learn_more_address_verification_options'),
help_center_redirect_path(
category: 'verify-your-identity',
Expand Down Expand Up @@ -95,7 +95,7 @@
<%= t('doc_auth.info.privacy', app_name: APP_NAME) %>
</p>
<p>
<%= new_window_link_to(
<%= new_tab_link_to(
t('doc_auth.instructions.learn_more'),
MarketingSite.security_and_privacy_practices_url,
) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/in_person/address.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% unless capture_secondary_id_enabled %>
<p>
<%= t('in_person_proofing.body.address.info') %>
<%= new_window_link_to(
<%= new_tab_link_to(
t('in_person_proofing.body.address.learn_more'),
MarketingSite.help_center_article_url(
category: 'verify-your-identity',
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 @@ -44,7 +44,7 @@
<p class="margin-bottom-0">
<%= t('in_person_proofing.body.barcode.questions') %>
<%= render ClickObserverComponent.new(event_name: 'IdV: user clicked what to bring link on ready to verify page') do %>
<%= new_window_link_to(
<%= new_tab_link_to(
t('in_person_proofing.body.barcode.learn_more'),
MarketingSite.help_center_article_url(
category: 'verify-your-identity',
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/in_person/ssn.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ locals:

<p>
<%= t('doc_auth.info.ssn') %>
<%= new_window_link_to(MarketingSite.security_and_privacy_practices_url, class: 'display-inline') do %>
<%= new_tab_link_to(MarketingSite.security_and_privacy_practices_url, class: 'display-inline') do %>
<%= t('doc_auth.info.learn_more') %>
<% end %>
</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/phone/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</ul>

<p>
<%= new_window_link_to(
<%= new_tab_link_to(
t('idv.troubleshooting.options.learn_more_verify_by_phone'),
help_center_redirect_url(
category: 'verify-your-identity',
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/phone_errors/warning.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<p>
<%= t('idv.failure.phone.warning.next_steps_html') %>
<%= new_window_link_to(
<%= new_tab_link_to(
t('idv.failure.phone.warning.learn_more_link'),
help_center_redirect_path(
category: 'verify-your-identity',
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/review/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<%= t('idv.messages.sessions.review_message', app_name: APP_NAME) %>
</p>

<%= new_window_link_to(
<%= new_tab_link_to(
t('idv.messages.sessions.read_more_encrypt', app_name: APP_NAME),
MarketingSite.security_url,
) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/ssn/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ locals:

<p>
<%= t('doc_auth.info.ssn') %>
<%= new_window_link_to(MarketingSite.security_and_privacy_practices_url, class: 'display-inline') do %>
<%= new_tab_link_to(MarketingSite.security_and_privacy_practices_url, class: 'display-inline') do %>
<%= t('doc_auth.info.learn_more') %>
<% end %>
</p>
Expand Down
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_window_link_to(
status_page_link: new_tab_link_to(
t('idv.unavailable.status_page_link'),
StatusPage.base_url,
),
Expand Down
10 changes: 5 additions & 5 deletions app/views/shared/_footer_lite.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<footer class="footer">
<%= new_window_link_to('https://www.gsa.gov', class: 'display-none tablet:display-inline') do %>
<%= new_tab_link_to('https://www.gsa.gov', class: 'display-none tablet:display-inline') do %>
<%= image_tag(asset_url('sp-logos/square-gsa.svg'), size: 20, alt: '', class: 'float-left margin-right-1') %>
<%= t('shared.footer_lite.gsa') %>
<% end %>
<%= render LanguagePickerComponent.new(class: 'footer__language-picker') %>
<div class="footer__links">
<%= new_window_link_to('https://www.gsa.gov', class: 'tablet:display-none margin-right-2') do %>
<%= new_tab_link_to('https://www.gsa.gov', class: 'tablet:display-none margin-right-2') do %>
<%= image_tag asset_url('sp-logos/square-gsa-dark.svg'), size: 20, alt: t('shared.footer_lite.gsa') %>
<% end %>
<%= new_window_link_to(t('links.help'), MarketingSite.help_url, class: 'margin-right-2') %>
<%= new_window_link_to(t('links.contact'), MarketingSite.contact_url, class: 'margin-right-2') %>
<%= new_window_link_to(t('links.privacy_policy'), MarketingSite.security_and_privacy_practices_url) %>
<%= new_tab_link_to(t('links.help'), MarketingSite.help_url, class: 'margin-right-2') %>
<%= new_tab_link_to(t('links.contact'), MarketingSite.contact_url, class: 'margin-right-2') %>
<%= new_tab_link_to(t('links.privacy_policy'), MarketingSite.security_and_privacy_practices_url) %>
</div>
</footer>
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_window_link_to(t('two_factor_authentication.recaptcha.google_policy_link'), GooglePolicySite.privacy_url),
google_tos_link: new_window_link_to(t('two_factor_authentication.recaptcha.google_tos_link'), GooglePolicySite.terms_url),
login_tos_link: new_window_link_to(t('two_factor_authentication.recaptcha.login_tos_link'), MarketingSite.rules_of_use_url),
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),
) %>
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
</span>
</p>
<p>
<%= new_window_link_to t('devise.registrations.start.learn_more'), MarketingSite.help_url %>
<%= new_tab_link_to t('devise.registrations.start.learn_more'), MarketingSite.help_url %>
</p>
<% end %>
6 changes: 3 additions & 3 deletions app/views/sign_up/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
as: :boolean,
label: capture do %>
<%= t('sign_up.terms', app_name: APP_NAME) %>
<%= new_window_link_to(t('titles.rules_of_use'), MarketingSite.rules_of_use_url) %>
<%= new_tab_link_to(t('titles.rules_of_use'), MarketingSite.rules_of_use_url) %>
<% end,
label_html: { class: 'margin-y-0' },
required: true,
Expand All @@ -56,14 +56,14 @@
<%= render 'shared/cancel', link: decorated_session.cancel_link_url %>

<p class='margin-top-2'>
<%= new_window_link_to(
<%= new_tab_link_to(
t('notices.privacy.security_and_privacy_practices'),
MarketingSite.security_and_privacy_practices_url,
) %>
</p>

<p>
<%= new_window_link_to(
<%= new_tab_link_to(
t('notices.privacy.privacy_act_statement'),
MarketingSite.privacy_act_statement_url,
) %>
Expand Down
12 changes: 8 additions & 4 deletions app/views/users/emails/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
<%= render 'shared/cancel', link: decorated_session.cancel_link_url %>

<p class="margin-top-2">
<%= new_window_link_to t('notices.privacy.security_and_privacy_practices'),
MarketingSite.security_and_privacy_practices_url %>
<%= new_tab_link_to (
t('notices.privacy.security_and_privacy_practices'),
MarketingSite.security_and_privacy_practices_url
) %>
</p>

<p>
<%= new_window_link_to t('notices.privacy.privacy_act_statement'),
MarketingSite.privacy_act_statement_url %>
<%= new_tab_link_to (
t('notices.privacy.privacy_act_statement'),
MarketingSite.privacy_act_statement_url
) %>
</p>
4 changes: 2 additions & 2 deletions app/views/users/rules_of_use/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
<%= t(
'users.rules_of_use.overview_html',
link: new_window_link_to(
link: new_tab_link_to(
t('titles.rules_of_use'),
MarketingSite.rules_of_use_url,
),
Expand All @@ -24,7 +24,7 @@
as: :boolean,
label: capture do %>
<%= t('users.rules_of_use.check_box_to_accept', app_name: APP_NAME) %>
<%= new_window_link_to(t('titles.rules_of_use'), MarketingSite.rules_of_use_url) %>
<%= new_tab_link_to(t('titles.rules_of_use'), MarketingSite.rules_of_use_url) %>
<% end,
required: true,
) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/totp_setup/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<p>
<%= t(
'forms.totp_setup.totp_intro_html',
link: new_window_link_to(t('links.what_is_totp'), MarketingSite.help_authentication_app_url),
link: new_tab_link_to(t('links.what_is_totp'), MarketingSite.help_authentication_app_url),
) %>
</p>

Expand Down
2 changes: 1 addition & 1 deletion config/locales/links/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ en:
exit_login: Exit %{app_name}
go_back: Go back
help: Help
new_window: '(opens new window)'
new_tab: '(opens new tab)'
next: Sign in
passwords:
forgot: Forgot your password?
Expand Down
2 changes: 1 addition & 1 deletion config/locales/links/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ es:
exit_login: Salga de %{app_name}
go_back: Regresa
help: Ayuda
new_window: '(abre nueva ventana)'
new_tab: '(abre nueva ventana)'
next: Siguiente
passwords:
forgot: '¿Olvidó su contraseña?'
Expand Down
2 changes: 1 addition & 1 deletion config/locales/links/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fr:
exit_login: Quitter %{app_name}
go_back: Retourner
help: Aide
new_window: '(ouvre une nouvelle fenêtre)'
new_tab: '(ouvre un nouvel onglet)'
next: Suivant
passwords:
forgot: Vous avez oublié votre mot de passe?
Expand Down
2 changes: 1 addition & 1 deletion spec/components/block_link_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
rendered = render_inline BlockLinkComponent.new(url: '/', new_tab: true)

expect(rendered).to have_css('.block-link.usa-link.usa-link--external[target=_blank]')
expect(rendered).to have_content(t('links.new_window'))
expect(rendered).to have_content(t('links.new_tab'))
end
end

Expand Down
Loading