Add action link

This commit is contained in:
Daniel Egger 2024-04-04 12:17:40 +02:00
parent 15d6baac81
commit 91ee3e605b
5 changed files with 23 additions and 5 deletions

View File

@ -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";

View File

@ -54,7 +54,21 @@ const { loading: loadingPersons, dashboardPersons } = useDashboardPersons();
<div>{{ cs.user_role }}</div>
</div>
<div class="md:w-1/4 md:text-right">
<div>action</div>
<div>
<router-link
:to="{
name: 'profileLearningPath',
params: {
userId: person.user_id,
courseSlug: cs.course_slug,
},
query: { courseSessionId: cs.id },
}"
class="link w-full lg:text-right"
>
{{ $t("a.Profil anzeigen") }}
</router-link>
</div>
</div>
</div>
</div>

View File

@ -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

View File

@ -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;

View File

@ -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,