Skip to content

Commit

Permalink
Fix children routes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 9, 2024
1 parent 0881f4c commit c4699b7
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 33 deletions.
30 changes: 21 additions & 9 deletions app/assets/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ const AdminActivitiesRoutes = [
const AdminGroupsRoutes = [
{
path: 'groups',
name: 'admin.groups',
meta: {
auth: {
redirect: { name: 'account.login' }
}
},
component: () => import('../views/GroupsView.vue'),
children: [
{
path: 'g/:slug', // groups/g/{slug}
path: '',
name: 'admin.groups',
component: () => import('../views/GroupsView.vue')
},
{
path: 'g/:slug',
name: 'admin.group',
component: () => import('../views/GroupView.vue')
}
Expand All @@ -47,14 +50,17 @@ const AdminGroupsRoutes = [
const AdminPermissionsRoutes = [
{
path: 'permissions',
name: 'admin.permissions',
meta: {
auth: {
redirect: { name: 'account.login' }
}
},
component: () => import('../views/PermissionsView.vue'),
children: [
{
path: '',
name: 'admin.permissions',
component: () => import('../views/PermissionsView.vue')
},
{
path: 'p/:id', // permissions/p/{id}
name: 'admin.permission',
Expand All @@ -66,14 +72,17 @@ const AdminPermissionsRoutes = [
const AdminRolesRoutes = [
{
path: 'roles',
name: 'admin.roles',
meta: {
auth: {
redirect: { name: 'account.login' }
}
},
component: () => import('../views/RolesView.vue'),
children: [
{
path: '',
name: 'admin.roles',
component: () => import('../views/RolesView.vue')
},
{
path: 'r/:slug', // roles/r/{slug}
name: 'admin.role',
Expand All @@ -86,14 +95,17 @@ const AdminRolesRoutes = [
const AdminUsersRoutes = [
{
path: 'users',
name: 'admin.users',
meta: {
auth: {
redirect: { name: 'account.login' }
}
},
component: () => import('../views/UsersView.vue'),
children: [
{
path: '',
name: 'admin.users',
component: () => import('../views/UsersView.vue')
},
{
path: 'u/:user_name', // users/u/{user_name}
name: 'admin.user',
Expand Down
34 changes: 20 additions & 14 deletions dist/router/routes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,73 +24,65 @@ declare const AdminActivitiesRoutes: {
}[];
declare const AdminGroupsRoutes: {
path: string;
name: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/GroupsView.vue")>;
children: {
path: string;
name: string;
component: () => Promise<typeof import("../views/GroupView.vue")>;
component: () => Promise<typeof import("../views/GroupsView.vue")>;
}[];
}[];
declare const AdminPermissionsRoutes: {
path: string;
name: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/PermissionsView.vue")>;
children: {
path: string;
name: string;
component: () => Promise<typeof import("../views/PermissionView.vue")>;
component: () => Promise<typeof import("../views/PermissionsView.vue")>;
}[];
}[];
declare const AdminRolesRoutes: {
path: string;
name: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/RolesView.vue")>;
children: {
path: string;
name: string;
component: () => Promise<typeof import("../views/RoleView.vue")>;
component: () => Promise<typeof import("../views/RolesView.vue")>;
}[];
}[];
declare const AdminUsersRoutes: {
path: string;
name: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
component: () => Promise<typeof import("../views/UsersView.vue")>;
children: {
path: string;
name: string;
component: () => Promise<typeof import("../views/UserView.vue")>;
component: () => Promise<typeof import("../views/UsersView.vue")>;
}[];
}[];
declare const AdminRoutes: {
declare const AdminRoutes: ({
path: string;
name: string;
meta: {
Expand All @@ -101,6 +93,20 @@ declare const AdminRoutes: {
};
};
component: () => Promise<typeof import("../views/DashboardView.vue")>;
}[];
} | {
path: string;
meta: {
auth: {
redirect: {
name: string;
};
};
};
children: {
path: string;
name: string;
component: () => Promise<typeof import("../views/GroupsView.vue")>;
}[];
})[];
export default AdminRoutes;
export { AdminDashboardRoutes, AdminActivitiesRoutes, AdminGroupsRoutes, AdminPermissionsRoutes, AdminRolesRoutes, AdminUsersRoutes };
2 changes: 1 addition & 1 deletion dist/routes.cjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"dashboard",name:"admin.dashboard",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./DashboardView-D7CFsOl5.cjs"))}],n=[{path:"activities",name:"admin.activities",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./ActivitiesView-DiFutZNz.cjs"))}],o=[{path:"groups",name:"admin.groups",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./GroupsView-DuagIXJ4.cjs")),children:[{path:"g/:slug",name:"admin.group",component:()=>Promise.resolve().then(()=>require("./GroupView-Cvy93KmK.cjs"))}]}],t=[{path:"permissions",name:"admin.permissions",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./PermissionsView-Dz0SDtvc.cjs")),children:[{path:"p/:id",name:"admin.permission",component:()=>Promise.resolve().then(()=>require("./PermissionView-CZvtwzCa.cjs"))}]}],i=[{path:"roles",name:"admin.roles",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./RolesView-BpLV9I3k.cjs")),children:[{path:"r/:slug",name:"admin.role",component:()=>Promise.resolve().then(()=>require("./RoleView-D859yBSb.cjs"))}]}],s=[{path:"users",name:"admin.users",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./UsersView-D84SVkdw.cjs")),children:[{path:"u/:user_name",name:"admin.user",component:()=>Promise.resolve().then(()=>require("./UserView-DI4zS3sA.cjs"))}]}],r=[...e,...n,...o,...t,...i,...s];exports.AdminActivitiesRoutes=n;exports.AdminDashboardRoutes=e;exports.AdminGroupsRoutes=o;exports.AdminPermissionsRoutes=t;exports.AdminRolesRoutes=i;exports.AdminUsersRoutes=s;exports.default=r;
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"dashboard",name:"admin.dashboard",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./DashboardView-D7CFsOl5.cjs"))}],n=[{path:"activities",name:"admin.activities",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./ActivitiesView-DiFutZNz.cjs"))}],o=[{path:"groups",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.groups",component:()=>Promise.resolve().then(()=>require("./GroupsView-DuagIXJ4.cjs"))},{path:"g/:slug",name:"admin.group",component:()=>Promise.resolve().then(()=>require("./GroupView-Cvy93KmK.cjs"))}]}],t=[{path:"permissions",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.permissions",component:()=>Promise.resolve().then(()=>require("./PermissionsView-Dz0SDtvc.cjs"))},{path:"p/:id",name:"admin.permission",component:()=>Promise.resolve().then(()=>require("./PermissionView-CZvtwzCa.cjs"))}]}],i=[{path:"roles",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.roles",component:()=>Promise.resolve().then(()=>require("./RolesView-BpLV9I3k.cjs"))},{path:"r/:slug",name:"admin.role",component:()=>Promise.resolve().then(()=>require("./RoleView-D859yBSb.cjs"))}]}],s=[{path:"users",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.users",component:()=>Promise.resolve().then(()=>require("./UsersView-D84SVkdw.cjs"))},{path:"u/:user_name",name:"admin.user",component:()=>Promise.resolve().then(()=>require("./UserView-DI4zS3sA.cjs"))}]}],r=[...e,...n,...o,...t,...i,...s];exports.AdminActivitiesRoutes=n;exports.AdminDashboardRoutes=e;exports.AdminGroupsRoutes=o;exports.AdminPermissionsRoutes=t;exports.AdminRolesRoutes=i;exports.AdminUsersRoutes=s;exports.default=r;
29 changes: 20 additions & 9 deletions dist/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ const n = [
], e = [
{
path: "groups",
name: "admin.groups",
meta: {
auth: {
redirect: { name: "account.login" }
}
},
component: () => import("./GroupsView-Bm9TF1U3.js"),
children: [
{
path: "",
name: "admin.groups",
component: () => import("./GroupsView-Bm9TF1U3.js")
},
{
path: "g/:slug",
// groups/g/{slug}
name: "admin.group",
component: () => import("./GroupView-Br2XanZz.js")
}
Expand All @@ -42,14 +44,17 @@ const n = [
], o = [
{
path: "permissions",
name: "admin.permissions",
meta: {
auth: {
redirect: { name: "account.login" }
}
},
component: () => import("./PermissionsView-C-572ZCS.js"),
children: [
{
path: "",
name: "admin.permissions",
component: () => import("./PermissionsView-C-572ZCS.js")
},
{
path: "p/:id",
// permissions/p/{id}
Expand All @@ -61,14 +66,17 @@ const n = [
], a = [
{
path: "roles",
name: "admin.roles",
meta: {
auth: {
redirect: { name: "account.login" }
}
},
component: () => import("./RolesView-Br0Mjup7.js"),
children: [
{
path: "",
name: "admin.roles",
component: () => import("./RolesView-Br0Mjup7.js")
},
{
path: "r/:slug",
// roles/r/{slug}
Expand All @@ -80,14 +88,17 @@ const n = [
], m = [
{
path: "users",
name: "admin.users",
meta: {
auth: {
redirect: { name: "account.login" }
}
},
component: () => import("./UsersView-BudQS2wW.js"),
children: [
{
path: "",
name: "admin.users",
component: () => import("./UsersView-BudQS2wW.js")
},
{
path: "u/:user_name",
// users/u/{user_name}
Expand Down

0 comments on commit c4699b7

Please sign in to comment.