chore: mentor management only available for VV courses (#1097)

This commit is contained in:
Livio Bieri 2023-12-14 10:33:54 +01:00
parent 1979dcd428
commit 712d6d2868
2 changed files with 18 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import {
getMediaCenterUrl, getMediaCenterUrl,
} from "@/utils/utils"; } from "@/utils/utils";
import { useCockpitStore } from "@/stores/cockpit"; import { useCockpitStore } from "@/stores/cockpit";
import { VV_COURSE_IDS } from "@/constants";
log.debug("MainNavigationBar created"); log.debug("MainNavigationBar created");
@ -95,6 +96,16 @@ const hasAppointmentsMenu = computed(() => {
const hasNotificationsMenu = computed(() => { const hasNotificationsMenu = computed(() => {
return userStore.loggedIn; return userStore.loggedIn;
}); });
const hasMentorManagementMenu = computed(() => {
if (courseSessionsStore.currentCourseSessionHasCockpit) {
return false;
}
// learning mentor management is only available for VV courses
const currentCourseId = courseSessionsStore.currentCourseSession?.course.id || "";
return inCourse() && VV_COURSE_IDS.includes(currentCourseId);
});
</script> </script>
<template> <template>
@ -223,6 +234,7 @@ const hasNotificationsMenu = computed(() => {
</router-link> </router-link>
<router-link <router-link
v-if="hasMentorManagementMenu"
data-cy="navigation-learning-mentor-link" data-cy="navigation-learning-mentor-link"
:to=" :to="
getLearningMentorManagementUrl( getLearningMentorManagementUrl(

View File

@ -3,3 +3,9 @@ export const itCheckboxDefaultIconCheckedTailwindClass =
export const itCheckboxDefaultIconUncheckedTailwindClass = export const itCheckboxDefaultIconUncheckedTailwindClass =
"bg-[url(/static/icons/icon-checkbox-unchecked.svg)] hover:bg-[url(/static/icons/icon-checkbox-unchecked-hover.svg)]"; "bg-[url(/static/icons/icon-checkbox-unchecked.svg)] hover:bg-[url(/static/icons/icon-checkbox-unchecked-hover.svg)]";
export const VV_COURSE_IDS = [
"-4", // vv-de
"-10", // vv-fr
"-11", // vv-it
];