From c4699b7ce87cf5924335180b2bd7e882f65d4d49 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Tue, 8 Oct 2024 22:11:50 -0400 Subject: [PATCH] Fix children routes --- app/assets/router/routes.ts | 30 +++++++++++++++++++++--------- dist/router/routes.d.ts | 34 ++++++++++++++++++++-------------- dist/routes.cjs | 2 +- dist/routes.js | 29 ++++++++++++++++++++--------- 4 files changed, 62 insertions(+), 33 deletions(-) diff --git a/app/assets/router/routes.ts b/app/assets/router/routes.ts index 34f3869..a179ac0 100644 --- a/app/assets/router/routes.ts +++ b/app/assets/router/routes.ts @@ -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') } @@ -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', @@ -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', @@ -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', diff --git a/dist/router/routes.d.ts b/dist/router/routes.d.ts index 927d39a..b811ec3 100644 --- a/dist/router/routes.d.ts +++ b/dist/router/routes.d.ts @@ -24,7 +24,6 @@ declare const AdminActivitiesRoutes: { }[]; declare const AdminGroupsRoutes: { path: string; - name: string; meta: { auth: { redirect: { @@ -32,16 +31,14 @@ declare const AdminGroupsRoutes: { }; }; }; - component: () => Promise; children: { path: string; name: string; - component: () => Promise; + component: () => Promise; }[]; }[]; declare const AdminPermissionsRoutes: { path: string; - name: string; meta: { auth: { redirect: { @@ -49,16 +46,14 @@ declare const AdminPermissionsRoutes: { }; }; }; - component: () => Promise; children: { path: string; name: string; - component: () => Promise; + component: () => Promise; }[]; }[]; declare const AdminRolesRoutes: { path: string; - name: string; meta: { auth: { redirect: { @@ -66,16 +61,14 @@ declare const AdminRolesRoutes: { }; }; }; - component: () => Promise; children: { path: string; name: string; - component: () => Promise; + component: () => Promise; }[]; }[]; declare const AdminUsersRoutes: { path: string; - name: string; meta: { auth: { redirect: { @@ -83,14 +76,13 @@ declare const AdminUsersRoutes: { }; }; }; - component: () => Promise; children: { path: string; name: string; - component: () => Promise; + component: () => Promise; }[]; }[]; -declare const AdminRoutes: { +declare const AdminRoutes: ({ path: string; name: string; meta: { @@ -101,6 +93,20 @@ declare const AdminRoutes: { }; }; component: () => Promise; -}[]; +} | { + path: string; + meta: { + auth: { + redirect: { + name: string; + }; + }; + }; + children: { + path: string; + name: string; + component: () => Promise; + }[]; +})[]; export default AdminRoutes; export { AdminDashboardRoutes, AdminActivitiesRoutes, AdminGroupsRoutes, AdminPermissionsRoutes, AdminRolesRoutes, AdminUsersRoutes }; diff --git a/dist/routes.cjs b/dist/routes.cjs index 94597c8..3f3803d 100644 --- a/dist/routes.cjs +++ b/dist/routes.cjs @@ -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; diff --git a/dist/routes.js b/dist/routes.js index b839bc1..2f261cb 100644 --- a/dist/routes.js +++ b/dist/routes.js @@ -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") } @@ -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} @@ -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} @@ -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}