From aafcc97949d8b29fbc76f9cf8eed8feccb9ccadc Mon Sep 17 00:00:00 2001 From: Felix Teutsch <63754496+FelixTeutsch@users.noreply.github.com> Date: Fri, 20 Jun 2025 00:40:31 +0200 Subject: [PATCH 01/11] feat(Frontend): add new cycle option for admin and fix drawer UI & Implementaiton (SCRUM-210) (#197) Co-authored-by: jb-cc <115902941+jb-cc@users.noreply.github.com> --- Frontend/components/SideDrawer/SideDrawer.vue | 173 ++++++++++-------- Frontend/i18n/locales/de-DE.json | 29 ++- Frontend/i18n/locales/en-GB.json | 31 +++- Frontend/layouts/GenericBackLayout.vue | 48 ++--- Frontend/package-lock.json | 1 + Frontend/package.json | 1 + Frontend/pages/admin/new-cycle.vue | 74 ++++++++ Frontend/plugins/fontawesome.js | 4 +- Frontend/shared/types/userInterfaces.ts | 14 ++ 9 files changed, 254 insertions(+), 121 deletions(-) create mode 100644 Frontend/pages/admin/new-cycle.vue diff --git a/Frontend/components/SideDrawer/SideDrawer.vue b/Frontend/components/SideDrawer/SideDrawer.vue index 6ae31da2..3dafd3ca 100644 --- a/Frontend/components/SideDrawer/SideDrawer.vue +++ b/Frontend/components/SideDrawer/SideDrawer.vue @@ -1,12 +1,13 @@ - diff --git a/Frontend/i18n/locales/de-DE.json b/Frontend/i18n/locales/de-DE.json index e23883df..ea58e03a 100644 --- a/Frontend/i18n/locales/de-DE.json +++ b/Frontend/i18n/locales/de-DE.json @@ -137,6 +137,14 @@ } } }, + "aria": { + "matching": { + "supervisor": { + "generalCard": "" + } + }, + "pageHeader": "Du bist auf der folgenden Seite: {pageName}" + }, "confirmation": { "acceptedOn": "Akzeptiert am: {date}", "details": "Bestätigungsdetails", @@ -227,6 +235,7 @@ "manageRequest": "Anfrage verwalten", "addStudent": "Als Betreute*r hinzufügen", "noVideoSupport": "Dein Browser unterstützt kein HTML-Video... ich denke, es ist Zeit für ein Upgrade deines Geräts!", + "nothing": "Nichts", "pendingRequestTo": "Ausstehende Anfrage an", "profile": "Profil", "profilePictureAlt": "Profil Bild von {firstName} {lastName}", @@ -254,6 +263,10 @@ "acceptRequest": "Betreuungsanfrage annehmen", "acceptRequestButton": "Anfrage annehmen", "acceptRequestDescription": "Möchten Sie die Betreuungsanfrage von {firstName} {lastName} annehmen? Nach Annahme seid ihr offiziell ein Betreuer-Studenten-Paar.", + "aria": { + "matchWith": "Betreuungsanfrage an {name} senden", + "reject": "Entferne {name}" + }, "confirmationToast": "Sie haben die Betreuungsanfrage {type}", "existingSupervision": { "actionButton": "Zurück zum Dashboard", @@ -399,9 +412,9 @@ "name": "Namen" }, "noResults": "Keine Suchergebnisse...", + "placeholderForAdmins": "Benutzer suchen...", "placeholderForStudents": "Betreuer suchen...", - "placeholderForSupervisors": "Studenten suchen...", - "placeholderForAdmins": "Benutzer suchen..." + "placeholderForSupervisors": "Studenten suchen..." }, "searchBar": { "noResults": "Keine Ergebnisse gefunden" @@ -480,6 +493,12 @@ "title": "Studierenden entfernen" } }, + "swipe": { + "announcement": { + "left": "Karte nach links gewischt.", + "right": "Karte nach links gewischt." + } + }, "tagPriority": { "arrangeByPriority": "Tags nach Priorität ordnen", "unknownTag": "Unbekannter Tag '{tagNumber}'" diff --git a/Frontend/i18n/locales/en-GB.json b/Frontend/i18n/locales/en-GB.json index 8b3b486a..c8570586 100644 --- a/Frontend/i18n/locales/en-GB.json +++ b/Frontend/i18n/locales/en-GB.json @@ -137,6 +137,14 @@ } } }, + "aria": { + "matching": { + "supervisor": { + "generalCard": "They have the following bio: {bio}. Their tags are: {tags}. Your compatabilty is {compatability}. They currently have {availableSpots} out of {totalSpots} slots available for supervision. Currently there are {pending} students pending." + } + }, + "pageHeader": "You are on the following page: {pageName}" + }, "confirmation": { "acceptedOn": "Accepted on: {date}", "details": "Confirmation Details", @@ -227,6 +235,7 @@ "manageRequest": "Manage Request", "addStudent": "Add as supervisee", "noVideoSupport": "Your browser does not support HTML video... i think its time to upgrade your device!", + "nothing": "Nothing", "pendingRequestTo": "Pending request to", "profile": "Profile", "profilePictureAlt": "Profile picture of {firstName} {lastName}", @@ -254,6 +263,10 @@ "acceptRequest": "Accept Supervision Request", "acceptRequestButton": "Accept Request", "acceptRequestDescription": "Would you like to accept the supervision request from {firstName} {lastName}? Once accepted You will officially be a supervisor-student pair", + "aria": { + "matchWith": "Match with {name}", + "reject": "Dismiss {name}" + }, "confirmationToast": "You {type} the supervision request", "existingSupervision": { "actionButton": "Go back to dashboard", @@ -399,9 +412,9 @@ "name": "Name" }, "noResults": "No search results...", + "placeholderForAdmins": "Search users...", "placeholderForStudents": "Search supervisor...", - "placeholderForSupervisors": "Search student...", - "placeholderForAdmins": "Search users..." + "placeholderForSupervisors": "Search student..." }, "searchBar": { "noResults": "No results found" @@ -480,6 +493,12 @@ "title": "Remove Student" } }, + "swipe": { + "announcement": { + "left": "Card has been swiped left.", + "right": "Card has been swiped right." + } + }, "tagPriority": { "arrangeByPriority": "Arrange tags by priority", "unknownTag": "Unbekannter Tag '{tagNumber}'" diff --git a/Frontend/pages/student/matching.vue b/Frontend/pages/student/matching.vue index 05939c97..f832bf9a 100644 --- a/Frontend/pages/student/matching.vue +++ b/Frontend/pages/student/matching.vue @@ -2,56 +2,64 @@
@@ -92,10 +100,7 @@ import { useSupervisorStore } from "~/stores/useSupervisorStore"; import { useSettingsStore } from "~/stores/useSettingsStore"; import { computed, nextTick, ref } from "vue"; import type { SupervisorData } from "~/shared/types/supervisorInterfaces"; -import type { - ConfirmationDialogData, - SupervisionRequestResponseData, -} from "~/shared/types/userInterfaces"; +import type { ConfirmationDialogData, SupervisionRequestResponseData, } from "~/shared/types/userInterfaces"; import { HttpMethods, supervisionRequestType } from "~/shared/enums/enums"; import type { SwipeContainer } from "#components"; import type { SupervisionRequestsData } from "#shared/types/supervisorInterfaces"; @@ -113,11 +118,11 @@ if (!userStore.user) { } const swipeContainerRefs = ref< - Record | null> + Record | null> >({}); const modalInformation = ref(null); const supervisionRequestReturnData = ref( - null + null ); const removedSupervisor = ref(null); const toast = ref({ @@ -135,7 +140,7 @@ onMounted(async () => { await studentStore.fetchSupervisionRequests(); } acceptedSupervisionRequests.value = - studentStore.acceptedSupervisionRequests[0]; + studentStore.acceptedSupervisionRequests[0]; }); onUnmounted(async () => { @@ -145,7 +150,7 @@ onUnmounted(async () => { }); if (!supervisorStore.supervisors || supervisorStore.supervisors.length === 0) { - const { data, error } = await useFetch(`/api/match/${userStore.user?.id}`, { + const { data, error } = await useFetch(`/api/match/${ userStore.user?.id }`, { method: HttpMethods.GET, }); if (error.value) { @@ -157,7 +162,7 @@ if (!supervisorStore.supervisors || supervisorStore.supervisors.length === 0) { } const recommendedSupervisors = computed(() => { - return [...supervisorStore.supervisors].sort((a, b) => { + return [ ...supervisorStore.supervisors ].sort((a, b) => { return b.compatibilityScore - a.compatibilityScore; }); }); @@ -170,7 +175,7 @@ const handleSwipeRight = async (supervisor: SupervisorData) => { removedSupervisor.value = supervisor; modalInformation.value = { type: supervisionRequestType.CONFIRM, - headline: `Request ${supervisor.firstName} ${supervisor.lastName}`, + headline: `Request ${ supervisor.firstName } ${ supervisor.lastName }`, icon: "", warning: "", description: t("modal.supervisionInfo"), @@ -239,17 +244,17 @@ const handleToastClosed = () => { const handleActionConfirmation = async (supervisor: SupervisorData) => { if (modalInformation.value?.type === supervisionRequestType.CONFIRM) { const { data } = await useFetch( - `/api/supervision-requests`, - { - method: HttpMethods.POST, - body: { - supervisor_id: supervisor.supervisorId, - }, - } + `/api/supervision-requests`, + { + method: HttpMethods.POST, + body: { + supervisor_id: supervisor.supervisorId, + }, + } ); supervisionRequestReturnData.value = data.value; } else if (modalInformation.value?.type === supervisionRequestType.DISMISS) { - await useFetch(`/api/users/${userStore.user?.id}/blocks`, { + await useFetch(`/api/users/${ userStore.user?.id }/blocks`, { method: HttpMethods.POST, body: { blocked_id: supervisor.supervisor_userId, @@ -286,7 +291,7 @@ const handleModalDontShowAgain = (type: supervisionRequestType) => { const openModal = async () => { await nextTick(); const modal = document.getElementById( - "confirmationModal" + "confirmationModal" ) as HTMLDialogElement; modal?.showModal(); }; @@ -294,7 +299,7 @@ const openModal = async () => { const showToastInformation = (type: string) => { if (modalInformation.value?.supervisor?.supervisor_userId) { supervisorStore.removeSupervisor( - modalInformation.value?.supervisor?.supervisor_userId + modalInformation.value?.supervisor?.supervisor_userId ); } if (type === supervisionRequestType.CONFIRM) { @@ -313,8 +318,8 @@ const showToastInformation = (type: string) => { }; const setItemRef = ( - el: InstanceType | null, - id: string + el: InstanceType | null, + id: string ) => { if (el) { swipeContainerRefs.value[id] = el; From 98c31c5cb4a7037b5a587f3e36728150d9f5778a Mon Sep 17 00:00:00 2001 From: FelixTeutsch Date: Fri, 20 Jun 2025 23:00:57 +0200 Subject: [PATCH 09/11] fix(Frontend): skip logo --- Frontend/components/AppHeader/AppHeader.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Frontend/components/AppHeader/AppHeader.vue b/Frontend/components/AppHeader/AppHeader.vue index 3aed3b38..745f846d 100644 --- a/Frontend/components/AppHeader/AppHeader.vue +++ b/Frontend/components/AppHeader/AppHeader.vue @@ -23,6 +23,8 @@ const props = withDefaults(defineProps(), { modelValue: "", }); +const { t } = useI18n(); + const goBack = () => { router.back(); }; @@ -58,6 +60,7 @@ const goBack = () => { : '../images/appHeader_logo_light.svg' " alt="Logo image" + aria-hidden="true" class="h-6" > @@ -73,6 +76,7 @@ const goBack = () => { Date: Fri, 20 Jun 2025 23:09:27 +0200 Subject: [PATCH 10/11] fix(Frontend): add german translation --- Frontend/i18n/locales/de-DE.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frontend/i18n/locales/de-DE.json b/Frontend/i18n/locales/de-DE.json index ea58e03a..292d4eeb 100644 --- a/Frontend/i18n/locales/de-DE.json +++ b/Frontend/i18n/locales/de-DE.json @@ -140,7 +140,7 @@ "aria": { "matching": { "supervisor": { - "generalCard": "" + "generalCard": "Diese Person hat folgendes Kurzprofil: {bio}. Ihre Tags sind: {tags}. Deine Kompatibilität beträgt {compatability}. Aktuell sind {availableSpots} von {totalSpots} Betreuungsplätzen verfügbar. Momentan warten {pending} Studierende auf eine Rückmeldung." } }, "pageHeader": "Du bist auf der folgenden Seite: {pageName}" @@ -518,4 +518,4 @@ "somethingWentWrong": "Etwas ist schief gelaufen, bitte versuchen Sie es später noch einmal", "addedStudentAsSupervisee": "Student wurde als Betreuer hinzugefügt" } -} \ No newline at end of file +} From 51f6ec4bca310f4502d0048cf44e7c624b828e13 Mon Sep 17 00:00:00 2001 From: FelixTeutsch Date: Fri, 20 Jun 2025 23:10:25 +0200 Subject: [PATCH 11/11] fix(Frontend): import i18n so the test are happy... --- Frontend/components/AppHeader/AppHeader.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/Frontend/components/AppHeader/AppHeader.vue b/Frontend/components/AppHeader/AppHeader.vue index 745f846d..e5a94123 100644 --- a/Frontend/components/AppHeader/AppHeader.vue +++ b/Frontend/components/AppHeader/AppHeader.vue @@ -1,6 +1,7 @@