-
Notifications
You must be signed in to change notification settings - Fork 166
LG-8948: Swap order of form steps "Location" and "Prepare" #8125
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
Changes from all commits
86e6a7d
a38d2d3
171b173
ed58cfe
1cd5c26
c3cf9a9
812c2b6
b131d4e
3a67874
e8dab19
5dc5e79
2d04f31
03ce743
4d52c85
1a422f8
c7fe5c2
6028749
8dd176d
28e68b2
7c03a81
a272d0b
4b2a7e4
7619a0e
0b61b8e
ab477db
0ee24b9
a288ff1
672d873
8579096
663ccfb
bb2ea49
e4f02ae
44d7b6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,48 @@ | ||
| import { useContext, useState } from 'react'; | ||
| import type { MouseEventHandler } from 'react'; | ||
| import { Alert, Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components'; | ||
| import { removeUnloadProtection } from '@18f/identity-url'; | ||
| import { Button, Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components'; | ||
| import { getConfigValue } from '@18f/identity-config'; | ||
| import { useI18n } from '@18f/identity-react-i18n'; | ||
| import { FormStepsButton } from '@18f/identity-form-steps'; | ||
| import { SpinnerButton } from '@18f/identity-spinner-button'; | ||
| import useHistoryParam from '@18f/identity-form-steps/use-history-param'; | ||
| import UploadContext from '../context/upload'; | ||
| import MarketingSiteContext from '../context/marketing-site'; | ||
| import AnalyticsContext from '../context/analytics'; | ||
| import BackButton from './back-button'; | ||
| import InPersonTroubleshootingOptions from './in-person-troubleshooting-options'; | ||
| import { InPersonContext } from '../context'; | ||
|
|
||
| function InPersonPrepareStep({ toPreviousStep, value }) { | ||
| function InPersonPrepareStep({ toPreviousStep }) { | ||
| const { t } = useI18n(); | ||
| const [isSubmitting, setIsSubmitting] = useState(false); | ||
| const { inPersonURL } = useContext(InPersonContext); | ||
| const [, setStepName] = useHistoryParam(undefined); | ||
| const { inPersonURL, inPersonCtaVariantActive } = useContext(InPersonContext); | ||
| const { flowPath } = useContext(UploadContext); | ||
| const { trackEvent } = useContext(AnalyticsContext); | ||
| const { trackEvent, setSubmitEventMetadata } = useContext(AnalyticsContext); | ||
| const { securityAndPrivacyHowItWorksURL } = useContext(MarketingSiteContext); | ||
| const { selectedLocationAddress } = value; | ||
|
|
||
| const onContinue: MouseEventHandler = async (event) => { | ||
| const onContinue: MouseEventHandler = (event: React.MouseEvent) => { | ||
| event.preventDefault(); | ||
|
|
||
| if (!isSubmitting) { | ||
| setIsSubmitting(true); | ||
| removeUnloadProtection(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may need to add this function call to the location step. |
||
| await trackEvent('IdV: prepare submitted'); | ||
| window.location.href = inPersonURL!; | ||
| setSubmitEventMetadata({ in_person_cta_variant: inPersonCtaVariantActive }); | ||
| trackEvent('IdV: prepare submitted'); | ||
| setStepName('location'); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| {selectedLocationAddress && ( | ||
| <Alert type="success" className="margin-bottom-4"> | ||
| {t('in_person_proofing.body.prepare.alert_selected_post_office', { | ||
| full_address: selectedLocationAddress, | ||
| })} | ||
| </Alert> | ||
| )} | ||
| <PageHeading>{t('in_person_proofing.headings.prepare')}</PageHeading> | ||
|
|
||
| <p>{t('in_person_proofing.body.prepare.verify_step_about')}</p> | ||
|
|
||
| <ProcessList className="margin-bottom-4"> | ||
| <ProcessListItem | ||
| heading={t('in_person_proofing.body.prepare.verify_step_post_office')} | ||
| headingUnstyled | ||
| /> | ||
| <ProcessListItem | ||
| heading={t('in_person_proofing.body.prepare.verify_step_enter_pii')} | ||
| headingUnstyled | ||
|
|
@@ -59,9 +55,14 @@ function InPersonPrepareStep({ toPreviousStep, value }) { | |
| {flowPath === 'hybrid' && <FormStepsButton.Continue />} | ||
| {inPersonURL && flowPath === 'standard' && ( | ||
| <div className="margin-y-5"> | ||
| <SpinnerButton onClick={onContinue} isBig isWide> | ||
| <Button | ||
| isBig | ||
| isWide | ||
| className="margin-top-3 margin-bottom-1" | ||
| onClick={(event: React.MouseEvent) => onContinue(event)} | ||
| > | ||
| {t('forms.buttons.continue')} | ||
| </SpinnerButton> | ||
| </Button> | ||
| </div> | ||
| )} | ||
| <p> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,10 +86,10 @@ | |
| 'IdV: doc auth image upload form submitted' => { success: true, errors: {}, attempts: 1, remaining_attempts: 3, user_id: user.uuid, flow_path: 'standard' }, | ||
| 'IdV: doc auth image upload vendor submitted' => hash_including(success: true, flow_path: 'standard', attention_with_barcode: true, doc_auth_result: 'Attention'), | ||
| 'IdV: verify in person troubleshooting option clicked' => { flow_path: 'standard', in_person_cta_variant: 'in_person_variant_a' }, | ||
| 'IdV: in person proofing location visited' => { flow_path: 'standard', in_person_cta_variant: 'in_person_variant_a' }, | ||
| 'IdV: in person proofing location submitted' => { flow_path: 'standard', selected_location: '606 E JUNEAU AVE, MILWAUKEE, WI, 53202-9998', in_person_cta_variant: 'in_person_variant_a' }, | ||
| 'IdV: in person proofing prepare visited' => { flow_path: 'standard' }, | ||
| 'IdV: in person proofing prepare submitted' => { flow_path: 'standard' }, | ||
| 'IdV: in person proofing location visited' => hash_including(flow_path: 'standard'), | ||
| 'IdV: in person proofing location submitted' => { flow_path: 'standard', selected_location: '606 E JUNEAU AVE, MILWAUKEE, WI, 53202-9998', in_person_cta_variant: 'in_person_variant_a' }, | ||
|
Comment on lines
-89
to
+92
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After merging in |
||
| 'IdV: in person proofing state_id visited' => { step: 'state_id', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false }, | ||
| 'IdV: in person proofing state_id submitted' => { success: true, flow_path: 'standard', step: 'state_id', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false, errors: {} }, | ||
| 'IdV: in person proofing address visited' => { step: 'address', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing', irs_reproofing: false }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.