Merged in feature/VBV-741-dashboard-detailseiten-navigation-uniformieren (pull request #394)
VBV-741: Dashboard Detailseite: Cockpit und Vorschau Links ausblenden Approved-by: Christian Cueni
This commit is contained in:
commit
a5a1bd124d
|
|
@ -2,6 +2,8 @@
|
|||
import CourseSessionsMenu from "@/components/header/CourseSessionsMenu.vue";
|
||||
import type { User } from "@/stores/user";
|
||||
import type { CourseSession } from "@/types";
|
||||
import { useRouteLookups } from "@/utils/route";
|
||||
import { computed } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
@ -13,6 +15,9 @@ const props = defineProps<{
|
|||
const emit = defineEmits(["selectCourseSession", "logout", "close"]);
|
||||
|
||||
const router = useRouter();
|
||||
const { inCourse } = useRouteLookups();
|
||||
|
||||
const showCourseSessionMenu = computed(() => inCourse() && props.courseSessions.length);
|
||||
|
||||
async function navigate(routeName: string) {
|
||||
await router.push({ name: routeName });
|
||||
|
|
@ -41,7 +46,7 @@ async function navigate(routeName: string) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="props.courseSessions.length" class="border-b py-4">
|
||||
<div v-if="showCourseSessionMenu" class="border-b py-4">
|
||||
<CourseSessionsMenu
|
||||
:items="courseSessions"
|
||||
:selected="selectedCourseSession"
|
||||
|
|
|
|||
|
|
@ -90,12 +90,17 @@ const hasMediaLibraryMenu = computed(() =>
|
|||
)
|
||||
);
|
||||
|
||||
const hasCockpitMenu = computed(() =>
|
||||
Boolean(courseSessionsStore.currentCourseSession?.actions.includes("expert-cockpit"))
|
||||
const hasCockpitMenu = computed(
|
||||
() =>
|
||||
Boolean(
|
||||
courseSessionsStore.currentCourseSession?.actions.includes("expert-cockpit")
|
||||
) && inCourse()
|
||||
);
|
||||
|
||||
const hasPreviewMenu = computed(() =>
|
||||
Boolean(courseSessionsStore.currentCourseSession?.actions.includes("preview"))
|
||||
const hasPreviewMenu = computed(
|
||||
() =>
|
||||
Boolean(courseSessionsStore.currentCourseSession?.actions.includes("preview")) &&
|
||||
inCourse()
|
||||
);
|
||||
|
||||
const hasAppointmentsMenu = computed(() =>
|
||||
|
|
|
|||
Loading…
Reference in New Issue