2020-07-09 17:24:28 +02:00
|
|
|
import { RouteConfig } from "vue-router";
|
2021-06-16 14:39:43 +02:00
|
|
|
import { ImportedComponent } from "vue/types/options";
|
2021-10-10 16:24:12 +02:00
|
|
|
import { i18n } from "@/utils/i18n";
|
2020-07-09 17:24:28 +02:00
|
|
|
|
|
|
|
export enum DiscussionRouteName {
|
|
|
|
DISCUSSION_LIST = "DISCUSSION_LIST",
|
|
|
|
CREATE_DISCUSSION = "CREATE_DISCUSSION",
|
|
|
|
DISCUSSION = "DISCUSSION",
|
|
|
|
}
|
|
|
|
|
|
|
|
export const discussionRoutes: RouteConfig[] = [
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/discussions",
|
|
|
|
name: DiscussionRouteName.DISCUSSION_LIST,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "DiscussionsList" */ "@/views/Discussions/DiscussionsList.vue"
|
|
|
|
),
|
2020-07-09 17:24:28 +02:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Discussions list") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/discussions/new",
|
|
|
|
name: DiscussionRouteName.CREATE_DISCUSSION,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "CreateDiscussion" */ "@/views/Discussions/Create.vue"
|
|
|
|
),
|
2020-07-09 17:24:28 +02:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Create discussion") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/@:preferredUsername/c/:slug/:comment_id?",
|
|
|
|
name: DiscussionRouteName.DISCUSSION,
|
2021-06-16 14:39:43 +02:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Discussion" */ "@/views/Discussions/Discussion.vue"
|
|
|
|
),
|
2020-07-09 17:24:28 +02:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-07-09 17:24:28 +02:00
|
|
|
},
|
|
|
|
];
|