Skip to content

LG-7832: Preserve State ID and Address form data on invalid submissions#7936

Merged
NavaTim merged 7 commits intomainfrom
tbradley/lg-7832-transliterate-usps-api-fix-forms
Mar 7, 2023
Merged

LG-7832: Preserve State ID and Address form data on invalid submissions#7936
NavaTim merged 7 commits intomainfrom
tbradley/lg-7832-transliterate-usps-api-fix-forms

Conversation

@NavaTim
Copy link
Contributor

@NavaTim NavaTim commented Mar 6, 2023

🎫 Ticket

🛠 Summary of changes

  • Preserve State ID and Address form data on invalid submissions
  • Form submission responses will include errors

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Complete IPP flow up until state ID form
  • Disable JavaScript and refresh
  • Use the dev tools to remove the required attribute from the First name field
  • Submit the form without filling out the First name
  • Verify that form re-renders with an error for the First name field
  • Enter valid state ID data and repeat the above for the address form

Note: Previous behavior was to re-render the same form with no error and with all fields blank.

changelog: Bug Fixes, In-Person Proofing, Retain State ID and Address on form re-render after invalid submissions
Copy link
Contributor

@jmhooper jmhooper left a comment

Choose a reason for hiding this comment

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

This looks like it should work. I think the fact that the forms get memoized is not very obvious to people implementing steps. That is, unfortunately however, the nature of the flow state machine and the reason we are discarding it.

I will say, related to it be non-obvious, I think we could do a lot of work on the commit message here. Doing so will help future readers understand what this change is doing and what its purpose is. Please make sure to write a descriptive message when you merge that provides context for why this change is necessary and describes how it solves that problem.

NavaTim and others added 4 commits March 7, 2023 12:47
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@NavaTim NavaTim merged commit 683ab69 into main Mar 7, 2023
@NavaTim NavaTim deleted the tbradley/lg-7832-transliterate-usps-api-fix-forms branch March 7, 2023 21:02
@NavaTim
Copy link
Contributor Author

NavaTim commented Mar 7, 2023

@jmhooper I included details about how and why this change works in the squash commit message.

@jmdembe jmdembe mentioned this pull request Mar 9, 2023
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.

3 participants