mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-07 03:32:02 +00:00
Some checks failed
Deploy / Deploy to AWS (push) Has been cancelled
## Summary Implements Phase 3 of the AUDIT-2026-05-20 findings: - 29 FIX-severity items across API, web, infra, and lambdas - 7 accessibility NITs (aria-labels, document titles) - 4 code quality NITs (deduplication, constants extraction) Key changes: - API: N+1 fix, pagination clamping, idempotent transitions, upload confirm endpoint, revision TotalBidAmount carry-forward - Web: confirmation dialogs, currency formatting, error states, date range filters, document titles - Infra: S3 CORS lockdown, API Gateway throttling, AOSS network policy fix, CI concurrency - Lambdas: skip empty suggestions, remove status side-effect - Scripts: post-deploy health check ## Test plan - [x] tsc --noEmit (web + infra) - [x] dotnet build (api) - [x] ruff check + format (lambdas) - [x] Cross-review via orchestrator (no blockers) [skip deploy]
66 lines
2.9 KiB
TypeScript
66 lines
2.9 KiB
TypeScript
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
import { useSelector } from 'react-redux';
|
|
import { Box, Toolbar, Typography } from '@mui/material';
|
|
import { selectSidebarOpen } from './app/slices/uiSlice';
|
|
import type { RootState } from './app/store';
|
|
import ProtectedRoute, { RoleGuard } from './components/ProtectedRoute';
|
|
import Topbar from './components/Topbar';
|
|
import Sidebar from './components/Sidebar';
|
|
import LoginPage from './pages/auth/LoginPage';
|
|
import AuthCallback from './pages/auth/AuthCallback';
|
|
import Dashboard from './pages/dashboard/Dashboard';
|
|
import ProposalFormPage from './pages/proposals/form/ProposalFormPage';
|
|
import ProposalDetailPage from './pages/proposals/detail/ProposalDetailPage';
|
|
import ProposalListPage from './pages/proposals/list/ProposalListPage';
|
|
import AdminDashboard from './pages/admin/dashboard/AdminDashboard';
|
|
import AdminWorkspace from './pages/admin/workspace/AdminWorkspace';
|
|
import { DRAWER_WIDTH } from './constants';
|
|
|
|
export default function App() {
|
|
const sidebarOpen = useSelector((state: RootState) => selectSidebarOpen(state));
|
|
|
|
return (
|
|
<Routes>
|
|
<Route path="/login" element={<LoginPage />} />
|
|
<Route path="/callback" element={<AuthCallback />} />
|
|
|
|
<Route
|
|
path="/*"
|
|
element={
|
|
<ProtectedRoute>
|
|
<Box sx={{ display: 'flex' }}>
|
|
<Topbar />
|
|
<Sidebar />
|
|
<Box
|
|
component="main"
|
|
sx={{
|
|
flexGrow: 1,
|
|
p: 1.25,
|
|
ml: sidebarOpen ? `${DRAWER_WIDTH}px` : 0,
|
|
transition: 'margin-left 250ms ease',
|
|
minHeight: '100vh',
|
|
}}
|
|
>
|
|
<Toolbar sx={{ minHeight: 64 }} />
|
|
<Routes>
|
|
<Route path="/" element={<Dashboard />} />
|
|
<Route path="/proposals" element={<ProposalListPage />} />
|
|
<Route path="/proposals/new" element={<ProposalFormPage />} />
|
|
<Route path="/proposals/:id" element={<ProposalDetailPage />} />
|
|
|
|
{/* Admin Routes */}
|
|
<Route path="/admin" element={<RoleGuard roles={['Admin', 'SysAdmin']}><AdminDashboard defaultStatus="InReview" /></RoleGuard>} />
|
|
<Route path="/admin/proposals" element={<RoleGuard roles={['Admin', 'SysAdmin']}><AdminDashboard /></RoleGuard>} />
|
|
<Route path="/admin/proposals/:id" element={<RoleGuard roles={['Admin', 'SysAdmin']}><AdminWorkspace /></RoleGuard>} />
|
|
<Route path="/admin/users" element={<RoleGuard roles={['SysAdmin']}><Typography variant="h5" sx={{ p: 2 }}>User Management — Coming Soon</Typography></RoleGuard>} />
|
|
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
</Routes>
|
|
</Box>
|
|
</Box>
|
|
</ProtectedRoute>
|
|
}
|
|
/>
|
|
</Routes>
|
|
);
|
|
}
|