2020-04-23 00:27:09 +02:00
|
|
|
import { RouteConfig, Route } from "vue-router";
|
2020-02-18 08:57:00 +01:00
|
|
|
import EventList from "../views/Event/EventList.vue";
|
|
|
|
import Location from "../views/Location.vue";
|
2020-07-31 17:52:26 +02:00
|
|
|
import Search from "../views/Search.vue";
|
2019-02-22 14:55:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
const participations = () =>
|
|
|
|
import(/* webpackChunkName: "participations" */ "@/views/Event/Participants.vue");
|
|
|
|
const editEvent = () => import(/* webpackChunkName: "edit-event" */ "@/views/Event/Edit.vue");
|
|
|
|
const event = () => import(/* webpackChunkName: "event" */ "@/views/Event/Event.vue");
|
|
|
|
const myEvents = () => import(/* webpackChunkName: "my-events" */ "@/views/Event/MyEvents.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",
|
|
|
|
EXPLORE = "Explore",
|
|
|
|
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",
|
|
|
|
LOCATION = "Location",
|
|
|
|
TAG = "Tag",
|
2019-02-22 14:55:47 +01:00
|
|
|
}
|
|
|
|
|
2019-04-01 11:49:54 +02:00
|
|
|
export const eventRoutes: RouteConfig[] = [
|
2019-02-22 14:55:47 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/list/:location?",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: EventRouteName.EVENT_LIST,
|
|
|
|
component: EventList,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
|
|
|
{
|
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,
|
2019-02-22 14:55:47 +01:00
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
2019-09-20 19:43:29 +02:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/events/explore",
|
2019-09-20 19:43:29 +02:00
|
|
|
name: EventRouteName.EXPLORE,
|
2020-08-05 11:42:23 +02:00
|
|
|
redirect: { name: "Search" },
|
2019-09-20 19:43:29 +02:00
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
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,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
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,
|
2019-02-22 14:55:47 +01:00
|
|
|
meta: { requiredAuth: true },
|
2020-04-23 00:27:09 +02:00
|
|
|
props: (route: Route) => ({ ...route.params, ...{ isUpdate: true } }),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/events/duplicate/:eventId",
|
|
|
|
name: EventRouteName.DUPLICATE_EVENT,
|
|
|
|
component: editEvent,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
props: (route: Route) => ({ ...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,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
props: true,
|
|
|
|
},
|
2019-02-22 14:55:47 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/location/new",
|
2019-02-22 14:55:47 +01:00
|
|
|
name: EventRouteName.LOCATION,
|
|
|
|
component: Location,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
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,
|
|
|
|
meta: { requiredAuth: false },
|
|
|
|
},
|
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,
|
2020-02-18 08:57:00 +01:00
|
|
|
component: () => import("../components/Participation/UnloggedParticipation.vue"),
|
2019-12-20 13:04:34 +01:00
|
|
|
props: true,
|
|
|
|
},
|
|
|
|
{
|
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,
|
2020-02-18 08:57:00 +01:00
|
|
|
component: () => import("../components/Participation/ParticipationWithAccount.vue"),
|
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,
|
2020-02-18 08:57:00 +01:00
|
|
|
component: () => import("../components/Participation/ParticipationWithoutAccount.vue"),
|
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,
|
2020-02-18 08:57:00 +01:00
|
|
|
component: () => import("../components/Participation/ConfirmParticipation.vue"),
|
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,
|
2020-07-31 17:52:26 +02:00
|
|
|
component: Search,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: false },
|
2019-10-23 12:36:11 +02:00
|
|
|
},
|
2019-02-22 14:55:47 +01:00
|
|
|
];
|