2021-10-10 16:24:12 +02:00
|
|
|
import { i18n } from "@/utils/i18n";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { RouteLocationNormalized, RouteRecordRaw } from "vue-router";
|
2019-02-22 14:55:47 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const t = i18n.global.t;
|
|
|
|
|
2022-08-26 16:08:58 +02:00
|
|
|
const participations = () => import("@/views/Event/ParticipantsView.vue");
|
|
|
|
const editEvent = () => import("@/views/Event/EditView.vue");
|
|
|
|
const event = () => import("@/views/Event/EventView.vue");
|
|
|
|
const myEvents = () => import("@/views/Event/MyEventsView.vue");
|
2019-05-31 15:13:07 +02:00
|
|
|
|
2019-02-22 14:55:47 +01:00
|
|
|
export enum EventRouteName {
|
2020-02-18 08:57:00 +01:00
|
|
|
EVENT_LIST = "EventList",
|
|
|
|
CREATE_EVENT = "CreateEvent",
|
|
|
|
MY_EVENTS = "MyEvents",
|
|
|
|
EDIT_EVENT = "EditEvent",
|
2020-04-23 00:27:09 +02:00
|
|
|
DUPLICATE_EVENT = "DuplicateEvent",
|
2020-02-18 08:57:00 +01:00
|
|
|
PARTICIPATIONS = "Participations",
|
|
|
|
EVENT = "Event",
|
|
|
|
EVENT_PARTICIPATE_WITH_ACCOUNT = "EVENT_PARTICIPATE_WITH_ACCOUNT",
|
|
|
|
EVENT_PARTICIPATE_WITHOUT_ACCOUNT = "EVENT_PARTICIPATE_WITHOUT_ACCOUNT",
|
|
|
|
EVENT_PARTICIPATE_LOGGED_OUT = "EVENT_PARTICIPATE_LOGGED_OUT",
|
|
|
|
EVENT_PARTICIPATE_CONFIRM = "EVENT_PARTICIPATE_CONFIRM",
|
|
|
|
TAG = "Tag",
|
2019-02-22 14:55:47 +01:00
|
|
|
}
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
export const eventRoutes: RouteRecordRaw[] = [
|
2019-02-22 14:55:47 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/create",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: EventRouteName.CREATE_EVENT,
|
2019-09-02 14:35:50 +02:00
|
|
|
component: editEvent,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
2022-07-12 10:55:28 +02:00
|
|
|
announcer: { message: (): string => t("Create event") as string },
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
2019-02-22 14:55:47 +01:00
|
|
|
},
|
2019-09-18 17:32:37 +02:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/me",
|
2019-09-18 17:32:37 +02:00
|
|
|
name: EventRouteName.MY_EVENTS,
|
|
|
|
component: myEvents,
|
2021-11-02 19:47:54 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
2022-07-12 10:55:28 +02:00
|
|
|
announcer: { message: (): string => t("My events") as string },
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
2019-09-18 17:32:37 +02:00
|
|
|
},
|
2019-02-22 14:55:47 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/edit/:eventId",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: EventRouteName.EDIT_EVENT,
|
2019-09-02 14:35:50 +02:00
|
|
|
component: editEvent,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2022-07-12 10:55:28 +02:00
|
|
|
props: (route: RouteLocationNormalized): Record<string, unknown> => {
|
2020-11-30 10:24:11 +01:00
|
|
|
return { ...route.params, ...{ isUpdate: true } };
|
|
|
|
},
|
2020-04-23 00:27:09 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/events/duplicate/:eventId",
|
|
|
|
name: EventRouteName.DUPLICATE_EVENT,
|
|
|
|
component: editEvent,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announce: { skip: true } },
|
2022-07-12 10:55:28 +02:00
|
|
|
props: (route: RouteLocationNormalized): Record<string, unknown> => ({
|
2020-11-27 19:27:44 +01:00
|
|
|
...route.params,
|
|
|
|
...{ isDuplicate: true },
|
|
|
|
}),
|
2019-02-22 14:55:47 +01:00
|
|
|
},
|
2019-09-20 18:22:03 +02:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/:eventId/participations",
|
2019-09-20 18:22:03 +02:00
|
|
|
name: EventRouteName.PARTICIPATIONS,
|
|
|
|
component: participations,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2019-09-20 18:22:03 +02:00
|
|
|
props: true,
|
|
|
|
},
|
2019-02-22 14:55:47 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/:uuid",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: EventRouteName.EVENT,
|
2019-05-31 15:13:07 +02:00
|
|
|
component: event,
|
2019-02-22 14:55:47 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: { requiredAuth: false, announcer: { skip: true } },
|
2019-02-22 14:55:47 +01:00
|
|
|
},
|
2019-12-20 13:04:34 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/:uuid/participate",
|
2019-12-20 13:04:34 +01:00
|
|
|
name: EventRouteName.EVENT_PARTICIPATE_LOGGED_OUT,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: () =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("../components/Participation/UnloggedParticipation.vue"),
|
2019-12-20 13:04:34 +01:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
announcer: {
|
2022-07-12 10:55:28 +02:00
|
|
|
message: (): string => t("Unlogged participation") as string,
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
|
|
|
},
|
2019-12-20 13:04:34 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/:uuid/participate/with-account",
|
2019-12-20 13:04:34 +01:00
|
|
|
name: EventRouteName.EVENT_PARTICIPATE_WITH_ACCOUNT,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: () =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("../components/Participation/ParticipationWithAccount.vue"),
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
announcer: {
|
2022-07-12 10:55:28 +02:00
|
|
|
message: (): string => t("Participation with account") as string,
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
|
|
|
},
|
2019-12-20 13:04:34 +01:00
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/:uuid/participate/without-account",
|
2019-12-20 13:04:34 +01:00
|
|
|
name: EventRouteName.EVENT_PARTICIPATE_WITHOUT_ACCOUNT,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: () =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("../components/Participation/ParticipationWithoutAccount.vue"),
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
announcer: {
|
2022-07-12 10:55:28 +02:00
|
|
|
message: (): string => t("Participation without account") as string,
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
|
|
|
},
|
2019-12-20 13:04:34 +01:00
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/participation/email/confirm/:token",
|
2019-12-20 13:04:34 +01:00
|
|
|
name: EventRouteName.EVENT_PARTICIPATE_CONFIRM,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: () =>
|
2020-11-30 10:24:11 +01:00
|
|
|
import("../components/Participation/ConfirmParticipation.vue"),
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
announcer: {
|
2022-07-12 10:55:28 +02:00
|
|
|
message: (): string => t("Confirm participation") as string,
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
|
|
|
},
|
2019-12-20 13:04:34 +01:00
|
|
|
props: true,
|
|
|
|
},
|
2019-10-23 12:36:11 +02:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/tag/:tag",
|
2019-10-23 12:36:11 +02:00
|
|
|
name: EventRouteName.TAG,
|
2022-07-12 10:55:28 +02:00
|
|
|
component: () => import("@/views/SearchView.vue"),
|
2020-07-31 17:52:26 +02:00
|
|
|
props: true,
|
2021-10-10 16:24:12 +02:00
|
|
|
meta: {
|
|
|
|
requiredAuth: false,
|
2022-07-12 10:55:28 +02:00
|
|
|
announcer: { message: (): string => t("Tag search") as string },
|
2021-10-10 16:24:12 +02:00
|
|
|
},
|
2019-10-23 12:36:11 +02:00
|
|
|
},
|
2019-02-22 14:55:47 +01:00
|
|
|
];
|