From 97f4e96b5c56b6bcba9a369ef4b64bf339278232 Mon Sep 17 00:00:00 2001 From: Reto Aebersold Date: Mon, 13 Nov 2023 13:41:37 +0100 Subject: [PATCH] feat: handle no course session --- .../components/dashboard/NoCourseSession.vue | 43 ++++++ .../src/components/onboarding/WizardPage.vue | 2 +- .../components/onboarding/WizardSidePanel.vue | 4 +- client/src/pages/DashboardPage.vue | 124 ------------------ client/src/pages/dashboard/DashboardPage.vue | 2 + .../src/pages/onboarding/AccountProfile.vue | 16 ++- client/src/pages/onboarding/WizardBase.vue | 8 +- client/src/stores/dashboard.ts | 2 +- 8 files changed, 67 insertions(+), 134 deletions(-) create mode 100644 client/src/components/dashboard/NoCourseSession.vue delete mode 100644 client/src/pages/DashboardPage.vue diff --git a/client/src/components/dashboard/NoCourseSession.vue b/client/src/components/dashboard/NoCourseSession.vue new file mode 100644 index 00000000..93b802c7 --- /dev/null +++ b/client/src/components/dashboard/NoCourseSession.vue @@ -0,0 +1,43 @@ + + + diff --git a/client/src/components/onboarding/WizardPage.vue b/client/src/components/onboarding/WizardPage.vue index d0f0943f..570081c0 100644 --- a/client/src/components/onboarding/WizardPage.vue +++ b/client/src/components/onboarding/WizardPage.vue @@ -7,7 +7,7 @@ const props = defineProps<{ diff --git a/client/src/pages/onboarding/WizardBase.vue b/client/src/pages/onboarding/WizardBase.vue index 5dc70552..3efdbcac 100644 --- a/client/src/pages/onboarding/WizardBase.vue +++ b/client/src/pages/onboarding/WizardBase.vue @@ -34,7 +34,11 @@ const courseData = computed(() => { diff --git a/client/src/stores/dashboard.ts b/client/src/stores/dashboard.ts index 7286eec6..1b011169 100644 --- a/client/src/stores/dashboard.ts +++ b/client/src/stores/dashboard.ts @@ -48,7 +48,7 @@ export const useDashboardStore = defineStore("dashboard", () => { const loadDashboardConfig = async () => { if (dashboardConfigs.value.length > 0) return; const configData = await fetchDashboardConfig(); - if (configData) { + if (configData && configData.length > 0) { dashboardConfigs.value = configData; await switchAndLoadDashboardConfig(configData[0]); }