Skip to content

LG-6114: Use Cleave.js to format personal key (IdV app)#6217

Merged
aduth merged 4 commits intomainfrom
aduth-lg-6114-personal-key-format
Apr 19, 2022
Merged

LG-6114: Use Cleave.js to format personal key (IdV app)#6217
aduth merged 4 commits intomainfrom
aduth-lg-6114-personal-key-format

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Apr 18, 2022

Why: So that the value is more readable as the user types, and to ensure feature parity with the existing experience.

Testing Instructions:

  1. Set idv_api_enabled: "true" in local config/application.yml
  2. Go to: http://localhost:3000/verify/v2/personal_key_confirm
  3. Type code into field
  4. Observe that a dash is inserted automatically after every 4th character

Implementation Notes:

Cleave.js includes a built-in React component: https://github.com/nosir/cleave.js#reactjs-component-usage

Initially I had tried to custom-implement the formatting, since Cleave.js is a pretty large dependency, but opted against this approach after realizing it's a pretty tricky implementation!

For follow-up: We should upgrade our version of @testing-library/user-event, since we're using an older version of the API, which will require some breaking changes to upgrade.

**Why**: So that the value is more readable as the user types, and to ensure feature parity with the existing experience.

changelog: Upcoming Features, Identity Verification, Add personal key step screen
@aduth aduth requested review from nprimak, peggles2 and solipet April 18, 2022 20:18
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

aduth added 3 commits April 18, 2022 16:36
As confirmed via integration specs, Cleave handles this
@aduth aduth merged commit 883e767 into main Apr 19, 2022
@aduth aduth deleted the aduth-lg-6114-personal-key-format branch April 19, 2022 12:13
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.

2 participants