From ae399b5ab231683a382a4e85c19c289abb4473dc Mon Sep 17 00:00:00 2001 From: Keith WIlliams Date: Mon, 19 Aug 2024 13:52:38 -0400 Subject: [PATCH] feat: update new variable on the frontend --- app/controllers/idv/hybrid_handoff_controller.rb | 6 +++--- .../components/document-capture.tsx | 14 +++++++++----- .../components/in-person-prepare-step.tsx | 4 ++-- .../packages/document-capture/context/in-person.ts | 4 ++-- app/javascript/packs/document-capture.tsx | 6 +++--- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb index 0637a6d8219..f746764b6f5 100644 --- a/app/controllers/idv/hybrid_handoff_controller.rb +++ b/app/controllers/idv/hybrid_handoff_controller.rb @@ -48,10 +48,10 @@ def self.selected_remote(idv_session:) if IdentityConfig.store.in_person_proofing_opt_in_enabled && IdentityConfig.store.in_person_proofing_enabled && idv_session.service_provider&.in_person_proofing_enabled - idv_session.skip_doc_auth_from_handoff == false + idv_session.skip_doc_auth_from_how_to_verify == false else - idv_session.skip_doc_auth_from_handoff.nil? || - idv_session.skip_doc_auth_from_handoff == false + idv_session.skip_doc_auth_from_how_to_verify.nil? || + idv_session.skip_doc_auth_from_how_to_verify == false end end diff --git a/app/javascript/packages/document-capture/components/document-capture.tsx b/app/javascript/packages/document-capture/components/document-capture.tsx index afbacbc27d6..ce3260b613a 100644 --- a/app/javascript/packages/document-capture/components/document-capture.tsx +++ b/app/javascript/packages/document-capture/components/document-capture.tsx @@ -37,8 +37,12 @@ function DocumentCapture({ onStepChange = () => {} }: DocumentCaptureProps) { const { t } = useI18n(); const { flowPath } = useContext(UploadContext); const { trackSubmitEvent, trackVisitEvent } = useContext(AnalyticsContext); - const { inPersonFullAddressEntryEnabled, inPersonURL, skipDocAuth, skipDocAuthFromHandoff } = - useContext(InPersonContext); + const { + inPersonFullAddressEntryEnabled, + inPersonURL, + skipDocAuthFromHowToVerify, + skipDocAuthFromHandoff, + } = useContext(InPersonContext); useDidUpdateEffect(onStepChange, [stepName]); useEffect(() => { if (stepName) { @@ -136,12 +140,12 @@ function DocumentCapture({ onStepChange = () => {} }: DocumentCaptureProps) { ? ([reviewFormStep] as FormStep[]).concat(inPersonSteps) : ([documentFormStep] as FormStep[]); - // If the user got here by opting-in to in-person proofing, when skipDocAuth === true, + // If the user got here by opting-in to in-person proofing, when skipDocAuthFromHowToVerify === true, // then set steps to inPersonSteps - const isInPersonStepEnabled = skipDocAuth || skipDocAuthFromHandoff; + const isInPersonStepEnabled = skipDocAuthFromHowToVerify || skipDocAuthFromHandoff; const steps: FormStep[] = isInPersonStepEnabled ? inPersonSteps : defaultSteps; - // If the user got here by opting-in to in-person proofing, when skipDocAuth === true; + // If the user got here by opting-in to in-person proofing, when skipDocAuthFromHowToVerify === true; // or opting-in ipp from handoff page, and selfie is required, when skipDocAuthFromHandoff === true // then set stepIndicatorPath to VerifyFlowPath.IN_PERSON const stepIndicatorPath = diff --git a/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx b/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx index a8de5bbe374..04a12982665 100644 --- a/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx +++ b/app/javascript/packages/document-capture/components/in-person-prepare-step.tsx @@ -19,7 +19,7 @@ function InPersonPrepareStep({ toPreviousStep }) { inPersonURL, inPersonOutageMessageEnabled, inPersonOutageExpectedUpdateDate, - skipDocAuth, + skipDocAuthFromHowToVerify, skipDocAuthFromHandoff, howToVerifyURL, previousStepURL, @@ -29,7 +29,7 @@ function InPersonPrepareStep({ toPreviousStep }) { if (skipDocAuthFromHandoff && previousStepURL) { // directly from handoff page forceRedirect(previousStepURL); - } else if (skipDocAuth && howToVerifyURL) { + } else if (skipDocAuthFromHowToVerify && howToVerifyURL) { forceRedirect(howToVerifyURL); } else { toPreviousStep(); diff --git a/app/javascript/packages/document-capture/context/in-person.ts b/app/javascript/packages/document-capture/context/in-person.ts index 5de622d6ccb..2104b0d42f4 100644 --- a/app/javascript/packages/document-capture/context/in-person.ts +++ b/app/javascript/packages/document-capture/context/in-person.ts @@ -43,11 +43,11 @@ export interface InPersonContextProps { usStatesTerritories: Array<[string, string]>; /** - * When skipDocAuth is true and in_person_proofing_opt_in_enabled is true, + * When skipDocAuthFromHowToVerify is true and in_person_proofing_opt_in_enabled is true, * users are directed to the beginning of the IPP flow. This is set to true when * they choose Opt-in IPP on the new How To Verify page */ - skipDocAuth?: boolean; + skipDocAuthFromHowToVerify?: boolean; /** * Flag set when user select IPP from handoff page when IPP is available diff --git a/app/javascript/packs/document-capture.tsx b/app/javascript/packs/document-capture.tsx index 66481af0086..78f74abfb3c 100644 --- a/app/javascript/packs/document-capture.tsx +++ b/app/javascript/packs/document-capture.tsx @@ -34,7 +34,7 @@ interface AppRootData { idvInPersonUrl?: string; optedInToInPersonProofing: string; securityAndPrivacyHowItWorksUrl: string; - skipDocAuth: string; + skipDocAuthFromHowToVerify: string; skipDocAuthFromHandoff: string; howToVerifyURL: string; previousStepUrl: string; @@ -104,7 +104,7 @@ const { inPersonOutageExpectedUpdateDate, optedInToInPersonProofing, usStatesTerritories = '', - skipDocAuth, + skipDocAuthFromHowToVerify, skipDocAuthFromHandoff, howToVerifyUrl, previousStepUrl, @@ -133,7 +133,7 @@ const App = composeComponents( inPersonFullAddressEntryEnabled: inPersonFullAddressEntryEnabled === 'true', optedInToInPersonProofing: optedInToInPersonProofing === 'true', usStatesTerritories: parsedUsStatesTerritories, - skipDocAuth: skipDocAuth === 'true', + skipDocAuthFromHowToVerify: skipDocAuthFromHowToVerify === 'true', skipDocAuthFromHandoff: skipDocAuthFromHandoff === 'true', howToVerifyURL: howToVerifyUrl, previousStepURL: previousStepUrl,