Skip to content

Commit

Permalink
added route skeleton for all the routes
Browse files Browse the repository at this point in the history
  • Loading branch information
nitheesh-aot committed Aug 2, 2024
1 parent 0cc9ca0 commit 47fd588
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 82 deletions.
27 changes: 9 additions & 18 deletions compliance-web/src/components/Shared/SideNav/RouteItemsList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Assessment, Settings, List } from "@mui/icons-material";
import { useAuth } from "react-oidc-context";

export interface RouteMenuItem {
routeName: string;
Expand All @@ -9,30 +8,28 @@ export interface RouteMenuItem {
}

export default function RouteItemsList() {
const { isAuthenticated } = useAuth();

let routeMenuItems: RouteMenuItem[] = [
const routeMenuItems: RouteMenuItem[] = [
{
routeName: "C&E Database",
icon: <List />,
subRoutes: [
{
routeName: "Case Files",
path: "/",
path: "/ce-database/case-files",
},
{
routeName: "Inspections",
path: "/link1",
path: "/ce-database/inspection",
},
{
routeName: "Complaints",
path: "/link2",
path: "/ce-database/compliants",
},
],
},
{
routeName: "IR Board",
path: "/about",
path: "/ir-board",
icon: <Assessment sx={{ transform: "rotate(180deg)" }} />,
},
{
Expand All @@ -41,29 +38,23 @@ export default function RouteItemsList() {
subRoutes: [
{
routeName: "Staff",
path: "/newpage",
path: "/admin/staff",
},
{
routeName: "Proponents",
path: "/link1",
path: "/admin/proponents",
},
{
routeName: "Agencies",
path: "/link2",
path: "/admin/agencies",
},
{
routeName: "Topics",
path: "/link3",
path: "/admin/topics",
},
],
},
];

const authenticatedRouteMenuItems: RouteMenuItem[] = [];

if (isAuthenticated) {
routeMenuItems = routeMenuItems.concat(authenticatedRouteMenuItems);
}

return routeMenuItems;
}
158 changes: 158 additions & 0 deletions compliance-web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ import { Route as IndexImport } from './routes/index'
import { Route as EaoPlansIndexImport } from './routes/eao-plans/index'
import { Route as EaoPlansPlanIdImport } from './routes/eao-plans/$planId'
import { Route as AuthenticatedProfileImport } from './routes/_authenticated/profile'
import { Route as AuthenticatedIrBoardImport } from './routes/_authenticated/ir-board'
import { Route as AuthenticatedUsersIndexImport } from './routes/_authenticated/users/index'
import { Route as AuthenticatedCeDatabaseInspectionImport } from './routes/_authenticated/ce-database/inspection'
import { Route as AuthenticatedCeDatabaseCompliantsImport } from './routes/_authenticated/ce-database/compliants'
import { Route as AuthenticatedCeDatabaseCaseFilesImport } from './routes/_authenticated/ce-database/case-files'
import { Route as AuthenticatedAdminTopicsImport } from './routes/_authenticated/admin/topics'
import { Route as AuthenticatedAdminStaffImport } from './routes/_authenticated/admin/staff'
import { Route as AuthenticatedAdminProponentsImport } from './routes/_authenticated/admin/proponents'
import { Route as AuthenticatedAdminAgenciesImport } from './routes/_authenticated/admin/agencies'

// Create Virtual Routes

Expand Down Expand Up @@ -68,11 +76,57 @@ const AuthenticatedProfileRoute = AuthenticatedProfileImport.update({
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedIrBoardRoute = AuthenticatedIrBoardImport.update({
path: '/ir-board',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedUsersIndexRoute = AuthenticatedUsersIndexImport.update({
path: '/users/',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedCeDatabaseInspectionRoute =
AuthenticatedCeDatabaseInspectionImport.update({
path: '/ce-database/inspection',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedCeDatabaseCompliantsRoute =
AuthenticatedCeDatabaseCompliantsImport.update({
path: '/ce-database/compliants',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedCeDatabaseCaseFilesRoute =
AuthenticatedCeDatabaseCaseFilesImport.update({
path: '/ce-database/case-files',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedAdminTopicsRoute = AuthenticatedAdminTopicsImport.update({
path: '/admin/topics',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedAdminStaffRoute = AuthenticatedAdminStaffImport.update({
path: '/admin/staff',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedAdminProponentsRoute =
AuthenticatedAdminProponentsImport.update({
path: '/admin/proponents',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedAdminAgenciesRoute = AuthenticatedAdminAgenciesImport.update(
{
path: '/admin/agencies',
getParentRoute: () => AuthenticatedRoute,
} as any,
)

// Populate the FileRoutesByPath interface

declare module '@tanstack/react-router' {
Expand Down Expand Up @@ -112,6 +166,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof NewpageLazyImport
parentRoute: typeof rootRoute
}
'/_authenticated/ir-board': {
id: '/_authenticated/ir-board'
path: '/ir-board'
fullPath: '/ir-board'
preLoaderRoute: typeof AuthenticatedIrBoardImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/profile': {
id: '/_authenticated/profile'
path: '/profile'
Expand All @@ -133,6 +194,55 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof EaoPlansIndexImport
parentRoute: typeof rootRoute
}
'/_authenticated/admin/agencies': {
id: '/_authenticated/admin/agencies'
path: '/admin/agencies'
fullPath: '/admin/agencies'
preLoaderRoute: typeof AuthenticatedAdminAgenciesImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/admin/proponents': {
id: '/_authenticated/admin/proponents'
path: '/admin/proponents'
fullPath: '/admin/proponents'
preLoaderRoute: typeof AuthenticatedAdminProponentsImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/admin/staff': {
id: '/_authenticated/admin/staff'
path: '/admin/staff'
fullPath: '/admin/staff'
preLoaderRoute: typeof AuthenticatedAdminStaffImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/admin/topics': {
id: '/_authenticated/admin/topics'
path: '/admin/topics'
fullPath: '/admin/topics'
preLoaderRoute: typeof AuthenticatedAdminTopicsImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/ce-database/case-files': {
id: '/_authenticated/ce-database/case-files'
path: '/ce-database/case-files'
fullPath: '/ce-database/case-files'
preLoaderRoute: typeof AuthenticatedCeDatabaseCaseFilesImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/ce-database/compliants': {
id: '/_authenticated/ce-database/compliants'
path: '/ce-database/compliants'
fullPath: '/ce-database/compliants'
preLoaderRoute: typeof AuthenticatedCeDatabaseCompliantsImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/ce-database/inspection': {
id: '/_authenticated/ce-database/inspection'
path: '/ce-database/inspection'
fullPath: '/ce-database/inspection'
preLoaderRoute: typeof AuthenticatedCeDatabaseInspectionImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/users/': {
id: '/_authenticated/users/'
path: '/users'
Expand All @@ -148,7 +258,15 @@ declare module '@tanstack/react-router' {
export const routeTree = rootRoute.addChildren({
IndexRoute,
AuthenticatedRoute: AuthenticatedRoute.addChildren({
AuthenticatedIrBoardRoute,
AuthenticatedProfileRoute,
AuthenticatedAdminAgenciesRoute,
AuthenticatedAdminProponentsRoute,
AuthenticatedAdminStaffRoute,
AuthenticatedAdminTopicsRoute,
AuthenticatedCeDatabaseCaseFilesRoute,
AuthenticatedCeDatabaseCompliantsRoute,
AuthenticatedCeDatabaseInspectionRoute,
AuthenticatedUsersIndexRoute,
}),
OidcCallbackRoute,
Expand Down Expand Up @@ -181,7 +299,15 @@ export const routeTree = rootRoute.addChildren({
"/_authenticated": {
"filePath": "_authenticated.tsx",
"children": [
"/_authenticated/ir-board",
"/_authenticated/profile",
"/_authenticated/admin/agencies",
"/_authenticated/admin/proponents",
"/_authenticated/admin/staff",
"/_authenticated/admin/topics",
"/_authenticated/ce-database/case-files",
"/_authenticated/ce-database/compliants",
"/_authenticated/ce-database/inspection",
"/_authenticated/users/"
]
},
Expand All @@ -194,6 +320,10 @@ export const routeTree = rootRoute.addChildren({
"/newpage": {
"filePath": "newpage.lazy.tsx"
},
"/_authenticated/ir-board": {
"filePath": "_authenticated/ir-board.tsx",
"parent": "/_authenticated"
},
"/_authenticated/profile": {
"filePath": "_authenticated/profile.tsx",
"parent": "/_authenticated"
Expand All @@ -204,6 +334,34 @@ export const routeTree = rootRoute.addChildren({
"/eao-plans/": {
"filePath": "eao-plans/index.tsx"
},
"/_authenticated/admin/agencies": {
"filePath": "_authenticated/admin/agencies.tsx",
"parent": "/_authenticated"
},
"/_authenticated/admin/proponents": {
"filePath": "_authenticated/admin/proponents.tsx",
"parent": "/_authenticated"
},
"/_authenticated/admin/staff": {
"filePath": "_authenticated/admin/staff.tsx",
"parent": "/_authenticated"
},
"/_authenticated/admin/topics": {
"filePath": "_authenticated/admin/topics.tsx",
"parent": "/_authenticated"
},
"/_authenticated/ce-database/case-files": {
"filePath": "_authenticated/ce-database/case-files.tsx",
"parent": "/_authenticated"
},
"/_authenticated/ce-database/compliants": {
"filePath": "_authenticated/ce-database/compliants.tsx",
"parent": "/_authenticated"
},
"/_authenticated/ce-database/inspection": {
"filePath": "_authenticated/ce-database/inspection.tsx",
"parent": "/_authenticated"
},
"/_authenticated/users/": {
"filePath": "_authenticated/users/index.tsx",
"parent": "/_authenticated"
Expand Down
5 changes: 5 additions & 0 deletions compliance-web/src/routes/_authenticated/admin/agencies.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/admin/agencies')({
component: () => <div>Hello /_authenticated/admin/agencies!</div>
})
5 changes: 5 additions & 0 deletions compliance-web/src/routes/_authenticated/admin/proponents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/admin/proponents')({
component: () => <div>Hello /_authenticated/admin/proponents!</div>
})
5 changes: 5 additions & 0 deletions compliance-web/src/routes/_authenticated/admin/staff.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/admin/staff')({
component: () => <div>Hello /_authenticated/admin/staff!</div>
})
5 changes: 5 additions & 0 deletions compliance-web/src/routes/_authenticated/admin/topics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/admin/topics')({
component: () => <div>Hello /_authenticated/admin/topics!</div>
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/ce-database/case-files')({
component: () => <div>Hello /_authenticated/ce-database/case-files!</div>
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/ce-database/compliants')({
component: () => <div>Hello /_authenticated/ce-database/compliants!</div>
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/ce-database/inspection')({
component: () => <div>Hello /_authenticated/ce-database/inspection!</div>
})
5 changes: 5 additions & 0 deletions compliance-web/src/routes/_authenticated/ir-board.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/_authenticated/ir-board')({
component: () => <div>Hello /_authenticated/ir-board!</div>
})
Loading

0 comments on commit 47fd588

Please sign in to comment.