Clean up router index, add route names

This commit is contained in:
Ramon Wenger 2024-11-11 17:03:30 +01:00
parent d361dabd16
commit 20e2a2b172
2 changed files with 254 additions and 223 deletions

View File

@ -14,9 +14,12 @@ import { addToHistory, setLastNavigationWasPush } from "@/router/history";
import { onboardingRedirect } from "@/router/onboarding"; import { onboardingRedirect } from "@/router/onboarding";
import { createRouter, createWebHistory } from "vue-router"; import { createRouter, createWebHistory } from "vue-router";
import { import {
ATTENDANCE_ROUTE,
CERTIFICATES_ROUTE, CERTIFICATES_ROUTE,
COCKPIT_ROUTE,
COMPETENCE_ROUTE, COMPETENCE_ROUTE,
COMPETENCES_ROUTE, COMPETENCES_ROUTE,
DOCUMENTS_ROUTE,
SELF_EVALUATION_ROUTE, SELF_EVALUATION_ROUTE,
SETTINGS_ROUTE, SETTINGS_ROUTE,
} from "./names"; } from "./names";
@ -86,88 +89,265 @@ const router = createRouter({
props: true, props: true,
}, },
{ {
path: "/course/:courseSlug/media", path: "/course/:courseSlug",
props: true, props: true,
component: () => import("@/pages/mediaLibrary/MediaLibraryParentPage.vue"),
children: [ children: [
{ {
path: "", path: "media",
component: () => import("@/pages/mediaLibrary/MediaLibraryIndexPage.vue"), component: () => import("@/pages/mediaLibrary/MediaLibraryParentPage.vue"),
children: [
{
path: "",
component: () => import("@/pages/mediaLibrary/MediaLibraryIndexPage.vue"),
},
{
path: ":categorySlug",
props: true,
component: () =>
import("@/pages/mediaLibrary/MediaLibraryCategoryPage.vue"),
},
{
path: ":categorySlug/:contentSlug",
props: true,
component: () =>
import("@/pages/mediaLibrary/MediaLibraryContentPage.vue"),
},
],
}, },
{ {
path: ":categorySlug", path: "competence",
props: true, component: () => import("@/pages/competence/CompetenceParentPage.vue"),
component: () => import("@/pages/mediaLibrary/MediaLibraryCategoryPage.vue"), children: [
{
path: "",
props: true,
name: COMPETENCE_ROUTE,
component: () => import("@/pages/competence/CompetenceIndexPage.vue"),
},
{
path: "certificates",
name: CERTIFICATES_ROUTE,
props: true,
component: () =>
import("@/pages/competence/CompetenceCertificateListPage.vue"),
},
{
path: "certificates/:certificateSlug",
props: true,
component: () =>
import("@/pages/competence/CompetenceCertificateDetailPage.vue"),
},
{
name: SELF_EVALUATION_ROUTE,
path: "self-evaluation-and-feedback",
props: true,
component: () =>
import("@/pages/competence/SelfEvaluationAndFeedbackPage.vue"),
},
{
path: "competences",
name: COMPETENCES_ROUTE,
props: true,
component: () =>
import("@/pages/competence/ActionCompetenceListPage.vue"),
},
],
}, },
{ {
path: ":categorySlug/:contentSlug", path: "learn",
children: [
{
path: "",
component: () =>
import("../pages/learningPath/learningPathPage/LearningPathPage.vue"),
},
{
path: ":circleSlug",
component: () =>
import("../pages/learningPath/circlePage/CirclePage.vue"),
props: true,
},
{
path: ":circleSlug/evaluate/:learningUnitSlug",
component: () =>
import(
"../pages/learningPath/selfEvaluationPage/SelfEvaluationPage.vue"
),
props: true,
},
{
path: ":circleSlug/:contentSlug",
component: () =>
import(
"../pages/learningPath/learningContentPage/LearningContentPage.vue"
),
props: true,
},
],
},
{
path: "profile/:userId",
component: () => import("@/pages/userProfile/UserProfilePage.vue"),
children: [
{
path: "learning-path",
component: () =>
import("@/pages/userProfile/LearningPathProfilePage.vue"),
props: true,
name: "profileLearningPath",
meta: {
hideChrome: true,
showCloseButton: true,
},
},
{
path: "competence",
component: () => import("@/pages/userProfile/CompetenceProfilePage.vue"),
props: true,
name: "profileCompetence",
meta: {
hideChrome: true,
showCloseButton: true,
},
children: [
{
path: "",
name: "competenceMain",
component: () =>
import(
"@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue"
),
},
{
path: "evaluations",
name: "competenceEvaluations",
component: () =>
import(
"@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue"
),
},
{
path: "certificates/:certificateSlug",
name: "competenceCertificateDetail",
props: true,
component: () =>
import("@/pages/competence/CompetenceCertificateDetailPage.vue"),
},
{
path: "certificates",
name: "competenceCertificates",
component: () =>
import("@/pages/competence/CompetenceCertificateListPage.vue"),
},
],
},
],
},
{
path: "learning-mentor",
component: () => import("@/pages/learningMentor/mentor/MentorIndexPage.vue"),
name: "learningMentor",
children: [
{
path: "",
component: () =>
import("@/pages/learningMentor/mentor/MentorParticipantsPage.vue"),
name: "mentorsAndParticipants",
},
{
path: "tasks",
component: () =>
import("@/pages/learningMentor/mentor/MentorOverviewPage.vue"),
name: "learningMentorOverview",
},
{
path: "self-evaluation-feedback/:learningUnitId",
component: () =>
import("@/pages/learningMentor/mentor/SelfEvaluationFeedbackPage.vue"),
name: "mentorSelfEvaluationFeedback",
props: true,
},
{
path: "details",
component: () =>
import("@/pages/learningMentor/mentor/MentorDetailParentPage.vue"),
children: [
{
path: "praxis-assignments/:praxisAssignmentId",
component: () =>
import(
"@/pages/learningMentor/mentor/MentorPraxisAssignmentPage.vue"
),
name: "learningMentorPraxisAssignments",
props: true,
},
{
path: "self-evaluation-feedback-assignments/:learningUnitId",
component: () =>
import(
"@/pages/learningMentor/mentor/MentorSelfEvaluationFeedbackAssignmentPage.vue"
),
name: "learningMentorSelfEvaluationFeedbackAssignments",
props: true,
},
],
},
],
},
{
path: "assignment-evaluation/:assignmentId/:userId",
component: () =>
import("@/pages/assignmentEvaluation/AssignmentEvaluationPage.vue"),
props: true, props: true,
component: () => import("@/pages/mediaLibrary/MediaLibraryContentPage.vue"), },
{
path: "cockpit",
name: "cockpit",
component: () =>
import("@/pages/cockpit/cockpitPage/CockpitExpertParentPage.vue"),
props: true,
children: [
{
path: "",
component: () =>
import("@/pages/cockpit/cockpitPage/CockpitExpertHomePage.vue"),
name: COCKPIT_ROUTE,
props: true,
},
{
path: "profile/:userId/:circleSlug",
component: () => import("@/pages/cockpit/CockpitUserCirclePage.vue"),
props: true,
},
{
path: "feedback/:circleId",
component: () => import("@/pages/cockpit/FeedbackPage.vue"),
props: true,
},
{
path: "assignment/:assignmentId",
component: () =>
import("@/pages/cockpit/assignmentsPage/AssignmentsPage.vue"),
props: true,
},
{
path: "attendance",
component: () =>
import("@/pages/cockpit/attendanceCheckPage/AttendanceCheckPage.vue"),
props: true,
name: ATTENDANCE_ROUTE,
},
{
path: "documents",
component: () => import("@/pages/cockpit/documentPage/DocumentPage.vue"),
props: true,
name: DOCUMENTS_ROUTE,
},
],
}, },
], ],
}, },
{
path: "/course/:courseSlug/competence",
props: true,
component: () => import("@/pages/competence/CompetenceParentPage.vue"),
children: [
{
path: "",
props: true,
name: COMPETENCE_ROUTE,
component: () => import("@/pages/competence/CompetenceIndexPage.vue"),
},
{
path: "certificates",
name: CERTIFICATES_ROUTE,
props: true,
component: () =>
import("@/pages/competence/CompetenceCertificateListPage.vue"),
},
{
path: "certificates/:certificateSlug",
props: true,
component: () =>
import("@/pages/competence/CompetenceCertificateDetailPage.vue"),
},
{
name: SELF_EVALUATION_ROUTE,
path: "self-evaluation-and-feedback",
props: true,
component: () =>
import("@/pages/competence/SelfEvaluationAndFeedbackPage.vue"),
},
{
path: "competences",
name: COMPETENCES_ROUTE,
props: true,
component: () => import("@/pages/competence/ActionCompetenceListPage.vue"),
},
],
},
{
path: "/course/:courseSlug/learn",
component: () =>
import("../pages/learningPath/learningPathPage/LearningPathPage.vue"),
props: true,
},
{
path: "/course/:courseSlug/learn/:circleSlug",
component: () => import("../pages/learningPath/circlePage/CirclePage.vue"),
props: true,
},
{
path: "/course/:courseSlug/learn/:circleSlug/evaluate/:learningUnitSlug",
component: () =>
import("../pages/learningPath/selfEvaluationPage/SelfEvaluationPage.vue"),
props: true,
},
{
path: "/course/:courseSlug/learn/:circleSlug/:contentSlug",
component: () =>
import("../pages/learningPath/learningContentPage/LearningContentPage.vue"),
props: true,
},
{ {
path: "/lernbegleitung/:courseId/invitation/:invitationId", path: "/lernbegleitung/:courseId/invitation/:invitationId",
component: () => import("@/pages/learningMentor/InvitationAcceptPage.vue"), component: () => import("@/pages/learningMentor/InvitationAcceptPage.vue"),
@ -178,158 +358,6 @@ const router = createRouter({
public: true, public: true,
}, },
}, },
{
path: "/course/:courseSlug/profile/:userId",
component: () => import("@/pages/userProfile/UserProfilePage.vue"),
props: true,
children: [
{
path: "learning-path",
component: () => import("@/pages/userProfile/LearningPathProfilePage.vue"),
props: true,
name: "profileLearningPath",
meta: {
hideChrome: true,
showCloseButton: true,
},
},
{
path: "competence",
component: () => import("@/pages/userProfile/CompetenceProfilePage.vue"),
props: true,
name: "profileCompetence",
meta: {
hideChrome: true,
showCloseButton: true,
},
children: [
{
path: "",
name: "competenceMain",
component: () =>
import(
"@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackOverview.vue"
),
},
{
path: "evaluations",
name: "competenceEvaluations",
component: () =>
import(
"@/components/selfEvaluationFeedback/SelfEvaluationAndFeedbackList.vue"
),
},
{
path: "certificates/:certificateSlug",
name: "competenceCertificateDetail",
props: true,
component: () =>
import("@/pages/competence/CompetenceCertificateDetailPage.vue"),
},
{
path: "certificates",
name: "competenceCertificates",
component: () =>
import("@/pages/competence/CompetenceCertificateListPage.vue"),
},
],
},
],
},
{
path: "/course/:courseSlug/learning-mentor",
component: () => import("@/pages/learningMentor/mentor/MentorIndexPage.vue"),
props: true,
name: "learningMentor",
children: [
{
path: "",
component: () =>
import("@/pages/learningMentor/mentor/MentorParticipantsPage.vue"),
name: "mentorsAndParticipants",
},
{
path: "tasks",
component: () =>
import("@/pages/learningMentor/mentor/MentorOverviewPage.vue"),
name: "learningMentorOverview",
},
{
path: "self-evaluation-feedback/:learningUnitId",
component: () =>
import("@/pages/learningMentor/mentor/SelfEvaluationFeedbackPage.vue"),
name: "mentorSelfEvaluationFeedback",
props: true,
},
{
path: "details",
component: () =>
import("@/pages/learningMentor/mentor/MentorDetailParentPage.vue"),
children: [
{
path: "praxis-assignments/:praxisAssignmentId",
component: () =>
import("@/pages/learningMentor/mentor/MentorPraxisAssignmentPage.vue"),
name: "learningMentorPraxisAssignments",
props: true,
},
{
path: "self-evaluation-feedback-assignments/:learningUnitId",
component: () =>
import(
"@/pages/learningMentor/mentor/MentorSelfEvaluationFeedbackAssignmentPage.vue"
),
name: "learningMentorSelfEvaluationFeedbackAssignments",
props: true,
},
],
},
],
},
{
path: "/course/:courseSlug/assignment-evaluation/:assignmentId/:userId",
component: () =>
import("@/pages/assignmentEvaluation/AssignmentEvaluationPage.vue"),
props: true,
},
{
path: "/course/:courseSlug/cockpit",
name: "cockpit",
children: [
{
path: "",
component: () => import("@/pages/cockpit/cockpitPage/CockpitExpertPage.vue"),
props: true,
},
{
path: "profile/:userId/:circleSlug",
component: () => import("@/pages/cockpit/CockpitUserCirclePage.vue"),
props: true,
},
{
path: "feedback/:circleId",
component: () => import("@/pages/cockpit/FeedbackPage.vue"),
props: true,
},
{
path: "assignment/:assignmentId",
component: () =>
import("@/pages/cockpit/assignmentsPage/AssignmentsPage.vue"),
props: true,
},
{
path: "attendance",
component: () =>
import("@/pages/cockpit/attendanceCheckPage/AttendanceCheckPage.vue"),
props: true,
},
{
path: "documents",
component: () => import("@/pages/cockpit/documentPage/DocumentPage.vue"),
props: true,
},
],
},
{ {
path: "/statistic/:courseSlug", path: "/statistic/:courseSlug",
props: true, props: true,

View File

@ -3,3 +3,6 @@ export const CERTIFICATES_ROUTE = "certificates";
export const SELF_EVALUATION_ROUTE = "selfEvaluationAndFeedback"; export const SELF_EVALUATION_ROUTE = "selfEvaluationAndFeedback";
export const COMPETENCES_ROUTE = "competences"; export const COMPETENCES_ROUTE = "competences";
export const SETTINGS_ROUTE = "settings"; export const SETTINGS_ROUTE = "settings";
export const COCKPIT_ROUTE = "cockpit-home";
export const ATTENDANCE_ROUTE = "attendance";
export const DOCUMENTS_ROUTE = "documents";