Skip to content

LG-3207: incorporate selfie in document capture step#3929

Merged
jmhooper merged 12 commits intomasterfrom
dprice-lg-3207-incorporate-selfie-in-document-capture-step
Jul 22, 2020
Merged

LG-3207: incorporate selfie in document capture step#3929
jmhooper merged 12 commits intomasterfrom
dprice-lg-3207-incorporate-selfie-in-document-capture-step

Conversation

@solipet
Copy link
Contributor

@solipet solipet commented Jul 16, 2020

As a user, I want to complete all of my doc_auth image uploads in one form so I can proof with a vendor that doesn't allow staggered uploads.

This PR adds the selfie upload to the document_capture_step. It's now one big long form with input fields to allow uploading the front/back of the DL and the selfie image.

@solipet solipet force-pushed the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch from 97d20cf to 3a26dfe Compare July 16, 2020 02:53
@anniehirshman-gsa
Copy link
Contributor

@solipet Including two mockups here with design suggestions: 1 with just my two biggest priority changes, and 1 with two more revisions if you have time:

At minimum:

  • Add 1px primary-light horizontal border between the three sections, with 2 rem (or spacing token: 4) space above and below
  • Update image tips in body text font style

If possible (if you don't have time to do this now, no worries - we can revisit later):

  • Add an h1 to the top of the page ("Upload your state-issued ID and a photo of you"), and update each section heading to h2
  • Remove illustrations to streamline the form

Let me know if you have any questions or if any of these are a pain. Thanks so much!

Minimum changes example:
Backstop - Minimum

Additional changes example:
Backstop - Additional Changes

selfie_response = post_selfie(image: selfie_image, instance_id: instance_id)
[selfie_response, pii]
else
results
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this line is uncovered. I think it makes sense for us to drop in a unit test for what happens if posting the selfie fails.

@solipet
Copy link
Contributor Author

solipet commented Jul 16, 2020

@solipet Including two mockups here with design suggestions: 1 with just my two biggest priority changes, and 1 with two more revisions if you have time:

@anniehirshman-gsa Implemented all - here's a new screenshot:

Screen Shot 2020-07-16 at 4 54 54 PM

@anniehirshman-gsa
Copy link
Contributor

It looks perfect! Thank you @solipet!

@solipet solipet force-pushed the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch from 1d1e20e to 11479f4 Compare July 20, 2020 15:01
@solipet solipet force-pushed the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch from d7afb03 to c7a78bb Compare July 20, 2020 17:45
Copy link
Contributor

Choose a reason for hiding this comment

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

this ===== looks like a merge error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gah!!

@solipet solipet force-pushed the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch from c7a78bb to 753d2fa Compare July 20, 2020 18:00
let(:facial_match_url) { URI.join(Figaro.env.acuant_facial_match_url, '/api/v1/facematch') }
let(:liveness_url) { URI.join(Figaro.env.acuant_passlive_url, '/api/v1/liveness') }

it 'sends an upload image request for the front, back, and selfie images' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to enable liveness for this spec? It looks like otherwise it ignores the selfie.

I noticed the gap in the coverage above. Maybe a test case for this w/ selfie enabled and selfie disabled?

)

result = subject.post_images(
result, _pii = subject.post_images(
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't return PII anymore, right?

@solipet solipet force-pushed the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch from 95c2c51 to 4bc7b00 Compare July 21, 2020 20:32
@solipet solipet force-pushed the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch from f1cc396 to 3d5b1d4 Compare July 22, 2020 03:19
end

# rubocop:disable Metrics/AbcSize
def post_images(front_image:, back_image:, selfie_image:,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can drop the instance ID here, right?

token_missing: falta el token
confirm_password_incorrect: La contraseña es incorrecta.
doc_auth:
document_capture_info_html: |-
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to remember to translate these before we merge


# making a new method to avoid breaking the existing flow
def save_pii_in_session(pii)
flow_session[:pii_from_doc] = pii.merge(
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is uncovered, but I also can't find where it is used. I think if we pulled this out we'd fix our coverage woes.

@jmhooper jmhooper merged commit 2783655 into master Jul 22, 2020
@jmhooper jmhooper deleted the dprice-lg-3207-incorporate-selfie-in-document-capture-step branch July 22, 2020 15:52
<%= render 'idv/doc_auth/start_over_or_cancel' %>
<%= javascript_pack_tag 'image-preview' %>
</div>
<%= javascript_pack_tag 'document-capture' %>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may have been the artifact of a rebase after #3922 was merged. I don't think this change should be here. In #3922, it was moved higher in the file, and now there's two script tags that unfortunately conflict with one another 😬

Copy link
Contributor

Choose a reason for hiding this comment

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

Sneaking in a fix at #3964 (comment)

aduth added a commit that referenced this pull request Jul 23, 2020
**Why**: So the React component renders in the page

See: #3929 (comment)
aduth added a commit that referenced this pull request Jul 23, 2020
* Disable prop type validation for test files

**Why**: These restrictions are useful for runtime components, but unnecessary overhead for written tests.

* Create stub React submission upload component flow

**Why**: While the API endpoints for submitting the document upload form values does not yet exist, it can be abstracted as a function which receives a payload object and returns a Promise resolving or rejecting by the result of an attempt to upload.

This implements Suspense-based asynchronous component handling, and introduces an optional upload context used in tests to replace the submission handler with a mock value.

* Remove duplicate script pack tag

**Why**: So the React component renders in the page

See: #3929 (comment)

<%= f.input :selfie_image_data_url, as: :hidden %>
<%= f.input :selfie_image, label: false, as: :file, required: true, wrapper_class: 'mt3 sm-col-8' %>
<div class='my2' id='selfie_target'>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting that this tag is unclosed.

Suggested change
<div class='my2' id='selfie_target'>
<div class='my2' id='selfie_target'></div>

I encountered it in #3986. Not sure it's the cause of the errors there, but it was the source of some confusion in trying to keep the static rendered "Start over" and "Cancel" buttons, and them not showing 😅 I'll plan to include a fix for it with those changes.

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.

5 participants