add parent pages

This commit is contained in:
root
2026-04-23 02:24:05 -04:00
parent 9191fd32f0
commit 94700d4f0f
30 changed files with 8179 additions and 634 deletions
+309 -162
View File
@@ -1,176 +1,323 @@
import { Suspense, lazy } from 'react'
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'
import { AuthProvider } from './auth/AuthProvider'
import { RequireAuth } from './auth/RequireAuth'
import { PublicLayout } from './layout/PublicLayout'
import { ManagementLayout } from './layout/ManagementLayout'
import { AdminDocs } from './pages/AdminDocs'
import { AppHome } from './pages/AppHome'
import { CiPlaceholderPage } from './pages/CiPlaceholderPage'
import { CiSitemapPage } from './pages/CiSitemapPage'
import { ForgotPasswordPage } from './pages/ForgotPasswordPage'
import { HomePage } from './pages/HomePage'
import { LoginPage } from './pages/LoginPage'
import { RegisterPage } from './pages/RegisterPage'
import { ParentAttendancePage } from './pages/parent/ParentAttendancePage'
import { ParentHomePage } from './pages/parent/ParentHomePage'
import {
ParentEmergencyContactEditPage,
ParentProgressAttachmentFilePage,
ParentProgressAttachmentPage,
ParentProgressViewPage,
ParentReportCardsSignPage,
ParentReportCardsViewPage,
ParentStudentEditPage,
} from './pages/parent/dynamicParityPages'
import {
ParentAddEmergencyFormPage,
ParentAddStudentFormPage,
ParentEditAllStudentsPage,
ParentUpdateProfileParityPage,
} from './pages/parent/extraParentParityPages'
import {
ParentAttendanceReportsHistoryPage,
ParentAuthorizedUsersPage,
} from './pages/parent/ParentAccountListPages'
import { ParentEmergencyContactsPage } from './pages/parent/ParentEmergencyContactsPage'
import {
RedirectParentLegacyEmergencyContactEdit,
RedirectParentLegacyStudentEdit,
} from './pages/parent/ParentCiRouteRedirects'
import {
ParentAddSecondParentPage,
ParentAssignmentsPage,
ParentCalendarPage,
ParentClassesPage,
ParentEnrollFailurePage,
ParentEnrollSuccessPage,
ParentInvoicePaymentPage,
ParentMessagePage,
ParentNoKidsRegisteredPage,
ParentPaymentSuccessPage,
ParentProgressListPage,
ParentReportCardsPage,
ParentScoresPage,
ParentSuccessMessagePage,
ParentWithdrawSuccessPage,
} from './pages/parent/staticParityPages'
import {
ParentContactPage,
ParentEnrollClassesPage,
ParentEventsPage,
ParentPaymentInvoicesPage,
ParentRegisterStudentPage,
ParentReportAttendancePage,
} from './pages/parent/WiredParentScreens'
import { SwaggerDocs } from './pages/SwaggerDocs'
import './App.css'
const PublicLayout = lazy(() =>
import('./layout/PublicLayout').then((m) => ({ default: m.PublicLayout })),
)
const ManagementLayout = lazy(() =>
import('./layout/ManagementLayout').then((m) => ({ default: m.ManagementLayout })),
)
const MainLayout = lazy(() =>
import('./layout/MainLayout').then((m) => ({ default: m.MainLayout })),
)
const HomePage = lazy(() => import('./pages/HomePage').then((m) => ({ default: m.HomePage })))
const LoginPage = lazy(() => import('./pages/LoginPage').then((m) => ({ default: m.LoginPage })))
const RegisterPage = lazy(() =>
import('./pages/RegisterPage').then((m) => ({ default: m.RegisterPage })),
)
const ForgotPasswordPage = lazy(() =>
import('./pages/ForgotPasswordPage').then((m) => ({ default: m.ForgotPasswordPage })),
)
const AdminDocs = lazy(() => import('./pages/AdminDocs').then((m) => ({ default: m.AdminDocs })))
const SwaggerDocs = lazy(() =>
import('./pages/SwaggerDocs').then((m) => ({ default: m.SwaggerDocs })),
)
const RoleSelectPage = lazy(() =>
import('./pages/RoleSelectPage').then((m) => ({ default: m.RoleSelectPage })),
)
const AppHome = lazy(() => import('./pages/AppHome').then((m) => ({ default: m.AppHome })))
const CiSitemapPage = lazy(() =>
import('./pages/CiSitemapPage').then((m) => ({ default: m.CiSitemapPage })),
)
const CiPlaceholderPage = lazy(() =>
import('./pages/CiPlaceholderPage').then((m) => ({ default: m.CiPlaceholderPage })),
)
const NavBuilderPage = lazy(() =>
import('./pages/NavBuilderPage').then((m) => ({ default: m.NavBuilderPage })),
)
const ParentHomePage = lazy(() =>
import('./pages/parent/ParentHomePage').then((m) => ({ default: m.ParentHomePage })),
)
const ParentAttendancePage = lazy(() =>
import('./pages/parent/ParentAttendancePage').then((m) => ({ default: m.ParentAttendancePage })),
)
const ParentEmergencyContactsPage = lazy(() =>
import('./pages/parent/ParentEmergencyContactsPage').then((m) => ({
default: m.ParentEmergencyContactsPage,
})),
)
const ParentAttendanceReportsHistoryPage = lazy(() =>
import('./pages/parent/ParentAccountListPages').then((m) => ({
default: m.ParentAttendanceReportsHistoryPage,
})),
)
const ParentAuthorizedUsersPage = lazy(() =>
import('./pages/parent/ParentAccountListPages').then((m) => ({
default: m.ParentAuthorizedUsersPage,
})),
)
const RedirectParentLegacyStudentEdit = lazy(() =>
import('./pages/parent/ParentCiRouteRedirects').then((m) => ({
default: m.RedirectParentLegacyStudentEdit,
})),
)
const RedirectParentLegacyEmergencyContactEdit = lazy(() =>
import('./pages/parent/ParentCiRouteRedirects').then((m) => ({
default: m.RedirectParentLegacyEmergencyContactEdit,
})),
)
const ParentReportCardsSignPage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({
default: m.ParentReportCardsSignPage,
})),
)
const ParentReportCardsViewPage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({
default: m.ParentReportCardsViewPage,
})),
)
const ParentProgressViewPage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({
default: m.ParentProgressViewPage,
})),
)
const ParentProgressAttachmentPage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({
default: m.ParentProgressAttachmentPage,
})),
)
const ParentProgressAttachmentFilePage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({
default: m.ParentProgressAttachmentFilePage,
})),
)
const ParentEmergencyContactEditPage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({
default: m.ParentEmergencyContactEditPage,
})),
)
const ParentStudentEditPage = lazy(() =>
import('./pages/parent/dynamicParityPages').then((m) => ({ default: m.ParentStudentEditPage })),
)
const ParentEditAllStudentsPage = lazy(() =>
import('./pages/parent/extraParentParityPages').then((m) => ({
default: m.ParentEditAllStudentsPage,
})),
)
const ParentAddEmergencyFormPage = lazy(() =>
import('./pages/parent/extraParentParityPages').then((m) => ({
default: m.ParentAddEmergencyFormPage,
})),
)
const ParentAddStudentFormPage = lazy(() =>
import('./pages/parent/extraParentParityPages').then((m) => ({
default: m.ParentAddStudentFormPage,
})),
)
const ParentUpdateProfileParityPage = lazy(() =>
import('./pages/parent/extraParentParityPages').then((m) => ({
default: m.ParentUpdateProfileParityPage,
})),
)
const ParentAddSecondParentPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentAddSecondParentPage })),
)
const ParentAssignmentsPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentAssignmentsPage })),
)
const ParentCalendarPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentCalendarPage })),
)
const ParentClassesPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentClassesPage })),
)
const ParentEnrollFailurePage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentEnrollFailurePage })),
)
const ParentEnrollSuccessPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentEnrollSuccessPage })),
)
const ParentInvoicePaymentPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentInvoicePaymentPage })),
)
const ParentMessagePage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentMessagePage })),
)
const ParentNoKidsRegisteredPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({
default: m.ParentNoKidsRegisteredPage,
})),
)
const ParentPaymentSuccessPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentPaymentSuccessPage })),
)
const ParentProgressListPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentProgressListPage })),
)
const ParentReportCardsPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentReportCardsPage })),
)
const ParentScoresPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentScoresPage })),
)
const ParentSuccessMessagePage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentSuccessMessagePage })),
)
const ParentWithdrawSuccessPage = lazy(() =>
import('./pages/parent/staticParityPages').then((m) => ({ default: m.ParentWithdrawSuccessPage })),
)
const ParentContactPage = lazy(() =>
import('./pages/parent/WiredParentScreens').then((m) => ({ default: m.ParentContactPage })),
)
const ParentEnrollClassesPage = lazy(() =>
import('./pages/parent/WiredParentScreens').then((m) => ({
default: m.ParentEnrollClassesPage,
})),
)
const ParentEventsPage = lazy(() =>
import('./pages/parent/WiredParentScreens').then((m) => ({ default: m.ParentEventsPage })),
)
const ParentPaymentInvoicesPage = lazy(() =>
import('./pages/parent/WiredParentScreens').then((m) => ({
default: m.ParentPaymentInvoicesPage,
})),
)
const ParentRegisterStudentPage = lazy(() =>
import('./pages/parent/WiredParentScreens').then((m) => ({
default: m.ParentRegisterStudentPage,
})),
)
const ParentReportAttendancePage = lazy(() =>
import('./pages/parent/WiredParentScreens').then((m) => ({
default: m.ParentReportAttendancePage,
})),
)
function RouteFallback() {
return <div className="container py-4">Loading</div>
}
export default function App() {
return (
<AuthProvider>
<BrowserRouter>
<Routes>
<Route element={<PublicLayout />}>
<Route path="/" element={<HomePage />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/register" element={<RegisterPage />} />
<Route path="/forgot-password" element={<ForgotPasswordPage />} />
</Route>
<Route
path="/docs"
element={
<div className="docs-root-inner py-3">
<SwaggerDocs bootstrapPath="/api/docs/public" />
</div>
}
/>
<Route path="/admin" element={<AdminDocs />} />
<Route element={<RequireAuth />}>
<Route path="/app" element={<ManagementLayout />}>
<Route index element={<Navigate to="home" replace />} />
<Route path="home" element={<AppHome />} />
<Route path="parent/add_second_parent" element={<Navigate to="/app/parent/add-second-parent" replace />} />
<Route path="parent/register_student" element={<Navigate to="/app/parent/register-student" replace />} />
<Route path="parent/enroll_classes" element={<Navigate to="/app/parent/enroll-classes" replace />} />
<Route path="parent/enroll_success" element={<Navigate to="/app/parent/enroll/success" replace />} />
<Route path="parent/enroll_failure" element={<Navigate to="/app/parent/enroll/failure" replace />} />
<Route path="parent/invoice_payment" element={<Navigate to="/app/parent/invoice-payment" replace />} />
<Route path="parent/viewSecondParent" element={<Navigate to="/app/parent/add-second-parent" replace />} />
<Route path="parent/child_register" element={<Navigate to="/app/parent/register-student" replace />} />
<Route path="parent/edit_student/:studentId" element={<RedirectParentLegacyStudentEdit />} />
<Route path="parent/edit-student/:studentId" element={<RedirectParentLegacyStudentEdit />} />
<Route path="parent_dashboard" element={<Navigate to="/app/parent/home" replace />} />
<Route path="parent/report-cards/sign/:studentId" element={<ParentReportCardsSignPage />} />
<Route
path="parent/edit-emergency-contact/:contactId"
element={<RedirectParentLegacyEmergencyContactEdit />}
/>
<Route
path="parent/edit_emergency_contact/:contactId"
element={<RedirectParentLegacyEmergencyContactEdit />}
/>
<Route path="parent/enroll/failure" element={<ParentEnrollFailurePage />} />
<Route path="parent/enroll/success" element={<ParentEnrollSuccessPage />} />
<Route path="parent/payment/success" element={<ParentPaymentSuccessPage />} />
<Route path="parent/withdraw/success" element={<ParentWithdrawSuccessPage />} />
<Route path="parent/report-cards/view/:reportId" element={<ParentReportCardsViewPage />} />
<Route path="parent/progress/view/:progressId" element={<ParentProgressViewPage />} />
<Route path="parent/progress/attachment/:attachmentId" element={<ParentProgressAttachmentPage />} />
<Route path="parent/progress/attachment-file/:fileId" element={<ParentProgressAttachmentFilePage />} />
<Route path="parent/emergency-contacts" element={<ParentEmergencyContactsPage />} />
<Route path="parent/edit-emergency-contact" element={<ParentEmergencyContactsPage />} />
<Route
path="parent/emergency-contact/:contactId"
element={<ParentEmergencyContactEditPage />}
/>
<Route path="parent/students/:studentId/edit" element={<ParentStudentEditPage />} />
<Route path="parent/edit-all-students" element={<ParentEditAllStudentsPage />} />
<Route path="parent/add-emergency-form" element={<ParentAddEmergencyFormPage />} />
<Route path="parent/add-student-form" element={<ParentAddStudentFormPage />} />
<Route path="parent/contact" element={<ParentContactPage />} />
<Route path="parent/enroll-classes" element={<ParentEnrollClassesPage />} />
<Route path="parent/events" element={<ParentEventsPage />} />
<Route path="parent/payment" element={<ParentPaymentInvoicesPage />} />
<Route path="parent/register-student" element={<ParentRegisterStudentPage />} />
<Route path="parent/report-attendance" element={<ParentReportAttendancePage />} />
<Route path="parent/attendance-reports" element={<ParentAttendanceReportsHistoryPage />} />
<Route path="parent/authorized-users" element={<ParentAuthorizedUsersPage />} />
<Route path="parent/update-profile" element={<ParentUpdateProfileParityPage />} />
<Route path="parent/home" element={<ParentHomePage />} />
<Route path="parent/attendance" element={<ParentAttendancePage />} />
<Route path="parent/add-second-parent" element={<ParentAddSecondParentPage />} />
<Route path="parent/assignments" element={<ParentAssignmentsPage />} />
<Route path="parent/calendar" element={<ParentCalendarPage />} />
<Route path="parent/classes" element={<ParentClassesPage />} />
<Route path="parent/progress" element={<ParentProgressListPage />} />
<Route path="parent/invoice-payment" element={<ParentInvoicePaymentPage />} />
<Route path="parent/no-kids-registered" element={<ParentNoKidsRegisteredPage />} />
<Route path="parent/message" element={<ParentMessagePage />} />
<Route path="parent/report-cards" element={<ParentReportCardsPage />} />
<Route path="parent/scores" element={<ParentScoresPage />} />
<Route path="parent/success" element={<ParentSuccessMessagePage />} />
<Route path="browse" element={<CiSitemapPage />} />
<Route path="*" element={<CiPlaceholderPage />} />
<Suspense fallback={<RouteFallback />}>
<Routes>
<Route element={<PublicLayout />}>
<Route path="/" element={<HomePage />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/register" element={<RegisterPage />} />
<Route path="/forgot-password" element={<ForgotPasswordPage />} />
</Route>
</Route>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
<Route
path="/docs"
element={
<div className="docs-root-inner py-3">
<SwaggerDocs bootstrapPath="/api/docs/public" />
</div>
}
/>
<Route path="/admin" element={<AdminDocs />} />
<Route element={<RequireAuth />}>
<Route path="/app">
<Route element={<ManagementLayout />}>
<Route index element={<Navigate to="home" replace />} />
<Route path="select-role" element={<RoleSelectPage />} />
<Route path="home" element={<AppHome />} />
<Route path="nav-builder" element={<NavBuilderPage />} />
</Route>
<Route element={<MainLayout />}>
<Route path="parent/add_second_parent" element={<Navigate to="/app/parent/add-second-parent" replace />} />
<Route path="parent/register_student" element={<Navigate to="/app/parent/register-student" replace />} />
<Route path="parent/enroll_classes" element={<Navigate to="/app/parent/enroll-classes" replace />} />
<Route path="parent/enroll_success" element={<Navigate to="/app/parent/enroll/success" replace />} />
<Route path="parent/enroll_failure" element={<Navigate to="/app/parent/enroll/failure" replace />} />
<Route path="parent/invoice_payment" element={<Navigate to="/app/parent/invoice-payment" replace />} />
<Route path="parent/viewSecondParent" element={<Navigate to="/app/parent/add-second-parent" replace />} />
<Route path="parent/child_register" element={<Navigate to="/app/parent/register-student" replace />} />
<Route path="parent/edit_student/:studentId" element={<RedirectParentLegacyStudentEdit />} />
<Route path="parent/edit-student/:studentId" element={<RedirectParentLegacyStudentEdit />} />
<Route path="parent_dashboard" element={<Navigate to="/app/parent/home" replace />} />
<Route path="parent/report-cards/sign/:studentId" element={<ParentReportCardsSignPage />} />
<Route
path="parent/edit-emergency-contact/:contactId"
element={<RedirectParentLegacyEmergencyContactEdit />}
/>
<Route
path="parent/edit_emergency_contact/:contactId"
element={<RedirectParentLegacyEmergencyContactEdit />}
/>
<Route path="parent/enroll/failure" element={<ParentEnrollFailurePage />} />
<Route path="parent/enroll/success" element={<ParentEnrollSuccessPage />} />
<Route path="parent/payment/success" element={<ParentPaymentSuccessPage />} />
<Route path="parent/withdraw/success" element={<ParentWithdrawSuccessPage />} />
<Route path="parent/report-cards/view/:reportId" element={<ParentReportCardsViewPage />} />
<Route path="parent/progress/view/:progressId" element={<ParentProgressViewPage />} />
<Route path="parent/progress/attachment/:attachmentId" element={<ParentProgressAttachmentPage />} />
<Route path="parent/progress/attachment-file/:fileId" element={<ParentProgressAttachmentFilePage />} />
<Route path="parent/emergency-contacts" element={<ParentEmergencyContactsPage />} />
<Route path="parent/edit-emergency-contact" element={<ParentEmergencyContactsPage />} />
<Route
path="parent/emergency-contact/:contactId"
element={<ParentEmergencyContactEditPage />}
/>
<Route path="parent/students/:studentId/edit" element={<ParentStudentEditPage />} />
<Route path="parent/edit-all-students" element={<ParentEditAllStudentsPage />} />
<Route path="parent/add-emergency-form" element={<ParentAddEmergencyFormPage />} />
<Route path="parent/add-student-form" element={<ParentAddStudentFormPage />} />
<Route path="parent/contact" element={<ParentContactPage />} />
<Route path="parent/enroll-classes" element={<ParentEnrollClassesPage />} />
<Route path="parent/events" element={<ParentEventsPage />} />
<Route path="parent/payment" element={<ParentPaymentInvoicesPage />} />
<Route path="parent/register-student" element={<ParentRegisterStudentPage />} />
<Route path="parent/report-attendance" element={<ParentReportAttendancePage />} />
<Route path="parent/attendance-reports" element={<ParentAttendanceReportsHistoryPage />} />
<Route path="parent/authorized-users" element={<ParentAuthorizedUsersPage />} />
<Route path="parent/update-profile" element={<ParentUpdateProfileParityPage />} />
<Route path="parent/home" element={<ParentHomePage />} />
<Route path="parent/attendance" element={<ParentAttendancePage />} />
<Route path="parent/add-second-parent" element={<ParentAddSecondParentPage />} />
<Route path="parent/assignments" element={<ParentAssignmentsPage />} />
<Route path="parent/calendar" element={<ParentCalendarPage />} />
<Route path="parent/classes" element={<ParentClassesPage />} />
<Route path="parent/progress" element={<ParentProgressListPage />} />
<Route path="parent/invoice-payment" element={<ParentInvoicePaymentPage />} />
<Route path="parent/no-kids-registered" element={<ParentNoKidsRegisteredPage />} />
<Route path="parent/message" element={<ParentMessagePage />} />
<Route path="parent/report-cards" element={<ParentReportCardsPage />} />
<Route path="parent/scores" element={<ParentScoresPage />} />
<Route path="parent/success" element={<ParentSuccessMessagePage />} />
</Route>
<Route element={<ManagementLayout />}>
<Route path="browse" element={<CiSitemapPage />} />
<Route path="*" element={<CiPlaceholderPage />} />
</Route>
</Route>
</Route>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>
</BrowserRouter>
</AuthProvider>
)