Skip to content

LG-6349: Add verify page to IPP flow#6514

Merged
sheldon-b merged 28 commits intomainfrom
sbachstein/lg-6349-add-verify-page
Jun 29, 2022
Merged

LG-6349: Add verify page to IPP flow#6514
sheldon-b merged 28 commits intomainfrom
sbachstein/lg-6349-add-verify-page

Conversation

@sheldon-b
Copy link
Contributor

@sheldon-b sheldon-b commented Jun 23, 2022

  • Pulls the majority of the doc auth verify page into a new shared partial view that is used by both the doc auth and in person flows
  • Begins using the verify page partial view in the in person flow
  • Adds some conditional rendering so that when the user lands on the verify page in the in person flow they're able to view and change their state ID information
  • Updates the in person verify step so that the data entered by the user is what's used to create the profile. A separate ticket will add the logic to verify the user's information before allowing the user to continue past the verify page

I've added new Spanish and French content string keys to LG-6337 to be properly translated.

📆 Future work for separate PRs

There are a few visual differences in this PR compared to the designs. I'd prefer to make these changes in a separate PR since this PR is already changing a lot of files and the below changes will impact the existing doc auth flow:

  • Update verify page to use "Update" buttons instead of "Change"
  • Update the update pages to use "Update" buttons instead of "Continue"
  • Begin displaying the user's address line 2 field on the verify page if they've entered one
  • Begin using sentence case on the verify page labels, eg "First name: " instead of "First Name: ". Exceptions: "ZIP Code" and "Social Security number"
  • The back and cancel/start over buttons are broken in the IPP flow. LG-6163 and LG-6377 will do the work of making them functional for the entire IPP flow

📺 Demo

You can try this out in the sbachstein sandbox

Doc auth flow
Screen.Recording.2022-06-24.at.3.02.21.PM.mov
In person flow
Screen.Recording.2022-06-24.at.3.00.18.PM.mov

<%= render ValidatedFieldComponent.new(
name: :first_name,
form: f,
input_html: { value: pii[:first_name] },
Copy link
Contributor

@aduth aduth Jun 23, 2022

Choose a reason for hiding this comment

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

We could avoid assigning the value explicitly if we initialize SimpleForm with a form object that's populated with the values. Maybe something roughly like:

def extra_view_variables
  {
    form: Idv::StateIdForm.new(flow_session[:pii_from_user]),
    # ...
  }
end
<%= validated_form_for form do |f| %>

It might get a little tricky with the input names though, since FlowStateMachine assumes to pick form values from the flow's name (:doc_auth in this case). We could control that by assigning the form's model_name as 'DocAuth' in all cases, but it feels a little hacky. 🤷

def self.model_name
ActiveModel::Name.new(self, nil, 'StateId')
end

We don't use this pattern very much throughout the codebase, so not really something I'd push too strongly for, but it would seem to simplify some of these screens where we want to restore existing values to the form inputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oof, yeah, it feels pretty hacky to me with having to name all of the forms 'DocAuth'. How about I add a ticket to look into this post-pilot? I think there'll be some refactoring work to fully pull the doc auth and IPP flows apart and this could be an enhancement that allows

What's the general attitude towards WILLFIX comments left in the code? I'm thinking I could leave such comments linking to the enhancement ticket but they might be around for quite a few weeks depending on when we can get to it

Copy link
Contributor

Choose a reason for hiding this comment

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

@sheldon-b Yeah, I wouldn't consider this a blocker, but I think it is highlighting a couple specific issues:

  • That we're extending DocAuth base classes in the non-DocAuth flow
  • That FlowStateMachine is looking for a specific, constant form key

Later refactoring may be fine, though I'd wonder if it would eventually be made redundant as FlowStateMachine v2 would seek to reimplement these steps anyways.

To the question about WILLFIX: You may be able to add it, but generally these kinds of comments are prevented by our CodeClimate configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that makes sense. I'll create a ticket to track this tech debt, I would hope that we can prioritize it sometime after the pilot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sheldon-b sheldon-b changed the title LG-6349: Add verify page to IPP flow (Draft) LG-6349: Add verify page to IPP flow Jun 23, 2022
@sheldon-b sheldon-b changed the title (Draft) LG-6349: Add verify page to IPP flow (WIP) LG-6349: Add verify page to IPP flow Jun 23, 2022
<div class='margin-top-4 margin-bottom-2'>
<% if remote_identity_proofing %>
<div>
<%= "#{t('doc_auth.forms.first_name')}: #{pii[:first_name]}" %>
Copy link
Contributor

@zachmargolis zachmargolis Jun 23, 2022

Choose a reason for hiding this comment

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

So I know it's copy-pasted from the other page, but IMO this kind of interpolation is very silly #{} for something trivial inside of <%= , if it's not too much effort, I'd consider breaking these out:

Suggested change
<%= "#{t('doc_auth.forms.first_name')}: #{pii[:first_name]}" %>
<%= t('doc_auth.forms.first_name') %>: <%= pii[:first_name] %>

Copy link
Contributor

Choose a reason for hiding this comment

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

I've also been eyeing these for some time wondering if there's some more semantic HTML we could be using for this field: value association. With the barcode attention page in #6483, I went with a dl for a similar listing (screenshot):

<dl className="add-list-reset">
<div>
<dt className="display-inline">{t('doc_auth.forms.first_name')}:</dt>
<dd className="display-inline margin-left-05">{pii.first_name}</dd>
</div>
<div>
<dt className="display-inline">{t('doc_auth.forms.last_name')}:</dt>
<dd className="display-inline margin-left-05">{pii.last_name}</dd>
</div>
<div>
<dt className="display-inline">{t('doc_auth.forms.dob')}:</dt>
<dd className="display-inline margin-left-05">{pii.dob}</dd>
</div>
</dl>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm up to consider these and use one or the other of these suggestions but I'd prefer to do it in a separate PR. I'm trying to keep this PR's changes to existing prod behavior minimal and then follow-up with a couple PRs that make more specific changes to existing prod behavior

Comment on lines -15 to +25
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,
Copy link
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

@sheldon-b sheldon-b changed the title (WIP) LG-6349: Add verify page to IPP flow LG-6349: Add verify page to IPP flow Jun 24, 2022
@sheldon-b sheldon-b marked this pull request as ready for review June 24, 2022 19:52
@sheldon-b sheldon-b requested review from a team, NavaTim, WheresHJ and tomas-nava and removed request for a team, NavaTim and tomas-nava June 24, 2022 19:53
Copy link
Contributor

@svalexander svalexander left a comment

Choose a reason for hiding this comment

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

just a few questions to help me understand the repo

end
end

def extra_view_variables
Copy link
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
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

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@NavaTim NavaTim self-requested a review June 28, 2022 18:11
@rutvigupta-design
Copy link

LGTM!

@sheldon-b sheldon-b merged commit ac3d086 into main Jun 29, 2022
@sheldon-b sheldon-b deleted the sbachstein/lg-6349-add-verify-page branch June 29, 2022 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants