From 6b2628b3339d33816d5c378eddd44935b1b1a8f7 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Mon, 5 Aug 2024 14:11:26 +0200 Subject: [PATCH] Show different links for different roles --- .../assignmentsPage/AssignmentDetails.vue | 19 +++++++++++++++++-- .../assignmentsPage/AssignmentsPage.vue | 1 + .../agentAssignment/AgentAssignmentDetail.vue | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue b/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue index 844668c0..15df55fd 100644 --- a/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue +++ b/client/src/pages/cockpit/assignmentsPage/AssignmentDetails.vue @@ -23,6 +23,7 @@ export interface Props { courseSession: CourseSession; learningContent: LearningContentAssignment | LearningContentEdoniqTest; userSelectionIds?: string[]; + linkToResults?: boolean; } const props = defineProps(); @@ -85,6 +86,12 @@ function findUserPointsHtml(userId: string) { } return result; } + +function generateCertificatesLink(userId: string) { + const parts = props.learningContent.competence_certificate?.frontend_url?.split("/"); + const certificatePart = parts[parts.length - 1]; + return `/course/${props.courseSession.course.slug}/profile/${userId}/competence/certificates/${certificatePart}`; +} diff --git a/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue b/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue index a4281394..1e92d1db 100644 --- a/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue +++ b/client/src/pages/cockpit/assignmentsPage/AssignmentsPage.vue @@ -53,6 +53,7 @@ const backRoute = computed(() => { v-if="learningContentAssignment" :course-session="courseSession" :learning-content="learningContentAssignment as (LearningContentAssignment | LearningContentEdoniqTest)" + :link-to-results="true" /> diff --git a/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue b/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue index bf0828c4..03d6f474 100644 --- a/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue +++ b/client/src/pages/dashboard/agentAssignment/AgentAssignmentDetail.vue @@ -53,6 +53,7 @@ const learningContentAssignment = computed(() => { :course-session="courseSession" :learning-content="learningContentAssignment as (LearningContentAssignment | LearningContentEdoniqTest)" :user-selection-ids="participantUserIds" + :link-to-results="props.agentRole.toLowerCase() !== 'berufsbildner'" />