Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LG-10465 Add update route for address controller #9489

Merged
merged 24 commits into from
Nov 15, 2023

Conversation

svalexander
Copy link
Contributor

@svalexander svalexander commented Oct 31, 2023

🎫 Ticket

LG-10465

🛠 Summary of changes

Add update route for the new address controller. Also add more before actions to ensure user who manually changes url is routed to the correct page.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • Go through ipp flow and arrive at state id page
  • select no address does not match id
  • click continue and make sure url is in_person/address
  • Change url manually to in_person_proofing/address and make sure 404 renders
  • In config/application.yml.default update controller flag (in_person_residential_address_controller_enabled) to true
  • Go through ipp flow again and arrive at state id page
  • select no address does not match id
  • Continue to next page and make sure url is in_person_proofing/address
  • Fill out form with invalid inputs (numbers in city field and non-alphabet characters in address1 and addres2 fields)
  • Click continue
  • make sure errors are shown and that you do not proceed to next page
  • Fix form so it has valid inputs
  • Click continue
  • Continue onto ssn page
  • Manually change url to in_person_proofing/address
  • Make sure you are routed back to the ssn page
  • Fill out form and continue onto verify info page
  • Click update address
  • Ensure url is in_person_proofing/address
  • Manually change url to in_person/address
  • Make sure you are routed back to the verify info page
  • Click update address
  • Manually change url to in_person/state_id
  • Make sure you are routed back to the verify info page
  • Click update address
  • Manually change url to in_person/ssn
  • Make sure you are routed back to the verify info page
  • Click update address
  • Manually change url to in_person/address
  • Make sure you are routed back to the verify info page
  • Click update address
  • Change values on the page
  • Click update and make sure new values are in residential address section
  • On Verify info page click update state id
  • Change same address selection to yes
  • Click update and make sure address values are same in state and address sections
  • On Verify info page click update state id
  • Change same address selection to no
  • Click update and make sure url is in_person_proofing/address
  • Fill out form and submit
  • Make sure values are in address section of verify info page

@svalexander svalexander marked this pull request as draft October 31, 2023 16:55

analytics.idv_in_person_proofing_residential_address_submitted(**form_result.to_h)

if updating_address?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@soniaconnolly since I'm doing this check here and redirecting to verify_info do I still need the check mentioned in this comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

You'll have to test it out to make sure, but I believe that you do, because the before_action will redirect away from the Ssn step if the user already has an address in the session, the way they do when they're editing from VerifyInfo. It looks like you did add it below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If i manually change the url to in_person/state_id when on the in_person_proofing/address page it redirects to in_person/address. Any thoughts on how I might fix that @soniaconnolly ?

Copy link
Contributor

@soniaconnolly soniaconnolly Oct 31, 2023

Choose a reason for hiding this comment

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

Re: redirecting to the FSM step from the previous step, let's make a failing spec and look at the redirects and see if we can figure this out. (I think we started on that.)


analytics.idv_in_person_proofing_residential_address_submitted(**form_result.to_h)

if updating_address?
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll have to test it out to make sure, but I believe that you do, because the before_action will redirect away from the Ssn step if the user already has an address in the session, the way they do when they're editing from VerifyInfo. It looks like you did add it below.

Comment on lines 76 to 99
redirect_to idv_in_person_ssn_url
return if request.referer == idv_in_person_verify_info_url
redirect_to idv_in_person_verify_info_url
Copy link
Contributor

Choose a reason for hiding this comment

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

The referer check looks good (although I've been discovering lately that relying on the referer is not ideal). Why are you redirecting to verify_info instead of ssn at the end?

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 using confirm_ssn_step_needed instead to redirect to ssn. Line 99 will redirect us to verify info in case a user changes the url to in_person_proofing/address after having completed all the steps.

Comment on lines 102 to 105
def confirm_ssn_step_needed
if pii_from_user&.has_key?(:address1) && !idv_session.ssn
redirect_to idv_in_person_ssn_url
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need this check here? I would think the SsnController would do this check if needed.

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 added it in to handle someone manually entering in_person_proofing/address on the ssn pg

Copy link
Contributor

@soniaconnolly soniaconnolly Oct 31, 2023

Choose a reason for hiding this comment

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

Re: redirecting to the FSM step from the previous step, let's make a failing spec and look at the redirects and see if we can figure this out. (I think we started on that.)

@svalexander
Copy link
Contributor Author

FormValidation is not working for this page on input fields (other than zipcode)

@svalexander svalexander changed the title Shannon/lg 10465 update route address LG-10465 Add update route for address controller Nov 9, 2023
@svalexander svalexander marked this pull request as ready for review November 9, 2023 22:14
@svalexander svalexander requested review from a team and gina-yamada November 13, 2023 15:24
Copy link
Member

@n1zyy n1zyy left a comment

Choose a reason for hiding this comment

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

This all looks like good stuff to me! I left a couple small questions/suggestions below, but certainly nothing blocking.

I think I would prefer to let another teammate approve this, just because I'm new to this flow and it's probably best if someone with more familiarity with it could give this a once-over.

app/controllers/idv/in_person/address_controller.rb Outdated Show resolved Hide resolved
spec/controllers/idv/in_person/address_controller_spec.rb Outdated Show resolved Hide resolved
app/controllers/idv/in_person/address_controller.rb Outdated Show resolved Hide resolved
spec/features/idv/steps/in_person/address_spec.rb Outdated Show resolved Hide resolved
@gina-yamada
Copy link
Contributor

gina-yamada commented Nov 15, 2023

@svalexander Everything I have tested is working as I'd expect except for the back button. When I click back I see this page and then get directed to phone. (Cancel- initial page visit is working as I'd expect)

Screenshot 2023-11-15 at 2 47 48 PM

✅ UI Is accurate for update (link/button/header)
✅ Form validation is working for initial submission on also on update (if I clear out fields and submit I can not proceed)
✅ Form submission takes me to Verify on submission (update)
✅ Clicking Update on /verify/in_person/verify_info for Current residential address takes me to new non-FSM controller at /verify/in_person_proofing/address
❌ Back button is not redirecting back to the Verify view at /verify/in_person/verify_info
✅ Redirects correctly when I edit state id address and change same as id from false to true- date also updated, same updates and redirects correctly when I edit residential address (after originally picking that is was the same)- address updates and the radio button on state id address now says they are different
✅ When in_person_full_address_entry_enabled is set to false, existing behavior does not appear to be affected- tested many flows, also observe a 404 when I try to visit non-fsm controller at url /verify/in_person_proofing/address

@gina-yamada
Copy link
Contributor

gina-yamada commented Nov 15, 2023

Worked through code changes & tests with Shannon and Sonia. Back button is now working! Shannon and Sonia are still working through some changes so not going to approve at this time.

Copy link
Contributor

@soniaconnolly soniaconnolly left a comment

Choose a reason for hiding this comment

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

We reviewed this together in detail along with @gina-yamada, looks great!

@svalexander svalexander merged commit 8600e4c into main Nov 15, 2023
2 checks passed
@svalexander svalexander deleted the shannon/lg-10465-update-route-address branch November 15, 2023 22:56
@zachmargolis
Copy link
Contributor

👋 hi this PR didn't have have a changelog entry in the commit message after it was merged, please make sure to add one next time

@svalexander
Copy link
Contributor Author

👋 hi this PR didn't have have a changelog entry in the commit message after it was merged, please make sure to add one next time

@zachmargolis My mistake. I didn't get a ci/cd error due to the changelog to catch the mistake. How do I make sure the changelog message is present for this pr for the next deploy?

@zachmargolis
Copy link
Contributor

@zachmargolis My mistake. I didn't get a ci/cd error due to the changelog to catch the mistake. How do I make sure the changelog message is present for this pr for the next deploy?

When you click "Squash and Merge" just make sure to preserve the changelog: ... line in the commit message

@svalexander
Copy link
Contributor Author

svalexander commented Nov 16, 2023

When you click "Squash and Merge" just make sure to preserve the changelog: ... line in the commit message

Looking back at my commit history it looks like i never added a changelog message :-( .

@mitchellhenke mitchellhenke restored the shannon/lg-10465-update-route-address branch November 16, 2023 18:15
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