diff --git a/caprover_deploy.sh b/caprover_deploy.sh index 23a89760..f31cdba0 100755 --- a/caprover_deploy.sh +++ b/caprover_deploy.sh @@ -16,10 +16,6 @@ echo "$BRANCH_NAME_SLUG" DEFAULT_APP_NAME="vbv-$BRANCH_NAME_SLUG" APP_NAME=${1:-$DEFAULT_APP_NAME} -# remove multiple dashes and make sure it does not end with a dash -APP_NAME=$(echo "$APP_NAME" | sed -E 's/-+/-/g') -APP_NAME=$(echo "$APP_NAME" | sed 's/-\+$//') - # shorten APP_NAME to 32 characters # app names with more character seem to fail in some steps in CapRover # CapRover generates longer names out from the app name and there @@ -29,6 +25,10 @@ if (( ${#APP_NAME} > 32 )); then APP_NAME=$(echo -n "${APP_NAME:0:28}-${hash}") fi +# remove multiple dashes and make sure it does not end with a dash +APP_NAME=$(echo "$APP_NAME" | sed -E 's/-+/-/g') +APP_NAME=$(echo "$APP_NAME" | sed 's/-\+$//') + echo "Deploy to $APP_NAME" VITE_GRAPHQL_URL="/server/graphql/" diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index 7ebbe0e7..5a7f599b 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -106,7 +106,7 @@ onMounted(() => { v-if=" inCourse() && courseSessionsStore.currentCourseSession && - courseSessionsStore.hasCockpit + courseSessionsStore.currentCourseSessionHasCockpit " :to="`${courseSessionsStore.currentCourseSession.course_url}/cockpit`" class="nav-item" diff --git a/client/src/pages/DashboardPage.vue b/client/src/pages/DashboardPage.vue index d8ad0606..f9b20c08 100644 --- a/client/src/pages/DashboardPage.vue +++ b/client/src/pages/DashboardPage.vue @@ -2,8 +2,9 @@ import LearningPathDiagramSmall from "@/components/learningPath/LearningPathDiagramSmall.vue"; import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useUserStore } from "@/stores/user"; +import type { CourseSession } from "@/types"; import log from "loglevel"; -import { onMounted } from "vue"; +import { computed, onMounted } from "vue"; log.debug("DashboardPage created"); @@ -13,6 +14,15 @@ const courseSessionsStore = useCourseSessionsStore(); onMounted(async () => { log.debug("DashboardPage mounted"); }); + +const getNextStepLink = (courseSession: CourseSession) => { + return computed(() => { + if (courseSessionsStore.hasCockpit(courseSession)) { + return courseSession.cockpit_url; + } + return courseSession.learning_path_url; + }); +};