Skip to content

Commit

Permalink
feat: update new variable on the frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
KeithNava committed Aug 19, 2024
1 parent 7c0b2f7 commit ae399b5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions app/controllers/idv/hybrid_handoff_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function InPersonPrepareStep({ toPreviousStep }) {
inPersonURL,
inPersonOutageMessageEnabled,
inPersonOutageExpectedUpdateDate,
skipDocAuth,
skipDocAuthFromHowToVerify,
skipDocAuthFromHandoff,
howToVerifyURL,
previousStepURL,
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/packages/document-capture/context/in-person.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/packs/document-capture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface AppRootData {
idvInPersonUrl?: string;
optedInToInPersonProofing: string;
securityAndPrivacyHowItWorksUrl: string;
skipDocAuth: string;
skipDocAuthFromHowToVerify: string;
skipDocAuthFromHandoff: string;
howToVerifyURL: string;
previousStepUrl: string;
Expand Down Expand Up @@ -104,7 +104,7 @@ const {
inPersonOutageExpectedUpdateDate,
optedInToInPersonProofing,
usStatesTerritories = '',
skipDocAuth,
skipDocAuthFromHowToVerify,
skipDocAuthFromHandoff,
howToVerifyUrl,
previousStepUrl,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ae399b5

Please sign in to comment.