From 68461a0aac96a8166513612ec3f2ae8a3e67ba75 Mon Sep 17 00:00:00 2001 From: EwoutV Date: Thu, 4 Apr 2024 18:42:33 +0200 Subject: [PATCH] chore: pr comments --- backend/api/views/course_view.py | 2 - backend/authentication/views.py | 2 +- backend/ypovoli/settings.py | 1 + frontend/.prettierrc | 9 +- frontend/src/components/LanguageSelector.vue | 8 +- frontend/src/components/RoleSelector.vue | 16 +- frontend/src/components/YearSelector.vue | 15 +- .../components/courses/CourseDetailCard.vue | 16 +- .../components/courses/CourseGeneralCard.vue | 3 +- .../src/components/courses/CourseList.vue | 9 +- .../students/StudentCourseJoinButton.vue | 20 +- frontend/src/components/layout/Footer.vue | 5 +- frontend/src/components/layout/Header.vue | 27 +- .../src/components/projects/GroupCard.vue | 4 +- .../src/components/projects/ProjectCard.vue | 24 +- .../src/components/projects/ProjectList.vue | 14 +- frontend/src/composables/filters/paginator.ts | 8 +- .../composables/services/admins.service.ts | 7 +- .../composables/services/assistant.service.ts | 62 +--- .../composables/services/courses.service.ts | 61 +--- .../composables/services/faculties.service.ts | 14 +- .../composables/services/groups.service.ts | 27 +- frontend/src/composables/services/helpers.ts | 47 +-- .../composables/services/project.service.ts | 68 +--- .../services/structure_check.service.ts | 49 +-- .../composables/services/students.service.ts | 91 +---- .../services/submission.service.ts | 32 +- .../services/submission_status.service.ts | 15 +- .../composables/services/teachers.service.ts | 52 +-- .../src/router/guards/authentication.guard.ts | 4 +- frontend/src/router/guards/logout.guard.ts | 5 +- frontend/src/router/router.ts | 6 +- frontend/src/store/authentication.store.ts | 15 +- frontend/src/test/unit/admin_service.test.ts | 24 +- .../src/test/unit/assistant_service.test.ts | 20 +- .../src/test/unit/project_service.test.ts | 40 +-- frontend/src/test/unit/setup.ts | 337 ++++++------------ .../src/test/unit/student_service.test.ts | 44 +-- .../src/test/unit/submission_service.test.ts | 20 +- .../unit/submission_status_service.test.ts | 3 +- .../src/test/unit/teacher_service.test.ts | 20 +- frontend/src/types/Course.ts | 3 +- frontend/src/types/Group.ts | 8 +- frontend/src/types/users/Assistant.ts | 4 +- frontend/src/types/users/User.ts | 5 +- frontend/src/views/App.vue | 5 +- .../src/views/authentication/LoginView.vue | 11 +- frontend/src/views/calendar/CalendarView.vue | 22 +- .../src/views/courses/CreateCourseView.vue | 34 +- .../src/views/courses/SearchCourseView.vue | 38 +- .../src/views/dashboard/DashboardView.vue | 4 +- .../dashboard/roles/StudentDashboardView.vue | 16 +- frontend/src/views/projects/ProjectView.vue | 4 +- 53 files changed, 342 insertions(+), 1058 deletions(-) diff --git a/backend/api/views/course_view.py b/backend/api/views/course_view.py index 370b1ee1..38537f39 100644 --- a/backend/api/views/course_view.py +++ b/backend/api/views/course_view.py @@ -61,8 +61,6 @@ def search(self, request: Request) -> Response: name__icontains=search ) - print(years, faculties) - # Filter the queryset based on selected years if years: queryset = queryset.filter(academic_startyear__in=years) diff --git a/backend/authentication/views.py b/backend/authentication/views.py index bb401cd0..617cd58e 100644 --- a/backend/authentication/views.py +++ b/backend/authentication/views.py @@ -23,7 +23,7 @@ def login(self, request: Request) -> Response: should_echo = request.query_params.get('echo', False) if should_echo == "1" and settings.DEBUG: - client._service_url = 'https://localhost:8080/api/auth/cas/echo' + client._service_url = settings.CAS_DEBUG_RESPONSE return redirect(client.get_login_url()) diff --git a/backend/ypovoli/settings.py b/backend/ypovoli/settings.py index ce904f80..27d287c9 100644 --- a/backend/ypovoli/settings.py +++ b/backend/ypovoli/settings.py @@ -91,6 +91,7 @@ PORT = environ.get("DJANGO_CAS_PORT", "8080") CAS_ENDPOINT = "https://login.ugent.be" CAS_RESPONSE = f"https://{DOMAIN_NAME}:{PORT}/auth/verify" +CAS_DEBUG_RESPONSE = f"https://{DOMAIN_NAME}:{PORT}/api/auth/cas/echo" API_ENDPOINT = f"https://{DOMAIN_NAME}/api" # Database diff --git a/frontend/.prettierrc b/frontend/.prettierrc index 57a4acdb..1d946086 100644 --- a/frontend/.prettierrc +++ b/frontend/.prettierrc @@ -1,11 +1,8 @@ { "tabWidth": 4, - "printWidth": 80, - "max_line_length": 80, + "printWidth": 120, + "max_line_length": 120, "semi": true, "singleQuote": true, - "arrowParens": "always", - "endOfLine": "auto", - "jsxBracketSameLine": true, - "bracketSameLine": true + "endOfLine": "auto" } \ No newline at end of file diff --git a/frontend/src/components/LanguageSelector.vue b/frontend/src/components/LanguageSelector.vue index b0c7b4e6..e4deaf19 100644 --- a/frontend/src/components/LanguageSelector.vue +++ b/frontend/src/components/LanguageSelector.vue @@ -50,13 +50,11 @@ onMounted(() => { class="w-auto" :options="availableLocales" @change="updateLocale($event.value)" - variant="outlined"> + variant="outlined" + > diff --git a/frontend/src/components/RoleSelector.vue b/frontend/src/components/RoleSelector.vue index 9d48294c..bc2bea57 100644 --- a/frontend/src/components/RoleSelector.vue +++ b/frontend/src/components/RoleSelector.vue @@ -10,26 +10,16 @@ const { view, user } = storeToRefs(useAuthStore()); diff --git a/frontend/src/components/layout/Footer.vue b/frontend/src/components/layout/Footer.vue index 8bb05b5c..3ac8e1bc 100644 --- a/frontend/src/components/layout/Footer.vue +++ b/frontend/src/components/layout/Footer.vue @@ -13,10 +13,7 @@ const logo: Record = { nl, en }; diff --git a/frontend/src/components/layout/Header.vue b/frontend/src/components/layout/Header.vue index 9f34b319..72615863 100644 --- a/frontend/src/components/layout/Header.vue +++ b/frontend/src/components/layout/Header.vue @@ -45,31 +45,24 @@ const items = computed(() => [ @@ -89,13 +83,10 @@ const items = computed(() => [