From daaecb57a077bfddd36a9e7816d38359161064aa Mon Sep 17 00:00:00 2001 From: Livio Bieri Date: Thu, 28 Sep 2023 17:44:07 +0200 Subject: [PATCH] fix: use trainer url --- .../src/components/dueDates/DueDateSingle.vue | 19 +++++++------------ client/src/types.ts | 1 + 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/client/src/components/dueDates/DueDateSingle.vue b/client/src/components/dueDates/DueDateSingle.vue index 8a5f179e..5ba7556c 100644 --- a/client/src/components/dueDates/DueDateSingle.vue +++ b/client/src/components/dueDates/DueDateSingle.vue @@ -8,19 +8,17 @@ const props = defineProps<{ singleLine?: boolean; }>(); -/* FIXME @livioso 19.09.23: This is a temporary workaround to have a ship-able / deployable - version of the preview feature (VBV-516). The plan is to tackle the role-based - due dates calendar next (VBV-524) which will touch all usage of this component. - For now, just disable links for trainer / expert -> to reduce level of confusion ;) -*/ const courseSessionsStore = useCourseSessionsStore(); const courseSession = courseSessionsStore.allCourseSessions.find( (cs: CourseSession) => cs.id === props.dueDate.course_session ); -const disableLink = courseSession - ? !courseSessionsStore.hasCockpit(courseSession) - : false; +if (!courseSession) { + throw new Error("Course session not found"); +} + +const isExpert = courseSessionsStore.hasCockpit(courseSession); +const url = isExpert ? props.dueDate.url_expert : props.dueDate.url;