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;