diff --git a/client/src/components/dashboard/CourseDetailDates.vue b/client/src/components/dashboard/CourseDetailDates.vue new file mode 100644 index 00000000..a06621dd --- /dev/null +++ b/client/src/components/dashboard/CourseDetailDates.vue @@ -0,0 +1,41 @@ + + + + + {{ $t("a.Aktueller Lehrgang") }} + + + {{ dashboardStore.currentDashboardConfig.name }} + + {{ $t("a.Cockpit anschauen") }} + + + + + + {{ $t("a.Alle Lehrgänge anzeigen") }} + + + {{ $t("a.AlleTermine") }} + + diff --git a/client/src/components/dashboard/SimpleDates.vue b/client/src/components/dashboard/SimpleDates.vue index 093b2cda..09f1bd9a 100644 --- a/client/src/components/dashboard/SimpleDates.vue +++ b/client/src/components/dashboard/SimpleDates.vue @@ -7,7 +7,7 @@ const allDueDates = courseSessionsStore.allDueDates(); - Termine + {{ $t("a.AlleTermine") }} - - diff --git a/client/src/gql/graphql.ts b/client/src/gql/graphql.ts index 13fa0a31..dfd28b51 100644 --- a/client/src/gql/graphql.ts +++ b/client/src/gql/graphql.ts @@ -442,7 +442,7 @@ export type DashboardConfigType = { export type DashboardType = | 'PROGRESS_DASHBOARD' - | 'SIMPLE_LIST_DASHBOARD' + | 'SIMPLE_DASHBOARD' | 'STATISTICS_DASHBOARD'; export type DueDateObjectType = { diff --git a/client/src/gql/schema.graphql b/client/src/gql/schema.graphql index 0021f8eb..0bb09f4a 100644 --- a/client/src/gql/schema.graphql +++ b/client/src/gql/schema.graphql @@ -203,7 +203,7 @@ type DashboardConfigType { enum DashboardType { STATISTICS_DASHBOARD PROGRESS_DASHBOARD - SIMPLE_LIST_DASHBOARD + SIMPLE_DASHBOARD } type LearningPathObjectType implements CoursePageInterface { diff --git a/client/src/pages/dashboard/CourseListPage.vue b/client/src/pages/dashboard/CourseListPage.vue new file mode 100644 index 00000000..fe76aa9e --- /dev/null +++ b/client/src/pages/dashboard/CourseListPage.vue @@ -0,0 +1,30 @@ + + + + + + + {{ config.name }} + + + {{ $t("a.Cockpit anschauen") }} + + + + + + diff --git a/client/src/pages/dashboard/DashboardPage.vue b/client/src/pages/dashboard/DashboardPage.vue index 9d3aa97c..4e9fd417 100644 --- a/client/src/pages/dashboard/DashboardPage.vue +++ b/client/src/pages/dashboard/DashboardPage.vue @@ -7,8 +7,9 @@ import SimpleDates from "@/components/dashboard/SimpleDates.vue"; import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue"; import { useDashboardStore } from "@/stores/dashboard"; import type { DashboardType } from "@/gql/graphql"; -import SimpleListPage from "@/pages/dashboard/SimpleListPage.vue"; +import SimpleCoursePage from "@/pages/dashboard/SimpleCoursePage.vue"; import LoadingSpinner from "@/components/ui/LoadingSpinner.vue"; +import CourseDetailDates from "@/components/dashboard/CourseDetailDates.vue"; const dashboardStore = useDashboardStore(); @@ -19,8 +20,8 @@ interface DashboardPage { const boards: Record = { PROGRESS_DASHBOARD: { main: ProgressPage, aside: SimpleDates }, - SIMPLE_LIST_DASHBOARD: { main: SimpleListPage, aside: SimpleDates }, - STATISTICS_DASHBOARD: { main: StatisticPage, aside: SimpleDates }, + SIMPLE_DASHBOARD: { main: SimpleCoursePage, aside: SimpleDates }, + STATISTICS_DASHBOARD: { main: StatisticPage, aside: CourseDetailDates }, }; onMounted(dashboardStore.loadDashboardDetails); diff --git a/client/src/pages/dashboard/SimpleListPage.vue b/client/src/pages/dashboard/SimpleCoursePage.vue similarity index 100% rename from client/src/pages/dashboard/SimpleListPage.vue rename to client/src/pages/dashboard/SimpleCoursePage.vue diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 709027e4..a9bb8728 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -198,6 +198,11 @@ const router = createRouter({ props: true, component: () => import("@/pages/dashboard/statistic/FeedbackList.vue"), }, + { + path: "list", + props: true, + component: () => import("@/pages/dashboard/CourseListPage.vue"), + }, ], }, { diff --git a/server/vbv_lernwelt/dashboard/graphql/queries.py b/server/vbv_lernwelt/dashboard/graphql/queries.py index a50dae23..ca278d15 100644 --- a/server/vbv_lernwelt/dashboard/graphql/queries.py +++ b/server/vbv_lernwelt/dashboard/graphql/queries.py @@ -72,7 +72,7 @@ class DashboardQuery(graphene.ObjectType): "course_id": c["id"], "name": c["title"], "slug": c["slug"], - "dashboard_type": DashboardType.SIMPLE_LIST_DASHBOARD, + "dashboard_type": DashboardType.SIMPLE_DASHBOARD, } for c in courses ] @@ -202,12 +202,12 @@ def get_user_course_session_dashboards( if len(roles) == 1: course_role = roles.pop() if course_role == CourseSessionUser.Role.EXPERT: - resolved_dashboard_type = DashboardType.SIMPLE_LIST_DASHBOARD + resolved_dashboard_type = DashboardType.SIMPLE_DASHBOARD elif course_role == CourseSessionUser.Role.MEMBER: resolved_dashboard_type = DashboardType.PROGRESS_DASHBOARD else: # fallback: just go with simple list dashboard - resolved_dashboard_type = DashboardType.SIMPLE_LIST_DASHBOARD + resolved_dashboard_type = DashboardType.SIMPLE_DASHBOARD dashboards.append( { diff --git a/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py b/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py index 3b3f11f7..2fc289e2 100644 --- a/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py +++ b/server/vbv_lernwelt/dashboard/graphql/types/dashboard.py @@ -52,7 +52,7 @@ class StatisticsCourseSessionPropertiesType(graphene.ObjectType): class DashboardType(Enum): STATISTICS_DASHBOARD = "StatisticsDashboard" PROGRESS_DASHBOARD = "ProgressDashboard" - SIMPLE_LIST_DASHBOARD = "SimpleListDashboard" + SIMPLE_DASHBOARD = "SimpleDashboard" class DashboardConfigType(graphene.ObjectType): diff --git a/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py b/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py index 6221f186..6b4c57df 100644 --- a/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py +++ b/server/vbv_lernwelt/dashboard/tests/graphql/test_dashboard.py @@ -211,7 +211,7 @@ class DashboardTestCase(GraphQLTestCase): self.assertIsNotNone(course_3_config) self.assertEqual(course_3_config["name"], course_3.title) self.assertEqual(course_3_config["slug"], course_3.slug) - self.assertEqual(course_3_config["dashboard_type"], "SIMPLE_LIST_DASHBOARD") + self.assertEqual(course_3_config["dashboard_type"], "SIMPLE_DASHBOARD") def test_course_statistics_deny_not_allowed_user(self): # GIVEN