-
Notifications
You must be signed in to change notification settings - Fork 166
Ensure advance warning of links opening new window (LG-3528) #4310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mitchellhenke
merged 24 commits into
master
from
mitchellhenke/advance-warning-of-external-links-lg-3528
Oct 20, 2020
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
9560287
convert registration pii accordion to erb and add new window warning …
5a7dce0
convert users emails show template to erb and add new window warning …
fb4857e
update translations
b07c2d1
add new window warning to external links
f2886dd
use partial for rendering links that open new window
de18674
automatically apply external link icon
aef0d22
helper function and CSS update
dcb00ff
Merge remote-tracking branch 'origin/master' into mitchellhenke/advan…
d406903
indenting
f6ce4f6
link helper
4c92079
set target=_blank
4ec3096
Update styles to not conflict
263da95
comment
9812580
support block form in new_window_link_to
6c8cda7
use new link helper
158d1b4
fix a couple bugs
84304d9
Update app/views/idv/doc_auth/overview.html.erb
0247297
Update app/views/sign_up/registrations/new.html.erb
b54defc
Update app/views/sign_up/registrations/new.html.erb
0426b62
lint
db9cb56
update helper to behave more like link_to
a73e236
remove convert_options_to_data_attributes
e838c87
maintain footer colors
5706c2c
fix double footer link spec
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // We're not (yet) using USWDS links consistently, where we'd expect color changes on hover, so in order to prevent the icon from flipping color independently from the rest of the link text on hover, we have to override it. | ||
|
|
||
| // In the future, we'll want to either apply usa-link to all links, or to configure $theme-global-link-styles to apply link styling globally. This will bring hover color styles, at which point we can remove these overrides. | ||
|
|
||
| .usa-link--external { | ||
| @include external-link(external-link, external-link); | ||
|
|
||
| &.usa-link--alt { | ||
| @include external-link(external-link-alt, external-link-alt); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| module LinkHelper | ||
| EXTERNAL_LINK_CLASS = 'usa-link--external'.freeze | ||
|
|
||
| def new_window_link_to(name = nil, options = nil, html_options = nil, &block) | ||
| if block_given? | ||
| html_options = options | ||
| options = name | ||
| name = block | ||
| end | ||
| options ||= {} | ||
| html_options ||= {} | ||
|
|
||
| url = url_for(options) | ||
| html_options[:href] ||= url | ||
| html_options[:class] ||= html_options[:class].to_s | ||
| html_options[:target] = '_blank' | ||
|
|
||
| classes = html_options[:class].split(' ').append(EXTERNAL_LINK_CLASS) | ||
|
|
||
| html_options[:class] = classes.uniq.join(' ') | ||
|
|
||
| if block_given? | ||
| link_to(url, html_options) do | ||
| yield(block) | ||
| concat content_tag('span', t('links.new_window'), class: 'usa-sr-only') | ||
| end | ||
| else | ||
| link_to(url, html_options) do | ||
| content_tag('span', name) + | ||
| content_tag('span', t('links.new_window'), class: 'usa-sr-only') | ||
| end | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
app/views/sign_up/registrations/_required_pii_accordion.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('get-started/ID.svg'), | ||
| size: '40', alt: '', class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('idv.index.id.need_html') %> | ||
| </span> | ||
| </p> | ||
|
|
||
| <div class="mt2"> | ||
| <%= accordion('you-will-need', t('devise.registrations.start.accordion')) do %> | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('get-started/email-password.svg'), | ||
| size: '40', alt: '', class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('devise.registrations.start.bullet_1_html') %> | ||
| </span> | ||
| </p> | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('get-started/2FA.svg'), size: '40', alt: '', | ||
| class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('devise.registrations.start.bullet_2_html') %> | ||
| </span> | ||
| </p> | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('get-started/personal-details.svg'), | ||
| size: '40', alt: '', class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('devise.registrations.start.bullet_3_html') %> | ||
| </span> | ||
| </p> | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('get-started/personal-details.svg'), | ||
| size: '40', alt: '', class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('devise.registrations.start.bullet_4_html') %> | ||
| </span> | ||
| </p> | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('get-started/financial.svg'), | ||
| size: '40', alt: '', class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('devise.registrations.start.bullet_5_html') %> | ||
| </span> | ||
| </p> | ||
| <p class="clearfix"> | ||
| <%= image_tag(asset_url('p-key.svg'), size: '40', alt: '', class: 'mt-tiny col col-1') %> | ||
| <span class="col col-11 pl2"> | ||
| <%= t('devise.registrations.start.bullet_6_html') %> | ||
| </span> | ||
| </p> | ||
| <p class="mb3"> | ||
| <%= new_window_link_to t('devise.registrations.start.learn_more'), | ||
| MarketingSite.help_url %> | ||
| </p> | ||
| <% end %> | ||
| </div> |
33 changes: 0 additions & 33 deletions
33
app/views/sign_up/registrations/_required_pii_accordion.html.slim
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <% title t('titles.registrations.new') %> | ||
|
|
||
| <%= render 'shared/sp_alert' %> | ||
|
|
||
| <h1 class="h3 my0"> | ||
| <%= t('headings.add_email') %> | ||
| </h1> | ||
|
|
||
| <div class="mb4"> | ||
| <%= validated_form_for(@add_user_email_form, | ||
| html: { autocomplete: 'off', role: 'form' }, | ||
| url: add_email_path) do |f| %> | ||
| <%= f.input :email, label: t('forms.registration.labels.email'), required: true, | ||
| input_html: { aria: { invalid: false } } %> | ||
| <%= f.button :submit, t('forms.buttons.submit.default'), class: 'btn-wide' %> | ||
| <% end %> | ||
| </div> | ||
|
|
||
| <%= render 'shared/cancel', link: decorated_session.cancel_link_url %> | ||
|
|
||
| <p class="mt2"> | ||
| <%= new_window_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 %> | ||
| </p> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.