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
51 changes: 0 additions & 51 deletions app/assets/stylesheets/components/_i18n-dropdown.scss

This file was deleted.

100 changes: 100 additions & 0 deletions app/assets/stylesheets/components/_language-picker.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.language-picker {
position: relative;
width: auto;

.usa-accordion__content {
@include u-bg('primary');
@include u-border(1px, 'primary-darker');
margin: 0.25rem 0 0;
overflow: visible;
padding: 0;
position: absolute;
text-align: center;
width: 100%;
z-index: 10;
bottom: 100%;
}
}

.language-picker__label {
align-items: center;
display: flex;
background-position: right units(1.5) center;
background-position-y: calc(50% + 2px);
padding: units(0.5);
padding-left: units(1);
padding-right: units(1);
border-color: transparent;

@include at-media-max('tablet') {
justify-content: center;
border-radius: 0;
}

@include at-media('tablet') {
border-color: color('primary');

&,
&:hover {
color: color('white');
}
}

span {
margin: 0 units(1);
}

&::after {
content: '';
display: block;
width: 0.8125rem;
height: 0.8125rem;
background-size: 0.8125rem;
}

&.usa-accordion__button[aria-expanded='false'],
&.usa-accordion__button[aria-expanded='true'] {
background-image: none;
}

&.usa-accordion__button[aria-expanded='false'] {
&:hover {
background-color: transparent;
}

&::after {
background-image: url(identity-style-guide/dist/assets/img/angle-arrow-up.svg);

@include at-media('tablet') {
background-image: url(identity-style-guide/dist/assets/img/angle-arrow-up-white.svg);
}
}
}

&.usa-accordion__button[aria-expanded='true'] {
@include u-bg('primary');
color: color('white');

&::after {
background-image: url(identity-style-guide/dist/assets/img/angle-arrow-down-white.svg);
}
}
}

.language-picker__list {
@include list-reset;

a {
@include u-padding-y(1.5);
display: block;
color: color('white');

&:focus {
outline-offset: units(2px);
}
}

li + li {
border-top: 1px solid color('primary-darker');
}
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import 'full-screen';
@import 'hr';
@import 'icon';
@import 'language-picker';
@import 'list';
@import 'modal';
@import 'nav';
Expand All @@ -26,6 +27,5 @@
@import 'step-indicator';
@import 'troubleshooting-options';
@import 'validated-checkbox';
@import 'i18n-dropdown';
@import 'location-collection-item';
@import 'memorable-date';
3 changes: 0 additions & 3 deletions app/assets/stylesheets/utilities/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ body {
.fs-12p {
font-size: 12px;
}
.fs-13p {
font-size: 13px;
}
.fs-20p {
font-size: 20px;
}
Expand Down
32 changes: 32 additions & 0 deletions app/components/language_picker_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%= content_tag(:div, **tag_options, class: css_class) do %>
<%= content_tag(
:button,
class: 'usa-accordion__button language-picker__label',
aria: {
controls: "language-picker-#{unique_id}",
expanded: false,
},
) do %>
<%= image_tag(asset_url('globe-blue.svg'), width: 12, height: 12, alt: '', class: 'tablet:display-none') %>
<%= image_tag(asset_url('globe-white.svg'), width: 12, height: 12, alt: '', class: 'display-none tablet:display-inline') %>
<span id="language-picker-description-<%= unique_id %>">
<%= t('i18n.language') %>
</span>
<% end %>
<ul
id="language-picker-<%= unique_id %>"
aria-describedby="language-picker-description-<%= unique_id %>"
class="usa-accordion__content language-picker__list"
hidden
>
<% I18n.available_locales.each do |locale| %>
<li>
<%= link_to(
t("i18n.locale.#{locale}"),
url_generator.call(sanitized_request_params.merge(locale: locale)),
lang: locale,
) %>
</li>
<% end %>
</ul>
<% end %>
16 changes: 16 additions & 0 deletions app/components/language_picker_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class LanguagePickerComponent < BaseComponent
attr_reader :url_generator, :tag_options

def initialize(url_generator: method(:url_for), **tag_options)
@url_generator = url_generator
@tag_options = tag_options
end

def css_class
['language-picker', 'usa-accordion', *tag_options[:class]]
end

def sanitized_request_params
request.query_parameters.slice(:request_id)
end
end
2 changes: 0 additions & 2 deletions app/controllers/api/verify/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class DocumentCaptureController < BaseController
def create
result = Idv::ApiDocumentVerificationForm.new(
verify_params,
liveness_checking_enabled: false,
analytics: analytics,
irs_attempts_api_tracker: irs_attempts_api_tracker,
flow_path: params[:flow_path],
Expand Down Expand Up @@ -37,7 +36,6 @@ def enqueue_job
}
Idv::Agent.new(applicant).proof_document(
verify_document_capture_session,
liveness_checking_enabled: false,
trace_id: amzn_trace_id,
image_metadata: image_metadata,
analytics_data: {
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/concerns/verify_profile_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def user_last_signed_in_more_than_5_months_ago?

def profile_needs_verification?
return false if current_user.blank?
return false if sp_session[:ial2_strict] &&
!IdentityConfig.store.gpo_allowed_for_strict_ial2
current_user.decorate.pending_profile_requires_verification? ||
user_needs_to_reactivate_account?
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/capture_doc_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CaptureDocController < ApplicationController
step_url: :idv_capture_doc_step_url,
final_url: :root_url,
flow: Idv::Flows::CaptureDocFlow,
analytics_id: Analytics::DOC_AUTH,
analytics_id: 'Doc Auth',
}.freeze

def return_to_sp
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/idv/doc_auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ class DocAuthController < ApplicationController
step_url: :idv_doc_auth_step_url,
final_url: :idv_review_url,
flow: Idv::Flows::DocAuthFlow,
analytics_id: Analytics::DOC_AUTH,
analytics_id: 'Doc Auth',
}.freeze

def return_to_sp
redirect_to return_to_sp_failure_to_proof_url(step: next_step, location: params[:location])
end

def redirect_if_pending_profile
return if sp_session[:ial2_strict] &&
!IdentityConfig.store.gpo_allowed_for_strict_ial2
redirect_to idv_gpo_verify_url if current_user.decorate.pending_profile_requires_verification?
end

Expand Down
7 changes: 0 additions & 7 deletions app/controllers/idv/gpo_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class GpoController < ApplicationController
before_action :confirm_idv_needed
before_action :confirm_user_completed_idv_profile_step
before_action :confirm_mail_not_spammed
before_action :confirm_gpo_allowed_if_strict_ial2

def index
@presenter = GpoPresenter.new(current_user, url_options)
Expand Down Expand Up @@ -57,12 +56,6 @@ def resend_requested?
current_user.decorate.pending_profile_requires_verification?
end

def confirm_gpo_allowed_if_strict_ial2
return unless sp_session[:ial2_strict]
return if IdentityConfig.store.gpo_allowed_for_strict_ial2
redirect_to idv_phone_url
end

def confirm_mail_not_spammed
redirect_to idv_review_url if idv_session.address_mechanism_chosen? &&
gpo_mail_service.mail_spammed?
Expand Down
1 change: 0 additions & 1 deletion app/controllers/idv/image_uploads_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def create
def image_upload_form
@image_upload_form ||= Idv::ApiImageUploadForm.new(
params,
liveness_checking_enabled: false,
service_provider: current_sp,
analytics: analytics,
uuid_prefix: current_sp&.app_id,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/inherited_proofing_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InheritedProofingController < ApplicationController
step_url: :idv_inherited_proofing_step_url,
final_url: :idv_phone_url,
flow: Idv::Flows::InheritedProofingFlow,
analytics_id: nil,
analytics_id: 'Inherited Proofing',
}.freeze

def return_to_sp
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/idv/otp_delivery_method_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ def otp_delivery_selection_form
def gpo_letter_available
return @gpo_letter_available if defined?(@gpo_letter_available)
@gpo_letter_available ||= FeatureManagement.enable_gpo_verification? &&
!Idv::GpoMail.new(current_user).mail_spammed? &&
!(sp_session[:ial2_strict] &&
!IdentityConfig.store.gpo_allowed_for_strict_ial2)
!Idv::GpoMail.new(current_user).mail_spammed?
end
end
end
4 changes: 1 addition & 3 deletions app/controllers/idv/phone_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ def new_phone_added?
def gpo_letter_available
return @gpo_letter_available if defined?(@gpo_letter_available)
@gpo_letter_available ||= FeatureManagement.enable_gpo_verification? &&
!Idv::GpoMail.new(current_user).mail_spammed? &&
!(sp_session[:ial2_strict] &&
!IdentityConfig.store.gpo_allowed_for_strict_ial2)
!Idv::GpoMail.new(current_user).mail_spammed?
end
end
end
4 changes: 1 addition & 3 deletions app/controllers/idv/phone_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ def track_event(type:)
def set_gpo_letter_available
return @gpo_letter_available if defined?(@gpo_letter_available)
@gpo_letter_available ||= FeatureManagement.enable_gpo_verification? &&
!Idv::GpoMail.new(current_user).mail_spammed? &&
!(sp_session[:ial2_strict] &&
!IdentityConfig.store.gpo_allowed_for_strict_ial2)
!Idv::GpoMail.new(current_user).mail_spammed?
end
# rubocop:enable Naming/MemoizedInstanceVariableName
end
Expand Down
9 changes: 2 additions & 7 deletions app/controllers/openid_connect/authorization_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,10 @@ def track_authorize_analytics(result)
end

def identity_needs_verification?
((@authorize_form.ial2_requested? || @authorize_form.ial2_strict_requested?) &&
(@authorize_form.ial2_requested? &&
(current_user.decorate.identity_not_verified? ||
decorated_session.requested_more_recent_verification?)) ||
current_user.decorate.reproof_for_irs?(service_provider: current_sp) ||
identity_needs_strict_ial2_verification?
end

def identity_needs_strict_ial2_verification?
@authorize_form.ial2_strict_requested? && !current_user.active_profile&.strict_ial2_proofed?
current_user.decorate.reproof_for_irs?(service_provider: current_sp)
end

def build_authorize_form_from_params
Expand Down
Loading