2022-07-12 10:55:28 +02:00
|
|
|
import { RouteLocationNormalized, RouteRecordRaw } from "vue-router";
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
export enum GroupsRouteName {
|
|
|
|
TODO_LISTS = "TODO_LISTS",
|
|
|
|
TODO_LIST = "TODO_LIST",
|
|
|
|
TODO = "TODO",
|
|
|
|
GROUP_SETTINGS = "GROUP_SETTINGS",
|
|
|
|
GROUP_PUBLIC_SETTINGS = "GROUP_PUBLIC_SETTINGS",
|
|
|
|
GROUP_MEMBERS_SETTINGS = "GROUP_MEMBERS_SETTINGS",
|
2021-01-20 18:16:44 +01:00
|
|
|
GROUP_FOLLOWERS_SETTINGS = "GROUP_FOLLOWERS_SETTINGS",
|
2020-02-18 08:57:00 +01:00
|
|
|
RESOURCES = "RESOURCES",
|
|
|
|
RESOURCE_FOLDER_ROOT = "RESOURCE_FOLDER_ROOT",
|
|
|
|
RESOURCE_FOLDER = "RESOURCE_FOLDER",
|
2020-07-09 17:24:28 +02:00
|
|
|
POST_CREATE = "POST_CREATE",
|
|
|
|
POST_EDIT = "POST_EDIT",
|
|
|
|
POST = "POST",
|
|
|
|
POSTS = "POSTS",
|
2020-08-31 12:40:30 +02:00
|
|
|
GROUP_EVENTS = "GROUP_EVENTS",
|
2020-11-06 11:34:32 +01:00
|
|
|
GROUP_JOIN = "GROUP_JOIN",
|
2021-10-25 16:53:46 +02:00
|
|
|
GROUP_FOLLOW = "GROUP_FOLLOW",
|
2021-02-24 19:06:48 +01:00
|
|
|
TIMELINE = "TIMELINE",
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const resourceFolder = (): Promise<any> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Resources/ResourceFolder.vue");
|
2022-07-12 10:55:28 +02:00
|
|
|
const groupEvents = (): Promise<any> => import("@/views/Event/GroupEvents.vue");
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
export const groupsRoutes: RouteRecordRaw[] = [
|
2020-02-18 08:57:00 +01:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/todo-lists",
|
|
|
|
name: GroupsRouteName.TODO_LISTS,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Todos/TodoLists.vue"),
|
2020-02-18 08:57:00 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/todo-lists/:id",
|
|
|
|
name: GroupsRouteName.TODO_LIST,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Todos/TodoList.vue"),
|
2020-02-18 08:57:00 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/todo/:todoId",
|
|
|
|
name: GroupsRouteName.TODO,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Todos/TodoView.vue"),
|
2020-02-18 08:57:00 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/resources",
|
|
|
|
name: GroupsRouteName.RESOURCE_FOLDER_ROOT,
|
|
|
|
component: resourceFolder,
|
2022-07-12 10:55:28 +02:00
|
|
|
props: (to) => ({
|
|
|
|
path: "/",
|
|
|
|
preferredUsername: to.params.preferredUsername,
|
|
|
|
}),
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/resources/:path+",
|
|
|
|
name: GroupsRouteName.RESOURCE_FOLDER,
|
|
|
|
component: resourceFolder,
|
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/settings",
|
2022-08-26 16:08:58 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Group/SettingsView.vue"),
|
2020-02-18 08:57:00 +01:00
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
redirect: { name: GroupsRouteName.GROUP_PUBLIC_SETTINGS },
|
|
|
|
name: GroupsRouteName.GROUP_SETTINGS,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "public",
|
|
|
|
name: GroupsRouteName.GROUP_PUBLIC_SETTINGS,
|
2022-07-12 10:55:28 +02:00
|
|
|
props: true,
|
|
|
|
component: (): Promise<any> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("../views/Group/GroupSettings.vue"),
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "members",
|
|
|
|
name: GroupsRouteName.GROUP_MEMBERS_SETTINGS,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("../views/Group/GroupMembers.vue"),
|
2020-02-18 08:57:00 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { announcer: { skip: true } },
|
2020-02-18 08:57:00 +01:00
|
|
|
},
|
2021-01-20 18:16:44 +01:00
|
|
|
{
|
|
|
|
path: "followers",
|
|
|
|
name: GroupsRouteName.GROUP_FOLLOWERS_SETTINGS,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> =>
|
2021-01-20 18:16:44 +01:00
|
|
|
import("../views/Group/GroupFollowers.vue"),
|
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { announcer: { skip: true } },
|
2021-01-20 18:16:44 +01:00
|
|
|
},
|
2020-02-18 08:57:00 +01:00
|
|
|
],
|
|
|
|
},
|
2020-07-09 17:24:28 +02:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/p/new",
|
2022-08-26 16:08:58 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Posts/EditView.vue"),
|
2020-07-09 17:24:28 +02:00
|
|
|
props: true,
|
|
|
|
name: GroupsRouteName.POST_CREATE,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/p/:slug/edit",
|
2022-08-26 16:08:58 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Posts/EditView.vue"),
|
2022-07-12 10:55:28 +02:00
|
|
|
props: (route: RouteLocationNormalized): Record<string, unknown> => ({
|
2020-11-30 10:24:11 +01:00
|
|
|
...route.params,
|
|
|
|
...{ isUpdate: true },
|
|
|
|
}),
|
2020-07-09 17:24:28 +02:00
|
|
|
name: GroupsRouteName.POST_EDIT,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/p/:slug",
|
2022-08-26 16:08:58 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Posts/PostView.vue"),
|
2020-07-09 17:24:28 +02:00
|
|
|
props: true,
|
|
|
|
name: GroupsRouteName.POST,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: false, announcer: { skip: true } },
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/p",
|
2022-08-26 16:08:58 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Posts/ListView.vue"),
|
2020-07-09 17:24:28 +02:00
|
|
|
props: true,
|
|
|
|
name: GroupsRouteName.POSTS,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: false, announcer: { skip: true } },
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
2020-08-31 12:40:30 +02:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/events",
|
|
|
|
component: groupEvents,
|
|
|
|
props: true,
|
|
|
|
name: GroupsRouteName.GROUP_EVENTS,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: false, announcer: { skip: true } },
|
2020-11-06 11:34:32 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/join",
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/components/Group/JoinGroupWithAccount.vue"),
|
2020-11-06 11:34:32 +01:00
|
|
|
props: true,
|
|
|
|
name: GroupsRouteName.GROUP_JOIN,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: false, announcer: { skip: true } },
|
2020-08-31 12:40:30 +02:00
|
|
|
},
|
2021-10-25 16:53:46 +02:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/follow",
|
2022-07-12 10:55:28 +02:00
|
|
|
component: (): Promise<any> =>
|
2021-10-25 16:53:46 +02:00
|
|
|
import("@/components/Group/JoinGroupWithAccount.vue"),
|
|
|
|
props: true,
|
|
|
|
name: GroupsRouteName.GROUP_FOLLOW,
|
|
|
|
meta: { requiredAuth: false, announcer: { skip: true } },
|
|
|
|
},
|
2021-02-24 19:06:48 +01:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/timeline",
|
|
|
|
name: GroupsRouteName.TIMELINE,
|
2022-08-26 16:08:58 +02:00
|
|
|
component: (): Promise<any> => import("@/views/Group/TimelineView.vue"),
|
2021-02-24 19:06:48 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2021-02-24 19:06:48 +01:00
|
|
|
},
|
2020-02-18 08:57:00 +01:00
|
|
|
];
|