diff --git a/client/src/components/dueDates/DueDateSingle.vue b/client/src/components/dueDates/DueDateSingle.vue index c7a14785..aa4a54a7 100644 --- a/client/src/components/dueDates/DueDateSingle.vue +++ b/client/src/components/dueDates/DueDateSingle.vue @@ -2,8 +2,8 @@ import type { CourseSession, DueDate } from "@/types"; import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useTranslation } from "i18next-vue"; -import dayjs from "dayjs"; import { computed } from "vue"; +import dayjs from "dayjs"; const props = defineProps<{ dueDate: DueDate; @@ -48,24 +48,23 @@ const courseSessionTitle = computed(() => {
- {{ dayjs(props.dueDate.start).format("D. MMMM YYYY") }}: - - - {{ " " }} + {{ dayjs(props.dueDate.start).format("dddd D. MMMM YYYY") }} - -
+
+
+ {{ dateType }} +
+ +
+ {{ assignmentType }} +
+ +
+ {{ props.dueDate.title }} +
+
diff --git a/client/src/composables.ts b/client/src/composables.ts index ca61ea2a..8cc0f03e 100644 --- a/client/src/composables.ts +++ b/client/src/composables.ts @@ -8,8 +8,12 @@ import { circleFlatLearningUnits, someFinishedInLearningSequence, } from "@/services/circle"; -import type { DashboardPersonType } from "@/services/dashboard"; -import { fetchDashboardPersons, fetchStatisticData } from "@/services/dashboard"; +import type { DashboardDueDate, DashboardPersonType } from "@/services/dashboard"; +import { + fetchDashboardDueDates, + fetchDashboardPersons, + fetchStatisticData, +} from "@/services/dashboard"; import { presignUpload, uploadFile } from "@/services/files"; import { useCompletionStore } from "@/stores/completion"; import { useCourseSessionsStore } from "@/stores/courseSessions"; @@ -30,6 +34,7 @@ import type { PerformanceCriteria, } from "@/types"; import { useQuery } from "@urql/vue"; +import { t } from "i18next"; import orderBy from "lodash/orderBy"; import log from "loglevel"; import type { ComputedRef, Ref } from "vue"; @@ -494,12 +499,28 @@ export function useMyLearningMentors() { export function useDashboardPersons() { const dashboardPersons = ref([]); + const dashboardDueDates = ref([]); const loading = ref(false); const fetchData = async () => { loading.value = true; try { - dashboardPersons.value = await fetchDashboardPersons(); + const [persons, dueDates] = await Promise.all([ + fetchDashboardPersons(), + fetchDashboardDueDates(), + ]); + dashboardPersons.value = persons; + dashboardDueDates.value = dueDates.map((dueDate) => { + const dateType = t(dueDate.date_type_translation_key); + const assignmentType = t(dueDate.assignment_type_translation_key); + dueDate.translatedType = dateType; + if (assignmentType) { + dueDate.translatedType += " " + assignmentType; + } + return dueDate; + }); + } catch (error) { + console.error("Error fetching data:", error); } finally { loading.value = false; } @@ -509,6 +530,7 @@ export function useDashboardPersons() { return { dashboardPersons, + dashboardDueDates, loading, }; } diff --git a/client/src/pages/dashboard/DashboardDueDatesPage.vue b/client/src/pages/dashboard/DashboardDueDatesPage.vue new file mode 100644 index 00000000..3d0496ee --- /dev/null +++ b/client/src/pages/dashboard/DashboardDueDatesPage.vue @@ -0,0 +1,234 @@ + + + diff --git a/client/src/pages/dashboard/DashboardPersonsPage.vue b/client/src/pages/dashboard/DashboardPersonsPage.vue index 821302e9..1a2f6610 100644 --- a/client/src/pages/dashboard/DashboardPersonsPage.vue +++ b/client/src/pages/dashboard/DashboardPersonsPage.vue @@ -19,7 +19,7 @@ type MenuItem = { const { t } = useTranslation(); -const { loading: loadingPersons, dashboardPersons } = useDashboardPersons(); +const { loading, dashboardPersons } = useDashboardPersons(); const courses = computed(() => { return [ @@ -64,10 +64,6 @@ const courseSessions = computed(() => { ]; }); -watch(selectedCourse, () => { - selectedSession.value = courseSessions.value[0]; -}); - const selectedSession = ref(courseSessions.value[0]); const filteredPersons = computed(() => { @@ -113,11 +109,15 @@ function personRoleDisplayValue(personCourseSession: DashboardPersonCourseSessio return ""; } + +watch(selectedCourse, () => { + selectedSession.value = courseSessions.value[0]; +});