From 326e42c99f3059b215c5d4b368dce45090a040d9 Mon Sep 17 00:00:00 2001 From: Livio Bieri Date: Sat, 16 Sep 2023 22:27:19 +0200 Subject: [PATCH] wip: course preview poc --- .../components/header/CoursePreviewBar.vue | 55 +++++++++++++++++++ .../components/header/MainNavigationBar.vue | 38 ++++++++++++- cypress/e2e/preview.cy.js | 23 ++++++++ 3 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 client/src/components/header/CoursePreviewBar.vue create mode 100644 cypress/e2e/preview.cy.js diff --git a/client/src/components/header/CoursePreviewBar.vue b/client/src/components/header/CoursePreviewBar.vue new file mode 100644 index 00000000..80de3595 --- /dev/null +++ b/client/src/components/header/CoursePreviewBar.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index e04414e5..33ff1ee9 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -14,6 +14,7 @@ import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue"; import { breakpointsTailwind, useBreakpoints } from "@vueuse/core"; import { computed, onMounted, reactive } from "vue"; import { useTranslation } from "i18next-vue"; +import CoursePreviewBar from "@/components/header/CoursePreviewBar.vue"; log.debug("MainNavigationBar created"); @@ -41,13 +42,22 @@ const selectedCourseSessionTitle = computed(() => { return courseSessionsStore.currentCourseSession?.title; }); +const isTrainerInCourseSessionPreview = computed(() => { + // todo wip @livioso check if this is correct? + const isTrainer = + courseSessionsStore.currentCourseSession && + courseSessionsStore.currentCourseSessionHasCockpit; + return isTrainer && !inCockpit(); +}); + onMounted(() => { log.debug("MainNavigationBar mounted"); });