@@ -14,7 +14,7 @@ export const actorRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/groups/create",
|
||||
name: ActorRouteName.CREATE_GROUP,
|
||||
component: (): Promise<any> => import("@/views/Group/Create.vue"),
|
||||
component: (): Promise<any> => import("@/views/Group/CreateView.vue"),
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
announcer: { message: (): string => t("Create group") as string },
|
||||
@@ -23,7 +23,7 @@ export const actorRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/@:preferredUsername",
|
||||
name: ActorRouteName.GROUP,
|
||||
component: (): Promise<any> => import("@/views/Group/Group.vue"),
|
||||
component: (): Promise<any> => import("@/views/Group/GroupView.vue"),
|
||||
props: true,
|
||||
meta: { requiredAuth: false, announcer: { skip: true } },
|
||||
},
|
||||
|
||||
@@ -1,51 +1,45 @@
|
||||
import { RouteConfig } from "vue-router";
|
||||
import { ImportedComponent } from "vue/types/options";
|
||||
import { RouteRecordRaw } from "vue-router";
|
||||
import { i18n } from "@/utils/i18n";
|
||||
|
||||
const t = i18n.global.t;
|
||||
|
||||
export enum DiscussionRouteName {
|
||||
DISCUSSION_LIST = "DISCUSSION_LIST",
|
||||
CREATE_DISCUSSION = "CREATE_DISCUSSION",
|
||||
DISCUSSION = "DISCUSSION",
|
||||
}
|
||||
|
||||
export const discussionRoutes: RouteConfig[] = [
|
||||
export const discussionRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/@:preferredUsername/discussions",
|
||||
name: DiscussionRouteName.DISCUSSION_LIST,
|
||||
component: (): Promise<ImportedComponent> =>
|
||||
import(
|
||||
/* webpackChunkName: "DiscussionsList" */ "@/views/Discussions/DiscussionsList.vue"
|
||||
),
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/Discussions/DiscussionsListView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
announcer: {
|
||||
message: (): string => i18n.t("Discussions list") as string,
|
||||
message: (): string => t("Discussions list") as string,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/@:preferredUsername/discussions/new",
|
||||
name: DiscussionRouteName.CREATE_DISCUSSION,
|
||||
component: (): Promise<ImportedComponent> =>
|
||||
import(
|
||||
/* webpackChunkName: "CreateDiscussion" */ "@/views/Discussions/Create.vue"
|
||||
),
|
||||
component: (): Promise<any> => import("@/views/Discussions/CreateView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
announcer: {
|
||||
message: (): string => i18n.t("Create discussion") as string,
|
||||
message: (): string => t("Create discussion") as string,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/@:preferredUsername/c/:slug/:comment_id?",
|
||||
name: DiscussionRouteName.DISCUSSION,
|
||||
component: (): Promise<ImportedComponent> =>
|
||||
import(
|
||||
/* webpackChunkName: "Discussion" */ "@/views/Discussions/Discussion.vue"
|
||||
),
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/Discussions/DiscussionView.vue"),
|
||||
props: true,
|
||||
meta: { requiredAuth: true, announcer: { skip: true } },
|
||||
},
|
||||
|
||||
@@ -3,10 +3,10 @@ import { RouteLocationNormalized, RouteRecordRaw } from "vue-router";
|
||||
|
||||
const t = i18n.global.t;
|
||||
|
||||
const participations = () => import("@/views/Event/Participants.vue");
|
||||
const editEvent = () => import("@/views/Event/Edit.vue");
|
||||
const event = () => import("@/views/Event/Event.vue");
|
||||
const myEvents = () => import("@/views/Event/MyEvents.vue");
|
||||
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");
|
||||
|
||||
export enum EventRouteName {
|
||||
EVENT_LIST = "EventList",
|
||||
|
||||
@@ -66,7 +66,7 @@ export const groupsRoutes: RouteRecordRaw[] = [
|
||||
},
|
||||
{
|
||||
path: "/@:preferredUsername/settings",
|
||||
component: (): Promise<any> => import("@/views/Group/Settings.vue"),
|
||||
component: (): Promise<any> => import("@/views/Group/SettingsView.vue"),
|
||||
props: true,
|
||||
meta: { requiredAuth: true },
|
||||
redirect: { name: GroupsRouteName.GROUP_PUBLIC_SETTINGS },
|
||||
@@ -100,14 +100,14 @@ export const groupsRoutes: RouteRecordRaw[] = [
|
||||
},
|
||||
{
|
||||
path: "/@:preferredUsername/p/new",
|
||||
component: (): Promise<any> => import("@/views/Posts/Edit.vue"),
|
||||
component: (): Promise<any> => import("@/views/Posts/EditView.vue"),
|
||||
props: true,
|
||||
name: GroupsRouteName.POST_CREATE,
|
||||
meta: { requiredAuth: true, announcer: { skip: true } },
|
||||
},
|
||||
{
|
||||
path: "/p/:slug/edit",
|
||||
component: (): Promise<any> => import("@/views/Posts/Edit.vue"),
|
||||
component: (): Promise<any> => import("@/views/Posts/EditView.vue"),
|
||||
props: (route: RouteLocationNormalized): Record<string, unknown> => ({
|
||||
...route.params,
|
||||
...{ isUpdate: true },
|
||||
@@ -117,14 +117,14 @@ export const groupsRoutes: RouteRecordRaw[] = [
|
||||
},
|
||||
{
|
||||
path: "/p/:slug",
|
||||
component: (): Promise<any> => import("@/views/Posts/Post.vue"),
|
||||
component: (): Promise<any> => import("@/views/Posts/PostView.vue"),
|
||||
props: true,
|
||||
name: GroupsRouteName.POST,
|
||||
meta: { requiredAuth: false, announcer: { skip: true } },
|
||||
},
|
||||
{
|
||||
path: "/@:preferredUsername/p",
|
||||
component: (): Promise<any> => import("@/views/Posts/List.vue"),
|
||||
component: (): Promise<any> => import("@/views/Posts/ListView.vue"),
|
||||
props: true,
|
||||
name: GroupsRouteName.POSTS,
|
||||
meta: { requiredAuth: false, announcer: { skip: true } },
|
||||
@@ -155,7 +155,7 @@ export const groupsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/@:preferredUsername/timeline",
|
||||
name: GroupsRouteName.TIMELINE,
|
||||
component: (): Promise<any> => import("@/views/Group/Timeline.vue"),
|
||||
component: (): Promise<any> => import("@/views/Group/TimelineView.vue"),
|
||||
props: true,
|
||||
meta: { requiredAuth: true, announcer: { skip: true } },
|
||||
},
|
||||
|
||||
@@ -76,7 +76,7 @@ export const routes = [
|
||||
path: "instance",
|
||||
name: RouteName.ABOUT_INSTANCE,
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/About/AboutInstance.vue"),
|
||||
import("@/views/About/AboutInstanceView.vue"),
|
||||
meta: {
|
||||
announcer: {
|
||||
message: (): string => t("About instance") as string,
|
||||
@@ -86,7 +86,7 @@ export const routes = [
|
||||
{
|
||||
path: "/terms",
|
||||
name: RouteName.TERMS,
|
||||
component: (): Promise<any> => import("@/views/About/Terms.vue"),
|
||||
component: (): Promise<any> => import("@/views/About/TermsView.vue"),
|
||||
meta: {
|
||||
requiredAuth: false,
|
||||
announcer: { message: (): string => t("Terms") as string },
|
||||
@@ -95,7 +95,7 @@ export const routes = [
|
||||
{
|
||||
path: "/privacy",
|
||||
name: RouteName.PRIVACY,
|
||||
component: (): Promise<any> => import("@/views/About/Privacy.vue"),
|
||||
component: (): Promise<any> => import("@/views/About/PrivacyView.vue"),
|
||||
meta: {
|
||||
requiredAuth: false,
|
||||
announcer: { message: (): string => t("Privacy") as string },
|
||||
@@ -104,7 +104,7 @@ export const routes = [
|
||||
{
|
||||
path: "/rules",
|
||||
name: RouteName.RULES,
|
||||
component: (): Promise<any> => import("@/views/About/Rules.vue"),
|
||||
component: (): Promise<any> => import("@/views/About/RulesView.vue"),
|
||||
meta: {
|
||||
requiredAuth: false,
|
||||
announcer: { message: (): string => t("Rules") as string },
|
||||
@@ -113,7 +113,7 @@ export const routes = [
|
||||
{
|
||||
path: "/glossary",
|
||||
name: RouteName.GLOSSARY,
|
||||
component: (): Promise<any> => import("@/views/About/Glossary.vue"),
|
||||
component: (): Promise<any> => import("@/views/About/GlossaryView.vue"),
|
||||
meta: {
|
||||
requiredAuth: false,
|
||||
announcer: { message: (): string => t("Glossary") as string },
|
||||
@@ -124,8 +124,7 @@ export const routes = [
|
||||
{
|
||||
path: "/interact",
|
||||
name: RouteName.INTERACT,
|
||||
component: (): Promise<any> =>
|
||||
import(/* webpackChunkName: "interact" */ "@/views/Interact.vue"),
|
||||
component: (): Promise<any> => import("@/views/InteractView.vue"),
|
||||
meta: {
|
||||
requiredAuth: false,
|
||||
announcer: { message: (): string => t("Interact") as string },
|
||||
|
||||
@@ -105,7 +105,7 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "admin/settings",
|
||||
name: SettingsRouteName.ADMIN_SETTINGS,
|
||||
component: (): Promise<any> => import("@/views/Admin/Settings.vue"),
|
||||
component: (): Promise<any> => import("@/views/Admin/SettingsView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
@@ -117,7 +117,7 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "admin/users",
|
||||
name: SettingsRouteName.USERS,
|
||||
component: (): Promise<any> => import("@/views/Admin/Users.vue"),
|
||||
component: (): Promise<any> => import("@/views/Admin/UsersView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
@@ -138,7 +138,7 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "admin/profiles",
|
||||
name: SettingsRouteName.PROFILES,
|
||||
component: (): Promise<any> => import("@/views/Admin/Profiles.vue"),
|
||||
component: (): Promise<any> => import("@/views/Admin/ProfilesView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
@@ -176,7 +176,8 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "admin/instances",
|
||||
name: SettingsRouteName.INSTANCES,
|
||||
component: (): Promise<any> => import("@/views/Admin/Instances.vue"),
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/Admin/InstancesView.vue"),
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
announcer: {
|
||||
@@ -188,7 +189,7 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "admin/instances/:domain",
|
||||
name: SettingsRouteName.INSTANCE,
|
||||
component: (): Promise<any> => import("@/views/Admin/Instance.vue"),
|
||||
component: (): Promise<any> => import("@/views/Admin/InstanceView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
@@ -207,7 +208,7 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
path: "/moderation/reports",
|
||||
name: SettingsRouteName.REPORTS,
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/Moderation/ReportList.vue"),
|
||||
import("@/views/Moderation/ReportListView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
@@ -219,7 +220,8 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/moderation/report/:reportId",
|
||||
name: SettingsRouteName.REPORT,
|
||||
component: (): Promise<any> => import("@/views/Moderation/Report.vue"),
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/Moderation/ReportView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
@@ -229,7 +231,8 @@ export const settingsRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/moderation/logs",
|
||||
name: SettingsRouteName.REPORT_LOGS,
|
||||
component: (): Promise<any> => import("@/views/Moderation/Logs.vue"),
|
||||
component: (): Promise<any> =>
|
||||
import("@/views/Moderation/LogsView.vue"),
|
||||
props: true,
|
||||
meta: {
|
||||
requiredAuth: true,
|
||||
|
||||
@@ -30,7 +30,7 @@ export const userRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/register/profile",
|
||||
name: UserRouteName.REGISTER_PROFILE,
|
||||
component: (): Promise<any> => import("@/views/Account/Register.vue"),
|
||||
component: (): Promise<any> => import("@/views/Account/RegisterView.vue"),
|
||||
// We can only pass string values through params, therefore
|
||||
props: (route: RouteLocationNormalized): Record<string, unknown> => ({
|
||||
email: route.params.email,
|
||||
|
||||
Reference in New Issue
Block a user