LG-9663 Move prepare page before location page in IPP flow - functional changes only#8308
Conversation
…step ahead of Location step in IPP flow
...vascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx
Outdated
Show resolved
Hide resolved
…-move-prepare-page-before-location
|
@JackRyan1989 could you please update the screen shots? it seems like the version in Spanish for the PO search doesn't show the updates |
@carmenrosalop can you please check in the content changes only Pull Request? I'm sorry for the confusion! |
…-move-prepare-page-before-location
kellular
left a comment
There was a problem hiding this comment.
Jack walked me through the updated flow. LGTM!
| {flowPath === 'hybrid' && <FormStepsButton.Continue />} | ||
| {inPersonURL && flowPath === 'standard' && ( | ||
| <div className="margin-y-5"> | ||
| <SpinnerButton onClick={onContinue} isBig isWide> | ||
| <SpinnerButton type="submit" onClick={onContinue} isBig isWide> | ||
| {t('forms.buttons.continue')} | ||
| </SpinnerButton> |
There was a problem hiding this comment.
Are we able to simplify this logic and use FormStepsButton.Continue for both cases, esp. now that this page will not direct the user outside the flow?
There was a problem hiding this comment.
I think so. I have some changes that reduce the complexity here.
| trackEvent('IdV: location submitted', { | ||
| selected_location: selectedLocationAddress, | ||
| in_person_cta_variant: inPersonCtaVariantActive, | ||
| }); | ||
| forceRedirect(inPersonURL!); |
There was a problem hiding this comment.
What's the behavior of these trackEvent and forceRedirect calls during hybrid flow?
There was a problem hiding this comment.
Good q. So trackEvent could get called twice, once on the typical submission event and then here at line 77. And then the forceRedirect behavior is probably being overridden.
There was a problem hiding this comment.
Options: I could wrap the trackEvent and forceRedirect in an if check analogous to what I do for the event.preventDefault; or I could try to take advantage of the e.click() behavior that pre-existed my changes.
There was a problem hiding this comment.
I opted for wrapping the forceRedirect trackEvent calls in an if check @NavaTim
…-move-prepare-page-before-location
| if (flowPath !== 'hybrid') { | ||
| e.preventDefault(); | ||
| } |
There was a problem hiding this comment.
Is this related to what we were seeing in the hybrid test failures? Unsure what this is needed for.
There was a problem hiding this comment.
Yeah, so as far as I can tell this is the one change that was breaking that test. I need to do more digging, but my understanding of the React FSM is that it's listening for submit events specifically. We were preventing that and then doing a click, so I think that was it.
allthesignals
left a comment
There was a problem hiding this comment.
I'm wondering what was the source of our testing woes with the hybrid flow? I see a new check for the hybrid flowPath... seems related.
Thanks for shepherding this through! Looks great.
| selected_location: selectedLocationAddress, | ||
| in_person_cta_variant: inPersonCtaVariantActive, | ||
| }); | ||
| forceRedirect(inPersonURL!); |
There was a problem hiding this comment.
Ah, was this the helper you mentioned earlier?
There was a problem hiding this comment.
Um, I don't think so as Tomas was the one who added this bit in. I think I was referring to const [, setStepName] = useHistoryParam(undefined);
| {inPersonURL && flowPath === 'standard' ? ( | ||
| <FormStepsButton.Continue className="margin-y-5" /> | ||
| ) : ( | ||
| <FormStepsButton.Continue /> |
…-move-prepare-page-before-location
🎫 Ticket
🛠 Summary of changes
The prepare page now appears before the location page in the IPP flow. Changes made to React application and RSpec feature tests where necessary.
📜 Testing Plan
👀 Screenshots - see PR 8312