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
4 changes: 3 additions & 1 deletion app/controllers/idv/in_person/address_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def self.step_info
controller: self,
next_steps: [:ipp_ssn],
preconditions: ->(idv_session:, user:) {
idv_session.ipp_state_id_complete?
# Handling passport navigation with checking in_person_passports_allowed? since passport
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍🏻

# form is not setup yet. This should be updated during LG-15985 implmentation.
idv_session.ipp_state_id_complete? || idv_session.in_person_passports_allowed?
},
undo_step: ->(idv_session:, user:) do
idv_session.invalidate_in_person_address_step!
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/idv/in_person/passport_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def show
analytics.idv_in_person_proofing_passport_visited(**analytics_arguments)
end

def update
redirect_to idv_in_person_address_path
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question: Are there PII-like keypaths that need to be redacted as part of event that gets logged on submission of address?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It looks like the only thing we log in the address submitted event is the zipcode for the current address.

end

def extra_view_variables
{
form:,
Expand Down
34 changes: 34 additions & 0 deletions app/views/idv/in_person/verify_info/_address_section.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 padding-top-1 border-bottom border-primary-light">
<dl class='grid-col-fill margin-y-0'>
<div class="padding-y-1">
<h2 class="h4 margin-y-0"><%= t('headings.residential_address') %></h2>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address2].presence %> </dd>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice use of presence.

</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= link_to(
t('idv.buttons.change_label'),
idv_in_person_address_url,
'aria-label': t('idv.buttons.change_address_label'),
) %>
</div>
</div>
26 changes: 26 additions & 0 deletions app/views/idv/in_person/verify_info/_ssn_section.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div class="grid-row grid-gap grid-gap-2 padding-top-1">
<div class='grid-col-fill'>
<div class="padding-y-1">
<h2 class="h4 margin-y-0"><%= t('headings.ssn') %></h2>
</div>
<%= t('idv.form.ssn') %>:
<%= render(
'shared/masked_text',
text: SsnFormatter.format(@ssn),
masked_text: SsnFormatter.format_masked(@ssn),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
first_number: @ssn[0],
last_number: @ssn[-1],
),
toggle_label: t('forms.ssn.show'),
) %>
</div>
<div class='grid-auto'>
<%= link_to(
t('idv.buttons.change_label'),
idv_in_person_ssn_url,
'aria-label': t('idv.buttons.change_ssn_label'),
) %>
</div>
</div>
56 changes: 56 additions & 0 deletions app/views/idv/in_person/verify_info/_state_id_section.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 border-bottom border-primary-light">
<dl class="grid-col-fill margin-y-0">
<div class="padding-y-1">
<h2 class="h4 margin-y-0"><%= t('headings.state_id') %></h2>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.first_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:first_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.last_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:last_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.dob') %>: </dt>
<dd class="display-inline margin-left-0">
<%= I18n.l(Date.parse(@pii[:dob]), format: I18n.t('time.formats.event_date')) %>
</dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.issuing_state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_jurisdiction] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.id_number') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_number] %> </dd>
</div>
<div class="margin-top-105">
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address2].presence %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address_state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= link_to(
idv_in_person_state_id_url,
class: 'usa-button usa-button--unstyled padding-y-1',
'aria-label': t('idv.buttons.change_state_id_label'),
) { t('idv.buttons.change_label') } %>
</div>
</div>
153 changes: 21 additions & 132 deletions app/views/idv/in_person/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,140 +23,29 @@ locals:

<%= render PageHeadingComponent.new.with_content(t('headings.verify')) %>
<div class='margin-top-4 margin-bottom-2'>
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 border-bottom border-primary-light">
<dl class="grid-col-fill margin-y-0">
<div class="padding-y-1">
<h2 class="h4 margin-y-0"><%= t('headings.state_id') %></h2>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.first_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:first_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.last_name') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:last_name] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.dob') %>: </dt>
<dd class="display-inline margin-left-0">
<%= I18n.l(Date.parse(@pii[:dob]), format: I18n.t('time.formats.event_date')) %>
</dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.issuing_state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_jurisdiction] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.id_number') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state_id_number] %> </dd>
</div>
<div class="margin-top-105">
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address2].presence %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_address_state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:identity_doc_zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= link_to(
idv_in_person_state_id_url,
class: 'usa-button usa-button--unstyled padding-y-1',
'aria-label': t('idv.buttons.change_state_id_label'),
) { t('idv.buttons.change_label') } %>
</div>
</div>
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 padding-top-1 border-bottom border-primary-light">
<dl class='grid-col-fill margin-y-0'>
<div class="padding-y-1">
<h2 class="h4 margin-y-0"><%= t('headings.residential_address') %></h2>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address1') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address1] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.address2') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:address2].presence %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.city') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:city] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.state') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:state] %> </dd>
</div>
<div>
<dt class="display-inline"> <%= t('idv.form.zipcode') %>: </dt>
<dd class="display-inline margin-left-0"> <%= @pii[:zipcode] %> </dd>
</div>
</dl>
<div class='grid-auto'>
<%= link_to(
t('idv.buttons.change_label'),
idv_in_person_address_url,
'aria-label': t('idv.buttons.change_address_label'),
) %>
</div>
</div>
<div class="grid-row grid-gap grid-gap-2 padding-top-1">
<div class='grid-col-fill'>
<div class="padding-y-1">
<h2 class="h4 margin-y-0"><%= t('headings.ssn') %></h2>
</div>
<%= t('idv.form.ssn') %>:
<%= render(
'shared/masked_text',
text: SsnFormatter.format(@ssn),
masked_text: SsnFormatter.format_masked(@ssn),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
first_number: @ssn[0],
last_number: @ssn[-1],
),
toggle_label: t('forms.ssn.show'),
) %>
</div>
<div class='grid-auto'>
<%= link_to(
t('idv.buttons.change_label'),
idv_in_person_ssn_url,
'aria-label': t('idv.buttons.change_ssn_label'),
) %>
</div>
</div>
<% if !@pii[:state_id_number].nil? %>
<%= render 'state_id_section', pii: @pii %>
<% end %>
<%= render 'address_section', pii: @pii %>
<%= render 'ssn_section', ssn: @ssn %>
<div class="margin-top-5">
<%= render SpinnerButtonComponent.new(
url: idv_in_person_verify_info_path,
big: true,
wide: true,
action_message: t('idv.messages.verifying'),
method: :put,
form: {
class: 'button_to',
data: {
form_steps_wait: '',
error_message: t('idv.failure.exceptions.internal_error'),
alert_target: '#form-steps-wait-alert',
wait_step_path: idv_in_person_verify_info_path,
poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000,
},
<%= render SpinnerButtonComponent.new(
url: idv_in_person_verify_info_path,
big: true,
wide: true,
action_message: t('idv.messages.verifying'),
method: :put,
form: {
class: 'button_to',
data: {
form_steps_wait: '',
error_message: t('idv.failure.exceptions.internal_error'),
alert_target: '#form-steps-wait-alert',
wait_step_path: idv_in_person_verify_info_path,
poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000,
},
).with_content(t('forms.buttons.submit.default')) %>
},
).with_content(t('forms.buttons.submit.default')) %>
</div>
</div>

Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@
as: :in_person_ready_to_verify
post '/in_person/usps_locations' => 'in_person/usps_locations#index'
put '/in_person/usps_locations' => 'in_person/usps_locations#update'
get '/in_person/passport' => 'in_person/passport#show'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@shanechesnutt-ft Show is a dup. I will clean it up in my branch #12135

put '/in_person/passport' => 'in_person/passport#update'
get '/in_person/state_id' => 'in_person/state_id#show'
put '/in_person/state_id' => 'in_person/state_id#update'
get '/in_person/address' => 'in_person/address#show'
Expand Down
5 changes: 5 additions & 0 deletions lib/idp/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ module Vendors
same_address_as_id: 'true',
}.freeze

MOCK_IPP_PASSPORT_APPLICANT = {
passport_number: '123456789',
passport_expiration_date: (DateTime.now.utc + 1.year).to_s,
}.freeze

MOCK_IDV_APPLICANT_WITH_PASSPORT = MOCK_IDV_APPLICANT.select do |field, _value|
%i[first_name middle_name last_name dob sex].include?(field)
end.merge(
Expand Down
56 changes: 56 additions & 0 deletions spec/controllers/idv/in_person/address_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,65 @@
state: state,
} }
end

it 'returns a valid StepInfo object' do
expect(Idv::InPerson::AddressController.step_info).to be_valid
end

context 'preconditions' do
context 'when ipp_state_id steps have been completed' do
before do
allow(subject.idv_session).to receive(:ipp_state_id_complete?).and_return(true)
end

it 'returns true' do
expect(
described_class.step_info.preconditions.call(idv_session: subject.idv_session, user:),
).to be(true)
end
end

context 'when ipp_state_id steps have not been completed' do
before do
allow(subject.idv_session).to receive(:ipp_state_id_complete?).and_return(false)
end

context 'when in_person passports are allowed' do
before do
allow(subject.idv_session).to receive(:in_person_passports_allowed?).and_return(true)
end

it 'returns true' do
expect(
described_class.step_info.preconditions.call(idv_session: subject.idv_session, user:),
).to be(true)
end
end

context 'when in_person passports are not allowed' do
before do
allow(subject.idv_session).to receive(:in_person_passports_allowed?).and_return(false)
end

it 'returns false' do
expect(
described_class.step_info.preconditions.call(idv_session: subject.idv_session, user:),
).to be(false)
end
end
end
end

context 'undo_step' do
before do
allow(subject.idv_session).to receive(:invalidate_in_person_address_step!)
described_class.step_info.undo_step.call(idv_session: subject.idv_session, user:)
end

it 'invalidates the ipp_address step' do
expect(subject.idv_session).to have_received(:invalidate_in_person_address_step!)
end
end
end

describe 'before_actions' do
Expand Down
Loading