From 91ee3e605b9c5a7be6a8574fe6a6954b4943d280 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Thu, 4 Apr 2024 12:17:40 +0200 Subject: [PATCH] Add action link --- client/src/composables.ts | 4 ++-- .../src/pages/dashboard/DashboardPersonsPage.vue | 16 +++++++++++++++- client/src/router/guards.ts | 2 +- client/src/services/dashboard.ts | 1 + server/vbv_lernwelt/dashboard/views.py | 5 ++++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/client/src/composables.ts b/client/src/composables.ts index cbf6dc97..d778f90c 100644 --- a/client/src/composables.ts +++ b/client/src/composables.ts @@ -5,7 +5,7 @@ import { COURSE_QUERY, COURSE_SESSION_DETAIL_QUERY } from "@/graphql/queries"; import { circleFlatChildren, circleFlatLearningContents, - circleFlatLearningUnits + circleFlatLearningUnits, } from "@/services/circle"; import type { DashboardPersonType } from "@/services/dashboard"; import { fetchDashboardPersons } from "@/services/dashboard"; @@ -25,7 +25,7 @@ import type { LearningMentor, LearningPathType, LearningUnitPerformanceCriteria, - PerformanceCriteria + PerformanceCriteria, } from "@/types"; import { useQuery } from "@urql/vue"; import orderBy from "lodash/orderBy"; diff --git a/client/src/pages/dashboard/DashboardPersonsPage.vue b/client/src/pages/dashboard/DashboardPersonsPage.vue index 483b5091..6813947c 100644 --- a/client/src/pages/dashboard/DashboardPersonsPage.vue +++ b/client/src/pages/dashboard/DashboardPersonsPage.vue @@ -54,7 +54,21 @@ const { loading: loadingPersons, dashboardPersons } = useDashboardPersons();
{{ cs.user_role }}
-
action
+
+ + {{ $t("a.Profil anzeigen") }} + +
diff --git a/client/src/router/guards.ts b/client/src/router/guards.ts index 089ac20a..b60e527f 100644 --- a/client/src/router/guards.ts +++ b/client/src/router/guards.ts @@ -89,7 +89,7 @@ export async function handleCourseSessionAsQueryParam(to: RouteLocationNormalize return { path: to.path, query: restOfQuery, - replace: true, + // replace: true, }; } else { // courseSessionId is invalid for current user -> redirect to home diff --git a/client/src/services/dashboard.ts b/client/src/services/dashboard.ts index 66c9f831..a1ccaa0e 100644 --- a/client/src/services/dashboard.ts +++ b/client/src/services/dashboard.ts @@ -24,6 +24,7 @@ export type DashboardPersonCourseSessionType = { session_title: string; course_id: number; course_title: string; + course_slug: string; user_role: DashboardPersonRoleType; my_role: DashboardPersonRoleType; is_uk: boolean; diff --git a/server/vbv_lernwelt/dashboard/views.py b/server/vbv_lernwelt/dashboard/views.py index 123bb354..0f44b479 100644 --- a/server/vbv_lernwelt/dashboard/views.py +++ b/server/vbv_lernwelt/dashboard/views.py @@ -99,6 +99,7 @@ def get_dashboard_persons(request): "session_title": cs.title, "course_id": cs.course.id, "course_title": cs.course.title, + "course_slug": cs.course.slug, "user_role": csu.role, "my_role": my_role, "is_uk": cs.course.configuration.is_uk, @@ -117,9 +118,10 @@ def get_dashboard_persons(request): for participant in lm.participants.all(): course_session_entry = { "id": cs.id, - "course_id": cs.course.id, "session_title": cs.title, + "course_id": cs.course.id, "course_title": cs.course.title, + "course_slug": cs.course.slug, "user_role": "LEARNING_MENTEE", "my_role": "LEARNING_MENTOR", "is_uk": cs.course.configuration.is_uk, @@ -151,6 +153,7 @@ def get_dashboard_persons(request): "session_title": cs.title, "course_id": cs.course.id, "course_title": cs.course.title, + "course_slug": cs.course.slug, "user_role": "LEARNING_MENTOR", "my_role": "LEARNING_MENTEE", "is_uk": cs.course.configuration.is_uk,