From 79471f485199b41dbc22c1abbd4a81e21d6dbb78 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 16:42:38 -0700 Subject: [PATCH 01/25] Change /app folder to /redux --- .../src/components/authentication/ProtectedRoute.tsx | 2 +- .../authentication/hooks/useAuthenticateWithOAuth.ts | 9 ++++++--- frontend/src/components/common/AuthenticatedHeader.tsx | 2 +- frontend/src/components/common/GuestInviteButton.tsx | 2 +- frontend/src/main.tsx | 2 +- frontend/src/{app => redux}/authSlice.ts | 0 frontend/src/{app => redux}/helpers.ts | 0 frontend/src/{app => redux}/hooks/store.ts | 0 frontend/src/{app => redux}/hooks/useAuth.ts | 0 frontend/src/{app => redux}/store.ts | 0 frontend/src/services/api.ts | 4 ++-- frontend/src/utils/test/test-utils.tsx | 2 +- frontend/src/views/ConfirmSignUp.tsx | 2 +- frontend/src/views/ForgotPassword.tsx | 2 +- frontend/src/views/ForgotPasswordCode.tsx | 2 +- frontend/src/views/NewPassword.tsx | 2 +- frontend/src/views/ResetPassword.tsx | 2 +- frontend/src/views/SignIn.tsx | 6 +++--- frontend/src/views/SignUp.tsx | 2 +- 19 files changed, 22 insertions(+), 19 deletions(-) rename frontend/src/{app => redux}/authSlice.ts (100%) rename frontend/src/{app => redux}/helpers.ts (100%) rename frontend/src/{app => redux}/hooks/store.ts (100%) rename frontend/src/{app => redux}/hooks/useAuth.ts (100%) rename frontend/src/{app => redux}/store.ts (100%) diff --git a/frontend/src/components/authentication/ProtectedRoute.tsx b/frontend/src/components/authentication/ProtectedRoute.tsx index 759acb60..501d5414 100644 --- a/frontend/src/components/authentication/ProtectedRoute.tsx +++ b/frontend/src/components/authentication/ProtectedRoute.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Navigate, useLocation} from 'react-router-dom'; -import {useAuth} from '../../app/hooks/useAuth'; +import {useAuth} from '../../redux/hooks/useAuth'; import {Loading} from '../common'; import {useCurrentUserQuery} from '../../services/user'; diff --git a/frontend/src/components/authentication/hooks/useAuthenticateWithOAuth.ts b/frontend/src/components/authentication/hooks/useAuthenticateWithOAuth.ts index caf3b3cb..893eaf98 100644 --- a/frontend/src/components/authentication/hooks/useAuthenticateWithOAuth.ts +++ b/frontend/src/components/authentication/hooks/useAuthenticateWithOAuth.ts @@ -1,9 +1,12 @@ import React from 'react'; -import {setCredentials} from '../../../app/authSlice'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../../../app/helpers'; +import {setCredentials} from '../../../redux/authSlice'; +import { + isFetchBaseQueryError, + isErrorWithMessage, +} from '../../../redux/helpers'; import {TokenRequest, TokenResponse} from '../../../services/auth'; import {useNavigate} from 'react-router-dom'; -import {useAppDispatch} from '../../../app/hooks/store'; +import {useAppDispatch} from '../../../redux/hooks/store'; import { MutationActionCreatorResult, MutationDefinition, diff --git a/frontend/src/components/common/AuthenticatedHeader.tsx b/frontend/src/components/common/AuthenticatedHeader.tsx index 273b230e..a55899db 100644 --- a/frontend/src/components/common/AuthenticatedHeader.tsx +++ b/frontend/src/components/common/AuthenticatedHeader.tsx @@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography'; import {Tooltip, Avatar, Menu, MenuItem, Stack} from '@mui/material'; import logo from '../../img/favicon.png'; import {useSignOutMutation} from '../../services/auth'; -import {selectCurrentUser} from '../../app/authSlice'; +import {selectCurrentUser} from '../../redux/authSlice'; import {User, UserRole} from '../../services/user'; import {useSelector} from 'react-redux'; diff --git a/frontend/src/components/common/GuestInviteButton.tsx b/frontend/src/components/common/GuestInviteButton.tsx index 9918d6a5..56a5b18b 100644 --- a/frontend/src/components/common/GuestInviteButton.tsx +++ b/frontend/src/components/common/GuestInviteButton.tsx @@ -16,7 +16,7 @@ import { } from '@mui/material'; import {useInviteGuestMutation} from '../../services/coordinator'; import {CheckOutlined, EmailOutlined} from '@mui/icons-material'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../../app/helpers'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../../redux/helpers'; export const validationSchema = object({ firstName: string().required('first name is required'), diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 83fa9e7c..10c81999 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -7,7 +7,7 @@ import {LocalizationProvider} from '@mui/x-date-pickers'; import {AdapterDateFns} from '@mui/x-date-pickers/AdapterDateFns'; import './index.css'; -import {setupStore} from './app/store'; +import {setupStore} from './redux/store'; import {ProtectedRoute} from './components/authentication/ProtectedRoute'; import {useSessionMutation} from './services/auth'; import {HomeUniteUsTheme} from './theme'; diff --git a/frontend/src/app/authSlice.ts b/frontend/src/redux/authSlice.ts similarity index 100% rename from frontend/src/app/authSlice.ts rename to frontend/src/redux/authSlice.ts diff --git a/frontend/src/app/helpers.ts b/frontend/src/redux/helpers.ts similarity index 100% rename from frontend/src/app/helpers.ts rename to frontend/src/redux/helpers.ts diff --git a/frontend/src/app/hooks/store.ts b/frontend/src/redux/hooks/store.ts similarity index 100% rename from frontend/src/app/hooks/store.ts rename to frontend/src/redux/hooks/store.ts diff --git a/frontend/src/app/hooks/useAuth.ts b/frontend/src/redux/hooks/useAuth.ts similarity index 100% rename from frontend/src/app/hooks/useAuth.ts rename to frontend/src/redux/hooks/useAuth.ts diff --git a/frontend/src/app/store.ts b/frontend/src/redux/store.ts similarity index 100% rename from frontend/src/app/store.ts rename to frontend/src/redux/store.ts diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index 94a1c0dd..30f441cb 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -5,8 +5,8 @@ import { FetchBaseQueryError, FetchArgs, } from '@reduxjs/toolkit/query/react'; -import {setCredentials, tokenReceived} from '../app/authSlice'; -import {RootState} from '../app/store'; +import {setCredentials, tokenReceived} from '../redux/authSlice'; +import {RootState} from '../redux/store'; // Create base query const baseQuery = fetchBaseQuery({ diff --git a/frontend/src/utils/test/test-utils.tsx b/frontend/src/utils/test/test-utils.tsx index 76c97d31..9cae4570 100644 --- a/frontend/src/utils/test/test-utils.tsx +++ b/frontend/src/utils/test/test-utils.tsx @@ -6,7 +6,7 @@ import userEvent from '@testing-library/user-event'; import {HomeUniteUsTheme} from '../../theme'; import {PreloadedState} from '@reduxjs/toolkit'; -import {setupStore, RootState, AppStore} from '../../app/store'; +import {setupStore, RootState, AppStore} from '../../redux/store'; interface ProviderProps { children: ReactNode; diff --git a/frontend/src/views/ConfirmSignUp.tsx b/frontend/src/views/ConfirmSignUp.tsx index 9961057a..f32f69bc 100644 --- a/frontend/src/views/ConfirmSignUp.tsx +++ b/frontend/src/views/ConfirmSignUp.tsx @@ -11,7 +11,7 @@ import CloseIcon from '@mui/icons-material/Close'; import {useSearchParams} from 'react-router-dom'; import {useResendConfirmationCodeMutation} from '../services/auth'; import {FormContainer} from '../components/authentication'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../app/helpers'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; interface Alert { severity: 'success' | 'error'; diff --git a/frontend/src/views/ForgotPassword.tsx b/frontend/src/views/ForgotPassword.tsx index 733d59a3..300c2cd2 100644 --- a/frontend/src/views/ForgotPassword.tsx +++ b/frontend/src/views/ForgotPassword.tsx @@ -11,7 +11,7 @@ import CloseIcon from '@mui/icons-material/Close'; import {useFormikContext} from 'formik'; import React from 'react'; import {useNavigate} from 'react-router-dom'; -import {isErrorWithMessage, isFetchBaseQueryError} from '../app/helpers'; +import {isErrorWithMessage, isFetchBaseQueryError} from '../redux/helpers'; import {ResestPasswordValues} from '../components/authentication/ResetPasswordContext'; import {useForgotPasswordMutation} from '../services/auth'; import {FormContainer} from '../components/authentication'; diff --git a/frontend/src/views/ForgotPasswordCode.tsx b/frontend/src/views/ForgotPasswordCode.tsx index 57c9c6f8..8152d108 100644 --- a/frontend/src/views/ForgotPasswordCode.tsx +++ b/frontend/src/views/ForgotPasswordCode.tsx @@ -16,7 +16,7 @@ import {useNavigate} from 'react-router-dom'; import {ResestPasswordValues} from '../components/authentication/ResetPasswordContext'; import {CodeField, FormContainer} from '../components/authentication'; import {useForgotPasswordMutation} from '../services/auth'; -import {getErrorMessage} from '../app/helpers'; +import {getErrorMessage} from '../redux/helpers'; interface Alert { severity: AlertColor; diff --git a/frontend/src/views/NewPassword.tsx b/frontend/src/views/NewPassword.tsx index b1e47860..4da82067 100644 --- a/frontend/src/views/NewPassword.tsx +++ b/frontend/src/views/NewPassword.tsx @@ -5,7 +5,7 @@ import {Typography, Stack, Alert, IconButton} from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import {NewPasswordRequest, useNewPasswordMutation} from '../services/auth'; import {useNavigate} from 'react-router-dom'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../app/helpers'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; import {FormContainer} from '../components/authentication'; export const NewPassword = () => { diff --git a/frontend/src/views/ResetPassword.tsx b/frontend/src/views/ResetPassword.tsx index 67db2a6c..fc52d102 100644 --- a/frontend/src/views/ResetPassword.tsx +++ b/frontend/src/views/ResetPassword.tsx @@ -9,7 +9,7 @@ import React from 'react'; import {useFormikContext} from 'formik'; import {ResestPasswordValues} from '../components/authentication/ResetPasswordContext'; import {useConfirmForgotPasswordMutation} from '../services/auth'; -import {getErrorMessage} from '../app/helpers'; +import {getErrorMessage} from '../redux/helpers'; import {FormContainer, PasswordField} from '../components/authentication'; import {PasswordValidation} from '../components/common/PasswordValidation'; diff --git a/frontend/src/views/SignIn.tsx b/frontend/src/views/SignIn.tsx index 63df4a07..56664589 100644 --- a/frontend/src/views/SignIn.tsx +++ b/frontend/src/views/SignIn.tsx @@ -10,15 +10,15 @@ import { } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; -import {setCredentials} from '../app/authSlice'; -import {useAppDispatch} from '../app/hooks/store'; +import {setCredentials} from '../redux/authSlice'; +import {useAppDispatch} from '../redux/hooks/store'; import {SignInForm} from '../components/authentication/SignInForm'; import { SignInRequest, useGoogleSignInMutation, useSignInMutation, } from '../services/auth'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../app/helpers'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; import {FormContainer} from '../components/authentication'; import { useAuthenticateWithOAuth, diff --git a/frontend/src/views/SignUp.tsx b/frontend/src/views/SignUp.tsx index 91f9712c..0d11aaee 100644 --- a/frontend/src/views/SignUp.tsx +++ b/frontend/src/views/SignUp.tsx @@ -16,7 +16,7 @@ import { useSignUpMutation, SignUpRequest, } from '../services/auth'; -import {isErrorWithMessage, isFetchBaseQueryError} from '../app/helpers'; +import {isErrorWithMessage, isFetchBaseQueryError} from '../redux/helpers'; import {FormContainer} from '../components/authentication'; import {useAuthenticateWithOAuth} from '../components/authentication/hooks/useAuthenticateWithOAuth'; From 5ddf2fe4323f9680c78de26401d0e7c267de145e Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 16:43:17 -0700 Subject: [PATCH 02/25] Change /views to /pages --- frontend/src/components/dashboard/DashboardTask.tsx | 2 +- .../src/components/dashboard/DashboardTaskAccordion.tsx | 2 +- .../src/components/intake-profile/IntakeProfileGroups.tsx | 4 ++-- frontend/src/components/intake-profile/ProfileReview.tsx | 2 +- .../intake-profile/fields/AdditionaGuestsField.tsx | 2 +- .../intake-profile/fields/AdditionalPetsField.tsx | 2 +- frontend/src/main.tsx | 6 +++--- frontend/src/{views => pages}/AccountVerification.tsx | 0 frontend/src/{views => pages}/ConfirmSignUp.tsx | 0 frontend/src/{views => pages}/CoordinatorDashboard.tsx | 0 frontend/src/{views => pages}/EmailVerificationError.tsx | 0 frontend/src/{views => pages}/EmailVerificationSuccess.tsx | 0 frontend/src/{views => pages}/ForgotPassword.tsx | 0 frontend/src/{views => pages}/ForgotPasswordCode.tsx | 0 frontend/src/{views => pages}/ForgotPasswordSuccess.tsx | 0 frontend/src/{views => pages}/GuestApplicationTracker.tsx | 0 frontend/src/{views => pages}/GuestContacts.tsx | 0 frontend/src/{views => pages}/GuestDocuments.tsx | 0 frontend/src/{views => pages}/GuestSettings.tsx | 0 frontend/src/{views => pages}/GuestTasks.tsx | 0 frontend/src/{views => pages}/Home.tsx | 0 frontend/src/{views => pages}/HostApplicationTracker.tsx | 0 frontend/src/{views => pages}/HostsList.tsx | 0 .../IntakeProfile/constants/buildValidationSchema.ts | 0 .../IntakeProfile/constants/createInitialValues.ts | 0 .../src/{views => pages}/IntakeProfile/constants/index.ts | 0 frontend/src/{views => pages}/IntakeProfile/index.tsx | 0 frontend/src/{views => pages}/LoadingComponent.tsx | 0 frontend/src/{views => pages}/NewPassword.tsx | 0 frontend/src/{views => pages}/ResetPassword.tsx | 0 frontend/src/{views => pages}/SelectAccountType.tsx | 0 frontend/src/{views => pages}/Settings.tsx | 0 frontend/src/{views => pages}/SignIn.tsx | 0 frontend/src/{views => pages}/SignUp.tsx | 0 frontend/src/{views => pages}/SystemAdminDashboard.tsx | 0 .../{views => pages}/__tests__/ForgotPasswordCode.test.tsx | 0 .../src/{views => pages}/__tests__/ResetPassword.test.tsx | 0 frontend/src/{views => pages}/index.ts | 0 38 files changed, 10 insertions(+), 10 deletions(-) rename frontend/src/{views => pages}/AccountVerification.tsx (100%) rename frontend/src/{views => pages}/ConfirmSignUp.tsx (100%) rename frontend/src/{views => pages}/CoordinatorDashboard.tsx (100%) rename frontend/src/{views => pages}/EmailVerificationError.tsx (100%) rename frontend/src/{views => pages}/EmailVerificationSuccess.tsx (100%) rename frontend/src/{views => pages}/ForgotPassword.tsx (100%) rename frontend/src/{views => pages}/ForgotPasswordCode.tsx (100%) rename frontend/src/{views => pages}/ForgotPasswordSuccess.tsx (100%) rename frontend/src/{views => pages}/GuestApplicationTracker.tsx (100%) rename frontend/src/{views => pages}/GuestContacts.tsx (100%) rename frontend/src/{views => pages}/GuestDocuments.tsx (100%) rename frontend/src/{views => pages}/GuestSettings.tsx (100%) rename frontend/src/{views => pages}/GuestTasks.tsx (100%) rename frontend/src/{views => pages}/Home.tsx (100%) rename frontend/src/{views => pages}/HostApplicationTracker.tsx (100%) rename frontend/src/{views => pages}/HostsList.tsx (100%) rename frontend/src/{views => pages}/IntakeProfile/constants/buildValidationSchema.ts (100%) rename frontend/src/{views => pages}/IntakeProfile/constants/createInitialValues.ts (100%) rename frontend/src/{views => pages}/IntakeProfile/constants/index.ts (100%) rename frontend/src/{views => pages}/IntakeProfile/index.tsx (100%) rename frontend/src/{views => pages}/LoadingComponent.tsx (100%) rename frontend/src/{views => pages}/NewPassword.tsx (100%) rename frontend/src/{views => pages}/ResetPassword.tsx (100%) rename frontend/src/{views => pages}/SelectAccountType.tsx (100%) rename frontend/src/{views => pages}/Settings.tsx (100%) rename frontend/src/{views => pages}/SignIn.tsx (100%) rename frontend/src/{views => pages}/SignUp.tsx (100%) rename frontend/src/{views => pages}/SystemAdminDashboard.tsx (100%) rename frontend/src/{views => pages}/__tests__/ForgotPasswordCode.test.tsx (100%) rename frontend/src/{views => pages}/__tests__/ResetPassword.test.tsx (100%) rename frontend/src/{views => pages}/index.ts (100%) diff --git a/frontend/src/components/dashboard/DashboardTask.tsx b/frontend/src/components/dashboard/DashboardTask.tsx index c08708bb..b96bb6c1 100644 --- a/frontend/src/components/dashboard/DashboardTask.tsx +++ b/frontend/src/components/dashboard/DashboardTask.tsx @@ -4,7 +4,7 @@ import LockIcon from '@mui/icons-material/Lock'; import AccessTimeIcon from '@mui/icons-material/AccessTime'; import {Link} from 'react-router-dom'; -import {SubTask} from '../../views/GuestApplicationTracker'; +import {SubTask} from '../../pages/GuestApplicationTracker'; export type DashboardTaskProps = Pick< SubTask, diff --git a/frontend/src/components/dashboard/DashboardTaskAccordion.tsx b/frontend/src/components/dashboard/DashboardTaskAccordion.tsx index 84df9541..2235ae69 100644 --- a/frontend/src/components/dashboard/DashboardTaskAccordion.tsx +++ b/frontend/src/components/dashboard/DashboardTaskAccordion.tsx @@ -13,7 +13,7 @@ import CheckCircleOutlined from '@mui/icons-material/CheckCircleOutlined'; import LockIcon from '@mui/icons-material/Lock'; import {styled} from '@mui/material/styles'; -import {Task} from '../../views/GuestApplicationTracker'; +import {Task} from '../../pages/GuestApplicationTracker'; import {DashboardTask} from './DashboardTask'; export interface TaskAccordionProps diff --git a/frontend/src/components/intake-profile/IntakeProfileGroups.tsx b/frontend/src/components/intake-profile/IntakeProfileGroups.tsx index e2d3a523..ba692be9 100644 --- a/frontend/src/components/intake-profile/IntakeProfileGroups.tsx +++ b/frontend/src/components/intake-profile/IntakeProfileGroups.tsx @@ -16,11 +16,11 @@ import { } from '@mui/material'; import {useFormikContext} from 'formik'; import {useOutletContext} from 'react-router-dom'; -import {InitialValues} from 'src/views/IntakeProfile'; +import {InitialValues} from 'src/pages/IntakeProfile'; import {AdditionalGuestsField} from './fields/AdditionaGuestsField'; import {FieldGroup, Fields, Guest, Pet} from 'src/services/profile'; import {AdditionalPetsField} from './fields/AdditionalPetsField'; -import {phoneRegExp} from '../../views/IntakeProfile/constants/index'; +import {phoneRegExp} from '../../pages/IntakeProfile/constants/index'; import {DatePickerField} from './fields/DatePickerField'; export interface OutletContext { diff --git a/frontend/src/components/intake-profile/ProfileReview.tsx b/frontend/src/components/intake-profile/ProfileReview.tsx index 4536c0a2..5aebd35a 100644 --- a/frontend/src/components/intake-profile/ProfileReview.tsx +++ b/frontend/src/components/intake-profile/ProfileReview.tsx @@ -12,7 +12,7 @@ import {useFormikContext} from 'formik'; import {format, parseISO} from 'date-fns'; import {OutletContext} from './IntakeProfileGroups'; -import {InitialValues} from 'src/views/IntakeProfile'; +import {InitialValues} from 'src/pages/IntakeProfile'; import {Response} from 'src/services/profile'; export const ProfileReview = () => { diff --git a/frontend/src/components/intake-profile/fields/AdditionaGuestsField.tsx b/frontend/src/components/intake-profile/fields/AdditionaGuestsField.tsx index da72b8fe..c756b847 100644 --- a/frontend/src/components/intake-profile/fields/AdditionaGuestsField.tsx +++ b/frontend/src/components/intake-profile/fields/AdditionaGuestsField.tsx @@ -6,7 +6,7 @@ import { FieldArray, useFormikContext, } from 'formik'; -import {InitialValues} from 'src/views/IntakeProfile'; +import {InitialValues} from 'src/pages/IntakeProfile'; import {Guest} from '../../../services/profile'; import {DatePickerField} from './DatePickerField'; diff --git a/frontend/src/components/intake-profile/fields/AdditionalPetsField.tsx b/frontend/src/components/intake-profile/fields/AdditionalPetsField.tsx index 794735f2..ac986106 100644 --- a/frontend/src/components/intake-profile/fields/AdditionalPetsField.tsx +++ b/frontend/src/components/intake-profile/fields/AdditionalPetsField.tsx @@ -2,7 +2,7 @@ import {Stack, Button, TextField, Typography} from '@mui/material'; import {FormikErrors, FieldArray, useFormikContext} from 'formik'; import {Pet} from '../../../services/profile'; import Autocomplete from '@mui/material/Autocomplete'; -import {InitialValues} from 'src/views/IntakeProfile'; +import {InitialValues} from 'src/pages/IntakeProfile'; interface Values { pets: Pet[]; diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 10c81999..4fd213d1 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -34,9 +34,9 @@ import { GuestSettings, CoordinatorDashboard, IntakeProfile, -} from './views'; +} from './pages'; -import {AccountVerification} from './views/AccountVerification'; +import {AccountVerification} from './pages/AccountVerification'; import {AppLayout, Header} from './components/common'; import {ResetPasswordContext} from './components/authentication/ResetPasswordContext'; import { @@ -45,7 +45,7 @@ import { } from './components/layout'; import {FieldGroupList} from './components/intake-profile/IntakeProfileGroups'; import {enableMocking} from './utils/test/browser'; -import {SystemAdminDashboard} from './views/SystemAdminDashboard'; +import {SystemAdminDashboard} from './pages/SystemAdminDashboard'; import {ProfileReview} from './components/intake-profile/ProfileReview'; function HuuApp() { diff --git a/frontend/src/views/AccountVerification.tsx b/frontend/src/pages/AccountVerification.tsx similarity index 100% rename from frontend/src/views/AccountVerification.tsx rename to frontend/src/pages/AccountVerification.tsx diff --git a/frontend/src/views/ConfirmSignUp.tsx b/frontend/src/pages/ConfirmSignUp.tsx similarity index 100% rename from frontend/src/views/ConfirmSignUp.tsx rename to frontend/src/pages/ConfirmSignUp.tsx diff --git a/frontend/src/views/CoordinatorDashboard.tsx b/frontend/src/pages/CoordinatorDashboard.tsx similarity index 100% rename from frontend/src/views/CoordinatorDashboard.tsx rename to frontend/src/pages/CoordinatorDashboard.tsx diff --git a/frontend/src/views/EmailVerificationError.tsx b/frontend/src/pages/EmailVerificationError.tsx similarity index 100% rename from frontend/src/views/EmailVerificationError.tsx rename to frontend/src/pages/EmailVerificationError.tsx diff --git a/frontend/src/views/EmailVerificationSuccess.tsx b/frontend/src/pages/EmailVerificationSuccess.tsx similarity index 100% rename from frontend/src/views/EmailVerificationSuccess.tsx rename to frontend/src/pages/EmailVerificationSuccess.tsx diff --git a/frontend/src/views/ForgotPassword.tsx b/frontend/src/pages/ForgotPassword.tsx similarity index 100% rename from frontend/src/views/ForgotPassword.tsx rename to frontend/src/pages/ForgotPassword.tsx diff --git a/frontend/src/views/ForgotPasswordCode.tsx b/frontend/src/pages/ForgotPasswordCode.tsx similarity index 100% rename from frontend/src/views/ForgotPasswordCode.tsx rename to frontend/src/pages/ForgotPasswordCode.tsx diff --git a/frontend/src/views/ForgotPasswordSuccess.tsx b/frontend/src/pages/ForgotPasswordSuccess.tsx similarity index 100% rename from frontend/src/views/ForgotPasswordSuccess.tsx rename to frontend/src/pages/ForgotPasswordSuccess.tsx diff --git a/frontend/src/views/GuestApplicationTracker.tsx b/frontend/src/pages/GuestApplicationTracker.tsx similarity index 100% rename from frontend/src/views/GuestApplicationTracker.tsx rename to frontend/src/pages/GuestApplicationTracker.tsx diff --git a/frontend/src/views/GuestContacts.tsx b/frontend/src/pages/GuestContacts.tsx similarity index 100% rename from frontend/src/views/GuestContacts.tsx rename to frontend/src/pages/GuestContacts.tsx diff --git a/frontend/src/views/GuestDocuments.tsx b/frontend/src/pages/GuestDocuments.tsx similarity index 100% rename from frontend/src/views/GuestDocuments.tsx rename to frontend/src/pages/GuestDocuments.tsx diff --git a/frontend/src/views/GuestSettings.tsx b/frontend/src/pages/GuestSettings.tsx similarity index 100% rename from frontend/src/views/GuestSettings.tsx rename to frontend/src/pages/GuestSettings.tsx diff --git a/frontend/src/views/GuestTasks.tsx b/frontend/src/pages/GuestTasks.tsx similarity index 100% rename from frontend/src/views/GuestTasks.tsx rename to frontend/src/pages/GuestTasks.tsx diff --git a/frontend/src/views/Home.tsx b/frontend/src/pages/Home.tsx similarity index 100% rename from frontend/src/views/Home.tsx rename to frontend/src/pages/Home.tsx diff --git a/frontend/src/views/HostApplicationTracker.tsx b/frontend/src/pages/HostApplicationTracker.tsx similarity index 100% rename from frontend/src/views/HostApplicationTracker.tsx rename to frontend/src/pages/HostApplicationTracker.tsx diff --git a/frontend/src/views/HostsList.tsx b/frontend/src/pages/HostsList.tsx similarity index 100% rename from frontend/src/views/HostsList.tsx rename to frontend/src/pages/HostsList.tsx diff --git a/frontend/src/views/IntakeProfile/constants/buildValidationSchema.ts b/frontend/src/pages/IntakeProfile/constants/buildValidationSchema.ts similarity index 100% rename from frontend/src/views/IntakeProfile/constants/buildValidationSchema.ts rename to frontend/src/pages/IntakeProfile/constants/buildValidationSchema.ts diff --git a/frontend/src/views/IntakeProfile/constants/createInitialValues.ts b/frontend/src/pages/IntakeProfile/constants/createInitialValues.ts similarity index 100% rename from frontend/src/views/IntakeProfile/constants/createInitialValues.ts rename to frontend/src/pages/IntakeProfile/constants/createInitialValues.ts diff --git a/frontend/src/views/IntakeProfile/constants/index.ts b/frontend/src/pages/IntakeProfile/constants/index.ts similarity index 100% rename from frontend/src/views/IntakeProfile/constants/index.ts rename to frontend/src/pages/IntakeProfile/constants/index.ts diff --git a/frontend/src/views/IntakeProfile/index.tsx b/frontend/src/pages/IntakeProfile/index.tsx similarity index 100% rename from frontend/src/views/IntakeProfile/index.tsx rename to frontend/src/pages/IntakeProfile/index.tsx diff --git a/frontend/src/views/LoadingComponent.tsx b/frontend/src/pages/LoadingComponent.tsx similarity index 100% rename from frontend/src/views/LoadingComponent.tsx rename to frontend/src/pages/LoadingComponent.tsx diff --git a/frontend/src/views/NewPassword.tsx b/frontend/src/pages/NewPassword.tsx similarity index 100% rename from frontend/src/views/NewPassword.tsx rename to frontend/src/pages/NewPassword.tsx diff --git a/frontend/src/views/ResetPassword.tsx b/frontend/src/pages/ResetPassword.tsx similarity index 100% rename from frontend/src/views/ResetPassword.tsx rename to frontend/src/pages/ResetPassword.tsx diff --git a/frontend/src/views/SelectAccountType.tsx b/frontend/src/pages/SelectAccountType.tsx similarity index 100% rename from frontend/src/views/SelectAccountType.tsx rename to frontend/src/pages/SelectAccountType.tsx diff --git a/frontend/src/views/Settings.tsx b/frontend/src/pages/Settings.tsx similarity index 100% rename from frontend/src/views/Settings.tsx rename to frontend/src/pages/Settings.tsx diff --git a/frontend/src/views/SignIn.tsx b/frontend/src/pages/SignIn.tsx similarity index 100% rename from frontend/src/views/SignIn.tsx rename to frontend/src/pages/SignIn.tsx diff --git a/frontend/src/views/SignUp.tsx b/frontend/src/pages/SignUp.tsx similarity index 100% rename from frontend/src/views/SignUp.tsx rename to frontend/src/pages/SignUp.tsx diff --git a/frontend/src/views/SystemAdminDashboard.tsx b/frontend/src/pages/SystemAdminDashboard.tsx similarity index 100% rename from frontend/src/views/SystemAdminDashboard.tsx rename to frontend/src/pages/SystemAdminDashboard.tsx diff --git a/frontend/src/views/__tests__/ForgotPasswordCode.test.tsx b/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx similarity index 100% rename from frontend/src/views/__tests__/ForgotPasswordCode.test.tsx rename to frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx diff --git a/frontend/src/views/__tests__/ResetPassword.test.tsx b/frontend/src/pages/__tests__/ResetPassword.test.tsx similarity index 100% rename from frontend/src/views/__tests__/ResetPassword.test.tsx rename to frontend/src/pages/__tests__/ResetPassword.test.tsx diff --git a/frontend/src/views/index.ts b/frontend/src/pages/index.ts similarity index 100% rename from frontend/src/views/index.ts rename to frontend/src/pages/index.ts From 047f8581f65a7954e463f2aabfcc73106d5078da Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 16:48:36 -0700 Subject: [PATCH 03/25] Change /components to /features --- .../Icons/CoordinatorIcon.tsx | 0 .../src/{components => features}/Icons/GuestIcon.tsx | 0 .../src/{components => features}/Icons/HostIcon.tsx | 0 .../Icons/InProgressIcon.tsx | 0 frontend/src/{components => features}/Icons/index.ts | 0 .../authentication/AccountVerificationForm.tsx | 0 .../authentication/CodeField.tsx | 0 .../authentication/FormContainer.tsx | 0 .../authentication/NewPasswordForm.tsx | 0 .../authentication/PasswordField.tsx | 0 .../authentication/ProtectedRoute.tsx | 0 .../authentication/ResetPasswordContext.tsx | 0 .../authentication/SignInForm.tsx | 0 .../authentication/SignUpForm.tsx | 2 +- .../authentication/__tests__/CodeField.test.tsx | 0 .../authentication/__tests__/SignInForm.test.tsx | 0 .../authentication/__tests__/SignUpForm.test.tsx | 0 .../authentication/hooks/useAuthenticateWithOAuth.ts | 0 .../{components => features}/authentication/index.ts | 0 .../{components => features}/common/AppContainer.tsx | 0 .../{components => features}/common/AppLayout.tsx | 0 .../common/AuthenticatedHeader.tsx | 0 .../src/{components => features}/common/Avatar.tsx | 0 .../common/GuestInviteButton.tsx | 0 .../src/{components => features}/common/Header.tsx | 0 .../src/{components => features}/common/HomeLink.tsx | 0 .../src/{components => features}/common/Loading.tsx | 0 .../common/PasswordValidation.tsx | 2 +- .../{components => features}/common/ProgressBar.tsx | 0 .../common/UiPlaceholder.tsx | 0 .../common/__tests__/GuestInviteButton.test.tsx | 0 .../src/{components => features}/common/index.ts | 0 .../dashboard/CoordinatorContact.tsx | 0 .../dashboard/DashboardTask.tsx | 0 .../dashboard/DashboardTaskAccordion.tsx | 0 .../dashboard/__tests__/CoordinatorContact.test.tsx | 0 .../dashboard/__tests__/DashboardTask.test.tsx | 0 .../__tests__/DashboardTaskAccordion.test.tsx | 0 .../src/{components => features}/dashboard/index.ts | 0 .../intake-profile/IntakeProfileGroups.tsx | 0 .../intake-profile/ProfileReview.tsx | 0 .../intake-profile/ProfileSidebar.tsx | 0 .../intake-profile/SidebarButton.tsx | 0 .../intake-profile/fields/AdditionaGuestsField.tsx | 0 .../intake-profile/fields/AdditionalPetsField.tsx | 0 .../intake-profile/fields/DatePickerField.tsx | 0 .../intake-profile/hooks/useStatusStyling.tsx | 0 .../layout/CoordinatorDashboardLayout.tsx | 0 .../layout/DashboardLayout.tsx | 0 .../layout/GuestDashboardLayout.tsx | 0 .../src/{components => features}/layout/index.ts | 0 frontend/src/main.tsx | 12 ++++++------ frontend/src/pages/AccountVerification.tsx | 2 +- frontend/src/pages/ConfirmSignUp.tsx | 2 +- frontend/src/pages/CoordinatorDashboard.tsx | 2 +- frontend/src/pages/EmailVerificationError.tsx | 2 +- frontend/src/pages/EmailVerificationSuccess.tsx | 2 +- frontend/src/pages/ForgotPassword.tsx | 4 ++-- frontend/src/pages/ForgotPasswordCode.tsx | 4 ++-- frontend/src/pages/ForgotPasswordSuccess.tsx | 2 +- frontend/src/pages/GuestApplicationTracker.tsx | 2 +- frontend/src/pages/HostApplicationTracker.tsx | 2 +- frontend/src/pages/IntakeProfile/index.tsx | 2 +- frontend/src/pages/NewPassword.tsx | 4 ++-- frontend/src/pages/ResetPassword.tsx | 6 +++--- frontend/src/pages/SelectAccountType.tsx | 2 +- frontend/src/pages/SignIn.tsx | 6 +++--- frontend/src/pages/SignUp.tsx | 6 +++--- frontend/src/pages/SystemAdminDashboard.tsx | 2 +- .../src/pages/__tests__/ForgotPasswordCode.test.tsx | 2 +- frontend/src/pages/__tests__/ResetPassword.test.tsx | 2 +- ...rdValidationSchema.tsx => validation-schemas.tsx} | 0 72 files changed, 36 insertions(+), 36 deletions(-) rename frontend/src/{components => features}/Icons/CoordinatorIcon.tsx (100%) rename frontend/src/{components => features}/Icons/GuestIcon.tsx (100%) rename frontend/src/{components => features}/Icons/HostIcon.tsx (100%) rename frontend/src/{components => features}/Icons/InProgressIcon.tsx (100%) rename frontend/src/{components => features}/Icons/index.ts (100%) rename frontend/src/{components => features}/authentication/AccountVerificationForm.tsx (100%) rename frontend/src/{components => features}/authentication/CodeField.tsx (100%) rename frontend/src/{components => features}/authentication/FormContainer.tsx (100%) rename frontend/src/{components => features}/authentication/NewPasswordForm.tsx (100%) rename frontend/src/{components => features}/authentication/PasswordField.tsx (100%) rename frontend/src/{components => features}/authentication/ProtectedRoute.tsx (100%) rename frontend/src/{components => features}/authentication/ResetPasswordContext.tsx (100%) rename frontend/src/{components => features}/authentication/SignInForm.tsx (100%) rename frontend/src/{components => features}/authentication/SignUpForm.tsx (98%) rename frontend/src/{components => features}/authentication/__tests__/CodeField.test.tsx (100%) rename frontend/src/{components => features}/authentication/__tests__/SignInForm.test.tsx (100%) rename frontend/src/{components => features}/authentication/__tests__/SignUpForm.test.tsx (100%) rename frontend/src/{components => features}/authentication/hooks/useAuthenticateWithOAuth.ts (100%) rename frontend/src/{components => features}/authentication/index.ts (100%) rename frontend/src/{components => features}/common/AppContainer.tsx (100%) rename frontend/src/{components => features}/common/AppLayout.tsx (100%) rename frontend/src/{components => features}/common/AuthenticatedHeader.tsx (100%) rename frontend/src/{components => features}/common/Avatar.tsx (100%) rename frontend/src/{components => features}/common/GuestInviteButton.tsx (100%) rename frontend/src/{components => features}/common/Header.tsx (100%) rename frontend/src/{components => features}/common/HomeLink.tsx (100%) rename frontend/src/{components => features}/common/Loading.tsx (100%) rename frontend/src/{components => features}/common/PasswordValidation.tsx (97%) rename frontend/src/{components => features}/common/ProgressBar.tsx (100%) rename frontend/src/{components => features}/common/UiPlaceholder.tsx (100%) rename frontend/src/{components => features}/common/__tests__/GuestInviteButton.test.tsx (100%) rename frontend/src/{components => features}/common/index.ts (100%) rename frontend/src/{components => features}/dashboard/CoordinatorContact.tsx (100%) rename frontend/src/{components => features}/dashboard/DashboardTask.tsx (100%) rename frontend/src/{components => features}/dashboard/DashboardTaskAccordion.tsx (100%) rename frontend/src/{components => features}/dashboard/__tests__/CoordinatorContact.test.tsx (100%) rename frontend/src/{components => features}/dashboard/__tests__/DashboardTask.test.tsx (100%) rename frontend/src/{components => features}/dashboard/__tests__/DashboardTaskAccordion.test.tsx (100%) rename frontend/src/{components => features}/dashboard/index.ts (100%) rename frontend/src/{components => features}/intake-profile/IntakeProfileGroups.tsx (100%) rename frontend/src/{components => features}/intake-profile/ProfileReview.tsx (100%) rename frontend/src/{components => features}/intake-profile/ProfileSidebar.tsx (100%) rename frontend/src/{components => features}/intake-profile/SidebarButton.tsx (100%) rename frontend/src/{components => features}/intake-profile/fields/AdditionaGuestsField.tsx (100%) rename frontend/src/{components => features}/intake-profile/fields/AdditionalPetsField.tsx (100%) rename frontend/src/{components => features}/intake-profile/fields/DatePickerField.tsx (100%) rename frontend/src/{components => features}/intake-profile/hooks/useStatusStyling.tsx (100%) rename frontend/src/{components => features}/layout/CoordinatorDashboardLayout.tsx (100%) rename frontend/src/{components => features}/layout/DashboardLayout.tsx (100%) rename frontend/src/{components => features}/layout/GuestDashboardLayout.tsx (100%) rename frontend/src/{components => features}/layout/index.ts (100%) rename frontend/src/utils/{PasswordValidationSchema.tsx => validation-schemas.tsx} (100%) diff --git a/frontend/src/components/Icons/CoordinatorIcon.tsx b/frontend/src/features/Icons/CoordinatorIcon.tsx similarity index 100% rename from frontend/src/components/Icons/CoordinatorIcon.tsx rename to frontend/src/features/Icons/CoordinatorIcon.tsx diff --git a/frontend/src/components/Icons/GuestIcon.tsx b/frontend/src/features/Icons/GuestIcon.tsx similarity index 100% rename from frontend/src/components/Icons/GuestIcon.tsx rename to frontend/src/features/Icons/GuestIcon.tsx diff --git a/frontend/src/components/Icons/HostIcon.tsx b/frontend/src/features/Icons/HostIcon.tsx similarity index 100% rename from frontend/src/components/Icons/HostIcon.tsx rename to frontend/src/features/Icons/HostIcon.tsx diff --git a/frontend/src/components/Icons/InProgressIcon.tsx b/frontend/src/features/Icons/InProgressIcon.tsx similarity index 100% rename from frontend/src/components/Icons/InProgressIcon.tsx rename to frontend/src/features/Icons/InProgressIcon.tsx diff --git a/frontend/src/components/Icons/index.ts b/frontend/src/features/Icons/index.ts similarity index 100% rename from frontend/src/components/Icons/index.ts rename to frontend/src/features/Icons/index.ts diff --git a/frontend/src/components/authentication/AccountVerificationForm.tsx b/frontend/src/features/authentication/AccountVerificationForm.tsx similarity index 100% rename from frontend/src/components/authentication/AccountVerificationForm.tsx rename to frontend/src/features/authentication/AccountVerificationForm.tsx diff --git a/frontend/src/components/authentication/CodeField.tsx b/frontend/src/features/authentication/CodeField.tsx similarity index 100% rename from frontend/src/components/authentication/CodeField.tsx rename to frontend/src/features/authentication/CodeField.tsx diff --git a/frontend/src/components/authentication/FormContainer.tsx b/frontend/src/features/authentication/FormContainer.tsx similarity index 100% rename from frontend/src/components/authentication/FormContainer.tsx rename to frontend/src/features/authentication/FormContainer.tsx diff --git a/frontend/src/components/authentication/NewPasswordForm.tsx b/frontend/src/features/authentication/NewPasswordForm.tsx similarity index 100% rename from frontend/src/components/authentication/NewPasswordForm.tsx rename to frontend/src/features/authentication/NewPasswordForm.tsx diff --git a/frontend/src/components/authentication/PasswordField.tsx b/frontend/src/features/authentication/PasswordField.tsx similarity index 100% rename from frontend/src/components/authentication/PasswordField.tsx rename to frontend/src/features/authentication/PasswordField.tsx diff --git a/frontend/src/components/authentication/ProtectedRoute.tsx b/frontend/src/features/authentication/ProtectedRoute.tsx similarity index 100% rename from frontend/src/components/authentication/ProtectedRoute.tsx rename to frontend/src/features/authentication/ProtectedRoute.tsx diff --git a/frontend/src/components/authentication/ResetPasswordContext.tsx b/frontend/src/features/authentication/ResetPasswordContext.tsx similarity index 100% rename from frontend/src/components/authentication/ResetPasswordContext.tsx rename to frontend/src/features/authentication/ResetPasswordContext.tsx diff --git a/frontend/src/components/authentication/SignInForm.tsx b/frontend/src/features/authentication/SignInForm.tsx similarity index 100% rename from frontend/src/components/authentication/SignInForm.tsx rename to frontend/src/features/authentication/SignInForm.tsx diff --git a/frontend/src/components/authentication/SignUpForm.tsx b/frontend/src/features/authentication/SignUpForm.tsx similarity index 98% rename from frontend/src/components/authentication/SignUpForm.tsx rename to frontend/src/features/authentication/SignUpForm.tsx index 14111422..98a51a94 100644 --- a/frontend/src/components/authentication/SignUpForm.tsx +++ b/frontend/src/features/authentication/SignUpForm.tsx @@ -10,7 +10,7 @@ import { import {useFormik} from 'formik'; import {SignUpRequest} from '../../services/auth'; import {PasswordValidation} from '../common/PasswordValidation'; -import {signUpVaildationSchema} from '../../utils/PasswordValidationSchema'; +import {signUpVaildationSchema} from '../../utils/validation-schemas'; import {PasswordField} from './PasswordField'; export interface SignUpFormProps { diff --git a/frontend/src/components/authentication/__tests__/CodeField.test.tsx b/frontend/src/features/authentication/__tests__/CodeField.test.tsx similarity index 100% rename from frontend/src/components/authentication/__tests__/CodeField.test.tsx rename to frontend/src/features/authentication/__tests__/CodeField.test.tsx diff --git a/frontend/src/components/authentication/__tests__/SignInForm.test.tsx b/frontend/src/features/authentication/__tests__/SignInForm.test.tsx similarity index 100% rename from frontend/src/components/authentication/__tests__/SignInForm.test.tsx rename to frontend/src/features/authentication/__tests__/SignInForm.test.tsx diff --git a/frontend/src/components/authentication/__tests__/SignUpForm.test.tsx b/frontend/src/features/authentication/__tests__/SignUpForm.test.tsx similarity index 100% rename from frontend/src/components/authentication/__tests__/SignUpForm.test.tsx rename to frontend/src/features/authentication/__tests__/SignUpForm.test.tsx diff --git a/frontend/src/components/authentication/hooks/useAuthenticateWithOAuth.ts b/frontend/src/features/authentication/hooks/useAuthenticateWithOAuth.ts similarity index 100% rename from frontend/src/components/authentication/hooks/useAuthenticateWithOAuth.ts rename to frontend/src/features/authentication/hooks/useAuthenticateWithOAuth.ts diff --git a/frontend/src/components/authentication/index.ts b/frontend/src/features/authentication/index.ts similarity index 100% rename from frontend/src/components/authentication/index.ts rename to frontend/src/features/authentication/index.ts diff --git a/frontend/src/components/common/AppContainer.tsx b/frontend/src/features/common/AppContainer.tsx similarity index 100% rename from frontend/src/components/common/AppContainer.tsx rename to frontend/src/features/common/AppContainer.tsx diff --git a/frontend/src/components/common/AppLayout.tsx b/frontend/src/features/common/AppLayout.tsx similarity index 100% rename from frontend/src/components/common/AppLayout.tsx rename to frontend/src/features/common/AppLayout.tsx diff --git a/frontend/src/components/common/AuthenticatedHeader.tsx b/frontend/src/features/common/AuthenticatedHeader.tsx similarity index 100% rename from frontend/src/components/common/AuthenticatedHeader.tsx rename to frontend/src/features/common/AuthenticatedHeader.tsx diff --git a/frontend/src/components/common/Avatar.tsx b/frontend/src/features/common/Avatar.tsx similarity index 100% rename from frontend/src/components/common/Avatar.tsx rename to frontend/src/features/common/Avatar.tsx diff --git a/frontend/src/components/common/GuestInviteButton.tsx b/frontend/src/features/common/GuestInviteButton.tsx similarity index 100% rename from frontend/src/components/common/GuestInviteButton.tsx rename to frontend/src/features/common/GuestInviteButton.tsx diff --git a/frontend/src/components/common/Header.tsx b/frontend/src/features/common/Header.tsx similarity index 100% rename from frontend/src/components/common/Header.tsx rename to frontend/src/features/common/Header.tsx diff --git a/frontend/src/components/common/HomeLink.tsx b/frontend/src/features/common/HomeLink.tsx similarity index 100% rename from frontend/src/components/common/HomeLink.tsx rename to frontend/src/features/common/HomeLink.tsx diff --git a/frontend/src/components/common/Loading.tsx b/frontend/src/features/common/Loading.tsx similarity index 100% rename from frontend/src/components/common/Loading.tsx rename to frontend/src/features/common/Loading.tsx diff --git a/frontend/src/components/common/PasswordValidation.tsx b/frontend/src/features/common/PasswordValidation.tsx similarity index 97% rename from frontend/src/components/common/PasswordValidation.tsx rename to frontend/src/features/common/PasswordValidation.tsx index 8b65a565..2dfe2fe5 100644 --- a/frontend/src/components/common/PasswordValidation.tsx +++ b/frontend/src/features/common/PasswordValidation.tsx @@ -2,7 +2,7 @@ import {List, ListItem, ListSubheader} from '@mui/material'; import RemoveRoundedIcon from '@mui/icons-material/RemoveRounded'; import CheckRoundedIcon from '@mui/icons-material/CheckRounded'; import {useEffect, useState} from 'react'; -import pwValidate from '../../utils/PasswordValidationSchema'; +import pwValidate from '../../utils/validation-schemas'; interface PasswordProps { password: string; diff --git a/frontend/src/components/common/ProgressBar.tsx b/frontend/src/features/common/ProgressBar.tsx similarity index 100% rename from frontend/src/components/common/ProgressBar.tsx rename to frontend/src/features/common/ProgressBar.tsx diff --git a/frontend/src/components/common/UiPlaceholder.tsx b/frontend/src/features/common/UiPlaceholder.tsx similarity index 100% rename from frontend/src/components/common/UiPlaceholder.tsx rename to frontend/src/features/common/UiPlaceholder.tsx diff --git a/frontend/src/components/common/__tests__/GuestInviteButton.test.tsx b/frontend/src/features/common/__tests__/GuestInviteButton.test.tsx similarity index 100% rename from frontend/src/components/common/__tests__/GuestInviteButton.test.tsx rename to frontend/src/features/common/__tests__/GuestInviteButton.test.tsx diff --git a/frontend/src/components/common/index.ts b/frontend/src/features/common/index.ts similarity index 100% rename from frontend/src/components/common/index.ts rename to frontend/src/features/common/index.ts diff --git a/frontend/src/components/dashboard/CoordinatorContact.tsx b/frontend/src/features/dashboard/CoordinatorContact.tsx similarity index 100% rename from frontend/src/components/dashboard/CoordinatorContact.tsx rename to frontend/src/features/dashboard/CoordinatorContact.tsx diff --git a/frontend/src/components/dashboard/DashboardTask.tsx b/frontend/src/features/dashboard/DashboardTask.tsx similarity index 100% rename from frontend/src/components/dashboard/DashboardTask.tsx rename to frontend/src/features/dashboard/DashboardTask.tsx diff --git a/frontend/src/components/dashboard/DashboardTaskAccordion.tsx b/frontend/src/features/dashboard/DashboardTaskAccordion.tsx similarity index 100% rename from frontend/src/components/dashboard/DashboardTaskAccordion.tsx rename to frontend/src/features/dashboard/DashboardTaskAccordion.tsx diff --git a/frontend/src/components/dashboard/__tests__/CoordinatorContact.test.tsx b/frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx similarity index 100% rename from frontend/src/components/dashboard/__tests__/CoordinatorContact.test.tsx rename to frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx diff --git a/frontend/src/components/dashboard/__tests__/DashboardTask.test.tsx b/frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx similarity index 100% rename from frontend/src/components/dashboard/__tests__/DashboardTask.test.tsx rename to frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx diff --git a/frontend/src/components/dashboard/__tests__/DashboardTaskAccordion.test.tsx b/frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx similarity index 100% rename from frontend/src/components/dashboard/__tests__/DashboardTaskAccordion.test.tsx rename to frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx diff --git a/frontend/src/components/dashboard/index.ts b/frontend/src/features/dashboard/index.ts similarity index 100% rename from frontend/src/components/dashboard/index.ts rename to frontend/src/features/dashboard/index.ts diff --git a/frontend/src/components/intake-profile/IntakeProfileGroups.tsx b/frontend/src/features/intake-profile/IntakeProfileGroups.tsx similarity index 100% rename from frontend/src/components/intake-profile/IntakeProfileGroups.tsx rename to frontend/src/features/intake-profile/IntakeProfileGroups.tsx diff --git a/frontend/src/components/intake-profile/ProfileReview.tsx b/frontend/src/features/intake-profile/ProfileReview.tsx similarity index 100% rename from frontend/src/components/intake-profile/ProfileReview.tsx rename to frontend/src/features/intake-profile/ProfileReview.tsx diff --git a/frontend/src/components/intake-profile/ProfileSidebar.tsx b/frontend/src/features/intake-profile/ProfileSidebar.tsx similarity index 100% rename from frontend/src/components/intake-profile/ProfileSidebar.tsx rename to frontend/src/features/intake-profile/ProfileSidebar.tsx diff --git a/frontend/src/components/intake-profile/SidebarButton.tsx b/frontend/src/features/intake-profile/SidebarButton.tsx similarity index 100% rename from frontend/src/components/intake-profile/SidebarButton.tsx rename to frontend/src/features/intake-profile/SidebarButton.tsx diff --git a/frontend/src/components/intake-profile/fields/AdditionaGuestsField.tsx b/frontend/src/features/intake-profile/fields/AdditionaGuestsField.tsx similarity index 100% rename from frontend/src/components/intake-profile/fields/AdditionaGuestsField.tsx rename to frontend/src/features/intake-profile/fields/AdditionaGuestsField.tsx diff --git a/frontend/src/components/intake-profile/fields/AdditionalPetsField.tsx b/frontend/src/features/intake-profile/fields/AdditionalPetsField.tsx similarity index 100% rename from frontend/src/components/intake-profile/fields/AdditionalPetsField.tsx rename to frontend/src/features/intake-profile/fields/AdditionalPetsField.tsx diff --git a/frontend/src/components/intake-profile/fields/DatePickerField.tsx b/frontend/src/features/intake-profile/fields/DatePickerField.tsx similarity index 100% rename from frontend/src/components/intake-profile/fields/DatePickerField.tsx rename to frontend/src/features/intake-profile/fields/DatePickerField.tsx diff --git a/frontend/src/components/intake-profile/hooks/useStatusStyling.tsx b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx similarity index 100% rename from frontend/src/components/intake-profile/hooks/useStatusStyling.tsx rename to frontend/src/features/intake-profile/hooks/useStatusStyling.tsx diff --git a/frontend/src/components/layout/CoordinatorDashboardLayout.tsx b/frontend/src/features/layout/CoordinatorDashboardLayout.tsx similarity index 100% rename from frontend/src/components/layout/CoordinatorDashboardLayout.tsx rename to frontend/src/features/layout/CoordinatorDashboardLayout.tsx diff --git a/frontend/src/components/layout/DashboardLayout.tsx b/frontend/src/features/layout/DashboardLayout.tsx similarity index 100% rename from frontend/src/components/layout/DashboardLayout.tsx rename to frontend/src/features/layout/DashboardLayout.tsx diff --git a/frontend/src/components/layout/GuestDashboardLayout.tsx b/frontend/src/features/layout/GuestDashboardLayout.tsx similarity index 100% rename from frontend/src/components/layout/GuestDashboardLayout.tsx rename to frontend/src/features/layout/GuestDashboardLayout.tsx diff --git a/frontend/src/components/layout/index.ts b/frontend/src/features/layout/index.ts similarity index 100% rename from frontend/src/components/layout/index.ts rename to frontend/src/features/layout/index.ts diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 4fd213d1..4423b4c6 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -8,7 +8,7 @@ import {AdapterDateFns} from '@mui/x-date-pickers/AdapterDateFns'; import './index.css'; import {setupStore} from './redux/store'; -import {ProtectedRoute} from './components/authentication/ProtectedRoute'; +import {ProtectedRoute} from './features/authentication/ProtectedRoute'; import {useSessionMutation} from './services/auth'; import {HomeUniteUsTheme} from './theme'; import { @@ -37,16 +37,16 @@ import { } from './pages'; import {AccountVerification} from './pages/AccountVerification'; -import {AppLayout, Header} from './components/common'; -import {ResetPasswordContext} from './components/authentication/ResetPasswordContext'; +import {AppLayout, Header} from './features/common'; +import {ResetPasswordContext} from './features/authentication/ResetPasswordContext'; import { CoordinatorDashboardLayout, GuestDashboardLayout, -} from './components/layout'; -import {FieldGroupList} from './components/intake-profile/IntakeProfileGroups'; +} from './features/layout'; +import {FieldGroupList} from './features/intake-profile/IntakeProfileGroups'; import {enableMocking} from './utils/test/browser'; import {SystemAdminDashboard} from './pages/SystemAdminDashboard'; -import {ProfileReview} from './components/intake-profile/ProfileReview'; +import {ProfileReview} from './features/intake-profile/ProfileReview'; function HuuApp() { const [session] = useSessionMutation(); diff --git a/frontend/src/pages/AccountVerification.tsx b/frontend/src/pages/AccountVerification.tsx index c38a74aa..9d491612 100644 --- a/frontend/src/pages/AccountVerification.tsx +++ b/frontend/src/pages/AccountVerification.tsx @@ -3,7 +3,7 @@ import {styled} from '@mui/system'; import {Stack, Typography} from '@mui/material'; import {VerificationRequest, useVerificationMutation} from '../services/auth'; -import {AccountVerificationForm} from '../components/authentication/AccountVerificationForm'; +import {AccountVerificationForm} from '../features/authentication/AccountVerificationForm'; export const AccountVerification = () => { const [verify] = useVerificationMutation(); diff --git a/frontend/src/pages/ConfirmSignUp.tsx b/frontend/src/pages/ConfirmSignUp.tsx index f32f69bc..b13152dd 100644 --- a/frontend/src/pages/ConfirmSignUp.tsx +++ b/frontend/src/pages/ConfirmSignUp.tsx @@ -10,7 +10,7 @@ import { import CloseIcon from '@mui/icons-material/Close'; import {useSearchParams} from 'react-router-dom'; import {useResendConfirmationCodeMutation} from '../services/auth'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; interface Alert { diff --git a/frontend/src/pages/CoordinatorDashboard.tsx b/frontend/src/pages/CoordinatorDashboard.tsx index b7a5363a..04b7a12a 100644 --- a/frontend/src/pages/CoordinatorDashboard.tsx +++ b/frontend/src/pages/CoordinatorDashboard.tsx @@ -17,7 +17,7 @@ import { DashboardDataResponse, useGetAllDashboardDataMutation, } from '../services/coordinator'; -import {GuestInviteButton} from '../components/common'; +import {GuestInviteButton} from '../features/common'; import {LoadingComponent} from './LoadingComponent'; const columns: GridColDef[] = [ diff --git a/frontend/src/pages/EmailVerificationError.tsx b/frontend/src/pages/EmailVerificationError.tsx index e88647ad..9fd5e934 100644 --- a/frontend/src/pages/EmailVerificationError.tsx +++ b/frontend/src/pages/EmailVerificationError.tsx @@ -1,7 +1,7 @@ import {Button, Stack, Typography} from '@mui/material'; import React from 'react'; import CancelOutlined from '@mui/icons-material/CancelOutlined'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; export const EmailVerificationError = () => { return ( diff --git a/frontend/src/pages/EmailVerificationSuccess.tsx b/frontend/src/pages/EmailVerificationSuccess.tsx index 7660dd3b..077a1855 100644 --- a/frontend/src/pages/EmailVerificationSuccess.tsx +++ b/frontend/src/pages/EmailVerificationSuccess.tsx @@ -1,7 +1,7 @@ import {Button, Stack, Typography} from '@mui/material'; import React from 'react'; import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; export const EmailVerificationSuccess = () => { return ( diff --git a/frontend/src/pages/ForgotPassword.tsx b/frontend/src/pages/ForgotPassword.tsx index 300c2cd2..acd54b33 100644 --- a/frontend/src/pages/ForgotPassword.tsx +++ b/frontend/src/pages/ForgotPassword.tsx @@ -12,9 +12,9 @@ import {useFormikContext} from 'formik'; import React from 'react'; import {useNavigate} from 'react-router-dom'; import {isErrorWithMessage, isFetchBaseQueryError} from '../redux/helpers'; -import {ResestPasswordValues} from '../components/authentication/ResetPasswordContext'; +import {ResestPasswordValues} from '../features/authentication/ResetPasswordContext'; import {useForgotPasswordMutation} from '../services/auth'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; export const ForgotPassword = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/ForgotPasswordCode.tsx b/frontend/src/pages/ForgotPasswordCode.tsx index 8152d108..c5f26da7 100644 --- a/frontend/src/pages/ForgotPasswordCode.tsx +++ b/frontend/src/pages/ForgotPasswordCode.tsx @@ -13,8 +13,8 @@ import CloseIcon from '@mui/icons-material/Close'; import {useFormikContext} from 'formik'; import React from 'react'; import {useNavigate} from 'react-router-dom'; -import {ResestPasswordValues} from '../components/authentication/ResetPasswordContext'; -import {CodeField, FormContainer} from '../components/authentication'; +import {ResestPasswordValues} from '../features/authentication/ResetPasswordContext'; +import {CodeField, FormContainer} from '../features/authentication'; import {useForgotPasswordMutation} from '../services/auth'; import {getErrorMessage} from '../redux/helpers'; diff --git a/frontend/src/pages/ForgotPasswordSuccess.tsx b/frontend/src/pages/ForgotPasswordSuccess.tsx index 56dfc978..a0b628e1 100644 --- a/frontend/src/pages/ForgotPasswordSuccess.tsx +++ b/frontend/src/pages/ForgotPasswordSuccess.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Typography, Button, Stack} from '@mui/material'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; export const ForgotPasswordSuccess = () => { return ( diff --git a/frontend/src/pages/GuestApplicationTracker.tsx b/frontend/src/pages/GuestApplicationTracker.tsx index 5a8db5ae..829b6ee6 100644 --- a/frontend/src/pages/GuestApplicationTracker.tsx +++ b/frontend/src/pages/GuestApplicationTracker.tsx @@ -3,7 +3,7 @@ import {styled} from '@mui/system'; import { DashboardTaskAccordion, CoordinatorContact, -} from '../components/dashboard'; +} from '../features/dashboard'; export type TaskStatus = 'inProgress' | 'complete' | 'locked'; diff --git a/frontend/src/pages/HostApplicationTracker.tsx b/frontend/src/pages/HostApplicationTracker.tsx index 6f7aef67..434bef7a 100644 --- a/frontend/src/pages/HostApplicationTracker.tsx +++ b/frontend/src/pages/HostApplicationTracker.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import {Box, Typography} from '@mui/material'; import * as React from 'react'; -import {AuthenticatedHeader} from '../components/common'; +import {AuthenticatedHeader} from '../features/common'; interface HostApplicationTrackerProps {} diff --git a/frontend/src/pages/IntakeProfile/index.tsx b/frontend/src/pages/IntakeProfile/index.tsx index 3b023eea..0dfc2d8d 100644 --- a/frontend/src/pages/IntakeProfile/index.tsx +++ b/frontend/src/pages/IntakeProfile/index.tsx @@ -8,7 +8,7 @@ import { Response, } from '../../services/profile'; import {useState} from 'react'; -import {ProfileSidebar} from '../../components/intake-profile/ProfileSidebar'; +import {ProfileSidebar} from '../../features/intake-profile/ProfileSidebar'; export type Values = { [key: string]: Response['value']; }; diff --git a/frontend/src/pages/NewPassword.tsx b/frontend/src/pages/NewPassword.tsx index 4da82067..ddad32ea 100644 --- a/frontend/src/pages/NewPassword.tsx +++ b/frontend/src/pages/NewPassword.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import {NewPasswordForm} from '../components/authentication/NewPasswordForm'; +import {NewPasswordForm} from '../features/authentication/NewPasswordForm'; import {useSearchParams} from 'react-router-dom'; import {Typography, Stack, Alert, IconButton} from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import {NewPasswordRequest, useNewPasswordMutation} from '../services/auth'; import {useNavigate} from 'react-router-dom'; import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; export const NewPassword = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/ResetPassword.tsx b/frontend/src/pages/ResetPassword.tsx index fc52d102..7efc2886 100644 --- a/frontend/src/pages/ResetPassword.tsx +++ b/frontend/src/pages/ResetPassword.tsx @@ -7,11 +7,11 @@ import { } from '@mui/material'; import React from 'react'; import {useFormikContext} from 'formik'; -import {ResestPasswordValues} from '../components/authentication/ResetPasswordContext'; +import {ResestPasswordValues} from '../features/authentication/ResetPasswordContext'; import {useConfirmForgotPasswordMutation} from '../services/auth'; import {getErrorMessage} from '../redux/helpers'; -import {FormContainer, PasswordField} from '../components/authentication'; -import {PasswordValidation} from '../components/common/PasswordValidation'; +import {FormContainer, PasswordField} from '../features/authentication'; +import {PasswordValidation} from '../features/common/PasswordValidation'; export const ResetPassword = () => { const { diff --git a/frontend/src/pages/SelectAccountType.tsx b/frontend/src/pages/SelectAccountType.tsx index 4c548e57..544365a8 100644 --- a/frontend/src/pages/SelectAccountType.tsx +++ b/frontend/src/pages/SelectAccountType.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react'; import {useNavigate} from 'react-router-dom'; import {Typography, Button, Stack, Link, Divider} from '@mui/material'; import {styled} from '@mui/system'; -import {HostIcon, CoordinatorIcon} from '../components/Icons'; +import {HostIcon, CoordinatorIcon} from '../features/Icons'; export const SelectAccountType = () => { const [type, setType] = useState(''); diff --git a/frontend/src/pages/SignIn.tsx b/frontend/src/pages/SignIn.tsx index 56664589..f31de484 100644 --- a/frontend/src/pages/SignIn.tsx +++ b/frontend/src/pages/SignIn.tsx @@ -12,18 +12,18 @@ import CloseIcon from '@mui/icons-material/Close'; import {setCredentials} from '../redux/authSlice'; import {useAppDispatch} from '../redux/hooks/store'; -import {SignInForm} from '../components/authentication/SignInForm'; +import {SignInForm} from '../features/authentication/SignInForm'; import { SignInRequest, useGoogleSignInMutation, useSignInMutation, } from '../services/auth'; import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; -import {FormContainer} from '../components/authentication'; +import {FormContainer} from '../features/authentication'; import { useAuthenticateWithOAuth, redirectsByRole, -} from '../components/authentication/hooks/useAuthenticateWithOAuth'; +} from '../features/authentication/hooks/useAuthenticateWithOAuth'; export interface LocationState { from: Location; } diff --git a/frontend/src/pages/SignUp.tsx b/frontend/src/pages/SignUp.tsx index 0d11aaee..db4b658e 100644 --- a/frontend/src/pages/SignUp.tsx +++ b/frontend/src/pages/SignUp.tsx @@ -10,15 +10,15 @@ import { import CloseIcon from '@mui/icons-material/Close'; import {useNavigate, useParams} from 'react-router-dom'; -import {SignUpForm} from '../components/authentication/SignUpForm'; +import {SignUpForm} from '../features/authentication/SignUpForm'; import { useGoogleSignUpMutation, useSignUpMutation, SignUpRequest, } from '../services/auth'; import {isErrorWithMessage, isFetchBaseQueryError} from '../redux/helpers'; -import {FormContainer} from '../components/authentication'; -import {useAuthenticateWithOAuth} from '../components/authentication/hooks/useAuthenticateWithOAuth'; +import {FormContainer} from '../features/authentication'; +import {useAuthenticateWithOAuth} from '../features/authentication/hooks/useAuthenticateWithOAuth'; export const SignUp = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/SystemAdminDashboard.tsx b/frontend/src/pages/SystemAdminDashboard.tsx index 9bbd7ad1..b2372daa 100644 --- a/frontend/src/pages/SystemAdminDashboard.tsx +++ b/frontend/src/pages/SystemAdminDashboard.tsx @@ -28,7 +28,7 @@ import DeleteIcon from '@mui/icons-material/Delete'; import PersonIcon from '@mui/icons-material/Person'; import {red} from '@mui/material/colors'; import * as React from 'react'; -import {AuthenticatedHeader} from '../components/common'; +import {AuthenticatedHeader} from '../features/common'; import { DashboardDataItem, DashboardDataResponse, diff --git a/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx b/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx index c1174d46..28171b1f 100644 --- a/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx +++ b/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx @@ -2,7 +2,7 @@ import { ResestPasswordValues, initialValues, validationSchema, -} from '../../components/authentication/ResetPasswordContext'; +} from '../../features/authentication/ResetPasswordContext'; import { render, screen, diff --git a/frontend/src/pages/__tests__/ResetPassword.test.tsx b/frontend/src/pages/__tests__/ResetPassword.test.tsx index 50aff8ef..3cc78704 100644 --- a/frontend/src/pages/__tests__/ResetPassword.test.tsx +++ b/frontend/src/pages/__tests__/ResetPassword.test.tsx @@ -4,7 +4,7 @@ import { ResestPasswordValues, initialValues, validationSchema, -} from '../../components/authentication/ResetPasswordContext'; +} from '../../features/authentication/ResetPasswordContext'; import {render, screen, waitFor, fireEvent} from '../../utils/test/test-utils'; import {ResetPassword} from '../ResetPassword'; diff --git a/frontend/src/utils/PasswordValidationSchema.tsx b/frontend/src/utils/validation-schemas.tsx similarity index 100% rename from frontend/src/utils/PasswordValidationSchema.tsx rename to frontend/src/utils/validation-schemas.tsx From c1b8af25c63175cb8d7a4397708574aea6033b1b Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:11:05 -0700 Subject: [PATCH 04/25] Move /images into /public --- .../{src/img => public/images}/admin-icon.svg | 0 .../{src/img => public/images}/avatar.png | Bin .../{src/img => public/images}/favicon.png | Bin .../{src/img => public/images}/guest-icon.svg | 0 .../{src/img => public/images}/host-icon.svg | 0 frontend/{src/img => public/images}/huu.svg | 0 frontend/{src/img => public/images}/spy.png | Bin .../features/common/AuthenticatedHeader.tsx | 29 ++++++++------ frontend/src/features/common/Header.tsx | 37 +++--------------- 9 files changed, 23 insertions(+), 43 deletions(-) rename frontend/{src/img => public/images}/admin-icon.svg (100%) rename frontend/{src/img => public/images}/avatar.png (100%) rename frontend/{src/img => public/images}/favicon.png (100%) rename frontend/{src/img => public/images}/guest-icon.svg (100%) rename frontend/{src/img => public/images}/host-icon.svg (100%) rename frontend/{src/img => public/images}/huu.svg (100%) rename frontend/{src/img => public/images}/spy.png (100%) diff --git a/frontend/src/img/admin-icon.svg b/frontend/public/images/admin-icon.svg similarity index 100% rename from frontend/src/img/admin-icon.svg rename to frontend/public/images/admin-icon.svg diff --git a/frontend/src/img/avatar.png b/frontend/public/images/avatar.png similarity index 100% rename from frontend/src/img/avatar.png rename to frontend/public/images/avatar.png diff --git a/frontend/src/img/favicon.png b/frontend/public/images/favicon.png similarity index 100% rename from frontend/src/img/favicon.png rename to frontend/public/images/favicon.png diff --git a/frontend/src/img/guest-icon.svg b/frontend/public/images/guest-icon.svg similarity index 100% rename from frontend/src/img/guest-icon.svg rename to frontend/public/images/guest-icon.svg diff --git a/frontend/src/img/host-icon.svg b/frontend/public/images/host-icon.svg similarity index 100% rename from frontend/src/img/host-icon.svg rename to frontend/public/images/host-icon.svg diff --git a/frontend/src/img/huu.svg b/frontend/public/images/huu.svg similarity index 100% rename from frontend/src/img/huu.svg rename to frontend/public/images/huu.svg diff --git a/frontend/src/img/spy.png b/frontend/public/images/spy.png similarity index 100% rename from frontend/src/img/spy.png rename to frontend/public/images/spy.png diff --git a/frontend/src/features/common/AuthenticatedHeader.tsx b/frontend/src/features/common/AuthenticatedHeader.tsx index a55899db..5a13c063 100644 --- a/frontend/src/features/common/AuthenticatedHeader.tsx +++ b/frontend/src/features/common/AuthenticatedHeader.tsx @@ -1,20 +1,25 @@ import * as React from 'react'; -import AppBar from '@mui/material/AppBar'; -import Box from '@mui/material/Box'; -import IconButton from '@mui/material/IconButton'; import MenuIcon from '@mui/icons-material/Menu'; -import Toolbar from '@mui/material/Toolbar'; -import Typography from '@mui/material/Typography'; -import {Tooltip, Avatar, Menu, MenuItem, Stack} from '@mui/material'; -import logo from '../../img/favicon.png'; +import {styled} from '@mui/system'; +import { + Tooltip, + Avatar, + Menu, + MenuItem, + Stack, + IconButton, + Toolbar, + Typography, + Box, + AppBar, +} from '@mui/material'; +import {useSelector} from 'react-redux'; +import {Link, useNavigate} from 'react-router-dom'; + import {useSignOutMutation} from '../../services/auth'; import {selectCurrentUser} from '../../redux/authSlice'; import {User, UserRole} from '../../services/user'; -import {useSelector} from 'react-redux'; -import {Link, useNavigate} from 'react-router-dom'; -import {styled} from '@mui/system'; - function getInitials(user: User): string { const fi = (user.firstName && user.firstName[0]) || '?'; const li = (user.lastName && user.lastName[0]) || ''; @@ -51,7 +56,7 @@ export const AuthenticatedHeader = ({onClick}: OwnProps) => { ) : (
)} - + diff --git a/frontend/src/features/common/Header.tsx b/frontend/src/features/common/Header.tsx index a988596f..8dd90ba5 100644 --- a/frontend/src/features/common/Header.tsx +++ b/frontend/src/features/common/Header.tsx @@ -1,22 +1,16 @@ import * as React from 'react'; -import AppBar from '@mui/material/AppBar'; -import Box from '@mui/material/Box'; -import Toolbar from '@mui/material/Toolbar'; -import Button from '@mui/material/Button'; import MenuIcon from '@mui/icons-material/Menu'; -import Divider from '@mui/material/Divider'; import { Drawer, IconButton, - List, - ListItem, - ListItemButton, - ListItemText, Stack, + Button, + Toolbar, + Box, + AppBar, styled, - Typography, } from '@mui/material'; -import logo from '../../img/favicon.png'; + const MOBILE_DRAWER_WIDTH = 209; const navItems = [ @@ -31,25 +25,6 @@ export const Header = () => { setMobileOpen(prevState => !prevState); }; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const drawer = ( - - - MUI - - - - {navItems.map(({title, href}) => ( - - - - - - ))} - - - ); - const container = window !== undefined ? () => window.document.body : undefined; @@ -68,7 +43,7 @@ export const Header = () => { Home Unite Us logo From bd68d64632fb99782c3ffb9ca47eda59c6254e64 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:16:58 -0700 Subject: [PATCH 05/25] Create coordinator-dashboard folder --- frontend/src/features/common/index.ts | 1 - .../{common => coordinator-dashboard}/GuestInviteButton.tsx | 0 .../__tests__/GuestInviteButton.test.tsx | 2 +- frontend/src/features/coordinator-dashboard/index.ts | 1 + frontend/src/features/intake-profile/hooks/useStatusStyling.tsx | 2 +- frontend/src/pages/CoordinatorDashboard.tsx | 2 +- frontend/src/pages/SelectAccountType.tsx | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) rename frontend/src/features/{common => coordinator-dashboard}/GuestInviteButton.tsx (100%) rename frontend/src/features/{common => coordinator-dashboard}/__tests__/GuestInviteButton.test.tsx (98%) create mode 100644 frontend/src/features/coordinator-dashboard/index.ts diff --git a/frontend/src/features/common/index.ts b/frontend/src/features/common/index.ts index 8a1d621f..a43f77b9 100644 --- a/frontend/src/features/common/index.ts +++ b/frontend/src/features/common/index.ts @@ -2,4 +2,3 @@ export {Loading} from './Loading'; export {Header} from './Header'; export {AppLayout} from './AppLayout'; export {AuthenticatedHeader} from './AuthenticatedHeader'; -export {GuestInviteButton} from './GuestInviteButton'; diff --git a/frontend/src/features/common/GuestInviteButton.tsx b/frontend/src/features/coordinator-dashboard/GuestInviteButton.tsx similarity index 100% rename from frontend/src/features/common/GuestInviteButton.tsx rename to frontend/src/features/coordinator-dashboard/GuestInviteButton.tsx diff --git a/frontend/src/features/common/__tests__/GuestInviteButton.test.tsx b/frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx similarity index 98% rename from frontend/src/features/common/__tests__/GuestInviteButton.test.tsx rename to frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx index 63cba846..46dfc275 100644 --- a/frontend/src/features/common/__tests__/GuestInviteButton.test.tsx +++ b/frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx @@ -7,7 +7,7 @@ import { screen, userEvent, } from '../../../utils/test/test-utils'; -import {GuestInviteButton} from '../GuestInviteButton'; +import {GuestInviteButton} from '../../coordinator-dashboard/GuestInviteButton'; import {server} from '../../../utils/test/server'; import {HttpResponse, http} from 'msw'; diff --git a/frontend/src/features/coordinator-dashboard/index.ts b/frontend/src/features/coordinator-dashboard/index.ts new file mode 100644 index 00000000..434d0c0c --- /dev/null +++ b/frontend/src/features/coordinator-dashboard/index.ts @@ -0,0 +1 @@ +export {GuestInviteButton} from './GuestInviteButton'; diff --git a/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx index 1a2a4564..ff2d83bf 100644 --- a/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx +++ b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx @@ -1,5 +1,5 @@ import {useTheme} from '@mui/material/styles'; -import {InProgressIcon} from '../../Icons/InProgressIcon'; +import {InProgressIcon} from '../../icons/InProgressIcon'; import LockIcon from '@mui/icons-material/Lock'; import {CheckCircleOutlined} from '@mui/icons-material'; diff --git a/frontend/src/pages/CoordinatorDashboard.tsx b/frontend/src/pages/CoordinatorDashboard.tsx index 04b7a12a..1e9d03aa 100644 --- a/frontend/src/pages/CoordinatorDashboard.tsx +++ b/frontend/src/pages/CoordinatorDashboard.tsx @@ -17,7 +17,7 @@ import { DashboardDataResponse, useGetAllDashboardDataMutation, } from '../services/coordinator'; -import {GuestInviteButton} from '../features/common'; +import {GuestInviteButton} from '../features/coordinator-dashboard'; import {LoadingComponent} from './LoadingComponent'; const columns: GridColDef[] = [ diff --git a/frontend/src/pages/SelectAccountType.tsx b/frontend/src/pages/SelectAccountType.tsx index 544365a8..818dea7d 100644 --- a/frontend/src/pages/SelectAccountType.tsx +++ b/frontend/src/pages/SelectAccountType.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react'; import {useNavigate} from 'react-router-dom'; import {Typography, Button, Stack, Link, Divider} from '@mui/material'; import {styled} from '@mui/system'; -import {HostIcon, CoordinatorIcon} from '../features/Icons'; +import {HostIcon, CoordinatorIcon} from '../features/icons'; export const SelectAccountType = () => { const [type, setType] = useState(''); From 79632464a1222464acfe3a69519b672ff93e095f Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:18:42 -0700 Subject: [PATCH 06/25] Move icons into common folder --- .../src/features/{Icons => common/icons}/CoordinatorIcon.tsx | 0 frontend/src/features/{Icons => common/icons}/GuestIcon.tsx | 0 frontend/src/features/{Icons => common/icons}/HostIcon.tsx | 0 .../src/features/{Icons => common/icons}/InProgressIcon.tsx | 0 frontend/src/features/{Icons => common/icons}/index.ts | 0 frontend/src/features/intake-profile/hooks/useStatusStyling.tsx | 2 +- frontend/src/pages/SelectAccountType.tsx | 2 +- 7 files changed, 2 insertions(+), 2 deletions(-) rename frontend/src/features/{Icons => common/icons}/CoordinatorIcon.tsx (100%) rename frontend/src/features/{Icons => common/icons}/GuestIcon.tsx (100%) rename frontend/src/features/{Icons => common/icons}/HostIcon.tsx (100%) rename frontend/src/features/{Icons => common/icons}/InProgressIcon.tsx (100%) rename frontend/src/features/{Icons => common/icons}/index.ts (100%) diff --git a/frontend/src/features/Icons/CoordinatorIcon.tsx b/frontend/src/features/common/icons/CoordinatorIcon.tsx similarity index 100% rename from frontend/src/features/Icons/CoordinatorIcon.tsx rename to frontend/src/features/common/icons/CoordinatorIcon.tsx diff --git a/frontend/src/features/Icons/GuestIcon.tsx b/frontend/src/features/common/icons/GuestIcon.tsx similarity index 100% rename from frontend/src/features/Icons/GuestIcon.tsx rename to frontend/src/features/common/icons/GuestIcon.tsx diff --git a/frontend/src/features/Icons/HostIcon.tsx b/frontend/src/features/common/icons/HostIcon.tsx similarity index 100% rename from frontend/src/features/Icons/HostIcon.tsx rename to frontend/src/features/common/icons/HostIcon.tsx diff --git a/frontend/src/features/Icons/InProgressIcon.tsx b/frontend/src/features/common/icons/InProgressIcon.tsx similarity index 100% rename from frontend/src/features/Icons/InProgressIcon.tsx rename to frontend/src/features/common/icons/InProgressIcon.tsx diff --git a/frontend/src/features/Icons/index.ts b/frontend/src/features/common/icons/index.ts similarity index 100% rename from frontend/src/features/Icons/index.ts rename to frontend/src/features/common/icons/index.ts diff --git a/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx index ff2d83bf..b66c54e3 100644 --- a/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx +++ b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx @@ -1,5 +1,5 @@ import {useTheme} from '@mui/material/styles'; -import {InProgressIcon} from '../../icons/InProgressIcon'; +import {InProgressIcon} from '../../common/icons/InProgressIcon'; import LockIcon from '@mui/icons-material/Lock'; import {CheckCircleOutlined} from '@mui/icons-material'; diff --git a/frontend/src/pages/SelectAccountType.tsx b/frontend/src/pages/SelectAccountType.tsx index 818dea7d..c727af72 100644 --- a/frontend/src/pages/SelectAccountType.tsx +++ b/frontend/src/pages/SelectAccountType.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react'; import {useNavigate} from 'react-router-dom'; import {Typography, Button, Stack, Link, Divider} from '@mui/material'; import {styled} from '@mui/system'; -import {HostIcon, CoordinatorIcon} from '../features/icons'; +import {HostIcon, CoordinatorIcon} from '../features/common/icons'; export const SelectAccountType = () => { const [type, setType] = useState(''); From 4aca260d278c521a0305e9e1ab9863f293371fef Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:40:35 -0700 Subject: [PATCH 07/25] Clean up common folder --- .../authentication/NewPasswordForm.tsx | 2 +- .../PasswordValidation.tsx | 0 .../features/authentication/SignUpForm.tsx | 2 +- frontend/src/features/common/AppContainer.tsx | 16 ------- frontend/src/features/common/Avatar.tsx | 26 ----------- frontend/src/features/common/HomeLink.tsx | 46 ------------------- frontend/src/features/common/ProgressBar.tsx | 29 ------------ .../src/features/common/UiPlaceholder.tsx | 25 ---------- frontend/src/pages/ResetPassword.tsx | 2 +- 9 files changed, 3 insertions(+), 145 deletions(-) rename frontend/src/features/{common => authentication}/PasswordValidation.tsx (100%) delete mode 100644 frontend/src/features/common/AppContainer.tsx delete mode 100644 frontend/src/features/common/Avatar.tsx delete mode 100644 frontend/src/features/common/HomeLink.tsx delete mode 100644 frontend/src/features/common/ProgressBar.tsx delete mode 100644 frontend/src/features/common/UiPlaceholder.tsx diff --git a/frontend/src/features/authentication/NewPasswordForm.tsx b/frontend/src/features/authentication/NewPasswordForm.tsx index aa9526f4..8e220191 100644 --- a/frontend/src/features/authentication/NewPasswordForm.tsx +++ b/frontend/src/features/authentication/NewPasswordForm.tsx @@ -4,7 +4,7 @@ import {object, string, ref} from 'yup'; import {NewPasswordRequest} from '../../services/auth'; import {PasswordField} from './PasswordField'; -import {PasswordValidation} from '../common/PasswordValidation'; +import {PasswordValidation} from './PasswordValidation'; interface NewPasswordFormProps { onSubmit: ({password, confirmPassword}: NewPasswordRequest) => Promise; diff --git a/frontend/src/features/common/PasswordValidation.tsx b/frontend/src/features/authentication/PasswordValidation.tsx similarity index 100% rename from frontend/src/features/common/PasswordValidation.tsx rename to frontend/src/features/authentication/PasswordValidation.tsx diff --git a/frontend/src/features/authentication/SignUpForm.tsx b/frontend/src/features/authentication/SignUpForm.tsx index 98a51a94..e80b174b 100644 --- a/frontend/src/features/authentication/SignUpForm.tsx +++ b/frontend/src/features/authentication/SignUpForm.tsx @@ -9,7 +9,7 @@ import { // import GoogleIcon from '@mui/icons-material/Google'; import {useFormik} from 'formik'; import {SignUpRequest} from '../../services/auth'; -import {PasswordValidation} from '../common/PasswordValidation'; +import {PasswordValidation} from './PasswordValidation'; import {signUpVaildationSchema} from '../../utils/validation-schemas'; import {PasswordField} from './PasswordField'; diff --git a/frontend/src/features/common/AppContainer.tsx b/frontend/src/features/common/AppContainer.tsx deleted file mode 100644 index fd72e63c..00000000 --- a/frontend/src/features/common/AppContainer.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import {Container} from '@mui/material'; -import {styled} from '@mui/system'; -import React from 'react'; - -const MaxWidthContainer = styled(Container)({ - height: '100vh', - maxWidth: '1400px', -}); - -interface AppContainerProps {} - -export const AppContainer = ({ - children, -}: React.PropsWithChildren) => { - return {children}; -}; diff --git a/frontend/src/features/common/Avatar.tsx b/frontend/src/features/common/Avatar.tsx deleted file mode 100644 index 293e7a6a..00000000 --- a/frontend/src/features/common/Avatar.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import {Avatar as MUIAvatar} from '@mui/material'; -import {styled} from '@mui/system'; - -interface AvatarProps { - name: string | undefined; - image: string | undefined; -} - -export const Avatar = ({name = 'No Name', image = ''}: AvatarProps) => { - return ( - - - - ); -}; - -const AvatarContainer = styled('div')(({theme}) => ({ - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - border: `1px solid ${theme.palette.grey[400]}`, - borderRadius: '50%', - height: 50, - width: 50, -})); diff --git a/frontend/src/features/common/HomeLink.tsx b/frontend/src/features/common/HomeLink.tsx deleted file mode 100644 index 0d5c3901..00000000 --- a/frontend/src/features/common/HomeLink.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import {Typography} from '@mui/material'; -import {styled} from '@mui/system'; -import {NavLink} from 'react-router-dom'; - -interface HomeLinkProps { - to: string; - name: string; -} - -export const HomeLink = ({ - to, - name, - children, -}: React.PropsWithChildren) => { - return ( - - {children} - {name} - - ); -}; - -const Link = styled(NavLink)(({theme}) => ({ - height: '11.625rem', - width: '11.625rem', - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center', - border: `1px solid ${theme.palette.grey[300]}`, - borderRadius: 26, - textDecoration: 'none', - transition: 'all 0.2s ease', - color: `${theme.palette.primary.main}`, - '&:hover': { - backgroundColor: `${theme.palette.primary.main}`, - color: '#fff', - }, -})); - -const Text = styled(Typography)({ - fontSize: '1.5rem', - fontWeight: 500, - color: 'currentcolor', -}); diff --git a/frontend/src/features/common/ProgressBar.tsx b/frontend/src/features/common/ProgressBar.tsx deleted file mode 100644 index ffa4b1ff..00000000 --- a/frontend/src/features/common/ProgressBar.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import {styled} from '@mui/material/styles'; -import Box from '@mui/material/Box'; -import LinearProgress, { - linearProgressClasses, -} from '@mui/material/LinearProgress'; - -const BorderLinearProgress = styled(LinearProgress)(({theme}) => ({ - height: 10, - borderRadius: 5, - [`&.${linearProgressClasses.colorPrimary}`]: { - backgroundColor: theme.palette.grey[300], - }, - [`& .${linearProgressClasses.bar}`]: { - borderRadius: 5, - backgroundColor: theme.palette.primary, - }, -})); - -export default function ProgressBar({ - progressBarValue, -}: { - progressBarValue: number; -}) { - return ( - - - - ); -} diff --git a/frontend/src/features/common/UiPlaceholder.tsx b/frontend/src/features/common/UiPlaceholder.tsx deleted file mode 100644 index 943d3133..00000000 --- a/frontend/src/features/common/UiPlaceholder.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react'; -import {Box, Typography} from '@mui/material'; - -export interface UiPlaceholderProps { - name: string; -} - -export function UiPlaceholder(props: UiPlaceholderProps) { - return ( - - {props.name} - - ); -} diff --git a/frontend/src/pages/ResetPassword.tsx b/frontend/src/pages/ResetPassword.tsx index 7efc2886..0cfe97ef 100644 --- a/frontend/src/pages/ResetPassword.tsx +++ b/frontend/src/pages/ResetPassword.tsx @@ -11,7 +11,7 @@ import {ResestPasswordValues} from '../features/authentication/ResetPasswordCont import {useConfirmForgotPasswordMutation} from '../services/auth'; import {getErrorMessage} from '../redux/helpers'; import {FormContainer, PasswordField} from '../features/authentication'; -import {PasswordValidation} from '../features/common/PasswordValidation'; +import {PasswordValidation} from '../features/authentication/PasswordValidation'; export const ResetPassword = () => { const { From 17fb77e482c158b163c818a4c5ef5a826d9b1d07 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:47:52 -0700 Subject: [PATCH 08/25] Change test to testing --- .../features/authentication/__tests__/CodeField.test.tsx | 2 +- .../features/authentication/__tests__/SignInForm.test.tsx | 2 +- .../features/authentication/__tests__/SignUpForm.test.tsx | 2 +- .../__tests__/GuestInviteButton.test.tsx | 4 ++-- .../dashboard/__tests__/CoordinatorContact.test.tsx | 2 +- .../features/dashboard/__tests__/DashboardTask.test.tsx | 2 +- .../dashboard/__tests__/DashboardTaskAccordion.test.tsx | 2 +- frontend/src/main.tsx | 2 +- frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx | 4 ++-- frontend/src/pages/__tests__/ResetPassword.test.tsx | 7 ++++++- frontend/src/utils/{test => testing}/__mocks__/fileMock.ts | 0 frontend/src/utils/{test => testing}/browser.ts | 0 frontend/src/utils/{test => testing}/db/profile.ts | 0 frontend/src/utils/{test => testing}/handlers/auth.ts | 0 frontend/src/utils/{test => testing}/handlers/profile.ts | 0 frontend/src/utils/{test => testing}/server.ts | 0 frontend/src/utils/{test => testing}/setupTests.ts | 0 frontend/src/utils/{test => testing}/test-utils.tsx | 0 18 files changed, 17 insertions(+), 12 deletions(-) rename frontend/src/utils/{test => testing}/__mocks__/fileMock.ts (100%) rename frontend/src/utils/{test => testing}/browser.ts (100%) rename frontend/src/utils/{test => testing}/db/profile.ts (100%) rename frontend/src/utils/{test => testing}/handlers/auth.ts (100%) rename frontend/src/utils/{test => testing}/handlers/profile.ts (100%) rename frontend/src/utils/{test => testing}/server.ts (100%) rename frontend/src/utils/{test => testing}/setupTests.ts (100%) rename frontend/src/utils/{test => testing}/test-utils.tsx (100%) diff --git a/frontend/src/features/authentication/__tests__/CodeField.test.tsx b/frontend/src/features/authentication/__tests__/CodeField.test.tsx index 1a254b7d..be7227f8 100644 --- a/frontend/src/features/authentication/__tests__/CodeField.test.tsx +++ b/frontend/src/features/authentication/__tests__/CodeField.test.tsx @@ -3,7 +3,7 @@ import { screen, userEvent, fireEvent, -} from '../../../utils/test/test-utils'; +} from '../../../utils/testing/test-utils'; import {CodeField} from '..'; describe('CodeField', () => { diff --git a/frontend/src/features/authentication/__tests__/SignInForm.test.tsx b/frontend/src/features/authentication/__tests__/SignInForm.test.tsx index 2381b514..452e8a53 100644 --- a/frontend/src/features/authentication/__tests__/SignInForm.test.tsx +++ b/frontend/src/features/authentication/__tests__/SignInForm.test.tsx @@ -1,6 +1,6 @@ import {BrowserRouter} from 'react-router-dom'; import {describe, vi} from 'vitest'; -import {fireEvent, render, screen} from '../../../utils/test/test-utils'; +import {fireEvent, render, screen} from '../../../utils/testing/test-utils'; import {SignInForm} from '../SignInForm'; const prepare = () => { diff --git a/frontend/src/features/authentication/__tests__/SignUpForm.test.tsx b/frontend/src/features/authentication/__tests__/SignUpForm.test.tsx index 74b03063..19d559be 100644 --- a/frontend/src/features/authentication/__tests__/SignUpForm.test.tsx +++ b/frontend/src/features/authentication/__tests__/SignUpForm.test.tsx @@ -5,7 +5,7 @@ import { screen, userEvent, fireEvent, -} from '../../../utils/test/test-utils'; +} from '../../../utils/testing/test-utils'; import {SignUpForm, SignUpFormProps} from '../SignUpForm'; import {faker} from '@faker-js/faker'; diff --git a/frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx b/frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx index 46dfc275..da534ac9 100644 --- a/frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx +++ b/frontend/src/features/coordinator-dashboard/__tests__/GuestInviteButton.test.tsx @@ -6,9 +6,9 @@ import { render, screen, userEvent, -} from '../../../utils/test/test-utils'; +} from '../../../utils/testing/test-utils'; import {GuestInviteButton} from '../../coordinator-dashboard/GuestInviteButton'; -import {server} from '../../../utils/test/server'; +import {server} from '../../../utils/testing/server'; import {HttpResponse, http} from 'msw'; function createGuest() { diff --git a/frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx b/frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx index 8417e51e..bf6dd5ea 100644 --- a/frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx +++ b/frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx @@ -1,4 +1,4 @@ -import {render, screen} from '../../../utils/test/test-utils'; +import {render, screen} from '../../../utils/testing/test-utils'; import {CoordinatorContact} from '../CoordinatorContact'; const setup = () => { diff --git a/frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx b/frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx index 56189891..8554470b 100644 --- a/frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx +++ b/frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx @@ -1,5 +1,5 @@ import {BrowserRouter} from 'react-router-dom'; -import {render, screen, userEvent} from '../../../utils/test/test-utils'; +import {render, screen, userEvent} from '../../../utils/testing/test-utils'; import {DashboardTask, DashboardTaskProps} from '../DashboardTask'; const {navigate} = vi.hoisted(() => { diff --git a/frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx b/frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx index 835b69a9..f875189c 100644 --- a/frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx +++ b/frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx @@ -1,5 +1,5 @@ import {BrowserRouter} from 'react-router-dom'; -import {render, screen, within} from '../../../utils/test/test-utils'; +import {render, screen, within} from '../../../utils/testing/test-utils'; import { DashboardTaskAccordion, TaskAccordionProps, diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 4423b4c6..56adf197 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -44,7 +44,7 @@ import { GuestDashboardLayout, } from './features/layout'; import {FieldGroupList} from './features/intake-profile/IntakeProfileGroups'; -import {enableMocking} from './utils/test/browser'; +import {enableMocking} from './utils/testing/browser'; import {SystemAdminDashboard} from './pages/SystemAdminDashboard'; import {ProfileReview} from './features/intake-profile/ProfileReview'; diff --git a/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx b/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx index 28171b1f..fe41c418 100644 --- a/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx +++ b/frontend/src/pages/__tests__/ForgotPasswordCode.test.tsx @@ -8,11 +8,11 @@ import { screen, fireEvent, userEvent, -} from '../../utils/test/test-utils'; +} from '../../utils/testing/test-utils'; import {ForgotPasswordCode} from '../ForgotPasswordCode'; import {BrowserRouter} from 'react-router-dom'; import {Formik} from 'formik'; -import {server} from '../../utils/test/server'; +import {server} from '../../utils/testing/server'; import {HttpResponse, http, delay} from 'msw'; const {navigate} = vi.hoisted(() => { diff --git a/frontend/src/pages/__tests__/ResetPassword.test.tsx b/frontend/src/pages/__tests__/ResetPassword.test.tsx index 3cc78704..e5c5d119 100644 --- a/frontend/src/pages/__tests__/ResetPassword.test.tsx +++ b/frontend/src/pages/__tests__/ResetPassword.test.tsx @@ -5,7 +5,12 @@ import { initialValues, validationSchema, } from '../../features/authentication/ResetPasswordContext'; -import {render, screen, waitFor, fireEvent} from '../../utils/test/test-utils'; +import { + render, + screen, + waitFor, + fireEvent, +} from '../../utils/testing/test-utils'; import {ResetPassword} from '../ResetPassword'; interface Mocks { diff --git a/frontend/src/utils/test/__mocks__/fileMock.ts b/frontend/src/utils/testing/__mocks__/fileMock.ts similarity index 100% rename from frontend/src/utils/test/__mocks__/fileMock.ts rename to frontend/src/utils/testing/__mocks__/fileMock.ts diff --git a/frontend/src/utils/test/browser.ts b/frontend/src/utils/testing/browser.ts similarity index 100% rename from frontend/src/utils/test/browser.ts rename to frontend/src/utils/testing/browser.ts diff --git a/frontend/src/utils/test/db/profile.ts b/frontend/src/utils/testing/db/profile.ts similarity index 100% rename from frontend/src/utils/test/db/profile.ts rename to frontend/src/utils/testing/db/profile.ts diff --git a/frontend/src/utils/test/handlers/auth.ts b/frontend/src/utils/testing/handlers/auth.ts similarity index 100% rename from frontend/src/utils/test/handlers/auth.ts rename to frontend/src/utils/testing/handlers/auth.ts diff --git a/frontend/src/utils/test/handlers/profile.ts b/frontend/src/utils/testing/handlers/profile.ts similarity index 100% rename from frontend/src/utils/test/handlers/profile.ts rename to frontend/src/utils/testing/handlers/profile.ts diff --git a/frontend/src/utils/test/server.ts b/frontend/src/utils/testing/server.ts similarity index 100% rename from frontend/src/utils/test/server.ts rename to frontend/src/utils/testing/server.ts diff --git a/frontend/src/utils/test/setupTests.ts b/frontend/src/utils/testing/setupTests.ts similarity index 100% rename from frontend/src/utils/test/setupTests.ts rename to frontend/src/utils/testing/setupTests.ts diff --git a/frontend/src/utils/test/test-utils.tsx b/frontend/src/utils/testing/test-utils.tsx similarity index 100% rename from frontend/src/utils/test/test-utils.tsx rename to frontend/src/utils/testing/test-utils.tsx From b5ba1f980d80c4295f9a9bc186f6442aa5a70c96 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:48:27 -0700 Subject: [PATCH 09/25] Change layout to layouts --- .../features/{layout => layouts}/CoordinatorDashboardLayout.tsx | 0 frontend/src/features/{layout => layouts}/DashboardLayout.tsx | 0 .../src/features/{layout => layouts}/GuestDashboardLayout.tsx | 0 frontend/src/features/{layout => layouts}/index.ts | 0 frontend/src/main.tsx | 2 +- 5 files changed, 1 insertion(+), 1 deletion(-) rename frontend/src/features/{layout => layouts}/CoordinatorDashboardLayout.tsx (100%) rename frontend/src/features/{layout => layouts}/DashboardLayout.tsx (100%) rename frontend/src/features/{layout => layouts}/GuestDashboardLayout.tsx (100%) rename frontend/src/features/{layout => layouts}/index.ts (100%) diff --git a/frontend/src/features/layout/CoordinatorDashboardLayout.tsx b/frontend/src/features/layouts/CoordinatorDashboardLayout.tsx similarity index 100% rename from frontend/src/features/layout/CoordinatorDashboardLayout.tsx rename to frontend/src/features/layouts/CoordinatorDashboardLayout.tsx diff --git a/frontend/src/features/layout/DashboardLayout.tsx b/frontend/src/features/layouts/DashboardLayout.tsx similarity index 100% rename from frontend/src/features/layout/DashboardLayout.tsx rename to frontend/src/features/layouts/DashboardLayout.tsx diff --git a/frontend/src/features/layout/GuestDashboardLayout.tsx b/frontend/src/features/layouts/GuestDashboardLayout.tsx similarity index 100% rename from frontend/src/features/layout/GuestDashboardLayout.tsx rename to frontend/src/features/layouts/GuestDashboardLayout.tsx diff --git a/frontend/src/features/layout/index.ts b/frontend/src/features/layouts/index.ts similarity index 100% rename from frontend/src/features/layout/index.ts rename to frontend/src/features/layouts/index.ts diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 56adf197..7c671267 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -42,7 +42,7 @@ import {ResetPasswordContext} from './features/authentication/ResetPasswordConte import { CoordinatorDashboardLayout, GuestDashboardLayout, -} from './features/layout'; +} from './features/layouts'; import {FieldGroupList} from './features/intake-profile/IntakeProfileGroups'; import {enableMocking} from './utils/testing/browser'; import {SystemAdminDashboard} from './pages/SystemAdminDashboard'; From 7bf98c3d0d657046c7e9055556c9d9b2e1ac28b4 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:49:53 -0700 Subject: [PATCH 10/25] Update guest dashboard feature --- .../{dashboard => guest-dashboard}/CoordinatorContact.tsx | 0 .../features/{dashboard => guest-dashboard}/DashboardTask.tsx | 2 +- .../{dashboard => guest-dashboard}/DashboardTaskAccordion.tsx | 2 +- .../__tests__/CoordinatorContact.test.tsx | 0 .../__tests__/DashboardTask.test.tsx | 0 .../__tests__/DashboardTaskAccordion.test.tsx | 0 frontend/src/features/{dashboard => guest-dashboard}/index.ts | 0 .../pages/{GuestApplicationTracker.tsx => GuestDashboard.tsx} | 2 +- frontend/src/pages/index.ts | 2 +- 9 files changed, 4 insertions(+), 4 deletions(-) rename frontend/src/features/{dashboard => guest-dashboard}/CoordinatorContact.tsx (100%) rename frontend/src/features/{dashboard => guest-dashboard}/DashboardTask.tsx (96%) rename frontend/src/features/{dashboard => guest-dashboard}/DashboardTaskAccordion.tsx (98%) rename frontend/src/features/{dashboard => guest-dashboard}/__tests__/CoordinatorContact.test.tsx (100%) rename frontend/src/features/{dashboard => guest-dashboard}/__tests__/DashboardTask.test.tsx (100%) rename frontend/src/features/{dashboard => guest-dashboard}/__tests__/DashboardTaskAccordion.test.tsx (100%) rename frontend/src/features/{dashboard => guest-dashboard}/index.ts (100%) rename frontend/src/pages/{GuestApplicationTracker.tsx => GuestDashboard.tsx} (99%) diff --git a/frontend/src/features/dashboard/CoordinatorContact.tsx b/frontend/src/features/guest-dashboard/CoordinatorContact.tsx similarity index 100% rename from frontend/src/features/dashboard/CoordinatorContact.tsx rename to frontend/src/features/guest-dashboard/CoordinatorContact.tsx diff --git a/frontend/src/features/dashboard/DashboardTask.tsx b/frontend/src/features/guest-dashboard/DashboardTask.tsx similarity index 96% rename from frontend/src/features/dashboard/DashboardTask.tsx rename to frontend/src/features/guest-dashboard/DashboardTask.tsx index b96bb6c1..328baa92 100644 --- a/frontend/src/features/dashboard/DashboardTask.tsx +++ b/frontend/src/features/guest-dashboard/DashboardTask.tsx @@ -4,7 +4,7 @@ import LockIcon from '@mui/icons-material/Lock'; import AccessTimeIcon from '@mui/icons-material/AccessTime'; import {Link} from 'react-router-dom'; -import {SubTask} from '../../pages/GuestApplicationTracker'; +import {SubTask} from '../../pages/GuestDashboard'; export type DashboardTaskProps = Pick< SubTask, diff --git a/frontend/src/features/dashboard/DashboardTaskAccordion.tsx b/frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx similarity index 98% rename from frontend/src/features/dashboard/DashboardTaskAccordion.tsx rename to frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx index 2235ae69..f69c46d8 100644 --- a/frontend/src/features/dashboard/DashboardTaskAccordion.tsx +++ b/frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx @@ -13,7 +13,7 @@ import CheckCircleOutlined from '@mui/icons-material/CheckCircleOutlined'; import LockIcon from '@mui/icons-material/Lock'; import {styled} from '@mui/material/styles'; -import {Task} from '../../pages/GuestApplicationTracker'; +import {Task} from '../../pages/GuestDashboard'; import {DashboardTask} from './DashboardTask'; export interface TaskAccordionProps diff --git a/frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx b/frontend/src/features/guest-dashboard/__tests__/CoordinatorContact.test.tsx similarity index 100% rename from frontend/src/features/dashboard/__tests__/CoordinatorContact.test.tsx rename to frontend/src/features/guest-dashboard/__tests__/CoordinatorContact.test.tsx diff --git a/frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx b/frontend/src/features/guest-dashboard/__tests__/DashboardTask.test.tsx similarity index 100% rename from frontend/src/features/dashboard/__tests__/DashboardTask.test.tsx rename to frontend/src/features/guest-dashboard/__tests__/DashboardTask.test.tsx diff --git a/frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx b/frontend/src/features/guest-dashboard/__tests__/DashboardTaskAccordion.test.tsx similarity index 100% rename from frontend/src/features/dashboard/__tests__/DashboardTaskAccordion.test.tsx rename to frontend/src/features/guest-dashboard/__tests__/DashboardTaskAccordion.test.tsx diff --git a/frontend/src/features/dashboard/index.ts b/frontend/src/features/guest-dashboard/index.ts similarity index 100% rename from frontend/src/features/dashboard/index.ts rename to frontend/src/features/guest-dashboard/index.ts diff --git a/frontend/src/pages/GuestApplicationTracker.tsx b/frontend/src/pages/GuestDashboard.tsx similarity index 99% rename from frontend/src/pages/GuestApplicationTracker.tsx rename to frontend/src/pages/GuestDashboard.tsx index 829b6ee6..9c12a8e0 100644 --- a/frontend/src/pages/GuestApplicationTracker.tsx +++ b/frontend/src/pages/GuestDashboard.tsx @@ -3,7 +3,7 @@ import {styled} from '@mui/system'; import { DashboardTaskAccordion, CoordinatorContact, -} from '../features/dashboard'; +} from '../features/guest-dashboard'; export type TaskStatus = 'inProgress' | 'complete' | 'locked'; diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index 448093bf..103ff5f9 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -1,6 +1,6 @@ export {AccountVerification} from './AccountVerification'; export {CoordinatorDashboard} from './CoordinatorDashboard'; -export {GuestApplicationTracker} from './GuestApplicationTracker'; +export {GuestApplicationTracker} from './GuestDashboard'; export {GuestSettings} from './GuestSettings'; export {GuestContacts} from './GuestContacts'; export {GuestTasks} from './GuestTasks'; From 76a43b5e7503fa5821691b63633a1e231e6dd201 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 17:55:28 -0700 Subject: [PATCH 11/25] Add app layout to layouts --- frontend/src/features/common/index.ts | 2 +- frontend/src/features/{common => layouts}/AppLayout.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename frontend/src/features/{common => layouts}/AppLayout.tsx (90%) diff --git a/frontend/src/features/common/index.ts b/frontend/src/features/common/index.ts index a43f77b9..02a47b9b 100644 --- a/frontend/src/features/common/index.ts +++ b/frontend/src/features/common/index.ts @@ -1,4 +1,4 @@ export {Loading} from './Loading'; export {Header} from './Header'; -export {AppLayout} from './AppLayout'; +export {AppLayout} from '../layouts/AppLayout'; export {AuthenticatedHeader} from './AuthenticatedHeader'; diff --git a/frontend/src/features/common/AppLayout.tsx b/frontend/src/features/layouts/AppLayout.tsx similarity index 90% rename from frontend/src/features/common/AppLayout.tsx rename to frontend/src/features/layouts/AppLayout.tsx index a70aef21..9e530421 100644 --- a/frontend/src/features/common/AppLayout.tsx +++ b/frontend/src/features/layouts/AppLayout.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Stack, Toolbar, Box} from '@mui/material'; import {Outlet} from 'react-router-dom'; -import {Header} from './Header'; +import {Header} from '../common/Header'; export const AppLayout = () => { return ( From c71ec4f4e7c563b9b0e48853d71872e5111af5dc Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:07:22 -0700 Subject: [PATCH 12/25] Organize authentication pages --- .../LoadingComponent.tsx | 0 .../features/coordinator-dashboard/index.ts | 1 + frontend/src/pages/CoordinatorDashboard.tsx | 6 ++++-- .../pages/__tests__/ResetPassword.test.tsx | 2 +- .../{ => authentication}/ConfirmSignUp.tsx | 0 .../EmailVerificationError.tsx | 2 +- .../EmailVerificationSuccess.tsx | 0 .../{ => authentication}/ForgotPassword.tsx | 8 ++++---- .../ForgotPasswordCode.tsx | 8 ++++---- .../ForgotPasswordSuccess.tsx | 2 +- .../{ => authentication}/ResetPassword.tsx | 10 +++++----- .../SelectAccountType.tsx | 2 +- .../src/pages/{ => authentication}/SignIn.tsx | 0 .../src/pages/{ => authentication}/SignUp.tsx | 0 frontend/src/pages/index.ts | 20 +++++++++---------- 15 files changed, 32 insertions(+), 29 deletions(-) rename frontend/src/{pages => features/coordinator-dashboard}/LoadingComponent.tsx (100%) rename frontend/src/pages/{ => authentication}/ConfirmSignUp.tsx (100%) rename frontend/src/pages/{ => authentication}/EmailVerificationError.tsx (92%) rename frontend/src/pages/{ => authentication}/EmailVerificationSuccess.tsx (100%) rename frontend/src/pages/{ => authentication}/ForgotPassword.tsx (91%) rename frontend/src/pages/{ => authentication}/ForgotPasswordCode.tsx (93%) rename frontend/src/pages/{ => authentication}/ForgotPasswordSuccess.tsx (88%) rename frontend/src/pages/{ => authentication}/ResetPassword.tsx (90%) rename frontend/src/pages/{ => authentication}/SelectAccountType.tsx (97%) rename frontend/src/pages/{ => authentication}/SignIn.tsx (100%) rename frontend/src/pages/{ => authentication}/SignUp.tsx (100%) diff --git a/frontend/src/pages/LoadingComponent.tsx b/frontend/src/features/coordinator-dashboard/LoadingComponent.tsx similarity index 100% rename from frontend/src/pages/LoadingComponent.tsx rename to frontend/src/features/coordinator-dashboard/LoadingComponent.tsx diff --git a/frontend/src/features/coordinator-dashboard/index.ts b/frontend/src/features/coordinator-dashboard/index.ts index 434d0c0c..8fe83584 100644 --- a/frontend/src/features/coordinator-dashboard/index.ts +++ b/frontend/src/features/coordinator-dashboard/index.ts @@ -1 +1,2 @@ export {GuestInviteButton} from './GuestInviteButton'; +export {LoadingComponent} from './LoadingComponent'; diff --git a/frontend/src/pages/CoordinatorDashboard.tsx b/frontend/src/pages/CoordinatorDashboard.tsx index 1e9d03aa..a1724ac5 100644 --- a/frontend/src/pages/CoordinatorDashboard.tsx +++ b/frontend/src/pages/CoordinatorDashboard.tsx @@ -17,8 +17,10 @@ import { DashboardDataResponse, useGetAllDashboardDataMutation, } from '../services/coordinator'; -import {GuestInviteButton} from '../features/coordinator-dashboard'; -import {LoadingComponent} from './LoadingComponent'; +import { + GuestInviteButton, + LoadingComponent, +} from '../features/coordinator-dashboard'; const columns: GridColDef[] = [ { diff --git a/frontend/src/pages/__tests__/ResetPassword.test.tsx b/frontend/src/pages/__tests__/ResetPassword.test.tsx index e5c5d119..605a9b7f 100644 --- a/frontend/src/pages/__tests__/ResetPassword.test.tsx +++ b/frontend/src/pages/__tests__/ResetPassword.test.tsx @@ -11,7 +11,7 @@ import { waitFor, fireEvent, } from '../../utils/testing/test-utils'; -import {ResetPassword} from '../ResetPassword'; +import {ResetPassword} from '../authentication/ResetPassword'; interface Mocks { isError: boolean; diff --git a/frontend/src/pages/ConfirmSignUp.tsx b/frontend/src/pages/authentication/ConfirmSignUp.tsx similarity index 100% rename from frontend/src/pages/ConfirmSignUp.tsx rename to frontend/src/pages/authentication/ConfirmSignUp.tsx diff --git a/frontend/src/pages/EmailVerificationError.tsx b/frontend/src/pages/authentication/EmailVerificationError.tsx similarity index 92% rename from frontend/src/pages/EmailVerificationError.tsx rename to frontend/src/pages/authentication/EmailVerificationError.tsx index 9fd5e934..3b247a6c 100644 --- a/frontend/src/pages/EmailVerificationError.tsx +++ b/frontend/src/pages/authentication/EmailVerificationError.tsx @@ -1,7 +1,7 @@ import {Button, Stack, Typography} from '@mui/material'; import React from 'react'; import CancelOutlined from '@mui/icons-material/CancelOutlined'; -import {FormContainer} from '../features/authentication'; +import {FormContainer} from '../../features/authentication'; export const EmailVerificationError = () => { return ( diff --git a/frontend/src/pages/EmailVerificationSuccess.tsx b/frontend/src/pages/authentication/EmailVerificationSuccess.tsx similarity index 100% rename from frontend/src/pages/EmailVerificationSuccess.tsx rename to frontend/src/pages/authentication/EmailVerificationSuccess.tsx diff --git a/frontend/src/pages/ForgotPassword.tsx b/frontend/src/pages/authentication/ForgotPassword.tsx similarity index 91% rename from frontend/src/pages/ForgotPassword.tsx rename to frontend/src/pages/authentication/ForgotPassword.tsx index acd54b33..c38c7d6d 100644 --- a/frontend/src/pages/ForgotPassword.tsx +++ b/frontend/src/pages/authentication/ForgotPassword.tsx @@ -11,10 +11,10 @@ import CloseIcon from '@mui/icons-material/Close'; import {useFormikContext} from 'formik'; import React from 'react'; import {useNavigate} from 'react-router-dom'; -import {isErrorWithMessage, isFetchBaseQueryError} from '../redux/helpers'; -import {ResestPasswordValues} from '../features/authentication/ResetPasswordContext'; -import {useForgotPasswordMutation} from '../services/auth'; -import {FormContainer} from '../features/authentication'; +import {isErrorWithMessage, isFetchBaseQueryError} from '../../redux/helpers'; +import {ResestPasswordValues} from '../../features/authentication/ResetPasswordContext'; +import {useForgotPasswordMutation} from '../../services/auth'; +import {FormContainer} from '../../features/authentication'; export const ForgotPassword = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/ForgotPasswordCode.tsx b/frontend/src/pages/authentication/ForgotPasswordCode.tsx similarity index 93% rename from frontend/src/pages/ForgotPasswordCode.tsx rename to frontend/src/pages/authentication/ForgotPasswordCode.tsx index c5f26da7..b4910809 100644 --- a/frontend/src/pages/ForgotPasswordCode.tsx +++ b/frontend/src/pages/authentication/ForgotPasswordCode.tsx @@ -13,10 +13,10 @@ import CloseIcon from '@mui/icons-material/Close'; import {useFormikContext} from 'formik'; import React from 'react'; import {useNavigate} from 'react-router-dom'; -import {ResestPasswordValues} from '../features/authentication/ResetPasswordContext'; -import {CodeField, FormContainer} from '../features/authentication'; -import {useForgotPasswordMutation} from '../services/auth'; -import {getErrorMessage} from '../redux/helpers'; +import {ResestPasswordValues} from '../../features/authentication/ResetPasswordContext'; +import {CodeField, FormContainer} from '../../features/authentication'; +import {useForgotPasswordMutation} from '../../services/auth'; +import {getErrorMessage} from '../../redux/helpers'; interface Alert { severity: AlertColor; diff --git a/frontend/src/pages/ForgotPasswordSuccess.tsx b/frontend/src/pages/authentication/ForgotPasswordSuccess.tsx similarity index 88% rename from frontend/src/pages/ForgotPasswordSuccess.tsx rename to frontend/src/pages/authentication/ForgotPasswordSuccess.tsx index a0b628e1..1c1ae8d0 100644 --- a/frontend/src/pages/ForgotPasswordSuccess.tsx +++ b/frontend/src/pages/authentication/ForgotPasswordSuccess.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Typography, Button, Stack} from '@mui/material'; -import {FormContainer} from '../features/authentication'; +import {FormContainer} from '../../features/authentication'; export const ForgotPasswordSuccess = () => { return ( diff --git a/frontend/src/pages/ResetPassword.tsx b/frontend/src/pages/authentication/ResetPassword.tsx similarity index 90% rename from frontend/src/pages/ResetPassword.tsx rename to frontend/src/pages/authentication/ResetPassword.tsx index 0cfe97ef..7681386d 100644 --- a/frontend/src/pages/ResetPassword.tsx +++ b/frontend/src/pages/authentication/ResetPassword.tsx @@ -7,11 +7,11 @@ import { } from '@mui/material'; import React from 'react'; import {useFormikContext} from 'formik'; -import {ResestPasswordValues} from '../features/authentication/ResetPasswordContext'; -import {useConfirmForgotPasswordMutation} from '../services/auth'; -import {getErrorMessage} from '../redux/helpers'; -import {FormContainer, PasswordField} from '../features/authentication'; -import {PasswordValidation} from '../features/authentication/PasswordValidation'; +import {ResestPasswordValues} from '../../features/authentication/ResetPasswordContext'; +import {useConfirmForgotPasswordMutation} from '../../services/auth'; +import {getErrorMessage} from '../../redux/helpers'; +import {FormContainer, PasswordField} from '../../features/authentication'; +import {PasswordValidation} from '../../features/authentication/PasswordValidation'; export const ResetPassword = () => { const { diff --git a/frontend/src/pages/SelectAccountType.tsx b/frontend/src/pages/authentication/SelectAccountType.tsx similarity index 97% rename from frontend/src/pages/SelectAccountType.tsx rename to frontend/src/pages/authentication/SelectAccountType.tsx index c727af72..ed61af94 100644 --- a/frontend/src/pages/SelectAccountType.tsx +++ b/frontend/src/pages/authentication/SelectAccountType.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react'; import {useNavigate} from 'react-router-dom'; import {Typography, Button, Stack, Link, Divider} from '@mui/material'; import {styled} from '@mui/system'; -import {HostIcon, CoordinatorIcon} from '../features/common/icons'; +import {HostIcon, CoordinatorIcon} from '../../features/common/icons'; export const SelectAccountType = () => { const [type, setType] = useState(''); diff --git a/frontend/src/pages/SignIn.tsx b/frontend/src/pages/authentication/SignIn.tsx similarity index 100% rename from frontend/src/pages/SignIn.tsx rename to frontend/src/pages/authentication/SignIn.tsx diff --git a/frontend/src/pages/SignUp.tsx b/frontend/src/pages/authentication/SignUp.tsx similarity index 100% rename from frontend/src/pages/SignUp.tsx rename to frontend/src/pages/authentication/SignUp.tsx diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index 103ff5f9..ffda8cf9 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -8,16 +8,16 @@ export {GuestDocuments} from './GuestDocuments'; export {Home} from './Home'; export {HostApplicationTracker} from './HostApplicationTracker'; export {HostsList} from './HostsList'; -export {ForgotPassword} from './ForgotPassword'; -export {ResetPassword} from './ResetPassword'; -export {SelectAccountType} from './SelectAccountType'; -export {SignIn} from './SignIn'; -export {SignUp} from './SignUp'; -export {EmailVerificationSuccess} from './EmailVerificationSuccess'; -export {EmailVerificationError} from './EmailVerificationError'; +export {ForgotPassword} from './authentication/ForgotPassword'; +export {ResetPassword} from './authentication/ResetPassword'; +export {SelectAccountType} from './authentication/SelectAccountType'; +export {SignIn} from './authentication/SignIn'; +export {SignUp} from './authentication/SignUp'; +export {EmailVerificationSuccess} from './authentication/EmailVerificationSuccess'; +export {EmailVerificationError} from './authentication/EmailVerificationError'; export {NewPassword} from './NewPassword'; -export {ForgotPasswordCode} from './ForgotPasswordCode'; -export {ForgotPasswordSuccess} from './ForgotPasswordSuccess'; +export {ForgotPasswordCode} from './authentication/ForgotPasswordCode'; +export {ForgotPasswordSuccess} from './authentication/ForgotPasswordSuccess'; export {Settings} from './Settings'; -export {ConfirmSignUp} from './ConfirmSignUp'; +export {ConfirmSignUp} from './authentication/ConfirmSignUp'; export {IntakeProfile} from './IntakeProfile'; From 164aa156af716571b644606adef661b2259420bd Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:11:18 -0700 Subject: [PATCH 13/25] Fix imports and make guest dashboard folder --- .../src/features/guest-dashboard/DashboardTask.tsx | 2 +- .../guest-dashboard/DashboardTaskAccordion.tsx | 2 +- .../src/pages/authentication/ConfirmSignUp.tsx | 6 +++--- .../authentication/EmailVerificationSuccess.tsx | 2 +- frontend/src/pages/authentication/SignIn.tsx | 14 +++++++------- frontend/src/pages/authentication/SignUp.tsx | 10 +++++----- .../pages/{ => guest-dashboard}/GuestContacts.tsx | 0 .../pages/{ => guest-dashboard}/GuestDashboard.tsx | 2 +- .../pages/{ => guest-dashboard}/GuestDocuments.tsx | 0 .../pages/{ => guest-dashboard}/GuestSettings.tsx | 0 .../src/pages/{ => guest-dashboard}/GuestTasks.tsx | 0 frontend/src/pages/index.ts | 10 +++++----- 12 files changed, 24 insertions(+), 24 deletions(-) rename frontend/src/pages/{ => guest-dashboard}/GuestContacts.tsx (100%) rename frontend/src/pages/{ => guest-dashboard}/GuestDashboard.tsx (99%) rename frontend/src/pages/{ => guest-dashboard}/GuestDocuments.tsx (100%) rename frontend/src/pages/{ => guest-dashboard}/GuestSettings.tsx (100%) rename frontend/src/pages/{ => guest-dashboard}/GuestTasks.tsx (100%) diff --git a/frontend/src/features/guest-dashboard/DashboardTask.tsx b/frontend/src/features/guest-dashboard/DashboardTask.tsx index 328baa92..0fd5359a 100644 --- a/frontend/src/features/guest-dashboard/DashboardTask.tsx +++ b/frontend/src/features/guest-dashboard/DashboardTask.tsx @@ -4,7 +4,7 @@ import LockIcon from '@mui/icons-material/Lock'; import AccessTimeIcon from '@mui/icons-material/AccessTime'; import {Link} from 'react-router-dom'; -import {SubTask} from '../../pages/GuestDashboard'; +import {SubTask} from '../../pages/guest-dashboard/GuestDashboard'; export type DashboardTaskProps = Pick< SubTask, diff --git a/frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx b/frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx index f69c46d8..9293e4d4 100644 --- a/frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx +++ b/frontend/src/features/guest-dashboard/DashboardTaskAccordion.tsx @@ -13,7 +13,7 @@ import CheckCircleOutlined from '@mui/icons-material/CheckCircleOutlined'; import LockIcon from '@mui/icons-material/Lock'; import {styled} from '@mui/material/styles'; -import {Task} from '../../pages/GuestDashboard'; +import {Task} from '../../pages/guest-dashboard/GuestDashboard'; import {DashboardTask} from './DashboardTask'; export interface TaskAccordionProps diff --git a/frontend/src/pages/authentication/ConfirmSignUp.tsx b/frontend/src/pages/authentication/ConfirmSignUp.tsx index b13152dd..2c58763e 100644 --- a/frontend/src/pages/authentication/ConfirmSignUp.tsx +++ b/frontend/src/pages/authentication/ConfirmSignUp.tsx @@ -9,9 +9,9 @@ import { } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import {useSearchParams} from 'react-router-dom'; -import {useResendConfirmationCodeMutation} from '../services/auth'; -import {FormContainer} from '../features/authentication'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; +import {useResendConfirmationCodeMutation} from '../../services/auth'; +import {FormContainer} from '../../features/authentication'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../../redux/helpers'; interface Alert { severity: 'success' | 'error'; diff --git a/frontend/src/pages/authentication/EmailVerificationSuccess.tsx b/frontend/src/pages/authentication/EmailVerificationSuccess.tsx index 077a1855..501aabd5 100644 --- a/frontend/src/pages/authentication/EmailVerificationSuccess.tsx +++ b/frontend/src/pages/authentication/EmailVerificationSuccess.tsx @@ -1,7 +1,7 @@ import {Button, Stack, Typography} from '@mui/material'; import React from 'react'; import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline'; -import {FormContainer} from '../features/authentication'; +import {FormContainer} from '../../features/authentication'; export const EmailVerificationSuccess = () => { return ( diff --git a/frontend/src/pages/authentication/SignIn.tsx b/frontend/src/pages/authentication/SignIn.tsx index f31de484..ab097216 100644 --- a/frontend/src/pages/authentication/SignIn.tsx +++ b/frontend/src/pages/authentication/SignIn.tsx @@ -10,20 +10,20 @@ import { } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; -import {setCredentials} from '../redux/authSlice'; -import {useAppDispatch} from '../redux/hooks/store'; -import {SignInForm} from '../features/authentication/SignInForm'; +import {setCredentials} from '../../redux/authSlice'; +import {useAppDispatch} from '../../redux/hooks/store'; +import {SignInForm} from '../../features/authentication/SignInForm'; import { SignInRequest, useGoogleSignInMutation, useSignInMutation, -} from '../services/auth'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; -import {FormContainer} from '../features/authentication'; +} from '../../services/auth'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../../redux/helpers'; +import {FormContainer} from '../../features/authentication'; import { useAuthenticateWithOAuth, redirectsByRole, -} from '../features/authentication/hooks/useAuthenticateWithOAuth'; +} from '../../features/authentication/hooks/useAuthenticateWithOAuth'; export interface LocationState { from: Location; } diff --git a/frontend/src/pages/authentication/SignUp.tsx b/frontend/src/pages/authentication/SignUp.tsx index db4b658e..acf3d861 100644 --- a/frontend/src/pages/authentication/SignUp.tsx +++ b/frontend/src/pages/authentication/SignUp.tsx @@ -10,15 +10,15 @@ import { import CloseIcon from '@mui/icons-material/Close'; import {useNavigate, useParams} from 'react-router-dom'; -import {SignUpForm} from '../features/authentication/SignUpForm'; +import {SignUpForm} from '../../features/authentication/SignUpForm'; import { useGoogleSignUpMutation, useSignUpMutation, SignUpRequest, -} from '../services/auth'; -import {isErrorWithMessage, isFetchBaseQueryError} from '../redux/helpers'; -import {FormContainer} from '../features/authentication'; -import {useAuthenticateWithOAuth} from '../features/authentication/hooks/useAuthenticateWithOAuth'; +} from '../../services/auth'; +import {isErrorWithMessage, isFetchBaseQueryError} from '../../redux/helpers'; +import {FormContainer} from '../../features/authentication'; +import {useAuthenticateWithOAuth} from '../../features/authentication/hooks/useAuthenticateWithOAuth'; export const SignUp = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/GuestContacts.tsx b/frontend/src/pages/guest-dashboard/GuestContacts.tsx similarity index 100% rename from frontend/src/pages/GuestContacts.tsx rename to frontend/src/pages/guest-dashboard/GuestContacts.tsx diff --git a/frontend/src/pages/GuestDashboard.tsx b/frontend/src/pages/guest-dashboard/GuestDashboard.tsx similarity index 99% rename from frontend/src/pages/GuestDashboard.tsx rename to frontend/src/pages/guest-dashboard/GuestDashboard.tsx index 9c12a8e0..783a340f 100644 --- a/frontend/src/pages/GuestDashboard.tsx +++ b/frontend/src/pages/guest-dashboard/GuestDashboard.tsx @@ -3,7 +3,7 @@ import {styled} from '@mui/system'; import { DashboardTaskAccordion, CoordinatorContact, -} from '../features/guest-dashboard'; +} from '../../features/guest-dashboard'; export type TaskStatus = 'inProgress' | 'complete' | 'locked'; diff --git a/frontend/src/pages/GuestDocuments.tsx b/frontend/src/pages/guest-dashboard/GuestDocuments.tsx similarity index 100% rename from frontend/src/pages/GuestDocuments.tsx rename to frontend/src/pages/guest-dashboard/GuestDocuments.tsx diff --git a/frontend/src/pages/GuestSettings.tsx b/frontend/src/pages/guest-dashboard/GuestSettings.tsx similarity index 100% rename from frontend/src/pages/GuestSettings.tsx rename to frontend/src/pages/guest-dashboard/GuestSettings.tsx diff --git a/frontend/src/pages/GuestTasks.tsx b/frontend/src/pages/guest-dashboard/GuestTasks.tsx similarity index 100% rename from frontend/src/pages/GuestTasks.tsx rename to frontend/src/pages/guest-dashboard/GuestTasks.tsx diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index ffda8cf9..574e81c4 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -1,10 +1,10 @@ export {AccountVerification} from './AccountVerification'; export {CoordinatorDashboard} from './CoordinatorDashboard'; -export {GuestApplicationTracker} from './GuestDashboard'; -export {GuestSettings} from './GuestSettings'; -export {GuestContacts} from './GuestContacts'; -export {GuestTasks} from './GuestTasks'; -export {GuestDocuments} from './GuestDocuments'; +export {GuestApplicationTracker} from './guest-dashboard/GuestDashboard'; +export {GuestSettings} from './guest-dashboard/GuestSettings'; +export {GuestContacts} from './guest-dashboard/GuestContacts'; +export {GuestTasks} from './guest-dashboard/GuestTasks'; +export {GuestDocuments} from './guest-dashboard/GuestDocuments'; export {Home} from './Home'; export {HostApplicationTracker} from './HostApplicationTracker'; export {HostsList} from './HostsList'; From c2dce8911d0e7aa6f5f829da61454f9de597f47c Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:12:51 -0700 Subject: [PATCH 14/25] Move new password page into authentication --- frontend/src/pages/{ => authentication}/NewPassword.tsx | 8 ++++---- frontend/src/pages/index.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename frontend/src/pages/{ => authentication}/NewPassword.tsx (89%) diff --git a/frontend/src/pages/NewPassword.tsx b/frontend/src/pages/authentication/NewPassword.tsx similarity index 89% rename from frontend/src/pages/NewPassword.tsx rename to frontend/src/pages/authentication/NewPassword.tsx index ddad32ea..1e8151e0 100644 --- a/frontend/src/pages/NewPassword.tsx +++ b/frontend/src/pages/authentication/NewPassword.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import {NewPasswordForm} from '../features/authentication/NewPasswordForm'; +import {NewPasswordForm} from '../../features/authentication/NewPasswordForm'; import {useSearchParams} from 'react-router-dom'; import {Typography, Stack, Alert, IconButton} from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; -import {NewPasswordRequest, useNewPasswordMutation} from '../services/auth'; +import {NewPasswordRequest, useNewPasswordMutation} from '../../services/auth'; import {useNavigate} from 'react-router-dom'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../redux/helpers'; -import {FormContainer} from '../features/authentication'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../../redux/helpers'; +import {FormContainer} from '../../features/authentication'; export const NewPassword = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index 574e81c4..840668e1 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -15,7 +15,7 @@ export {SignIn} from './authentication/SignIn'; export {SignUp} from './authentication/SignUp'; export {EmailVerificationSuccess} from './authentication/EmailVerificationSuccess'; export {EmailVerificationError} from './authentication/EmailVerificationError'; -export {NewPassword} from './NewPassword'; +export {NewPassword} from './authentication/NewPassword'; export {ForgotPasswordCode} from './authentication/ForgotPasswordCode'; export {ForgotPasswordSuccess} from './authentication/ForgotPasswordSuccess'; export {Settings} from './Settings'; From d4a5d196aa60a83bd0f060ceedb044fadc6e6ed0 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:15:26 -0700 Subject: [PATCH 15/25] Create intake profile pages folder --- frontend/src/features/intake-profile/IntakeProfileGroups.tsx | 4 ++-- frontend/src/features/intake-profile/ProfileReview.tsx | 2 +- .../features/intake-profile/fields/AdditionaGuestsField.tsx | 2 +- .../features/intake-profile/fields/AdditionalPetsField.tsx | 2 +- frontend/src/pages/index.ts | 2 +- .../index.tsx => intake-profile/IntakeProfile.tsx} | 0 .../constants/buildValidationSchema.ts | 0 .../constants/createInitialValues.ts | 2 +- .../{IntakeProfile => intake-profile}/constants/index.ts | 2 +- 9 files changed, 8 insertions(+), 8 deletions(-) rename frontend/src/pages/{IntakeProfile/index.tsx => intake-profile/IntakeProfile.tsx} (100%) rename frontend/src/pages/{IntakeProfile => intake-profile}/constants/buildValidationSchema.ts (100%) rename frontend/src/pages/{IntakeProfile => intake-profile}/constants/createInitialValues.ts (96%) rename frontend/src/pages/{IntakeProfile => intake-profile}/constants/index.ts (98%) diff --git a/frontend/src/features/intake-profile/IntakeProfileGroups.tsx b/frontend/src/features/intake-profile/IntakeProfileGroups.tsx index ba692be9..9097681c 100644 --- a/frontend/src/features/intake-profile/IntakeProfileGroups.tsx +++ b/frontend/src/features/intake-profile/IntakeProfileGroups.tsx @@ -16,11 +16,11 @@ import { } from '@mui/material'; import {useFormikContext} from 'formik'; import {useOutletContext} from 'react-router-dom'; -import {InitialValues} from 'src/pages/IntakeProfile'; +import {InitialValues} from 'src/pages/intake-profile'; import {AdditionalGuestsField} from './fields/AdditionaGuestsField'; import {FieldGroup, Fields, Guest, Pet} from 'src/services/profile'; import {AdditionalPetsField} from './fields/AdditionalPetsField'; -import {phoneRegExp} from '../../pages/IntakeProfile/constants/index'; +import {phoneRegExp} from '../../pages/intake-profile/constants/index'; import {DatePickerField} from './fields/DatePickerField'; export interface OutletContext { diff --git a/frontend/src/features/intake-profile/ProfileReview.tsx b/frontend/src/features/intake-profile/ProfileReview.tsx index 5aebd35a..e8315e85 100644 --- a/frontend/src/features/intake-profile/ProfileReview.tsx +++ b/frontend/src/features/intake-profile/ProfileReview.tsx @@ -12,7 +12,7 @@ import {useFormikContext} from 'formik'; import {format, parseISO} from 'date-fns'; import {OutletContext} from './IntakeProfileGroups'; -import {InitialValues} from 'src/pages/IntakeProfile'; +import {InitialValues} from 'src/pages/intake-profile'; import {Response} from 'src/services/profile'; export const ProfileReview = () => { diff --git a/frontend/src/features/intake-profile/fields/AdditionaGuestsField.tsx b/frontend/src/features/intake-profile/fields/AdditionaGuestsField.tsx index c756b847..0c7b3c3c 100644 --- a/frontend/src/features/intake-profile/fields/AdditionaGuestsField.tsx +++ b/frontend/src/features/intake-profile/fields/AdditionaGuestsField.tsx @@ -6,7 +6,7 @@ import { FieldArray, useFormikContext, } from 'formik'; -import {InitialValues} from 'src/pages/IntakeProfile'; +import {InitialValues} from 'src/pages/intake-profile'; import {Guest} from '../../../services/profile'; import {DatePickerField} from './DatePickerField'; diff --git a/frontend/src/features/intake-profile/fields/AdditionalPetsField.tsx b/frontend/src/features/intake-profile/fields/AdditionalPetsField.tsx index ac986106..068907f4 100644 --- a/frontend/src/features/intake-profile/fields/AdditionalPetsField.tsx +++ b/frontend/src/features/intake-profile/fields/AdditionalPetsField.tsx @@ -2,7 +2,7 @@ import {Stack, Button, TextField, Typography} from '@mui/material'; import {FormikErrors, FieldArray, useFormikContext} from 'formik'; import {Pet} from '../../../services/profile'; import Autocomplete from '@mui/material/Autocomplete'; -import {InitialValues} from 'src/pages/IntakeProfile'; +import {InitialValues} from 'src/pages/intake-profile'; interface Values { pets: Pet[]; diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index 840668e1..c18c5443 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -20,4 +20,4 @@ export {ForgotPasswordCode} from './authentication/ForgotPasswordCode'; export {ForgotPasswordSuccess} from './authentication/ForgotPasswordSuccess'; export {Settings} from './Settings'; export {ConfirmSignUp} from './authentication/ConfirmSignUp'; -export {IntakeProfile} from './IntakeProfile'; +export {IntakeProfile} from './intake-profile/IntakeProfile'; diff --git a/frontend/src/pages/IntakeProfile/index.tsx b/frontend/src/pages/intake-profile/IntakeProfile.tsx similarity index 100% rename from frontend/src/pages/IntakeProfile/index.tsx rename to frontend/src/pages/intake-profile/IntakeProfile.tsx diff --git a/frontend/src/pages/IntakeProfile/constants/buildValidationSchema.ts b/frontend/src/pages/intake-profile/constants/buildValidationSchema.ts similarity index 100% rename from frontend/src/pages/IntakeProfile/constants/buildValidationSchema.ts rename to frontend/src/pages/intake-profile/constants/buildValidationSchema.ts diff --git a/frontend/src/pages/IntakeProfile/constants/createInitialValues.ts b/frontend/src/pages/intake-profile/constants/createInitialValues.ts similarity index 96% rename from frontend/src/pages/IntakeProfile/constants/createInitialValues.ts rename to frontend/src/pages/intake-profile/constants/createInitialValues.ts index 7025723c..e8fe2d00 100644 --- a/frontend/src/pages/IntakeProfile/constants/createInitialValues.ts +++ b/frontend/src/pages/intake-profile/constants/createInitialValues.ts @@ -1,5 +1,5 @@ import {FieldGroup, FieldTypes, Response} from '../../../services/profile'; -import {InitialValues} from '..'; +import {InitialValues} from '../IntakeProfile'; /** * Creates an object used for the initial Formik valiues diff --git a/frontend/src/pages/IntakeProfile/constants/index.ts b/frontend/src/pages/intake-profile/constants/index.ts similarity index 98% rename from frontend/src/pages/IntakeProfile/constants/index.ts rename to frontend/src/pages/intake-profile/constants/index.ts index aa7c7304..a093c3d7 100644 --- a/frontend/src/pages/IntakeProfile/constants/index.ts +++ b/frontend/src/pages/intake-profile/constants/index.ts @@ -1,6 +1,6 @@ import {faker} from '@faker-js/faker'; import {array, object, string} from 'yup'; -import {InitialValues} from '..'; +import {InitialValues} from '../IntakeProfile'; import { FieldGroup, Fields, From 9ac96a83f0a8281d25d095d9aa6f2b1d8e34cbb1 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:17:23 -0700 Subject: [PATCH 16/25] Remove hosts list page and service --- frontend/src/main.tsx | 2 -- frontend/src/pages/HostsList.tsx | 51 -------------------------------- frontend/src/pages/index.ts | 1 - frontend/src/services/host.ts | 34 --------------------- 4 files changed, 88 deletions(-) delete mode 100644 frontend/src/pages/HostsList.tsx delete mode 100644 frontend/src/services/host.ts diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 7c671267..e242a9c2 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -15,7 +15,6 @@ import { GuestApplicationTracker, Home, HostApplicationTracker, - HostsList, SignIn, SignUp, ForgotPassword, @@ -61,7 +60,6 @@ function HuuApp() { }> } /> - } /> } /> } /> } /> diff --git a/frontend/src/pages/HostsList.tsx b/frontend/src/pages/HostsList.tsx deleted file mode 100644 index 7add4726..00000000 --- a/frontend/src/pages/HostsList.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { - Stack, - InputLabel, - OutlinedInput, - Button, - Container, -} from '@mui/material'; -import React from 'react'; -import {useGetHostsQuery, useCreateHostMutation} from '../services/host'; - -export const HostsList = () => { - const [name, setName] = React.useState(''); - - const {data} = useGetHostsQuery(); - const [createPost, {isLoading}] = useCreateHostMutation(); - - const handleChange = (event: React.ChangeEvent) => { - setName(event.target.value); - }; - - const handleSubmit = () => { - if (name === '') return; - - createPost({body: {name}}); - }; - - return ( - -

Create a host

- - Full name - - - -

Hosts

-
    {data?.map(host =>
  • {host.name}
  • )}
-
- ); -}; diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index c18c5443..856da8ac 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -7,7 +7,6 @@ export {GuestTasks} from './guest-dashboard/GuestTasks'; export {GuestDocuments} from './guest-dashboard/GuestDocuments'; export {Home} from './Home'; export {HostApplicationTracker} from './HostApplicationTracker'; -export {HostsList} from './HostsList'; export {ForgotPassword} from './authentication/ForgotPassword'; export {ResetPassword} from './authentication/ResetPassword'; export {SelectAccountType} from './authentication/SelectAccountType'; diff --git a/frontend/src/services/host.ts b/frontend/src/services/host.ts deleted file mode 100644 index dd986fb1..00000000 --- a/frontend/src/services/host.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {api} from './api'; -const injectedRtkApi = api.injectEndpoints({ - endpoints: build => ({ - getHosts: build.query({ - query: () => ({url: `/host`}), - providesTags: (result = []) => [ - ...result.map(({id}) => ({type: 'Hosts', id}) as const), - {type: 'Hosts' as const, id: 'LIST'}, - ], - }), - createHost: build.mutation({ - query: queryArg => ({url: `/host`, method: 'POST', body: queryArg.body}), - invalidatesTags: [{type: 'Hosts', id: 'LIST'}], - }), - }), - overrideExisting: false, -}); - -export {injectedRtkApi as hostAPI}; -export type Host = {id: number; name: string}; -export type GetHostsApiResponse = /** status 200 An array of hosts */ Host[]; -export type GetHostsApiArg = void; -export type CreateHostApiResponse = - /** status 200 Succes created host */ ApiResponse; -export type CreateHostApiArg = { - body: { - name: string; - }; -}; -export type ApiResponse = { - id?: number; - name?: string; -}; -export const {useGetHostsQuery, useCreateHostMutation} = injectedRtkApi; From 4736579811160d0d9537dcff724ee7c8053f3324 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:25:09 -0700 Subject: [PATCH 17/25] Remove account verification page --- .../AccountVerificationForm.tsx | 83 ------------------- frontend/src/features/common/index.ts | 1 - frontend/src/features/layouts/index.ts | 1 + frontend/src/main.tsx | 7 +- frontend/src/pages/AccountVerification.tsx | 46 ---------- frontend/src/pages/index.ts | 1 - frontend/src/services/auth.ts | 14 ---- 7 files changed, 3 insertions(+), 150 deletions(-) delete mode 100644 frontend/src/features/authentication/AccountVerificationForm.tsx delete mode 100644 frontend/src/pages/AccountVerification.tsx diff --git a/frontend/src/features/authentication/AccountVerificationForm.tsx b/frontend/src/features/authentication/AccountVerificationForm.tsx deleted file mode 100644 index 9c11f88e..00000000 --- a/frontend/src/features/authentication/AccountVerificationForm.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React from 'react'; -import { - OutlinedInput, - Stack, - InputLabel, - FormHelperText, - Button, -} from '@mui/material'; -import {styled} from '@mui/system'; -import {useFormik} from 'formik'; -import {object, string} from 'yup'; -import {VerificationRequest} from '../../services/auth'; - -interface AccountVerificationFormProps { - onSubmit: ({email, code}: VerificationRequest) => Promise; -} - -const codeValidationSchema = object({ - email: string().email().required('email is required'), - code: string() - .required('code is required') - .length(6, 'code must be 6 characters'), -}); - -export const AccountVerificationForm = ({ - onSubmit, -}: AccountVerificationFormProps) => { - const {handleSubmit, handleChange, values, touched, errors} = useFormik({ - initialValues: { - email: '', - code: '', - }, - validationSchema: codeValidationSchema, - onSubmit: values => { - onSubmit(values); - }, - }); - - return ( -
- - Email address - - {touched.email && errors.email && ( - {errors.email} - )} - - - Verification Code - - {touched.code && errors.code && ( - {errors.code} - )} - - - - - -
- ); -}; - -const Form = styled('form')({ - width: '100%', - display: 'flex', - flexDirection: 'column', - alignItems: 'stretch', - gap: '1rem', -}); diff --git a/frontend/src/features/common/index.ts b/frontend/src/features/common/index.ts index 02a47b9b..83f0b0d3 100644 --- a/frontend/src/features/common/index.ts +++ b/frontend/src/features/common/index.ts @@ -1,4 +1,3 @@ export {Loading} from './Loading'; export {Header} from './Header'; -export {AppLayout} from '../layouts/AppLayout'; export {AuthenticatedHeader} from './AuthenticatedHeader'; diff --git a/frontend/src/features/layouts/index.ts b/frontend/src/features/layouts/index.ts index 2826f281..1a90faf7 100644 --- a/frontend/src/features/layouts/index.ts +++ b/frontend/src/features/layouts/index.ts @@ -1,3 +1,4 @@ export {DashboardLayout} from './DashboardLayout'; export {CoordinatorDashboardLayout} from './CoordinatorDashboardLayout'; export {GuestDashboardLayout} from './GuestDashboardLayout'; +export {AppLayout} from './AppLayout'; diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index e242a9c2..20c42b95 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -35,10 +35,10 @@ import { IntakeProfile, } from './pages'; -import {AccountVerification} from './pages/AccountVerification'; -import {AppLayout, Header} from './features/common'; +import {Header} from './features/common'; import {ResetPasswordContext} from './features/authentication/ResetPasswordContext'; import { + AppLayout, CoordinatorDashboardLayout, GuestDashboardLayout, } from './features/layouts'; @@ -74,7 +74,6 @@ function HuuApp() { path="/forgot-password/success" element={} /> - } /> } /> } /> - - {/* guest routes */} { - const [verify] = useVerificationMutation(); - - const handleVerification = async ({email, code}: VerificationRequest) => { - try { - const response = await verify({ - email, - code, - }).unwrap(); - console.log(response); - } catch (err) { - console.log(err); - } - }; - - return ( - - Verify your account - - - ); -}; - -const FormContainer = styled(Stack)(({theme}) => ({ - maxWidth: '550px', - minWidth: '350px', - alignItems: 'center', - padding: '2rem', - border: '1px solid #e0e0e0', - borderRadius: theme.shape.borderRadius, - backgroundColor: '#fff', - margin: '0 16px', -})); - -const FormHeader = styled(Typography)({ - textAlign: 'center', - marginBottom: '16px', - fontWeight: 600, -}); diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index 856da8ac..3889f5eb 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -1,4 +1,3 @@ -export {AccountVerification} from './AccountVerification'; export {CoordinatorDashboard} from './CoordinatorDashboard'; export {GuestApplicationTracker} from './guest-dashboard/GuestDashboard'; export {GuestSettings} from './guest-dashboard/GuestSettings'; diff --git a/frontend/src/services/auth.ts b/frontend/src/services/auth.ts index 82a98665..7920569c 100644 --- a/frontend/src/services/auth.ts +++ b/frontend/src/services/auth.ts @@ -35,11 +35,6 @@ export interface SignOutResponse { message: string; } -export interface VerificationRequest { - email: string; - code: string; -} - export interface ForgotPasswordRequest { email: string; } @@ -109,14 +104,6 @@ const authApi = api.injectEndpoints({ }; }, }), - verification: build.mutation({ - query: credentials => ({ - url: 'auth/verify', - method: 'POST', - withCredentials: true, - body: credentials, - }), - }), forgotPassword: build.mutation({ query: credentials => ({ url: 'auth/forgot-password', @@ -181,7 +168,6 @@ export const { useSignUpMutation, useSignInMutation, useSignOutMutation, - useVerificationMutation, useNewPasswordMutation, useGoogleSignUpMutation, useGoogleSignInMutation, From 3b1a826e0102e9afa1a2e4e7e607f97aa310f912 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:28:32 -0700 Subject: [PATCH 18/25] Create host and coordinator dashboard page folders --- frontend/src/main.tsx | 4 ++-- .../CoordinatorDashboard.tsx | 4 ++-- .../HostDashboard.tsx} | 22 +++++++++---------- frontend/src/pages/index.ts | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) rename frontend/src/pages/{ => coordinator-dashboard}/CoordinatorDashboard.tsx (98%) rename frontend/src/pages/{HostApplicationTracker.tsx => host-dashboard/HostDashboard.tsx} (52%) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 20c42b95..564a213c 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -14,7 +14,7 @@ import {HomeUniteUsTheme} from './theme'; import { GuestApplicationTracker, Home, - HostApplicationTracker, + HostDashboard, SignIn, SignUp, ForgotPassword, @@ -124,7 +124,7 @@ function HuuApp() { path="/host" element={ - + } /> diff --git a/frontend/src/pages/CoordinatorDashboard.tsx b/frontend/src/pages/coordinator-dashboard/CoordinatorDashboard.tsx similarity index 98% rename from frontend/src/pages/CoordinatorDashboard.tsx rename to frontend/src/pages/coordinator-dashboard/CoordinatorDashboard.tsx index a1724ac5..fd238523 100644 --- a/frontend/src/pages/CoordinatorDashboard.tsx +++ b/frontend/src/pages/coordinator-dashboard/CoordinatorDashboard.tsx @@ -16,11 +16,11 @@ import { DashboardDataItem, DashboardDataResponse, useGetAllDashboardDataMutation, -} from '../services/coordinator'; +} from '../../services/coordinator'; import { GuestInviteButton, LoadingComponent, -} from '../features/coordinator-dashboard'; +} from '../../features/coordinator-dashboard'; const columns: GridColDef[] = [ { diff --git a/frontend/src/pages/HostApplicationTracker.tsx b/frontend/src/pages/host-dashboard/HostDashboard.tsx similarity index 52% rename from frontend/src/pages/HostApplicationTracker.tsx rename to frontend/src/pages/host-dashboard/HostDashboard.tsx index 434bef7a..51e2f983 100644 --- a/frontend/src/pages/HostApplicationTracker.tsx +++ b/frontend/src/pages/host-dashboard/HostDashboard.tsx @@ -1,32 +1,32 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import {Box, Typography} from '@mui/material'; import * as React from 'react'; -import {AuthenticatedHeader} from '../features/common'; +import {AuthenticatedHeader} from '../../features/common'; -interface HostApplicationTrackerProps {} +interface HostDashboardProps {} -interface HostApplicationTrackerState {} +interface HostDashboardState {} -enum HostApplicationTrackerActionType {} +enum HostDashboardActionType {} -interface HostApplicationTrackerAction { - type: HostApplicationTrackerActionType; +interface HostDashboardAction { + type: HostDashboardActionType; payload?: string; } -const initialState: HostApplicationTrackerState = {}; +const initialState: HostDashboardState = {}; function reducer( - state: HostApplicationTrackerState, - action: HostApplicationTrackerAction, -): HostApplicationTrackerState { + state: HostDashboardState, + action: HostDashboardAction, +): HostDashboardState { switch (action.type) { default: throw new Error(`Unsupported action: ${JSON.stringify(action)}`); } } -export function HostApplicationTracker(props: HostApplicationTrackerProps) { +export function HostDashboard(props: HostDashboardProps) { const [state, dispatch] = React.useReducer(reducer, initialState); return ( diff --git a/frontend/src/pages/index.ts b/frontend/src/pages/index.ts index 3889f5eb..55b823c7 100644 --- a/frontend/src/pages/index.ts +++ b/frontend/src/pages/index.ts @@ -1,11 +1,11 @@ -export {CoordinatorDashboard} from './CoordinatorDashboard'; +export {CoordinatorDashboard} from './coordinator-dashboard/CoordinatorDashboard'; export {GuestApplicationTracker} from './guest-dashboard/GuestDashboard'; export {GuestSettings} from './guest-dashboard/GuestSettings'; export {GuestContacts} from './guest-dashboard/GuestContacts'; export {GuestTasks} from './guest-dashboard/GuestTasks'; export {GuestDocuments} from './guest-dashboard/GuestDocuments'; export {Home} from './Home'; -export {HostApplicationTracker} from './HostApplicationTracker'; +export {HostDashboard} from './host-dashboard/HostDashboard'; export {ForgotPassword} from './authentication/ForgotPassword'; export {ResetPassword} from './authentication/ResetPassword'; export {SelectAccountType} from './authentication/SelectAccountType'; From 078fd068ff56a3c088dc57aa21476286eb59b023 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 24 Sep 2024 18:37:06 -0700 Subject: [PATCH 19/25] update husky command --- frontend/.husky/pre-commit | 2 +- frontend/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/.husky/pre-commit b/frontend/.husky/pre-commit index 24586419..73f95b65 100755 --- a/frontend/.husky/pre-commit +++ b/frontend/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -cd app +cd frontend npm run pre-commit diff --git a/frontend/package.json b/frontend/package.json index 53eaef1b..aa022ed6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,7 +21,7 @@ "build-storybook": "build-storybook", "lint": "eslint . --ext ts --ext tsx --max-warnings 0 --fix", "type-check": "npx tsc --noEmit", - "prepare": "cd .. && husky install app/.husky", + "prepare": "cd .. && husky install frontend/.husky", "pre-commit": "lint-staged", "generate": "npx @rtk-query/codegen-openapi openapi-config.ts", "check-node-version": "node check-node-version.mjs", From 2ed796607272bb8c3b59cd33d0dbc63f8724e5d2 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 25 Sep 2024 14:44:46 -0700 Subject: [PATCH 20/25] Fix import --- frontend/src/features/intake-profile/ProfileReview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/features/intake-profile/ProfileReview.tsx b/frontend/src/features/intake-profile/ProfileReview.tsx index e8315e85..1549e2bb 100644 --- a/frontend/src/features/intake-profile/ProfileReview.tsx +++ b/frontend/src/features/intake-profile/ProfileReview.tsx @@ -12,7 +12,7 @@ import {useFormikContext} from 'formik'; import {format, parseISO} from 'date-fns'; import {OutletContext} from './IntakeProfileGroups'; -import {InitialValues} from 'src/pages/intake-profile'; +import {InitialValues} from '../../pages/intake-profile/IntakeProfile'; import {Response} from 'src/services/profile'; export const ProfileReview = () => { From 45478860c983474854caa0c11267419d67224865 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 25 Sep 2024 15:09:53 -0700 Subject: [PATCH 21/25] Update index.ts imports and change constants to helpers --- frontend/src/features/authentication/index.ts | 6 +++++ .../intake-profile/IntakeProfileGroups.tsx | 2 +- frontend/src/features/intake-profile/index.ts | 1 + frontend/src/main.tsx | 22 +++++++++---------- .../src/pages/authentication/NewPassword.tsx | 2 +- .../pages/authentication/ResetPassword.tsx | 10 ++++++--- frontend/src/pages/authentication/SignIn.tsx | 5 ++--- frontend/src/pages/authentication/SignUp.tsx | 5 ++--- .../pages/intake-profile/IntakeProfile.tsx | 4 ++-- .../buildValidationSchema.ts | 0 .../createInitialValues.ts | 0 .../{constants => helpers}/index.ts | 0 12 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 frontend/src/features/intake-profile/index.ts rename frontend/src/pages/intake-profile/{constants => helpers}/buildValidationSchema.ts (100%) rename frontend/src/pages/intake-profile/{constants => helpers}/createInitialValues.ts (100%) rename frontend/src/pages/intake-profile/{constants => helpers}/index.ts (100%) diff --git a/frontend/src/features/authentication/index.ts b/frontend/src/features/authentication/index.ts index 7e42bf1c..8792d009 100644 --- a/frontend/src/features/authentication/index.ts +++ b/frontend/src/features/authentication/index.ts @@ -1,3 +1,9 @@ export {CodeField} from './CodeField'; export {FormContainer} from './FormContainer'; export {PasswordField} from './PasswordField'; +export {NewPasswordForm} from './NewPasswordForm'; +export {PasswordValidation} from './PasswordValidation'; +export {ProtectedRoute} from './ProtectedRoute'; +export {ResetPasswordContext} from './ResetPasswordContext'; +export {SignInForm} from './SignInForm'; +export {SignUpForm} from './SignUpForm'; diff --git a/frontend/src/features/intake-profile/IntakeProfileGroups.tsx b/frontend/src/features/intake-profile/IntakeProfileGroups.tsx index 9097681c..ad289012 100644 --- a/frontend/src/features/intake-profile/IntakeProfileGroups.tsx +++ b/frontend/src/features/intake-profile/IntakeProfileGroups.tsx @@ -20,7 +20,7 @@ import {InitialValues} from 'src/pages/intake-profile'; import {AdditionalGuestsField} from './fields/AdditionaGuestsField'; import {FieldGroup, Fields, Guest, Pet} from 'src/services/profile'; import {AdditionalPetsField} from './fields/AdditionalPetsField'; -import {phoneRegExp} from '../../pages/intake-profile/constants/index'; +import {phoneRegExp} from '../../pages/intake-profile/helpers/index'; import {DatePickerField} from './fields/DatePickerField'; export interface OutletContext { diff --git a/frontend/src/features/intake-profile/index.ts b/frontend/src/features/intake-profile/index.ts new file mode 100644 index 00000000..468ac9bf --- /dev/null +++ b/frontend/src/features/intake-profile/index.ts @@ -0,0 +1 @@ +export {ProfileSidebar} from './ProfileSidebar'; diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 564a213c..0477d061 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -8,9 +8,17 @@ import {AdapterDateFns} from '@mui/x-date-pickers/AdapterDateFns'; import './index.css'; import {setupStore} from './redux/store'; -import {ProtectedRoute} from './features/authentication/ProtectedRoute'; import {useSessionMutation} from './services/auth'; import {HomeUniteUsTheme} from './theme'; +import {ProtectedRoute, ResetPasswordContext} from './features/authentication'; +import {Header} from './features/common'; +import {ProfileReview} from './features/intake-profile/ProfileReview'; +import {FieldGroupList} from './features/intake-profile/IntakeProfileGroups'; +import { + AppLayout, + CoordinatorDashboardLayout, + GuestDashboardLayout, +} from './features/layouts'; import { GuestApplicationTracker, Home, @@ -34,18 +42,8 @@ import { CoordinatorDashboard, IntakeProfile, } from './pages'; - -import {Header} from './features/common'; -import {ResetPasswordContext} from './features/authentication/ResetPasswordContext'; -import { - AppLayout, - CoordinatorDashboardLayout, - GuestDashboardLayout, -} from './features/layouts'; -import {FieldGroupList} from './features/intake-profile/IntakeProfileGroups'; -import {enableMocking} from './utils/testing/browser'; import {SystemAdminDashboard} from './pages/SystemAdminDashboard'; -import {ProfileReview} from './features/intake-profile/ProfileReview'; +import {enableMocking} from './utils/testing/browser'; function HuuApp() { const [session] = useSessionMutation(); diff --git a/frontend/src/pages/authentication/NewPassword.tsx b/frontend/src/pages/authentication/NewPassword.tsx index 1e8151e0..66be3f6c 100644 --- a/frontend/src/pages/authentication/NewPassword.tsx +++ b/frontend/src/pages/authentication/NewPassword.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {NewPasswordForm} from '../../features/authentication/NewPasswordForm'; +import {NewPasswordForm} from '../../features/authentication'; import {useSearchParams} from 'react-router-dom'; import {Typography, Stack, Alert, IconButton} from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; diff --git a/frontend/src/pages/authentication/ResetPassword.tsx b/frontend/src/pages/authentication/ResetPassword.tsx index 7681386d..fcd0582f 100644 --- a/frontend/src/pages/authentication/ResetPassword.tsx +++ b/frontend/src/pages/authentication/ResetPassword.tsx @@ -7,11 +7,15 @@ import { } from '@mui/material'; import React from 'react'; import {useFormikContext} from 'formik'; -import {ResestPasswordValues} from '../../features/authentication/ResetPasswordContext'; + import {useConfirmForgotPasswordMutation} from '../../services/auth'; import {getErrorMessage} from '../../redux/helpers'; -import {FormContainer, PasswordField} from '../../features/authentication'; -import {PasswordValidation} from '../../features/authentication/PasswordValidation'; +import { + FormContainer, + PasswordField, + PasswordValidation, +} from '../../features/authentication'; +import {ResestPasswordValues} from '../../features/authentication/ResetPasswordContext'; export const ResetPassword = () => { const { diff --git a/frontend/src/pages/authentication/SignIn.tsx b/frontend/src/pages/authentication/SignIn.tsx index ab097216..2a697a54 100644 --- a/frontend/src/pages/authentication/SignIn.tsx +++ b/frontend/src/pages/authentication/SignIn.tsx @@ -12,14 +12,13 @@ import CloseIcon from '@mui/icons-material/Close'; import {setCredentials} from '../../redux/authSlice'; import {useAppDispatch} from '../../redux/hooks/store'; -import {SignInForm} from '../../features/authentication/SignInForm'; +import {isFetchBaseQueryError, isErrorWithMessage} from '../../redux/helpers'; import { SignInRequest, useGoogleSignInMutation, useSignInMutation, } from '../../services/auth'; -import {isFetchBaseQueryError, isErrorWithMessage} from '../../redux/helpers'; -import {FormContainer} from '../../features/authentication'; +import {SignInForm, FormContainer} from '../../features/authentication'; import { useAuthenticateWithOAuth, redirectsByRole, diff --git a/frontend/src/pages/authentication/SignUp.tsx b/frontend/src/pages/authentication/SignUp.tsx index acf3d861..d158b478 100644 --- a/frontend/src/pages/authentication/SignUp.tsx +++ b/frontend/src/pages/authentication/SignUp.tsx @@ -8,17 +8,16 @@ import { Link, } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; - import {useNavigate, useParams} from 'react-router-dom'; -import {SignUpForm} from '../../features/authentication/SignUpForm'; + import { useGoogleSignUpMutation, useSignUpMutation, SignUpRequest, } from '../../services/auth'; import {isErrorWithMessage, isFetchBaseQueryError} from '../../redux/helpers'; -import {FormContainer} from '../../features/authentication'; import {useAuthenticateWithOAuth} from '../../features/authentication/hooks/useAuthenticateWithOAuth'; +import {FormContainer, SignUpForm} from '../../features/authentication'; export const SignUp = () => { const [errorMessage, setErrorMessage] = React.useState(''); diff --git a/frontend/src/pages/intake-profile/IntakeProfile.tsx b/frontend/src/pages/intake-profile/IntakeProfile.tsx index 0dfc2d8d..6f31774b 100644 --- a/frontend/src/pages/intake-profile/IntakeProfile.tsx +++ b/frontend/src/pages/intake-profile/IntakeProfile.tsx @@ -1,14 +1,14 @@ import {Button, Stack, useMediaQuery, useTheme} from '@mui/material'; import {Outlet, useLocation, useNavigate, useParams} from 'react-router-dom'; import {Formik} from 'formik'; -import {buildValidationSchema, createInitialValues} from './constants'; +import {buildValidationSchema, createInitialValues} from './helpers'; import { useGetProfileQuery, useGetResponsesQuery, Response, } from '../../services/profile'; import {useState} from 'react'; -import {ProfileSidebar} from '../../features/intake-profile/ProfileSidebar'; +import {ProfileSidebar} from '../../features/intake-profile'; export type Values = { [key: string]: Response['value']; }; diff --git a/frontend/src/pages/intake-profile/constants/buildValidationSchema.ts b/frontend/src/pages/intake-profile/helpers/buildValidationSchema.ts similarity index 100% rename from frontend/src/pages/intake-profile/constants/buildValidationSchema.ts rename to frontend/src/pages/intake-profile/helpers/buildValidationSchema.ts diff --git a/frontend/src/pages/intake-profile/constants/createInitialValues.ts b/frontend/src/pages/intake-profile/helpers/createInitialValues.ts similarity index 100% rename from frontend/src/pages/intake-profile/constants/createInitialValues.ts rename to frontend/src/pages/intake-profile/helpers/createInitialValues.ts diff --git a/frontend/src/pages/intake-profile/constants/index.ts b/frontend/src/pages/intake-profile/helpers/index.ts similarity index 100% rename from frontend/src/pages/intake-profile/constants/index.ts rename to frontend/src/pages/intake-profile/helpers/index.ts From 2892941c515a9be00d171697cf00e05e6a6583de Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 25 Sep 2024 15:14:01 -0700 Subject: [PATCH 22/25] Update index.ts imports and change constants to helpers --- frontend/{src => public/images}/favicon.svg | 0 frontend/{src => public/images}/logo.svg | 0 frontend/src/features/authentication/ProtectedRoute.tsx | 2 +- frontend/src/features/intake-profile/hooks/useStatusStyling.tsx | 2 +- frontend/src/features/layouts/AppLayout.tsx | 2 +- frontend/src/features/layouts/DashboardLayout.tsx | 2 +- frontend/src/features/{common => ui}/AuthenticatedHeader.tsx | 0 frontend/src/features/{common => ui}/Header.tsx | 0 frontend/src/features/{common => ui}/Loading.tsx | 0 frontend/src/features/{common => ui}/icons/CoordinatorIcon.tsx | 0 frontend/src/features/{common => ui}/icons/GuestIcon.tsx | 0 frontend/src/features/{common => ui}/icons/HostIcon.tsx | 0 frontend/src/features/{common => ui}/icons/InProgressIcon.tsx | 0 frontend/src/features/{common => ui}/icons/index.ts | 0 frontend/src/features/{common => ui}/index.ts | 0 frontend/src/main.tsx | 2 +- frontend/src/pages/SystemAdminDashboard.tsx | 2 +- frontend/src/pages/authentication/SelectAccountType.tsx | 2 +- frontend/src/pages/host-dashboard/HostDashboard.tsx | 2 +- 19 files changed, 8 insertions(+), 8 deletions(-) rename frontend/{src => public/images}/favicon.svg (100%) rename frontend/{src => public/images}/logo.svg (100%) rename frontend/src/features/{common => ui}/AuthenticatedHeader.tsx (100%) rename frontend/src/features/{common => ui}/Header.tsx (100%) rename frontend/src/features/{common => ui}/Loading.tsx (100%) rename frontend/src/features/{common => ui}/icons/CoordinatorIcon.tsx (100%) rename frontend/src/features/{common => ui}/icons/GuestIcon.tsx (100%) rename frontend/src/features/{common => ui}/icons/HostIcon.tsx (100%) rename frontend/src/features/{common => ui}/icons/InProgressIcon.tsx (100%) rename frontend/src/features/{common => ui}/icons/index.ts (100%) rename frontend/src/features/{common => ui}/index.ts (100%) diff --git a/frontend/src/favicon.svg b/frontend/public/images/favicon.svg similarity index 100% rename from frontend/src/favicon.svg rename to frontend/public/images/favicon.svg diff --git a/frontend/src/logo.svg b/frontend/public/images/logo.svg similarity index 100% rename from frontend/src/logo.svg rename to frontend/public/images/logo.svg diff --git a/frontend/src/features/authentication/ProtectedRoute.tsx b/frontend/src/features/authentication/ProtectedRoute.tsx index 501d5414..90186da9 100644 --- a/frontend/src/features/authentication/ProtectedRoute.tsx +++ b/frontend/src/features/authentication/ProtectedRoute.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Navigate, useLocation} from 'react-router-dom'; import {useAuth} from '../../redux/hooks/useAuth'; -import {Loading} from '../common'; +import {Loading} from '../ui'; import {useCurrentUserQuery} from '../../services/user'; export const ProtectedRoute = ({children}: {children: JSX.Element}) => { diff --git a/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx index b66c54e3..64c50f9b 100644 --- a/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx +++ b/frontend/src/features/intake-profile/hooks/useStatusStyling.tsx @@ -1,5 +1,5 @@ import {useTheme} from '@mui/material/styles'; -import {InProgressIcon} from '../../common/icons/InProgressIcon'; +import {InProgressIcon} from '../../ui/icons/InProgressIcon'; import LockIcon from '@mui/icons-material/Lock'; import {CheckCircleOutlined} from '@mui/icons-material'; diff --git a/frontend/src/features/layouts/AppLayout.tsx b/frontend/src/features/layouts/AppLayout.tsx index 9e530421..e86e908f 100644 --- a/frontend/src/features/layouts/AppLayout.tsx +++ b/frontend/src/features/layouts/AppLayout.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Stack, Toolbar, Box} from '@mui/material'; import {Outlet} from 'react-router-dom'; -import {Header} from '../common/Header'; +import {Header} from '../ui/Header'; export const AppLayout = () => { return ( diff --git a/frontend/src/features/layouts/DashboardLayout.tsx b/frontend/src/features/layouts/DashboardLayout.tsx index 4d39afb5..2b7f1407 100644 --- a/frontend/src/features/layouts/DashboardLayout.tsx +++ b/frontend/src/features/layouts/DashboardLayout.tsx @@ -12,7 +12,7 @@ import {Link} from '@mui/material'; import {styled} from '@mui/system'; import {Outlet, useLocation} from 'react-router-dom'; -import {AuthenticatedHeader} from '../common'; +import {AuthenticatedHeader} from '../ui'; const DRAWER_WIDTH = 209; const MOBILE_DRAWER_WIDTH = 296; diff --git a/frontend/src/features/common/AuthenticatedHeader.tsx b/frontend/src/features/ui/AuthenticatedHeader.tsx similarity index 100% rename from frontend/src/features/common/AuthenticatedHeader.tsx rename to frontend/src/features/ui/AuthenticatedHeader.tsx diff --git a/frontend/src/features/common/Header.tsx b/frontend/src/features/ui/Header.tsx similarity index 100% rename from frontend/src/features/common/Header.tsx rename to frontend/src/features/ui/Header.tsx diff --git a/frontend/src/features/common/Loading.tsx b/frontend/src/features/ui/Loading.tsx similarity index 100% rename from frontend/src/features/common/Loading.tsx rename to frontend/src/features/ui/Loading.tsx diff --git a/frontend/src/features/common/icons/CoordinatorIcon.tsx b/frontend/src/features/ui/icons/CoordinatorIcon.tsx similarity index 100% rename from frontend/src/features/common/icons/CoordinatorIcon.tsx rename to frontend/src/features/ui/icons/CoordinatorIcon.tsx diff --git a/frontend/src/features/common/icons/GuestIcon.tsx b/frontend/src/features/ui/icons/GuestIcon.tsx similarity index 100% rename from frontend/src/features/common/icons/GuestIcon.tsx rename to frontend/src/features/ui/icons/GuestIcon.tsx diff --git a/frontend/src/features/common/icons/HostIcon.tsx b/frontend/src/features/ui/icons/HostIcon.tsx similarity index 100% rename from frontend/src/features/common/icons/HostIcon.tsx rename to frontend/src/features/ui/icons/HostIcon.tsx diff --git a/frontend/src/features/common/icons/InProgressIcon.tsx b/frontend/src/features/ui/icons/InProgressIcon.tsx similarity index 100% rename from frontend/src/features/common/icons/InProgressIcon.tsx rename to frontend/src/features/ui/icons/InProgressIcon.tsx diff --git a/frontend/src/features/common/icons/index.ts b/frontend/src/features/ui/icons/index.ts similarity index 100% rename from frontend/src/features/common/icons/index.ts rename to frontend/src/features/ui/icons/index.ts diff --git a/frontend/src/features/common/index.ts b/frontend/src/features/ui/index.ts similarity index 100% rename from frontend/src/features/common/index.ts rename to frontend/src/features/ui/index.ts diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 0477d061..859c0ac5 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -11,7 +11,7 @@ import {setupStore} from './redux/store'; import {useSessionMutation} from './services/auth'; import {HomeUniteUsTheme} from './theme'; import {ProtectedRoute, ResetPasswordContext} from './features/authentication'; -import {Header} from './features/common'; +import {Header} from './features/ui'; import {ProfileReview} from './features/intake-profile/ProfileReview'; import {FieldGroupList} from './features/intake-profile/IntakeProfileGroups'; import { diff --git a/frontend/src/pages/SystemAdminDashboard.tsx b/frontend/src/pages/SystemAdminDashboard.tsx index b2372daa..f4b0f69a 100644 --- a/frontend/src/pages/SystemAdminDashboard.tsx +++ b/frontend/src/pages/SystemAdminDashboard.tsx @@ -28,7 +28,7 @@ import DeleteIcon from '@mui/icons-material/Delete'; import PersonIcon from '@mui/icons-material/Person'; import {red} from '@mui/material/colors'; import * as React from 'react'; -import {AuthenticatedHeader} from '../features/common'; +import {AuthenticatedHeader} from '../features/ui'; import { DashboardDataItem, DashboardDataResponse, diff --git a/frontend/src/pages/authentication/SelectAccountType.tsx b/frontend/src/pages/authentication/SelectAccountType.tsx index ed61af94..5a688a73 100644 --- a/frontend/src/pages/authentication/SelectAccountType.tsx +++ b/frontend/src/pages/authentication/SelectAccountType.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react'; import {useNavigate} from 'react-router-dom'; import {Typography, Button, Stack, Link, Divider} from '@mui/material'; import {styled} from '@mui/system'; -import {HostIcon, CoordinatorIcon} from '../../features/common/icons'; +import {HostIcon, CoordinatorIcon} from '../../features/ui/icons'; export const SelectAccountType = () => { const [type, setType] = useState(''); diff --git a/frontend/src/pages/host-dashboard/HostDashboard.tsx b/frontend/src/pages/host-dashboard/HostDashboard.tsx index 51e2f983..d1febf8e 100644 --- a/frontend/src/pages/host-dashboard/HostDashboard.tsx +++ b/frontend/src/pages/host-dashboard/HostDashboard.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import {Box, Typography} from '@mui/material'; import * as React from 'react'; -import {AuthenticatedHeader} from '../../features/common'; +import {AuthenticatedHeader} from '../../features/ui'; interface HostDashboardProps {} From 5aab54b678f88a1c7cce45bde7d1992bf47759d0 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 25 Sep 2024 15:17:07 -0700 Subject: [PATCH 23/25] Update backend readme --- backend/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/README.md b/backend/README.md index 095f2e91..f285d864 100644 --- a/backend/README.md +++ b/backend/README.md @@ -27,11 +27,11 @@ Run `python -V` to check the Python version. #### Configuration -The API configuration must be specified before running the application. Configuration variables are specified as entries within a `.env` file located within the `api-v2` directory. To get started, create a `.env` file within `/api-v2` and copy the values from `.env.example` into the new `.env` file. You may have to contact someone from the development team to get the necessary values. +The API configuration must be specified before running the application. Configuration variables are specified as entries within a `.env` file located within the `backend` directory. To get started, create a `.env` file within `/backend` and copy the values from `.env.example` into the new `.env` file. You may have to contact someone from the development team to get the necessary values. #### Setup and Run -Once the `.env` file has been configured and Poetry is installed, run the following commands in the `api-v2` directory to install the required development dependencies and run the application. +Once the `.env` file has been configured and Poetry is installed, run the following commands in the `backend` directory to install the required development dependencies and run the application. ```shell poetry install # Installs all dependencies From 5cb0b9ba40c4ef0951357dc7c4e0140b99f71436 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 25 Sep 2024 15:34:49 -0700 Subject: [PATCH 24/25] Add folder structure description to frontend readme --- frontend/README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 3ee5703e..227c9eae 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -14,11 +14,11 @@ The minimum node version enforced is currently 20+, which is the current LTS ver 1. Clone the repository to a directory on your computer 2. Inside a terminal change directories to the root `HomeUniteUs/` directory -3. Navigate to the the `app/` directory `cd app/` +3. Navigate to the the `frontend/` directory: `cd frontend/` 4. Run the command `npm install` to download all dependencies from the local package.json 5. Create a local `.env` file and copy the contents from `.env.example` 6. Message a team member to obtain values for the .env file -7. From the `app/` directory run `npm run dev` to start a development server at `http://127.0.0.1:4040/` +7. From the `frontend/` directory run `npm run dev` to start a development server at `http://127.0.0.1:4040/` The setup for the front end application is now complete and you should see the website running in your browser at the listed port. @@ -62,11 +62,28 @@ For production builds, vite preforms a string replacement on the `import.meta.en The table below describes the environment variables that are used by this app: -| Variable | Required? | Example | Description | -|----------|-----------|---------|-------------| -| `VITE_HUU_API_BASE_URL` | YES | http://localhost:8080/api/ | The HUU API's base URL. In a development environment (mode is 'development' or 'test'): if this variable is not defined, then `http://localhost:4040/api/` will be used by default. In non-development environment: if this variable is not defined, then the build will throw an error. | -| | | | | +| Variable | Required? | Example | Description | +| ----------------------- | --------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `VITE_HUU_API_BASE_URL` | YES | http://localhost:8080/api/ | The HUU API's base URL. In a development environment (mode is 'development' or 'test'): if this variable is not defined, then `http://localhost:4040/api/` will be used by default. In non-development environment: if this variable is not defined, then the build will throw an error. | +| | | | | ## Production This application is statically compiled using `npm run build`. The files created by the build command are placed in a `dist` directory. Those files are then placed into a directory served by `Nginx`. The configuration environment variables are expected to exist prior to building this application. + +## Folder Structure + +The `frontend/` directory is organized as follows: + +- `src/` - Tthe source code for the frontend application + - `features/` - Contains the components for the application organized by feature as well as a `/ui` for shared components + - `feature/` - Inside the features folder are folders containing components for a specific feature along with any other required files. + - `hooks/` - Hooks related to the feature + - `helpers/` - Helper functions related to the feature + - `__tests__` - Tests for components in the feature + - `pages/` - Contains all pages that are rendered by the application. These can be organized by features and contain `hooks/`, `helpers/`, and `__tests__` subfolders as well. + - `hooks/` - Hooks that are shared across the application + - `redux/` - Cotains the redux store, state slices, and helpers for the application + - `services/` - Code related to interfacing with any external APIs + - `theme/` - Any files related to MUI theming and overrides + - `utils/` - All utility functions used throughout the application From 09c4b77996f1352a2b06302941ffabd3821f751f Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 25 Sep 2024 15:50:27 -0700 Subject: [PATCH 25/25] Fix some typos --- frontend/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 227c9eae..2f382c18 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -75,15 +75,16 @@ This application is statically compiled using `npm run build`. The files created The `frontend/` directory is organized as follows: -- `src/` - Tthe source code for the frontend application +- `src/` - The source code for the frontend application - `features/` - Contains the components for the application organized by feature as well as a `/ui` for shared components - `feature/` - Inside the features folder are folders containing components for a specific feature along with any other required files. - `hooks/` - Hooks related to the feature - `helpers/` - Helper functions related to the feature - `__tests__` - Tests for components in the feature + - `index.ts` - A file that exports any components that need to be accessed outside of the feature folder - `pages/` - Contains all pages that are rendered by the application. These can be organized by features and contain `hooks/`, `helpers/`, and `__tests__` subfolders as well. - `hooks/` - Hooks that are shared across the application - - `redux/` - Cotains the redux store, state slices, and helpers for the application + - `redux/` - Contains the redux store, state slices, and helpers for the application - `services/` - Code related to interfacing with any external APIs - `theme/` - Any files related to MUI theming and overrides - `utils/` - All utility functions used throughout the application