Skip to content

Enhance FormSteps to manage history using path fragment#6213

Merged
aduth merged 12 commits intomainfrom
aduth-use-history-path
Apr 18, 2022
Merged

Enhance FormSteps to manage history using path fragment#6213
aduth merged 12 commits intomainfrom
aduth-use-history-path

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Apr 15, 2022

Why: So that I can navigate back and forth in the new IdV v2 application, and my location is maintained accurately in the address bar path.

In the original document capture implementation, we included history management as part of the "steps" implemented there. That implementation only allowed for querystring-based hash fragments (e.g. /document_capture#step=selfie).

Because we want the React application to manage incoming routed URLs from Rails, and because hash fragment routing is unsightly, this pull request seeks to expand this base support to allow for path-based history management.

Testing Instructions:

  1. Set idv_api_enabled: "true" in local config/application.yml
  2. Go to: http://localhost:3000/verify/v2/
  3. Observe that you see the personal key page (the current first step of the application)
  4. Click "Continue"
  5. Observe that you see the confirmation modal, and the address bar changes to reflect /verify/v2/personal_key_confirm
  6. Refresh the page
  7. Observe that you still see the confirmation modal
  8. Press your browser's back button
  9. Observe that you see the personal key page, and the address bar changes to the previous value (/verify/v2/)

Video:

Screen.Recording.2022-04-15.at.4.10.22.PM.mov

Draft only because I wrapped this up rather quickly at the end of the day and haven't had a chance to give it a thorough look-over, but functionally it seems to work quite fine.

Base automatically changed from aduth-personal-key-continue to main April 18, 2022 14:10
@aduth aduth force-pushed the aduth-use-history-path branch from eb0f400 to 75b9080 Compare April 18, 2022 17:47
aduth added 4 commits April 18, 2022 13:58
Should be responsibility of consumer to deal with lingering path fragment upon completion if necessary

changelog: Upcoming Features, Identity Verification, Add client-side application path routing
**Why**: Because it will be necessary to reliably create step URLs

#6213 (comment)
We're not using a query parameter format
@aduth aduth marked this pull request as ready for review April 18, 2022 18:19
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 aduth merged commit 57da841 into main Apr 18, 2022
@aduth aduth deleted the aduth-use-history-path branch April 18, 2022 20:24
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