mobilizon/js/src/router/event.ts

69 lines
1.8 KiB
TypeScript
Raw Normal View History

2019-02-22 14:55:47 +01:00
import EventList from '@/views/Event/EventList.vue';
import Location from '@/views/Location.vue';
import { RouteConfig } from 'vue-router';
2019-02-22 14:55:47 +01:00
// tslint:disable:space-in-parens
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');
// tslint:enable
2019-02-22 14:55:47 +01:00
export enum EventRouteName {
EVENT_LIST = 'EventList',
CREATE_EVENT = 'CreateEvent',
MY_EVENTS = 'MyEvents',
2019-02-22 14:55:47 +01:00
EDIT_EVENT = 'EditEvent',
PARTICIPATIONS = 'Participations',
2019-02-22 14:55:47 +01:00
EVENT = 'Event',
LOCATION = 'Location',
}
export const eventRoutes: RouteConfig[] = [
2019-02-22 14:55:47 +01:00
{
path: '/events/list/:location?',
name: EventRouteName.EVENT_LIST,
component: EventList,
meta: { requiredAuth: false },
},
{
path: '/events/create',
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 },
},
{
path: '/events/me',
name: EventRouteName.MY_EVENTS,
component: myEvents,
meta: { requiredAuth: true },
},
2019-02-22 14:55:47 +01:00
{
2019-09-02 14:35:50 +02: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 },
2019-09-02 14:35:50 +02:00
props: { isUpdate: true },
2019-02-22 14:55:47 +01:00
},
{
path: '/events/participations/:eventId',
name: EventRouteName.PARTICIPATIONS,
component: participations,
meta: { requiredAuth: true },
props: true,
},
2019-02-22 14:55:47 +01:00
{
path: '/location/new',
name: EventRouteName.LOCATION,
component: Location,
meta: { requiredAuth: true },
},
{
path: '/events/:uuid',
name: EventRouteName.EVENT,
component: event,
2019-02-22 14:55:47 +01:00
props: true,
meta: { requiredAuth: false },
},
];