From 9dbeac14521ad8a34e74ac5a8145229fa07d8bc7 Mon Sep 17 00:00:00 2001 From: Jonathan Hooper Date: Tue, 25 Jun 2019 11:09:19 -0400 Subject: [PATCH 1/3] Revert "Revert "LG-929 In Person Proofing Flow (#3031)" (#3039)" This reverts commit 314f96b8d4b0b1f3dc0fc8bf36b8a9b595975a59. --- app/assets/images/idv/bar_code.png | Bin 0 -> 2802 bytes app/assets/stylesheets/components/_color.scss | 1 + app/controllers/idv/in_person_controller.rb | 14 ++ app/models/profile.rb | 1 + app/services/analytics.rb | 1 + app/services/idv/flows/in_person_flow.rb | 30 ++++ app/services/idv/steps/ipp/bar_code_step.rb | 9 ++ app/services/idv/steps/ipp/encrypt_step.rb | 9 ++ app/services/idv/steps/ipp/enter_info_step.rb | 9 ++ app/services/idv/steps/ipp/find_usps_step.rb | 9 ++ app/services/idv/steps/ipp/usps_list_step.rb | 9 ++ app/services/idv/steps/ipp/verify_step.rb | 9 ++ app/services/idv/steps/ipp/welcome_step.rb | 9 ++ .../idv/capture_doc/back_image.html.slim | 4 +- .../capture_mobile_back_image.html.slim | 4 +- .../idv/capture_doc/front_image.html.slim | 4 +- .../capture_doc/mobile_front_image.html.slim | 4 +- .../idv/doc_auth/_error_messages.html.slim | 5 + .../_in_person_proofing_option.html.slim | 3 + app/views/idv/doc_auth/back_image.html.slim | 4 +- app/views/idv/doc_auth/front_image.html.slim | 4 +- .../idv/doc_auth/mobile_back_image.html.slim | 4 +- .../idv/doc_auth/mobile_front_image.html.slim | 4 +- .../in_person/_start_over_or_cancel.html.slim | 4 + app/views/idv/in_person/bar_code.html.slim | 42 +++++ app/views/idv/in_person/encrypt.html.slim | 17 +++ app/views/idv/in_person/enter_info.html.erb | 144 ++++++++++++++++++ app/views/idv/in_person/find_usps.html.slim | 22 +++ app/views/idv/in_person/usps_list.html.erb | 62 ++++++++ app/views/idv/in_person/verify.html.slim | 25 +++ app/views/idv/in_person/welcome.html.slim | 49 ++++++ .../idv/shared/verification_failure.html.slim | 2 + config/locales/in_person_proofing/en.yml | 51 +++++++ config/locales/in_person_proofing/es.yml | 51 +++++++ config/locales/in_person_proofing/fr.yml | 51 +++++++ config/routes.rb | 5 + lib/feature_management.rb | 4 + .../idv/doc_auth/front_image_step_spec.rb | 15 ++ .../features/idv/doc_auth/verify_step_spec.rb | 15 ++ .../idv/in_person/bar_code_step_spec.rb | 21 +++ .../idv/in_person/encrypt_step_spec.rb | 21 +++ .../idv/in_person/enter_info_step_spec.rb | 21 +++ .../idv/in_person/find_usps_step_spec.rb | 22 +++ .../idv/in_person/usps_list_step_spec.rb | 20 +++ .../idv/in_person/verify_step_spec.rb | 21 +++ .../idv/in_person/welcome_step_spec.rb | 15 ++ spec/support/features/in_person_helper.rb | 68 +++++++++ 47 files changed, 894 insertions(+), 24 deletions(-) create mode 100644 app/assets/images/idv/bar_code.png create mode 100644 app/controllers/idv/in_person_controller.rb create mode 100644 app/services/idv/flows/in_person_flow.rb create mode 100644 app/services/idv/steps/ipp/bar_code_step.rb create mode 100644 app/services/idv/steps/ipp/encrypt_step.rb create mode 100644 app/services/idv/steps/ipp/enter_info_step.rb create mode 100644 app/services/idv/steps/ipp/find_usps_step.rb create mode 100644 app/services/idv/steps/ipp/usps_list_step.rb create mode 100644 app/services/idv/steps/ipp/verify_step.rb create mode 100644 app/services/idv/steps/ipp/welcome_step.rb create mode 100644 app/views/idv/doc_auth/_error_messages.html.slim create mode 100644 app/views/idv/doc_auth/_in_person_proofing_option.html.slim create mode 100644 app/views/idv/in_person/_start_over_or_cancel.html.slim create mode 100644 app/views/idv/in_person/bar_code.html.slim create mode 100644 app/views/idv/in_person/encrypt.html.slim create mode 100644 app/views/idv/in_person/enter_info.html.erb create mode 100644 app/views/idv/in_person/find_usps.html.slim create mode 100644 app/views/idv/in_person/usps_list.html.erb create mode 100644 app/views/idv/in_person/verify.html.slim create mode 100644 app/views/idv/in_person/welcome.html.slim create mode 100644 config/locales/in_person_proofing/en.yml create mode 100644 config/locales/in_person_proofing/es.yml create mode 100644 config/locales/in_person_proofing/fr.yml create mode 100644 spec/features/idv/in_person/bar_code_step_spec.rb create mode 100644 spec/features/idv/in_person/encrypt_step_spec.rb create mode 100644 spec/features/idv/in_person/enter_info_step_spec.rb create mode 100644 spec/features/idv/in_person/find_usps_step_spec.rb create mode 100644 spec/features/idv/in_person/usps_list_step_spec.rb create mode 100644 spec/features/idv/in_person/verify_step_spec.rb create mode 100644 spec/features/idv/in_person/welcome_step_spec.rb create mode 100644 spec/support/features/in_person_helper.rb diff --git a/app/assets/images/idv/bar_code.png b/app/assets/images/idv/bar_code.png new file mode 100644 index 0000000000000000000000000000000000000000..d3d7cab885cfa4ba3e95565cdb41fe58dad6a3a8 GIT binary patch literal 2802 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 YqyK%u*e_>1*ad*8p@l*9b=UiU18`+ZXaE2J literal 0 HcmV?d00001 diff --git a/app/assets/stylesheets/components/_color.scss b/app/assets/stylesheets/components/_color.scss index 572de70adf1..e5a78902226 100644 --- a/app/assets/stylesheets/components/_color.scss +++ b/app/assets/stylesheets/components/_color.scss @@ -1,3 +1,4 @@ @media #{$breakpoint-sm} { .sm-white { color: $white; } + .accent-blue { color: $blue; } } diff --git a/app/controllers/idv/in_person_controller.rb b/app/controllers/idv/in_person_controller.rb new file mode 100644 index 00000000000..6fbaabb7fe6 --- /dev/null +++ b/app/controllers/idv/in_person_controller.rb @@ -0,0 +1,14 @@ +module Idv + class InPersonController < ApplicationController + before_action :confirm_two_factor_authenticated + + include Flow::FlowStateMachine + + FSM_SETTINGS = { + step_url: :idv_in_person_step_url, + final_url: :account_url, + flow: Idv::Flows::InPersonFlow, + analytics_id: Analytics::IN_PERSON_PROOFING, + }.freeze + end +end diff --git a/app/models/profile.rb b/app/models/profile.rb index 69f7d20da3f..ecb9f7d4d69 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -15,6 +15,7 @@ class Profile < ApplicationRecord encryption_error: 2, verification_pending: 3, verification_cancelled: 4, + in_person_pending: 5, } attr_reader :personal_key diff --git a/app/services/analytics.rb b/app/services/analytics.rb index 2bb3d037fe0..ae7f3c4e72b 100644 --- a/app/services/analytics.rb +++ b/app/services/analytics.rb @@ -69,6 +69,7 @@ def browser_attributes ADD_EMAIL_VISIT = 'Add Email: enter email visited'.freeze CAPTURE_DOC = 'Capture Doc'.freeze # visited or submitted is appended DOC_AUTH = 'Doc Auth'.freeze # visited or submitted is appended + IN_PERSON_PROOFING = 'In Person Proofing'.freeze # visited or submitted is appended EMAIL_AND_PASSWORD_AUTH = 'Email and Password Authentication'.freeze EMAIL_DELETION_REQUEST = 'Email Deletion Requested'.freeze EVENT_DISAVOWAL = 'Event disavowal visited'.freeze diff --git a/app/services/idv/flows/in_person_flow.rb b/app/services/idv/flows/in_person_flow.rb new file mode 100644 index 00000000000..e4d40cd70b6 --- /dev/null +++ b/app/services/idv/flows/in_person_flow.rb @@ -0,0 +1,30 @@ +module Idv + module Flows + class InPersonFlow < Flow::BaseFlow + STEPS = { + welcome: Idv::Steps::Ipp::WelcomeStep, + find_usps: Idv::Steps::Ipp::FindUspsStep, + usps_list: Idv::Steps::Ipp::UspsListStep, + enter_info: Idv::Steps::Ipp::EnterInfoStep, + verify: Idv::Steps::Ipp::VerifyStep, + encrypt: Idv::Steps::Ipp::EncryptStep, + bar_code: Idv::Steps::Ipp::BarCodeStep, + }.freeze + + ACTIONS = { + reset: Idv::Actions::ResetAction, + }.freeze + + attr_reader :idv_session # this is needed to support (and satisfy) the current LOA3 flow + + def initialize(controller, session, name) + @idv_session = self.class.session_idv(session) + super(controller, STEPS, ACTIONS, session[name]) + end + + def self.session_idv(session) + session[:idv] ||= { params: {}, step_attempts: { phone: 0 } } + end + end + end +end diff --git a/app/services/idv/steps/ipp/bar_code_step.rb b/app/services/idv/steps/ipp/bar_code_step.rb new file mode 100644 index 00000000000..eaa1135760a --- /dev/null +++ b/app/services/idv/steps/ipp/bar_code_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class BarCodeStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/services/idv/steps/ipp/encrypt_step.rb b/app/services/idv/steps/ipp/encrypt_step.rb new file mode 100644 index 00000000000..9237396a686 --- /dev/null +++ b/app/services/idv/steps/ipp/encrypt_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class EncryptStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/services/idv/steps/ipp/enter_info_step.rb b/app/services/idv/steps/ipp/enter_info_step.rb new file mode 100644 index 00000000000..1beb415d0e8 --- /dev/null +++ b/app/services/idv/steps/ipp/enter_info_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class EnterInfoStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/services/idv/steps/ipp/find_usps_step.rb b/app/services/idv/steps/ipp/find_usps_step.rb new file mode 100644 index 00000000000..84028e84bee --- /dev/null +++ b/app/services/idv/steps/ipp/find_usps_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class FindUspsStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/services/idv/steps/ipp/usps_list_step.rb b/app/services/idv/steps/ipp/usps_list_step.rb new file mode 100644 index 00000000000..6fa0d401c28 --- /dev/null +++ b/app/services/idv/steps/ipp/usps_list_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class UspsListStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/services/idv/steps/ipp/verify_step.rb b/app/services/idv/steps/ipp/verify_step.rb new file mode 100644 index 00000000000..186759856ca --- /dev/null +++ b/app/services/idv/steps/ipp/verify_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class VerifyStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/services/idv/steps/ipp/welcome_step.rb b/app/services/idv/steps/ipp/welcome_step.rb new file mode 100644 index 00000000000..193b8e55513 --- /dev/null +++ b/app/services/idv/steps/ipp/welcome_step.rb @@ -0,0 +1,9 @@ +module Idv + module Steps + module Ipp + class WelcomeStep < DocAuthBaseStep + def call; end + end + end + end +end diff --git a/app/views/idv/capture_doc/back_image.html.slim b/app/views/idv/capture_doc/back_image.html.slim index 8f0d9a84435..aa0cfab46ca 100644 --- a/app/views/idv/capture_doc/back_image.html.slim +++ b/app/views/idv/capture_doc/back_image.html.slim @@ -10,9 +10,7 @@ h1.h3.my0 = t('doc_auth.headings.upload_back') .clearfix.mxn1 .sm-col.sm-col-8.px1.mt2 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session .mb4 id= 'target' .mt2 = render 'idv/doc_auth/submit_with_spinner' diff --git a/app/views/idv/capture_doc/capture_mobile_back_image.html.slim b/app/views/idv/capture_doc/capture_mobile_back_image.html.slim index f84d3b8a9d8..bc69021dbe1 100644 --- a/app/views/idv/capture_doc/capture_mobile_back_image.html.slim +++ b/app/views/idv/capture_doc/capture_mobile_back_image.html.slim @@ -17,9 +17,7 @@ ul .sm-col.sm-col-9.px1 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session div id= 'target' br diff --git a/app/views/idv/capture_doc/front_image.html.slim b/app/views/idv/capture_doc/front_image.html.slim index 0858c45aa48..adee4e1938e 100644 --- a/app/views/idv/capture_doc/front_image.html.slim +++ b/app/views/idv/capture_doc/front_image.html.slim @@ -11,9 +11,7 @@ h1.h3.my0 = t('doc_auth.headings.upload_front') .sm-col.sm-col-8.px1.mt2 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session .mb4 id= 'target' .mt2 diff --git a/app/views/idv/capture_doc/mobile_front_image.html.slim b/app/views/idv/capture_doc/mobile_front_image.html.slim index 327960ea731..5a7ee5b0626 100644 --- a/app/views/idv/capture_doc/mobile_front_image.html.slim +++ b/app/views/idv/capture_doc/mobile_front_image.html.slim @@ -17,9 +17,7 @@ ul .sm-col.sm-col-8.px1 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session div id= 'target' br diff --git a/app/views/idv/doc_auth/_error_messages.html.slim b/app/views/idv/doc_auth/_error_messages.html.slim new file mode 100644 index 00000000000..13fa7c36a22 --- /dev/null +++ b/app/views/idv/doc_auth/_error_messages.html.slim @@ -0,0 +1,5 @@ +- unless flow_session[:error_message].nil? + .alert.alert-error + = flow_session[:error_message] + = render 'idv/doc_auth/in_person_proofing_option' + .alert.alert-notice == flow_session[:notice] diff --git a/app/views/idv/doc_auth/_in_person_proofing_option.html.slim b/app/views/idv/doc_auth/_in_person_proofing_option.html.slim new file mode 100644 index 00000000000..274cc39c91c --- /dev/null +++ b/app/views/idv/doc_auth/_in_person_proofing_option.html.slim @@ -0,0 +1,3 @@ +- if FeatureManagement.in_person_proofing_enabled? + br + = link_to t('in_person_proofing.opt_in_link'), idv_in_person_step_path(:welcome) diff --git a/app/views/idv/doc_auth/back_image.html.slim b/app/views/idv/doc_auth/back_image.html.slim index a54039995c2..3871bb9d00f 100644 --- a/app/views/idv/doc_auth/back_image.html.slim +++ b/app/views/idv/doc_auth/back_image.html.slim @@ -11,9 +11,7 @@ h1.h3.my0 = t('doc_auth.headings.upload_back') .sm-col.sm-col-8.px1.mt2 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session .mb4 id= 'target' .mt2 = render 'idv/doc_auth/submit_with_spinner' diff --git a/app/views/idv/doc_auth/front_image.html.slim b/app/views/idv/doc_auth/front_image.html.slim index 8d817c95ccd..0f705d9b75b 100644 --- a/app/views/idv/doc_auth/front_image.html.slim +++ b/app/views/idv/doc_auth/front_image.html.slim @@ -10,9 +10,7 @@ h1.h3.my0 = t('doc_auth.headings.upload_front') .clearfix.mxn1 .sm-col.sm-col-8.px1.mt2 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session .mb4 id= 'target' .mt2 = render 'idv/doc_auth/submit_with_spinner' diff --git a/app/views/idv/doc_auth/mobile_back_image.html.slim b/app/views/idv/doc_auth/mobile_back_image.html.slim index bb2144cfc6c..16f40c0dc03 100644 --- a/app/views/idv/doc_auth/mobile_back_image.html.slim +++ b/app/views/idv/doc_auth/mobile_back_image.html.slim @@ -16,9 +16,7 @@ ul .clearfix.mxn1 .sm-col.sm-col-9.px1 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session div id= 'target' br diff --git a/app/views/idv/doc_auth/mobile_front_image.html.slim b/app/views/idv/doc_auth/mobile_front_image.html.slim index 5a582331afc..5d7fc9c7a60 100644 --- a/app/views/idv/doc_auth/mobile_front_image.html.slim +++ b/app/views/idv/doc_auth/mobile_front_image.html.slim @@ -16,9 +16,7 @@ ul .clearfix.mxn1 .sm-col.sm-col-8.px1 = f.input :image, label: false, as: 'file', required: true - - unless flow_session[:error_message].nil? - .alert.alert-error = flow_session[:error_message] - .alert.alert-notice == flow_session[:notice] + = render 'idv/doc_auth/error_messages', flow_session: flow_session div id= 'target' br .mt0 diff --git a/app/views/idv/in_person/_start_over_or_cancel.html.slim b/app/views/idv/in_person/_start_over_or_cancel.html.slim new file mode 100644 index 00000000000..01a552e89cc --- /dev/null +++ b/app/views/idv/in_person/_start_over_or_cancel.html.slim @@ -0,0 +1,4 @@ +br += button_to(t('doc_auth.buttons.start_over'), idv_in_person_step_path(:reset), method: :put, + class: 'btn btn-link', form_class: 'inline-block') += render 'shared/cancel', link: idv_cancel_path diff --git a/app/views/idv/in_person/bar_code.html.slim b/app/views/idv/in_person/bar_code.html.slim new file mode 100644 index 00000000000..183cc25d389 --- /dev/null +++ b/app/views/idv/in_person/bar_code.html.slim @@ -0,0 +1,42 @@ +- title t('forms.backup_code.title') + +h5.my1.caps.bold.accent-blue = t('in_person_proofing.step', step: 3) +br +h1.h3.my0 = t('in_person_proofing.headings.enrollment_form') +p.mt-tiny.mb3 == t('in_person_proofing.info.enrollment_form') +.mb4 + fieldset.m0.p0.rounded-xl + ul.list-reset + li.px-12p.mb1.border-none.mt1.m2 + .inline-block.h1.bold = t('in_person_proofing.enrollment_form') + .h5.mt0.mb0.pt1.pb2.fs-12p + = t('users.backup_code.generated_on_html', + date: content_tag(:strong, I18n.l(Time.zone.today, format: '%B %d, %Y'))) + .inline-block = t('in_person_proofing.instructions.enrollment_form') + br + br + = 'ROSSLYN POST OFFICE' + br + = '1101 WILSON BLVD STE 1 ARLINGTON, VA 22209-9998' + li.mb0.border-top + .alert-inline.bold.border-bottom + = t('in_person_proofing.warning.enrollment_form') + table.pl4.pr3.monospace + tr + td.center + = image_tag(asset_url('idv/bar_code.png'), + alt: t('doc_auth.headings.upload_back'), height: 140) + br + br + .center.mt1 + = link_to t('forms.backup_code.download'), backup_code_download_path, + class: 'text-decoration-none ico btn-border ico-download' + = link_to t('forms.backup_code.print'), '#', + data: { print: true }, + class: 'ico ico-print btn-border ml2 text-decoration-none' + += link_to t('forms.buttons.continue'), account_path, class: 'btn btn-primary btn-wide' +br += render 'idv/in_person/start_over_or_cancel' + +== javascript_pack_tag 'clipboard' diff --git a/app/views/idv/in_person/encrypt.html.slim b/app/views/idv/in_person/encrypt.html.slim new file mode 100644 index 00000000000..9d397d9a9c8 --- /dev/null +++ b/app/views/idv/in_person/encrypt.html.slim @@ -0,0 +1,17 @@ +- title t('idv.titles.review') + +h5.my1.caps.bold.accent-blue = t('in_person_proofing.step', step: 2) +br +h1.h3 = 'Re-enter your login.gov password to protect your information' + +p = t('in_person_proofing.instructions.encrypt') + += simple_form_for(:in_person_proofing, url: url_for, method: 'PUT', + html: { autocomplete: 'off', method: :put, role: 'form' }) do |f| + = f.input :password, label: t('idv.form.password'), required: true + .right-align.mtn2.mb4 = t('idv.forgot_password.link_html', + link: link_to(t('idv.forgot_password.link_text'), idv_forgot_password_url, + class: 'btn btn-link ml1', form_class: 'inline-block')) + = f.button :submit, t('forms.buttons.continue'), class: 'btn btn-primary btn-wide sm-col-6 col-12' + += render 'idv/in_person/start_over_or_cancel' diff --git a/app/views/idv/in_person/enter_info.html.erb b/app/views/idv/in_person/enter_info.html.erb new file mode 100644 index 00000000000..71c4444f931 --- /dev/null +++ b/app/views/idv/in_person/enter_info.html.erb @@ -0,0 +1,144 @@ +
<%= t('in_person_proofing.step', step: 2) %>
+

<%= t('in_person_proofing.headings.enter_info') %>

+ +<%= simple_form_for(:in_person_proofing, url: url_for, method: 'PUT', + html: { autocomplete: 'off', method: :put, role: 'form' }) do |f| %> +
+
+ + +
+
+ + +
+
+
+
+ +
example: 01/17/1964
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+
+ +
+<% end %> + +<%= render 'idv/in_person/start_over_or_cancel' %> diff --git a/app/views/idv/in_person/find_usps.html.slim b/app/views/idv/in_person/find_usps.html.slim new file mode 100644 index 00000000000..510fb428805 --- /dev/null +++ b/app/views/idv/in_person/find_usps.html.slim @@ -0,0 +1,22 @@ +-title t('in_person_proofing.titles.in_person_proofing') + +h5.my1.caps.bold.accent-blue = t('in_person_proofing.step', step: 1) +br +h1.h3.my0 = t('in_person_proofing.headings.zip_code') + += simple_form_for(:in_person, url: url_for, method: 'PUT', + html: { autocomplete: 'off', role: 'form', class: 'mt2' }) do |f| + .clearfix.mxn1 + .sm-col.sm-col-6.px1.mt2 + = f.input :zip_code, + label: t('in_person_proofing.forms.zip_code'), required: true, + pattern: '^\d{5}$', + input_html: { class: 'zip_code', value: '' } + + p = flow_session[:error_message] + + .mt0 + button type='submit' class='btn btn-primary btn-wide sm-col-6 col-12' + = t('forms.buttons.continue') + += render 'idv/in_person/start_over_or_cancel' diff --git a/app/views/idv/in_person/usps_list.html.erb b/app/views/idv/in_person/usps_list.html.erb new file mode 100644 index 00000000000..9ae4303c0c5 --- /dev/null +++ b/app/views/idv/in_person/usps_list.html.erb @@ -0,0 +1,62 @@ +
<%= t('in_person_proofing.step', step: 1) %>
+

<%= t('in_person_proofing.headings.usps_list') %>

+ +<%= simple_form_for(:in_person_proofing, url: url_for, method: 'PUT', + html: { autocomplete: 'off', method: :put, role: 'form' }) do |f| %> +
+
+ Choose a post office near you: + + + + + +
+
+ +
+ +
+<% end %> + +<%= render 'idv/in_person/start_over_or_cancel' %> diff --git a/app/views/idv/in_person/verify.html.slim b/app/views/idv/in_person/verify.html.slim new file mode 100644 index 00000000000..fc88f3e13a2 --- /dev/null +++ b/app/views/idv/in_person/verify.html.slim @@ -0,0 +1,25 @@ +-title t('in_person_proofing.titles.in_person_proofing') + +h5.my1.caps.bold.accent-blue = t('in_person_proofing.step', step: 2) +br +h1.h3.my0 = 'Verify your information' + +.mt3.mb2 + .right = link_to(t('in_person_proofing.buttons.change_address'), idv_address_url) + div = "#{t('in_person_proofing.forms.first_name')}: Jane" + div = "#{t('in_person_proofing.forms.last_name')}: Doe" + div = "#{t('in_person_proofing.forms.dob')}: 11/1/1911" + hr + .right = link_to(t('in_person_proofing.buttons.change_address'), idv_address_url) + div = "#{t('in_person_proofing.forms.address1')}: 1 Fake Street" + div = "#{t('in_person_proofing.forms.city')}: Faketown" + div = "#{t('in_person_proofing.forms.state')}: NY" + div = "#{t('in_person_proofing.forms.zip_code')}: 11364" + hr + .right = button_to(t('in_person_proofing.buttons.change_ssn'), + idv_doc_auth_step_path(step: :redo_ssn), method: :put, class: 'btn btn-link') + = "#{t('in_person_proofing.forms.ssn')}: 111-11-1111" + .mt4 = button_to(t('forms.buttons.continue'), url_for, method: :put, + class: 'btn btn-primary btn-wide sm-col-6 col-12') + += render 'idv/in_person/start_over_or_cancel' diff --git a/app/views/idv/in_person/welcome.html.slim b/app/views/idv/in_person/welcome.html.slim new file mode 100644 index 00000000000..6b863f12f0c --- /dev/null +++ b/app/views/idv/in_person/welcome.html.slim @@ -0,0 +1,49 @@ +h1.h3.my0 = t('in_person_proofing.headings.welcome') +p.mt-tiny.mb3 = t('in_person_proofing.info.welcome') +h1.h3.mb2 = t('in_person_proofing.instructions.welcome') +ul.list-reset + li.pt2.pb1 + .inline-block.mr2.mt1.align-top.circle.circle-number.bg-blue.white + | 1 + .mr1.inline-block + .h1.inline-block.bold = t('in_person_proofing.instructions.bullet1') + br + = t('in_person_proofing.instructions.text1') + li.pt2.pb1 + .inline-block.mr2.mt1.align-top.circle.circle-number.bg-blue.white + | 2 + .mr1.inline-block + .h1.inline-block.bold = t('in_person_proofing.instructions.bullet2') + br + = t('in_person_proofing.instructions.text2') + li.pt2.pb1 + .inline-block.mr2.mt1.align-top.circle.circle-number.bg-blue.white + | 3 + .mr1.inline-block + .h1.inline-block.bold = t('in_person_proofing.instructions.bullet3') + br + = t('in_person_proofing.instructions.text3') + li.pt2.pb1 + .inline-block.mr2.mt1.align-top.circle.circle-number.bg-blue.white + | 4 + .mr1.inline-block + .h1.inline-block.bold = t('in_person_proofing.instructions.bullet4') + br + = t('in_person_proofing.instructions.text4') + li.pt2.pb1 + .inline-block.mr2.mt1.align-top.circle.circle-number.bg-blue.white + | 5 + .mr1.inline-block + .h1.inline-block.bold = t('in_person_proofing.instructions.bullet5') + br + = t('in_person_proofing.instructions.text5') += simple_form_for(:in_person_proofing, url: url_for, method: 'PUT', + html: { autocomplete: 'off', role: 'form', class: 'mt2' }) do + br + .mt0 + button type='submit' class='btn btn-primary btn-wide sm-col-6 col-6' + = t('in_person_proofing.buttons.get_started') +br + +.mt2.pt1.border-top + = link_to cancel_link_text, account_path, class: 'h5' diff --git a/app/views/idv/shared/verification_failure.html.slim b/app/views/idv/shared/verification_failure.html.slim index 3855b78af71..c600c68726a 100644 --- a/app/views/idv/shared/verification_failure.html.slim +++ b/app/views/idv/shared/verification_failure.html.slim @@ -5,3 +5,5 @@ p == presenter.warning_message .mt3 = link_to presenter.button_text, presenter.button_path, class: 'btn btn-primary btn-link' + += render 'idv/doc_auth/in_person_proofing_option' diff --git a/config/locales/in_person_proofing/en.yml b/config/locales/in_person_proofing/en.yml new file mode 100644 index 00000000000..4417aab55b2 --- /dev/null +++ b/config/locales/in_person_proofing/en.yml @@ -0,0 +1,51 @@ +--- +en: + in_person_proofing: + buttons: + change_address: change + change_ssn: change + get_started: Get started + enrollment_form: Enrollment form + forms: + address1: Address + address2: Address (optional) + city: City + dob: Date of birth + first_name: First name + last_name: Last Name + ssn: Social security number + state: State + zip_code: Zip code + headings: + enrollment_form: Bring this form to your post office + enter_info: Enter in your information + usps_list: Choose a post office + welcome: Verify your identity in person + zip_code: Find a post office + info: + enrollment_form: Please print or save this form and take it to the post office + you chose. + welcome: We can verify your identity at your local post office. + instructions: + bullet1: Choose a nearby post office + bullet2: Enter your information + bullet3: Print or save your enrollment form + bullet4: Visit the post office to get verified + bullet5: Come back to login.gov + encrypt: When you re-enter your password, login.gov will encrypt your information + to make sure no one else can access it. + enrollment_form: 'Bring this code to the following post office along with a + government-issued ID:' + text1: by entering your ZIP code + text2: name, date of birth, address, and social security number + text3: a bar code that you need to take to the post office with you + text4: bring your enrollment code and a government-issued ID + text5: sign in and finish the process + welcome: 'What you''ll need to do:' + opt_in_link: Verify your identity in person at a local post office instead + step: Verify your identity in person - Step %{step} of 5 + titles: + in_person_proofing: Verify your identity in person + warning: + enrollment_form: Download, print, or save your enrollment form. A copy has + also been sent to your email. diff --git a/config/locales/in_person_proofing/es.yml b/config/locales/in_person_proofing/es.yml new file mode 100644 index 00000000000..fc58a30ef0b --- /dev/null +++ b/config/locales/in_person_proofing/es.yml @@ -0,0 +1,51 @@ +--- +es: + in_person_proofing: + buttons: + change_address: change + change_ssn: change + get_started: Get started + enrollment_form: Enrollment form + forms: + address1: Address + address2: Address (optional) + city: City + dob: Date of birth + first_name: First name + last_name: Last Name + ssn: Social security number + state: State + zip_code: Zip code + headings: + enrollment_form: Bring this form to your post office + enter_info: Enter in your information + usps_list: Choose a post office + welcome: Verify your identity in person + zip_code: Find a post office + info: + enrollment_form: Please print or save this form and take it to the post office + you chose. + welcome: We can verify your identity at your local post office. + instructions: + bullet1: Choose a nearby post office + bullet2: Enter your information + bullet3: Print or save your enrollment form + bullet4: Visit the post office to get verified + bullet5: Come back to login.gov + encrypt: When you re-enter your password, login.gov will encrypt your information + to make sure no one else can access it. + enrollment_form: 'Bring this code to the following post office along with a + government-issued ID:' + text1: by entering your ZIP code + text2: name, date of birth, address, and social security number + text3: a bar code that you need to take to the post office with you + text4: bring your enrollment code and a government-issued ID + text5: sign in and finish the process + welcome: 'What you''ll need to do:' + opt_in_link: Verify your identity in person at a local post office instead + step: Verify your identity in person - Step %{step} of 5 + titles: + in_person_proofing: Verify your identity in person + warning: + enrollment_form: Download, print, or save your enrollment form. A copy has + also been sent to your email. diff --git a/config/locales/in_person_proofing/fr.yml b/config/locales/in_person_proofing/fr.yml new file mode 100644 index 00000000000..1032eae98df --- /dev/null +++ b/config/locales/in_person_proofing/fr.yml @@ -0,0 +1,51 @@ +--- +fr: + in_person_proofing: + buttons: + change_address: change + change_ssn: change + get_started: Get started + enrollment_form: Enrollment form + forms: + address1: Address + address2: Address (optional) + city: City + dob: Date of birth + first_name: First name + last_name: Last Name + ssn: Social security number + state: State + zip_code: Zip code + headings: + enrollment_form: Bring this form to your post office + enter_info: Enter in your information + usps_list: Choose a post office + welcome: Verify your identity in person + zip_code: Find a post office + info: + enrollment_form: Please print or save this form and take it to the post office + you chose. + welcome: We can verify your identity at your local post office. + instructions: + bullet1: Choose a nearby post office + bullet2: Enter your information + bullet3: Print or save your enrollment form + bullet4: Visit the post office to get verified + bullet5: Come back to login.gov + encrypt: When you re-enter your password, login.gov will encrypt your information + to make sure no one else can access it. + enrollment_form: 'Bring this code to the following post office along with a + government-issued ID:' + text1: by entering your ZIP code + text2: name, date of birth, address, and social security number + text3: a bar code that you need to take to the post office with you + text4: bring your enrollment code and a government-issued ID + text5: sign in and finish the process + welcome: 'What you''ll need to do:' + opt_in_link: Verify your identity in person at a local post office instead + step: Verify your identity in person - Step %{step} of 5 + titles: + in_person_proofing: Verify your identity in person + warning: + enrollment_form: Download, print, or save your enrollment form. A copy has + also been sent to your email. diff --git a/config/routes.rb b/config/routes.rb index db7f83d9f9c..ced00245378 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -250,6 +250,11 @@ get '/recovery/:step' => 'recovery#show', as: :recovery_step put '/recovery/:step' => 'recovery#update' end + if FeatureManagement.in_person_proofing_enabled? + get '/in_person' => 'in_person#index' + get '/in_person/:step' => 'in_person#show', as: :in_person_step + put '/in_person/:step' => 'in_person#update' + end end end diff --git a/lib/feature_management.rb b/lib/feature_management.rb index 24238bea317..432cb2960e0 100644 --- a/lib/feature_management.rb +++ b/lib/feature_management.rb @@ -117,4 +117,8 @@ def self.allow_doc_auth_test_credentials? def self.backup_codes_as_only_2fa? Figaro.env.backup_codes_as_only_2fa == 'true' end + + def self.in_person_proofing_enabled? + Figaro.env.in_person_proofing_enabled == 'true' + end end diff --git a/spec/features/idv/doc_auth/front_image_step_spec.rb b/spec/features/idv/doc_auth/front_image_step_spec.rb index 1ed7c98b400..ce12ef99bd9 100644 --- a/spec/features/idv/doc_auth/front_image_step_spec.rb +++ b/spec/features/idv/doc_auth/front_image_step_spec.rb @@ -4,6 +4,7 @@ feature 'doc auth front image step' do include IdvStepHelper include DocAuthHelper + include InPersonHelper let(:user) { user_with_2fa } let(:max_attempts) { Figaro.env.acuant_max_attempts.to_i } @@ -34,6 +35,20 @@ expect(page).to have_current_path(idv_doc_auth_front_image_step) end + it 'offers in person option on failure' do + enable_in_person_proofing + + expect(page).to_not have_link(t('in_person_proofing.opt_in_link'), + href: idv_in_person_welcome_step) + + mock_assure_id_fail + attach_image + click_idv_continue + + expect(page).to have_link(t('in_person_proofing.opt_in_link'), + href: idv_in_person_welcome_step) + end + it 'throttles calls to acuant and allows retry after the attempt window' do allow(Figaro.env).to receive(:acuant_max_attempts).and_return(max_attempts) max_attempts.times do diff --git a/spec/features/idv/doc_auth/verify_step_spec.rb b/spec/features/idv/doc_auth/verify_step_spec.rb index edab402fe19..d9912de94bf 100644 --- a/spec/features/idv/doc_auth/verify_step_spec.rb +++ b/spec/features/idv/doc_auth/verify_step_spec.rb @@ -3,6 +3,7 @@ feature 'doc auth verify step' do include IdvStepHelper include DocAuthHelper + include InPersonHelper let(:max_attempts) { Idv::Attempter.idv_max_attempts } before do @@ -48,7 +49,21 @@ click_idv_continue click_idv_continue + enable_in_person_proofing expect(page).to have_current_path(idv_session_failure_path(reason: :warning)) + expect(page).to_not have_link(t('in_person_proofing.opt_in_link'), + href: idv_in_person_welcome_step) + end + + it 'has a link to proof in person' do + enable_in_person_proofing + complete_doc_auth_steps_before_ssn_step + fill_out_ssn_form_with_duplicate_ssn + click_idv_continue + click_idv_continue + + expect(page).to have_link(t('in_person_proofing.opt_in_link'), + href: idv_in_person_welcome_step) end it 'throttles resolution' do diff --git a/spec/features/idv/in_person/bar_code_step_spec.rb b/spec/features/idv/in_person/bar_code_step_spec.rb new file mode 100644 index 00000000000..1710eacf354 --- /dev/null +++ b/spec/features/idv/in_person/bar_code_step_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +feature 'in person find usps step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_bar_code_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_bar_code_step) + end + + it 'proceeds to the next step' do + click_link t('forms.buttons.continue') + + expect(page).to have_current_path(account_path) + end +end diff --git a/spec/features/idv/in_person/encrypt_step_spec.rb b/spec/features/idv/in_person/encrypt_step_spec.rb new file mode 100644 index 00000000000..fba3829e7b9 --- /dev/null +++ b/spec/features/idv/in_person/encrypt_step_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +feature 'in person encrypt step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_encrypt_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_encrypt_step) + end + + it 'proceeds to the next step' do + click_continue + + expect(page).to have_current_path(idv_in_person_bar_code_step) + end +end diff --git a/spec/features/idv/in_person/enter_info_step_spec.rb b/spec/features/idv/in_person/enter_info_step_spec.rb new file mode 100644 index 00000000000..f85ffeddf6f --- /dev/null +++ b/spec/features/idv/in_person/enter_info_step_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +feature 'in person enter info step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_enter_info_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_enter_info_step) + end + + it 'proceeds to the next page' do + click_continue + + expect(page).to have_current_path(idv_in_person_verify_step) + end +end diff --git a/spec/features/idv/in_person/find_usps_step_spec.rb b/spec/features/idv/in_person/find_usps_step_spec.rb new file mode 100644 index 00000000000..133e698b866 --- /dev/null +++ b/spec/features/idv/in_person/find_usps_step_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' + +feature 'in person find usps step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_find_usps_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_find_usps_step) + end + + it 'proceeds to next page with a zip code' do + fill_in :in_person_zip_code, with: Faker::Address.zip_code + click_continue + + expect(page).to have_current_path(idv_in_person_usps_list_step) + end +end diff --git a/spec/features/idv/in_person/usps_list_step_spec.rb b/spec/features/idv/in_person/usps_list_step_spec.rb new file mode 100644 index 00000000000..c204eb0ab8b --- /dev/null +++ b/spec/features/idv/in_person/usps_list_step_spec.rb @@ -0,0 +1,20 @@ +require 'rails_helper' + +feature 'in person usps list step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_usps_list_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_usps_list_step) + end + + it 'proceeds to the next page' do + click_continue + expect(page).to have_current_path(idv_in_person_enter_info_step) + end +end diff --git a/spec/features/idv/in_person/verify_step_spec.rb b/spec/features/idv/in_person/verify_step_spec.rb new file mode 100644 index 00000000000..7d7c42133b7 --- /dev/null +++ b/spec/features/idv/in_person/verify_step_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +feature 'in person verify info step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_verify_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_verify_step) + end + + it 'proceeds to the next page' do + click_continue + + expect(page).to have_current_path(idv_in_person_encrypt_step) + end +end diff --git a/spec/features/idv/in_person/welcome_step_spec.rb b/spec/features/idv/in_person/welcome_step_spec.rb new file mode 100644 index 00000000000..0587e4a3e5e --- /dev/null +++ b/spec/features/idv/in_person/welcome_step_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +feature 'in person welcome step' do + include InPersonHelper + + before do + enable_in_person_proofing + sign_in_and_2fa_user + complete_in_person_steps_before_welcome_step + end + + it 'is on the correct page' do + expect(page).to have_current_path(idv_in_person_welcome_step) + end +end diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb new file mode 100644 index 00000000000..c9875179006 --- /dev/null +++ b/spec/support/features/in_person_helper.rb @@ -0,0 +1,68 @@ +module InPersonHelper + def idv_in_person_welcome_step + idv_in_person_step_path(step: :welcome) + end + + def idv_in_person_find_usps_step + idv_in_person_step_path(step: :find_usps) + end + + def idv_in_person_usps_list_step + idv_in_person_step_path(step: :usps_list) + end + + def idv_in_person_enter_info_step + idv_in_person_step_path(step: :enter_info) + end + + def idv_in_person_verify_step + idv_in_person_step_path(step: :verify) + end + + def idv_in_person_encrypt_step + idv_in_person_step_path(step: :encrypt) + end + + def idv_in_person_bar_code_step + idv_in_person_step_path(step: :bar_code) + end + + def enable_in_person_proofing + allow(Figaro.env).to receive(:in_person_proofing_enabled).and_return('true') + Rails.application.reload_routes! + end + + def complete_in_person_steps_before_welcome_step + visit idv_in_person_welcome_step + end + + def complete_in_person_steps_before_find_usps_step + complete_in_person_steps_before_welcome_step + click_on t('doc_auth.buttons.get_started') + end + + def complete_in_person_steps_before_usps_list_step + complete_in_person_steps_before_find_usps_step + click_continue + end + + def complete_in_person_steps_before_enter_info_step + complete_in_person_steps_before_usps_list_step + click_continue + end + + def complete_in_person_steps_before_verify_step + complete_in_person_steps_before_enter_info_step + click_continue + end + + def complete_in_person_steps_before_encrypt_step + complete_in_person_steps_before_verify_step + click_continue + end + + def complete_in_person_steps_before_bar_code_step + complete_in_person_steps_before_encrypt_step + click_continue + end +end From 3f4c0a111c676e535a69fd9998299b0057968eec Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Wed, 26 Jun 2019 11:37:02 -0400 Subject: [PATCH 2/3] Fix again --- app/controllers/idv/in_person_controller.rb | 5 +++++ config/routes.rb | 8 +++----- spec/support/features/in_person_helper.rb | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/idv/in_person_controller.rb b/app/controllers/idv/in_person_controller.rb index 6fbaabb7fe6..a7f5af3c149 100644 --- a/app/controllers/idv/in_person_controller.rb +++ b/app/controllers/idv/in_person_controller.rb @@ -1,5 +1,6 @@ module Idv class InPersonController < ApplicationController + before_action :render_404_if_disabled before_action :confirm_two_factor_authenticated include Flow::FlowStateMachine @@ -10,5 +11,9 @@ class InPersonController < ApplicationController flow: Idv::Flows::InPersonFlow, analytics_id: Analytics::IN_PERSON_PROOFING, }.freeze + + def render_404_if_disabled + render_not_found unless FeatureManagement.in_person_proofing_enabled + end end end diff --git a/config/routes.rb b/config/routes.rb index ced00245378..649e448351a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -250,12 +250,10 @@ get '/recovery/:step' => 'recovery#show', as: :recovery_step put '/recovery/:step' => 'recovery#update' end - if FeatureManagement.in_person_proofing_enabled? - get '/in_person' => 'in_person#index' - get '/in_person/:step' => 'in_person#show', as: :in_person_step - put '/in_person/:step' => 'in_person#update' - end end + get '/in_person' => 'in_person#index' + get '/in_person/:step' => 'in_person#show', as: :in_person_step + put '/in_person/:step' => 'in_person#update' end if FeatureManagement.enable_usps_verification? diff --git a/spec/support/features/in_person_helper.rb b/spec/support/features/in_person_helper.rb index c9875179006..176912b1f8b 100644 --- a/spec/support/features/in_person_helper.rb +++ b/spec/support/features/in_person_helper.rb @@ -29,7 +29,6 @@ def idv_in_person_bar_code_step def enable_in_person_proofing allow(Figaro.env).to receive(:in_person_proofing_enabled).and_return('true') - Rails.application.reload_routes! end def complete_in_person_steps_before_welcome_step From 4edb6fa4569eb56c5644475ccaa648ece2375c24 Mon Sep 17 00:00:00 2001 From: Steve Urciuoli Date: Wed, 26 Jun 2019 11:38:53 -0400 Subject: [PATCH 3/3] Typo --- app/controllers/idv/in_person_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/idv/in_person_controller.rb b/app/controllers/idv/in_person_controller.rb index a7f5af3c149..37dab28996c 100644 --- a/app/controllers/idv/in_person_controller.rb +++ b/app/controllers/idv/in_person_controller.rb @@ -13,7 +13,7 @@ class InPersonController < ApplicationController }.freeze def render_404_if_disabled - render_not_found unless FeatureManagement.in_person_proofing_enabled + render_not_found unless FeatureManagement.in_person_proofing_enabled? end end end