2020-07-09 17:24:28 +02:00
|
|
|
import { RouteConfig, Route } from "vue-router";
|
2021-06-16 14:39:43 +02:00
|
|
|
import { ImportedComponent } from "vue/types/options";
|
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-02-24 19:06:48 +01:00
|
|
|
TIMELINE = "TIMELINE",
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
|
2021-06-16 14:39:43 +02:00
|
|
|
const resourceFolder = (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Resources/ResourceFolder.vue");
|
2021-06-16 14:39:43 +02:00
|
|
|
const groupEvents = (): Promise<ImportedComponent> =>
|
2020-08-31 12:40:30 +02:00
|
|
|
import(/* webpackChunkName: "groupEvents" */ "@/views/Event/GroupEvents.vue");
|
2020-02-18 08:57:00 +01:00
|
|
|
|
|
|
|
export const groupsRoutes: RouteConfig[] = [
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/todo-lists",
|
|
|
|
name: GroupsRouteName.TODO_LISTS,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
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,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
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,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Todos/Todo.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,
|
|
|
|
props: { path: "/" },
|
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",
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Group/Settings.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,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
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,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
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,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
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",
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Posts/Edit.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",
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Posts/Edit.vue"),
|
|
|
|
props: (route: Route): Record<string, unknown> => ({
|
|
|
|
...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",
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Posts/Post.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",
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("@/views/Posts/List.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",
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
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-02-24 19:06:48 +01:00
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/timeline",
|
|
|
|
name: GroupsRouteName.TIMELINE,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2021-02-24 19:06:48 +01:00
|
|
|
import("@/views/Group/Timeline.vue"),
|
|
|
|
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
|
|
|
];
|