From 871c9ad2929a7bfbd060731ffb945e27406679c3 Mon Sep 17 00:00:00 2001 From: S T Date: Fri, 23 Aug 2024 13:45:16 -0700 Subject: [PATCH] feat(complete user profile): split urls - complete user profile - w and without associations (#878) closes #863 ## Changes - feat(complete user profile): split urls - complete user profile - w and without associations ## How to test this PR 1. Create a profile -- using an account with financial institutions 2. Create a profile -- using an account without financial institutions - Try to break the PR by manually navigating as authorized and unauthorized (not logged in) users --- src/App.tsx | 38 ++++++++++++++++++++++++++---- src/pages/ProfileForm/index.tsx | 21 +++++++---------- src/pages/Summary/Summary.data.tsx | 2 +- 3 files changed, 44 insertions(+), 17 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 87e8db507..3dcffde28 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,6 +23,8 @@ import FilingWarnings from 'pages/Filing/FilingApp/FilingWarnings'; import InstitutionProtectedRoute from 'pages/Filing/FilingApp/InstitutionProtectedRoute'; import UpdateFinancialProfile from 'pages/Filing/UpdateFinancialProfile'; import ViewUserProfile from 'pages/Filing/ViewUserProfile'; +import CreateProfileFormNoAssoc from 'pages/ProfileForm/CreateProfileForm'; +import CreateProfileFormWAssoc from 'pages/ProfileForm/Step1Form/Step1Form'; import { SummaryRoutesList } from 'pages/Summary/SummaryRoutes'; import type { ReactElement } from 'react'; import { Suspense, lazy } from 'react'; @@ -231,7 +233,7 @@ export default function App(): ReactElement { UserProfile, isAnyAuthorizationLoading, }; - + return ( @@ -389,6 +391,28 @@ export default function App(): ReactElement { } /> + +
+ +
+ + } + /> + +
+ +
+ + } + /> } /> - {SummaryRoutesList.map(path => { - return } />; - })} + {SummaryRoutesList.map(path => { + return ( + } + /> + ); + })} } /> {/* TODO: Remove /loading route once testing is complete */} } /> diff --git a/src/pages/ProfileForm/index.tsx b/src/pages/ProfileForm/index.tsx index afd204a11..fedbb01f2 100644 --- a/src/pages/ProfileForm/index.tsx +++ b/src/pages/ProfileForm/index.tsx @@ -1,6 +1,3 @@ -import CreateProfileForm from 'pages/ProfileForm/CreateProfileForm'; -import Step1Form from 'pages/ProfileForm/Step1Form/Step1Form'; - import { useQuery } from '@tanstack/react-query'; import { fetchInstitutions, fetchIsDomainAllowed } from 'api/requests'; import useSblAuth from 'api/useSblAuth'; @@ -75,7 +72,11 @@ function CompleteUserProfileForm(): JSX.Element | null { if (isRoutingEnabled && !isEmailDomainAllowed) { // TODO: This check should happen in App.ts -- top-level return ( - + ); } @@ -89,15 +90,11 @@ function CompleteUserProfileForm(): JSX.Element | null { !isUserEmailDomainAssociatedWithAnyInstitution; /* If there is no financial institutions associated with user's email domain, use the 'Add Financial Institution' form instead */ - const UserProfileForm = isNonAssociatedEmailDomain - ? CreateProfileForm - : Step1Form; + if (isNonAssociatedEmailDomain) { + return ; + } - return ( -
- -
- ); + return ; } export default CompleteUserProfileForm; diff --git a/src/pages/Summary/Summary.data.tsx b/src/pages/Summary/Summary.data.tsx index e6b759201..1f1b9bd94 100644 --- a/src/pages/Summary/Summary.data.tsx +++ b/src/pages/Summary/Summary.data.tsx @@ -69,7 +69,7 @@ const linkStyles = 'border-b-[1px]'; // function ChildrenWarning2(): JSX.Element { // return ( // <> -// You may begin filing for the financial institution assocation that match +// You may begin filing for the financial institution association that match // your email domain. Your self selections have gone to our technical help // team for review. You will not be able to file for those institutions until // the associations are approved. Please allow 24-48 hours for a response