File tree Expand file tree Collapse file tree 5 files changed +27
-23
lines changed
Expand file tree Collapse file tree 5 files changed +27
-23
lines changed Original file line number Diff line number Diff line change 1+ import { ClusterLayout } from '@/features/cluster/ClusterLayout' ;
2+ import { getClusterInfoQueryOptions } from '@/features/cluster/queries/getClusterInfoQuery' ;
3+ import { clustersLayoutRoute } from '@/features/clusters/routes' ;
4+ import { createRoute } from '@tanstack/react-router' ;
5+
6+ export const clusterLayoutRoute = createRoute ( {
7+ getParentRoute : ( ) => clustersLayoutRoute ,
8+ path : '$clusterId' ,
9+ component : ClusterLayout ,
10+ beforeLoad : async ( { context, params } ) => {
11+ return {
12+ cluster : await context . queryClient . ensureQueryData ( getClusterInfoQueryOptions ( params . clusterId ) ) ,
13+ } ;
14+ } ,
15+ } ) ;
Original file line number Diff line number Diff line change 11import { defaultInstanceRouteUpOne } from '@/config/constants' ;
22import { ClusterInstanceSignIn } from '@/features/auth/ClusterInstanceSignIn' ;
3- import { ClusterLayout } from '@/features/cluster/ClusterLayout ' ;
3+ import { clusterLayoutRoute } from '@/features/cluster/clusterLayoutRoute ' ;
44import { ClusterSetPassword } from '@/features/cluster/ClusterSetPassword' ;
55import { ClusterIndex } from '@/features/cluster/index' ;
6- import { getClusterInfoQueryOptions } from '@/features/cluster/queries/getClusterInfoQuery' ;
7- import { clustersLayoutRoute } from '@/features/clusters/routes' ;
86import { createRoute , redirect } from '@tanstack/react-router' ;
97
10- export const clusterLayoutRoute = createRoute ( {
11- getParentRoute : ( ) => clustersLayoutRoute ,
12- path : '$clusterId' ,
13- component : ClusterLayout ,
14- beforeLoad : async ( { context, params } ) => {
15- return {
16- cluster : await context . queryClient . ensureQueryData ( getClusterInfoQueryOptions ( params . clusterId ) ) ,
17- } ;
18- } ,
19- } ) ;
20-
218const clusterIndexRoute = createRoute ( {
229 getParentRoute : ( ) => clusterLayoutRoute ,
2310 path : 'instances' ,
Original file line number Diff line number Diff line change 1+ import { clusterLayoutRoute } from '@/features/cluster/clusterLayoutRoute' ;
12import { ClustersList as ClusterList } from '@/features/clusters/ClustersList' ;
23import { UpsertCluster } from '@/features/clusters/upsert' ;
34import { orgLayoutRoute } from '@/features/organization/routes' ;
@@ -21,8 +22,8 @@ const newClusterRoute = createRoute({
2122} ) ;
2223
2324const editClusterRoute = createRoute ( {
24- getParentRoute : ( ) => orgLayoutRoute ,
25- path : '$clusterId /edit' ,
25+ getParentRoute : ( ) => clusterLayoutRoute ,
26+ path : '/edit' ,
2627 component : UpsertCluster ,
2728} ) ;
2829
Original file line number Diff line number Diff line change 1- import { clusterLayoutRoute } from '@/features/cluster/routes' ;
2- import { InstanceLayout } from '@/features/instance/InstanceLayout' ;
1+ import { clusterLayoutRoute } from '@/features/cluster/clusterLayoutRoute' ;
32import { getInstanceInfoQueryOptions } from '@/features/cluster/queries/getInstanceInfoQuery' ;
3+ import { InstanceLayout } from '@/features/instance/InstanceLayout' ;
44import { buildRedirectInSearch } from '@/lib/urls/buildRedirectInSearch' ;
55import { dashboardLayout } from '@/router/dashboardRoute' ;
66import { createRoute , redirect } from '@tanstack/react-router' ;
Original file line number Diff line number Diff line change 11import { isLocalStudio } from '@/config/constants' ;
2- import { rootRoute } from '@/router/rootRoute' ;
32import { authRouteTree , localAuthRoutes } from '@/features/auth/routes' ;
4- import { dashboardLayout } from '@/router/dashboardRoute' ;
3+ import { clusterLayoutRoute } from '@/features/cluster/clusterLayoutRoute' ;
4+ import { clusterRoutes } from '@/features/cluster/routes' ;
5+ import { clustersLayoutRoute , clustersRoutes } from '@/features/clusters/routes' ;
56import { createInstanceRouteTree } from '@/features/instance/routes' ;
6- import { orgsLayoutRoute , orgsRoutes } from '@/features/organizations/routes' ;
77import { orgLayoutRoute , orgRoutes } from '@/features/organization/routes' ;
8- import { clustersLayoutRoute , clustersRoutes } from '@/features/clusters/routes' ;
9- import { clusterLayoutRoute , clusterRoutes } from '@/features/cluster/routes' ;
8+ import { orgsLayoutRoute , orgsRoutes } from '@/features/organizations/routes' ;
109import { profileRoutes } from '@/features/profile/routes' ;
10+ import { dashboardLayout } from '@/router/dashboardRoute' ;
11+ import { rootRoute } from '@/router/rootRoute' ;
1112
1213export const rootRouteTree = isLocalStudio
1314 ? rootRoute . addChildren ( [
You can’t perform that action at this time.
0 commit comments