Skip to content

Commit

Permalink
Merge pull request #28 from bcgov/hot-fix
Browse files Browse the repository at this point in the history
Add dashboard layout for authenticated routes outside of registration
  • Loading branch information
jadmsaadaot authored Aug 13, 2024
2 parents 00df2d3 + a1e8c8a commit e17aadf
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 143 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export const Routes: RouteType[] = [
{
name: "Root",
path: "/",
},
{
name: "About",
path: "/aboutpage",
Expand Down
271 changes: 157 additions & 114 deletions submit-web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,27 @@ import { Route as OidcCallbackImport } from './routes/oidc-callback'
import { Route as ErrorImport } from './routes/error'
import { Route as AuthenticatedImport } from './routes/_authenticated'
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 AuthenticatedAdminLoginImport } from './routes/_authenticated/admin-login'
import { Route as AuthenticatedUsersIndexImport } from './routes/_authenticated/users/index'
import { Route as AuthenticatedProjectsIndexImport } from './routes/_authenticated/projects/index'
import { Route as AuthenticatedDashboardImport } from './routes/_authenticated/_dashboard'
import { Route as AuthenticatedRegistrationCreateAccountImport } from './routes/_authenticated/registration/create-account'
import { Route as AuthenticatedDashboardProfileImport } from './routes/_authenticated/_dashboard/profile'
import { Route as AuthenticatedDashboardUsersIndexImport } from './routes/_authenticated/_dashboard/users/index'
import { Route as AuthenticatedDashboardProjectsIndexImport } from './routes/_authenticated/_dashboard/projects/index'
import { Route as AuthenticatedDashboardEaoPlansIndexImport } from './routes/_authenticated/_dashboard/eao-plans/index'
import { Route as AuthenticatedDashboardEaoPlansPlanIdImport } from './routes/_authenticated/_dashboard/eao-plans/$planId'
import { Route as AuthenticatedRegistrationAccountAccountIdProjectsImport } from './routes/_authenticated/registration/account/$accountId/projects'

// Create Virtual Routes

const NewpageLazyImport = createFileRoute('/newpage')()
const AboutpageLazyImport = createFileRoute('/aboutpage')()
const AuthenticatedDashboardNewpageLazyImport = createFileRoute(
'/_authenticated/_dashboard/newpage',
)()
const AuthenticatedDashboardAboutpageLazyImport = createFileRoute(
'/_authenticated/_dashboard/aboutpage',
)()

// Create/Update Routes

const NewpageLazyRoute = NewpageLazyImport.update({
path: '/newpage',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./routes/newpage.lazy').then((d) => d.Route))

const AboutpageLazyRoute = AboutpageLazyImport.update({
path: '/aboutpage',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./routes/aboutpage.lazy').then((d) => d.Route))

const OidcCallbackRoute = OidcCallbackImport.update({
path: '/oidc-callback',
getParentRoute: () => rootRoute,
Expand All @@ -63,44 +58,72 @@ const IndexRoute = IndexImport.update({
getParentRoute: () => rootRoute,
} as any)

const EaoPlansIndexRoute = EaoPlansIndexImport.update({
path: '/eao-plans/',
getParentRoute: () => rootRoute,
} as any)

const EaoPlansPlanIdRoute = EaoPlansPlanIdImport.update({
path: '/eao-plans/$planId',
getParentRoute: () => rootRoute,
} as any)

const AuthenticatedProfileRoute = AuthenticatedProfileImport.update({
path: '/profile',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedAdminLoginRoute = AuthenticatedAdminLoginImport.update({
path: '/admin-login',
getParentRoute: () => AuthenticatedRoute,
} as any)

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

const AuthenticatedProjectsIndexRoute = AuthenticatedProjectsIndexImport.update(
{
path: '/projects/',
getParentRoute: () => AuthenticatedRoute,
} as any,
)
const AuthenticatedDashboardNewpageLazyRoute =
AuthenticatedDashboardNewpageLazyImport.update({
path: '/newpage',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any).lazy(() =>
import('./routes/_authenticated/_dashboard/newpage.lazy').then(
(d) => d.Route,
),
)

const AuthenticatedDashboardAboutpageLazyRoute =
AuthenticatedDashboardAboutpageLazyImport.update({
path: '/aboutpage',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any).lazy(() =>
import('./routes/_authenticated/_dashboard/aboutpage.lazy').then(
(d) => d.Route,
),
)

const AuthenticatedRegistrationCreateAccountRoute =
AuthenticatedRegistrationCreateAccountImport.update({
path: '/registration/create-account',
getParentRoute: () => AuthenticatedRoute,
} as any)

const AuthenticatedDashboardProfileRoute =
AuthenticatedDashboardProfileImport.update({
path: '/profile',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any)

const AuthenticatedDashboardUsersIndexRoute =
AuthenticatedDashboardUsersIndexImport.update({
path: '/users/',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any)

const AuthenticatedDashboardProjectsIndexRoute =
AuthenticatedDashboardProjectsIndexImport.update({
path: '/projects/',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any)

const AuthenticatedDashboardEaoPlansIndexRoute =
AuthenticatedDashboardEaoPlansIndexImport.update({
path: '/eao-plans/',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any)

const AuthenticatedDashboardEaoPlansPlanIdRoute =
AuthenticatedDashboardEaoPlansPlanIdImport.update({
path: '/eao-plans/$planId',
getParentRoute: () => AuthenticatedDashboardRoute,
} as any)

const AuthenticatedRegistrationAccountAccountIdProjectsRoute =
AuthenticatedRegistrationAccountAccountIdProjectsImport.update({
path: '/registration/account/$accountId/projects',
Expand Down Expand Up @@ -139,19 +162,12 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof OidcCallbackImport
parentRoute: typeof rootRoute
}
'/aboutpage': {
id: '/aboutpage'
path: '/aboutpage'
fullPath: '/aboutpage'
preLoaderRoute: typeof AboutpageLazyImport
parentRoute: typeof rootRoute
}
'/newpage': {
id: '/newpage'
path: '/newpage'
fullPath: '/newpage'
preLoaderRoute: typeof NewpageLazyImport
parentRoute: typeof rootRoute
'/_authenticated/_dashboard': {
id: '/_authenticated/_dashboard'
path: ''
fullPath: ''
preLoaderRoute: typeof AuthenticatedDashboardImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/admin-login': {
id: '/_authenticated/admin-login'
Expand All @@ -160,26 +176,12 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthenticatedAdminLoginImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/profile': {
id: '/_authenticated/profile'
'/_authenticated/_dashboard/profile': {
id: '/_authenticated/_dashboard/profile'
path: '/profile'
fullPath: '/profile'
preLoaderRoute: typeof AuthenticatedProfileImport
parentRoute: typeof AuthenticatedImport
}
'/eao-plans/$planId': {
id: '/eao-plans/$planId'
path: '/eao-plans/$planId'
fullPath: '/eao-plans/$planId'
preLoaderRoute: typeof EaoPlansPlanIdImport
parentRoute: typeof rootRoute
}
'/eao-plans/': {
id: '/eao-plans/'
path: '/eao-plans'
fullPath: '/eao-plans'
preLoaderRoute: typeof EaoPlansIndexImport
parentRoute: typeof rootRoute
preLoaderRoute: typeof AuthenticatedDashboardProfileImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/registration/create-account': {
id: '/_authenticated/registration/create-account'
Expand All @@ -188,19 +190,47 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthenticatedRegistrationCreateAccountImport
parentRoute: typeof AuthenticatedImport
}
'/_authenticated/projects/': {
id: '/_authenticated/projects/'
'/_authenticated/_dashboard/aboutpage': {
id: '/_authenticated/_dashboard/aboutpage'
path: '/aboutpage'
fullPath: '/aboutpage'
preLoaderRoute: typeof AuthenticatedDashboardAboutpageLazyImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/_dashboard/newpage': {
id: '/_authenticated/_dashboard/newpage'
path: '/newpage'
fullPath: '/newpage'
preLoaderRoute: typeof AuthenticatedDashboardNewpageLazyImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/_dashboard/eao-plans/$planId': {
id: '/_authenticated/_dashboard/eao-plans/$planId'
path: '/eao-plans/$planId'
fullPath: '/eao-plans/$planId'
preLoaderRoute: typeof AuthenticatedDashboardEaoPlansPlanIdImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/_dashboard/eao-plans/': {
id: '/_authenticated/_dashboard/eao-plans/'
path: '/eao-plans'
fullPath: '/eao-plans'
preLoaderRoute: typeof AuthenticatedDashboardEaoPlansIndexImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/_dashboard/projects/': {
id: '/_authenticated/_dashboard/projects/'
path: '/projects'
fullPath: '/projects'
preLoaderRoute: typeof AuthenticatedProjectsIndexImport
parentRoute: typeof AuthenticatedImport
preLoaderRoute: typeof AuthenticatedDashboardProjectsIndexImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/users/': {
id: '/_authenticated/users/'
'/_authenticated/_dashboard/users/': {
id: '/_authenticated/_dashboard/users/'
path: '/users'
fullPath: '/users'
preLoaderRoute: typeof AuthenticatedUsersIndexImport
parentRoute: typeof AuthenticatedImport
preLoaderRoute: typeof AuthenticatedDashboardUsersIndexImport
parentRoute: typeof AuthenticatedDashboardImport
}
'/_authenticated/registration/account/$accountId/projects': {
id: '/_authenticated/registration/account/$accountId/projects'
Expand All @@ -217,19 +247,21 @@ declare module '@tanstack/react-router' {
export const routeTree = rootRoute.addChildren({
IndexRoute,
AuthenticatedRoute: AuthenticatedRoute.addChildren({
AuthenticatedDashboardRoute: AuthenticatedDashboardRoute.addChildren({
AuthenticatedDashboardProfileRoute,
AuthenticatedDashboardAboutpageLazyRoute,
AuthenticatedDashboardNewpageLazyRoute,
AuthenticatedDashboardEaoPlansPlanIdRoute,
AuthenticatedDashboardEaoPlansIndexRoute,
AuthenticatedDashboardProjectsIndexRoute,
AuthenticatedDashboardUsersIndexRoute,
}),
AuthenticatedAdminLoginRoute,
AuthenticatedProfileRoute,
AuthenticatedRegistrationCreateAccountRoute,
AuthenticatedProjectsIndexRoute,
AuthenticatedUsersIndexRoute,
AuthenticatedRegistrationAccountAccountIdProjectsRoute,
}),
ErrorRoute,
OidcCallbackRoute,
AboutpageLazyRoute,
NewpageLazyRoute,
EaoPlansPlanIdRoute,
EaoPlansIndexRoute,
})

/* prettier-ignore-end */
Expand All @@ -243,11 +275,7 @@ export const routeTree = rootRoute.addChildren({
"/",
"/_authenticated",
"/error",
"/oidc-callback",
"/aboutpage",
"/newpage",
"/eao-plans/$planId",
"/eao-plans/"
"/oidc-callback"
]
},
"/": {
Expand All @@ -256,11 +284,9 @@ export const routeTree = rootRoute.addChildren({
"/_authenticated": {
"filePath": "_authenticated.tsx",
"children": [
"/_authenticated/_dashboard",
"/_authenticated/admin-login",
"/_authenticated/profile",
"/_authenticated/registration/create-account",
"/_authenticated/projects/",
"/_authenticated/users/",
"/_authenticated/registration/account/$accountId/projects"
]
},
Expand All @@ -270,37 +296,54 @@ export const routeTree = rootRoute.addChildren({
"/oidc-callback": {
"filePath": "oidc-callback.tsx"
},
"/aboutpage": {
"filePath": "aboutpage.lazy.tsx"
},
"/newpage": {
"filePath": "newpage.lazy.tsx"
"/_authenticated/_dashboard": {
"filePath": "_authenticated/_dashboard.tsx",
"parent": "/_authenticated",
"children": [
"/_authenticated/_dashboard/profile",
"/_authenticated/_dashboard/aboutpage",
"/_authenticated/_dashboard/newpage",
"/_authenticated/_dashboard/eao-plans/$planId",
"/_authenticated/_dashboard/eao-plans/",
"/_authenticated/_dashboard/projects/",
"/_authenticated/_dashboard/users/"
]
},
"/_authenticated/admin-login": {
"filePath": "_authenticated/admin-login.tsx",
"parent": "/_authenticated"
},
"/_authenticated/profile": {
"filePath": "_authenticated/profile.tsx",
"parent": "/_authenticated"
},
"/eao-plans/$planId": {
"filePath": "eao-plans/$planId.tsx"
},
"/eao-plans/": {
"filePath": "eao-plans/index.tsx"
"/_authenticated/_dashboard/profile": {
"filePath": "_authenticated/_dashboard/profile.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/registration/create-account": {
"filePath": "_authenticated/registration/create-account.tsx",
"parent": "/_authenticated"
},
"/_authenticated/projects/": {
"filePath": "_authenticated/projects/index.tsx",
"parent": "/_authenticated"
"/_authenticated/_dashboard/aboutpage": {
"filePath": "_authenticated/_dashboard/aboutpage.lazy.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/users/": {
"filePath": "_authenticated/users/index.tsx",
"parent": "/_authenticated"
"/_authenticated/_dashboard/newpage": {
"filePath": "_authenticated/_dashboard/newpage.lazy.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/_dashboard/eao-plans/$planId": {
"filePath": "_authenticated/_dashboard/eao-plans/$planId.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/_dashboard/eao-plans/": {
"filePath": "_authenticated/_dashboard/eao-plans/index.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/_dashboard/projects/": {
"filePath": "_authenticated/_dashboard/projects/index.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/_dashboard/users/": {
"filePath": "_authenticated/_dashboard/users/index.tsx",
"parent": "/_authenticated/_dashboard"
},
"/_authenticated/registration/account/$accountId/projects": {
"filePath": "_authenticated/registration/account/$accountId/projects.tsx",
Expand Down
Loading

0 comments on commit e17aadf

Please sign in to comment.