Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4e528b6
First pass at copying verify page into IPP flow
Jun 16, 2022
ba5567b
Start adding actions for IPP flow
Jun 17, 2022
6fd2b0f
Allow updating SSN
Jun 21, 2022
d04dc06
Functional verify pages in doc auth and IPP
Jun 21, 2022
2835214
Rename RedoAddress namespace to be consistent
Jun 22, 2022
55474bf
Make the update state ID page functional
Jun 22, 2022
947f4db
Functional update address page
Jun 22, 2022
ac4fffa
Functional update SSN page
Jun 22, 2022
93c4e7d
Swap state ID and dob displays
Jun 22, 2022
8317d56
Get rid of outdated data fudging
Jun 22, 2022
129a474
Cleanup
Jun 23, 2022
beeb328
Add es and fr translations
Jun 23, 2022
5b3ee22
Normalize yaml
Jun 23, 2022
de63612
Update es and fr translations
Jun 23, 2022
b029f11
Remove unused translations
Jun 23, 2022
5b21e99
Merge remote-tracking branch 'origin/main' into sbachstein/lg-6349-ad…
Jun 23, 2022
c2aa758
changelog: Upcoming Features, In-person proofing, Add verify page to …
Jun 23, 2022
8d3edf8
Normalize yaml
Jun 23, 2022
6956632
Use correct heading
Jun 23, 2022
531f98a
Fix broken specs
Jun 23, 2022
6719404
Simplify conditional IPP logic
Jun 23, 2022
06aa732
Check user info on the verify page
Jun 24, 2022
3c582b3
Pre-populate same address radio button
Jun 24, 2022
19e6010
Navigate to each update page
Jun 24, 2022
e8051ec
Add spec for verify step call
Jun 24, 2022
9d67577
Merge remote-tracking branch 'origin/main' into sbachstein/lg-6349-ad…
Jun 24, 2022
c082fd2
Remove unnecessary padding
Jun 24, 2022
35c05f9
Defensive programming
Jun 27, 2022
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
11 changes: 11 additions & 0 deletions app/services/idv/actions/ipp/redo_address_action.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Idv
module Actions
module Ipp
class RedoAddressAction < Idv::Steps::DocAuthBaseStep
def call
mark_step_incomplete(:address)
end
end
end
end
end
11 changes: 11 additions & 0 deletions app/services/idv/actions/ipp/redo_state_id_action.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Idv
module Actions
module Ipp
class RedoStateIdAction < Idv::Steps::DocAuthBaseStep
def call
mark_step_incomplete(:state_id)
end
end
end
end
end
9 changes: 9 additions & 0 deletions app/services/idv/actions/redo_address_action.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Idv
module Actions
class RedoAddressAction < Idv::Steps::DocAuthBaseStep
def call
redirect_to idv_address_url
end
end
end
end
1 change: 1 addition & 0 deletions app/services/idv/flows/doc_auth_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DocAuthFlow < Flow::BaseFlow
cancel_send_link: Idv::Actions::CancelSendLinkAction,
cancel_link_sent: Idv::Actions::CancelLinkSentAction,
cancel_update_ssn: Idv::Actions::CancelUpdateSsnAction,
redo_address: Idv::Actions::RedoAddressAction,
redo_ssn: Idv::Actions::RedoSsnAction,
redo_document_capture: Idv::Actions::RedoDocumentCaptureAction,
verify_document: Idv::Actions::VerifyDocumentAction,
Expand Down
17 changes: 6 additions & 11 deletions app/services/idv/flows/in_person_flow.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Idv
module Flows
class InPersonFlow < Flow::BaseFlow
attr_reader :idv_session # this is used by DocAuthBaseStep

STEPS = {
location: Idv::Steps::Ipp::LocationStep,
welcome: Idv::Steps::Ipp::WelcomeStep, # instructions
Expand All @@ -11,6 +13,9 @@ class InPersonFlow < Flow::BaseFlow
}.freeze

ACTIONS = {
redo_state_id: Idv::Actions::Ipp::RedoStateIdAction,
redo_address: Idv::Actions::Ipp::RedoAddressAction,
redo_ssn: Idv::Actions::RedoSsnAction,
}.freeze

# WILLFIX: (LG-6308) move this to the barcode page when we finish setting up IPP step
Expand All @@ -33,17 +38,7 @@ def initialize(controller, session, name)
end

def self.session_idv(session)
session[:idv] ||= { params: {}, step_attempts: { phone: 0 } }

# WILLFIX: remove the line below when we're collecting all user data
session[:idv][:applicant] ||= Idp::Constants::MOCK_IDV_APPLICANT_WITH_SSN.dup

# WILLFIX: (LG-6349) remove this block when we implement the verify page
session[:idv]['profile_confirmation'] = true
session[:idv]['vendor_phone_confirmation'] = false
session[:idv]['user_phone_confirmation'] = false
session[:idv]['address_verification_mechanism'] = 'phone'
session[:idv]['resolution_successful'] = 'phone'
session[:idv] ||= {}
end
end
end
Expand Down
7 changes: 7 additions & 0 deletions app/services/idv/steps/ipp/address_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ def call
end
end

def extra_view_variables
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.

what are extra view variables?

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.

The flow state machine is like a mini version of a rails controller, so the way a controller assigns @variables to be exposed in templates, the flow state machine calls this method that returns a hash that is exposed to the templates

{
pii: flow_session[:pii_from_user],
updating_address: flow_session[:pii_from_user].has_key?(:address1),
}
end

private

def form_submit
Expand Down
2 changes: 1 addition & 1 deletion app/services/idv/steps/ipp/ssn_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def call

def extra_view_variables
{
applicant_ssn: flow_session[:pii_from_user][:ssn],
updating_ssn: flow_session[:pii_from_user][:ssn].present?,
}
end

Expand Down
7 changes: 7 additions & 0 deletions app/services/idv/steps/ipp/state_id_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ def call
end
end

def extra_view_variables
{
pii: flow_session[:pii_from_user],
updating_state_id: flow_session[:pii_from_user].has_key?(:first_name),
}
end

private

def form_submit
Expand Down
13 changes: 12 additions & 1 deletion app/services/idv/steps/ipp/verify_step.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
module Idv
module Steps
module Ipp
class VerifyStep < DocAuthBaseStep
class VerifyStep < VerifyBaseStep
STEP_INDICATOR_STEP = :verify_info
def call
# WILLFIX: (LG-6498) make a call to Instant Verify before allowing the user to continue
save_legacy_state
delete_pii

# send the user to the phone page where they'll continue the remainder of
# the idv flow
redirect_to idv_phone_url
end

def extra_view_variables
{
pii: pii,
step_url: method(:idv_in_person_step_url),
}
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/services/idv/steps/ssn_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def call

def extra_view_variables
{
applicant_ssn: flow_session[:pii_from_doc][:ssn],
updating_ssn: flow_session[:pii_from_doc][:ssn].present?,
}
end

Expand Down
7 changes: 7 additions & 0 deletions app/services/idv/steps/verify_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ def call
enqueue_job
end

def extra_view_variables
{
pii: pii,
step_url: method(:idv_doc_auth_step_url),
}
end

private

def enqueue_job
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/doc_auth/ssn.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: applicant_ssn.blank?, updating_ssn: applicant_ssn %>
<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: !updating_ssn, updating_ssn: updating_ssn %>
82 changes: 1 addition & 81 deletions app/views/idv/doc_auth/verify.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,84 +18,4 @@
<% end %>
<% end %>

<% title t('titles.doc_auth.verify_info') %>

<%= render PageHeadingComponent.new.with_content(t('doc_auth.headings.verify')) %>
<div class='margin-top-4 margin-bottom-2'>
<div>
<%= "#{t('doc_auth.forms.first_name')}: #{flow_session[:pii_from_doc][:first_name]}" %>
</div>
<div>
<%= "#{t('doc_auth.forms.last_name')}: #{flow_session[:pii_from_doc][:last_name]}" %>
</div>
<div class='padding-bottom-1'>
<%= "#{t('doc_auth.forms.dob')}: #{flow_session[:pii_from_doc][:dob]}" %>
</div>
<div class="grid-row grid-gap grid-gap-2 padding-bottom-1 padding-top-1 border-y border-primary-light">
<div class='grid-col-fill'>
<div>
<%= "#{t('doc_auth.forms.address1')}: #{flow_session[:pii_from_doc][:address1]}" %>
</div>
<div>
<%= "#{t('doc_auth.forms.city')}: #{flow_session[:pii_from_doc][:city]}" %>
</div>
<div>
<%= "#{t('doc_auth.forms.state')}: #{flow_session[:pii_from_doc][:state]}" %>
</div>
<div>
<%= "#{t('doc_auth.forms.zip_code')}: #{flow_session[:pii_from_doc][:zipcode]}" %>
</div>
</div>
<div class='grid-auto'>
<%= link_to(t('doc_auth.buttons.change_address'), idv_address_url, 'aria-label': t('doc_auth.buttons.change_address_label')) %>
</div>
</div>
<div class="grid-row grid-gap grid-gap-2 padding-top-1">
<div class='grid-col-fill'>
<%= t('doc_auth.forms.ssn') %>:
<%= render(
'shared/masked_text',
text: SsnFormatter.format(flow_session[:pii_from_doc][:ssn]),
masked_text: SsnFormatter.format_masked(flow_session[:pii_from_doc][:ssn]),
accessible_masked_text: t(
'idv.accessible_labels.masked_ssn',
first_number: flow_session[:pii_from_doc][:ssn][0],
last_number: flow_session[:pii_from_doc][:ssn][-1],
),
toggle_label: t('forms.ssn.show'),
) %>
</div>
<div class='grid-auto'>
<%= button_to(
idv_doc_auth_step_path(step: :redo_ssn),
method: :put,
class: 'usa-button usa-button--unstyled',
'aria-label': t('doc_auth.buttons.change_ssn_label'),
) { t('doc_auth.buttons.change_ssn') } %>
</div>
</div>
<div class="margin-top-5">
<%= render SpinnerButtonComponent.new(
action: ->(**tag_options, &block) do
button_to(url_for, **tag_options, &block)
end,
big: true,
wide: true,
action_message: t('doc_auth.info.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_doc_auth_step_path(step: :verify_wait),
poll_interval_ms: IdentityConfig.store.poll_rate_for_verify_in_seconds * 1000,
},
},
).with_content(t('forms.buttons.continue')) %>
</div>
</div>

<% javascript_packs_tag_once 'form-steps-wait' %>
<%= render 'idv/doc_auth/start_over_or_cancel', step: 'verify' %>
<%= render 'idv/shared/verify', pii: pii, step_url: step_url, remote_identity_proofing: true %>
56 changes: 33 additions & 23 deletions app/views/idv/in_person/address.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<% title t('titles.doc_auth.verify') %>

<%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.address')) %>
<% if updating_address %>
<%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.update_address')) %>
<% else %>
<%= render PageHeadingComponent.new.with_content(t('in_person_proofing.headings.address')) %>
<% end %>

<p>
<%= t('in_person_proofing.body.address.info') %>
Expand All @@ -12,64 +16,70 @@
html: { autocomplete: 'off' }
) do |f| %>
<%= render ValidatedFieldComponent.new(
name: :address1,
form: f,
input_html: { value: pii[:address1] },
label: t('in_person_proofing.form.address.address1'),
required: true,
maxlength: 255,
label_html: { class: 'usa-label' },
maxlength: 255,
name: :address1,
required: true,
Comment on lines -15 to +25
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.

The reason there's so much noise in this file is that I sorted these keys alphabetically in addition to making them pre-populate with whatever values the user previously entered

) %>
<%= render ValidatedFieldComponent.new(
name: :address2,
form: f,
input_html: { value: pii[:address2] },
label: t('in_person_proofing.form.address.address2'),
required: false,
maxlength: 255,
label_html: { class: 'usa-label' },
maxlength: 255,
name: :address2,
required: false,
) %>
<%= render ValidatedFieldComponent.new(
name: :city,
form: f,
input_html: { value: pii[:city] },
label: t('in_person_proofing.form.address.city'),
required: true,
maxlength: 255,
label_html: { class: 'usa-label' },
maxlength: 255,
name: :city,
required: true,
) %>
<%= render ValidatedFieldComponent.new(
name: :state,
form: f,
collection: us_states_territories,
form: f,
label: t('in_person_proofing.form.address.state'),
label_html: { class: 'usa-label' },
name: :state,
prompt: t('in_person_proofing.form.address.state_prompt'),
required: true,
label_html: { class: 'usa-label' },
selected: pii[:state],
) %>

<div class="tablet:grid-col-6">
<%# using :tel for mobile numeric keypad %>
<%= render ValidatedFieldComponent.new(
name: :zipcode,
form: f,
as: :tel,
error_messages: { patternMismatch: t('idv.errors.pattern_mismatch.zipcode') },
form: f,
input_html: { value: pii[:zipcode] },
label: t('in_person_proofing.form.address.zipcode'),
required: true,
pattern: '\d{5}([\-]\d{4})?',
label_html: { class: 'usa-label' },
error_messages: { patternMismatch: t('idv.errors.pattern_mismatch.zipcode') },
name: :zipcode,
pattern: '\d{5}([\-]\d{4})?',
required: true,
) %>
</div>

<%= render ValidatedFieldComponent.new(
name: :same_address_as_id,
form: f,
as: :radio_buttons,
wrapper: :uswds_radio_buttons,
label: t('in_person_proofing.form.address.same_address'),
required: true,
checked: pii[:same_address_as_id],
collection: [
[t('in_person_proofing.form.address.same_address_choice_yes'), true],
[t('in_person_proofing.form.address.same_address_choice_no'), false],
],
form: f,
label: t('in_person_proofing.form.address.same_address'),
name: :same_address_as_id,
required: true,
wrapper: :uswds_radio_buttons,
) %>

<%= render ButtonComponent.new(big: true, wide: true, class: 'margin-top-1') do %>
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
@@ -1 +1 @@
<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: false, updating_ssn: applicant_ssn %>
<%= render 'idv/shared/ssn', flow_session: flow_session, success_alert_enabled: false, updating_ssn: updating_ssn %>
Loading