From f9a47d4941627dbb2ea3d53dfb91b486bb2551f6 Mon Sep 17 00:00:00 2001 From: EwoutV Date: Tue, 2 Apr 2024 23:19:17 +0200 Subject: [PATCH 1/6] chore: dashboard & project cleanup --- frontend/.eslintrc.cjs | 6 +- frontend/.prettierrc | 12 +- .../src/assets/scss/theme/_variables.scss | 10 +- .../base/components/input/_dropdown.scss | 10 +- frontend/src/assets/scss/theme/theme.scss | 2 +- frontend/src/components/Dummy.vue | 2 +- frontend/src/components/LanguageSelector.vue | 41 +- frontend/src/components/RoleSelector.vue | 30 +- frontend/src/components/YearSelector.vue | 34 ++ .../src/components/courses/CourseCard.vue | 36 +- .../src/components/courses/CourseList.vue | 36 ++ frontend/src/components/layout/BaseLayout.vue | 6 +- frontend/src/components/layout/Footer.vue | 16 +- frontend/src/components/layout/Header.vue | 76 +-- frontend/src/components/layout/Title.vue | 4 +- .../src/components/projects/GroupCard.vue | 32 +- .../src/components/projects/ProjectCard.vue | 66 ++- .../src/components/projects/ProjectList.vue | 62 +++ frontend/src/composables/axios.ts | 18 +- frontend/src/composables/configuration.ts | 16 +- frontend/src/composables/i18n.ts | 16 +- .../composables/services/admins.service.ts | 53 +- .../composables/services/assistant.service.ts | 131 +++-- .../composables/services/courses.service.ts | 96 ++-- .../composables/services/faculties.service.ts | 54 +- .../composables/services/groups.service.ts | 73 ++- frontend/src/composables/services/helpers.ts | 132 ++--- .../composables/services/project.service.ts | 138 ++---- .../services/structure_check.service.ts | 83 +--- .../composables/services/students.service.ts | 172 +++---- .../services/submission.service.ts | 76 ++- .../services/submissionStatus.service.ts | 32 -- .../services/submission_status.service.ts | 23 + .../composables/services/teachers.service.ts | 125 +++-- frontend/src/config/endpoints.ts | 28 +- frontend/src/config/environment.ts | 2 +- frontend/src/main.ts | 32 +- .../src/router/guards/authentication.guard.ts | 22 +- frontend/src/router/guards/logout.guard.ts | 17 +- frontend/src/router/router.ts | 90 ++-- frontend/src/store/authentication.store.ts | 130 +++-- frontend/src/store/messages.store.ts | 16 +- frontend/src/test/e2e/login.cy.ts | 16 +- frontend/src/test/unit/admin_service.test.ts | 92 ++-- .../src/test/unit/assistant_service.test.ts | 146 +++--- frontend/src/test/unit/course_service.test.ts | 234 ++++----- .../src/test/unit/faculty_service.test.ts | 36 +- frontend/src/test/unit/group_service.test.ts | 82 +-- .../src/test/unit/project_service.test.ts | 220 ++++----- frontend/src/test/unit/setup.ts | 467 +++++++----------- .../src/test/unit/structure_check.test.ts | 76 +-- .../src/test/unit/student_service.test.ts | 290 +++++------ .../src/test/unit/submission_service.test.ts | 96 ++-- .../unit/submission_status_service.test.ts | 20 +- .../src/test/unit/teacher_service.test.ts | 146 +++--- frontend/src/types/Course.ts | 20 +- frontend/src/types/Faculty.ts | 2 +- frontend/src/types/Group.ts | 18 +- frontend/src/types/Projects.ts | 16 +- frontend/src/types/Response.ts | 2 +- frontend/src/types/StructureCheck.ts | 8 +- frontend/src/types/SubmisionStatus.ts | 6 +- frontend/src/types/Submission.ts | 8 +- frontend/src/types/{ => users}/Assistant.ts | 31 +- frontend/src/types/users/Generics.ts | 5 + frontend/src/types/{ => users}/Student.ts | 29 +- frontend/src/types/{ => users}/Teacher.ts | 29 +- frontend/src/types/{ => users}/User.ts | 27 +- frontend/src/views/App.vue | 29 +- .../src/views/authentication/LoginView.vue | 34 +- .../src/views/authentication/VerifyView.vue | 22 +- frontend/src/views/calendar/CalendarView.vue | 93 ++-- frontend/src/views/courses/CourseView.vue | 20 +- .../src/views/courses/CreateCourseView.vue | 86 ++-- .../src/views/dashboard/DashboardView.vue | 260 ++++------ frontend/src/views/projects/ProjectView.vue | 76 +-- frontend/src/vite-env.d.ts | 2 +- frontend/tsconfig.json | 67 ++- 78 files changed, 2150 insertions(+), 2717 deletions(-) create mode 100644 frontend/src/components/YearSelector.vue create mode 100644 frontend/src/components/courses/CourseList.vue create mode 100644 frontend/src/components/projects/ProjectList.vue delete mode 100644 frontend/src/composables/services/submissionStatus.service.ts create mode 100644 frontend/src/composables/services/submission_status.service.ts rename frontend/src/types/{ => users}/Assistant.ts (65%) create mode 100644 frontend/src/types/users/Generics.ts rename frontend/src/types/{ => users}/Student.ts (69%) rename frontend/src/types/{ => users}/Teacher.ts (69%) rename frontend/src/types/{ => users}/User.ts (75%) diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index 8e1d2914..e177d614 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -37,7 +37,9 @@ module.exports = { "vue/multi-word-component-names": "off", // Disable rule that requires multi-word component names in Vue files "@typescript-eslint/no-floating-promises": "off", // Disable rule that flags floating promises in .ts files "@typescript-eslint/no-extraneous-class": "off", // Disable rule that flags usage of unnecessary classes in the codebase - "@typescript-eslint/unbound-method": "off", // Disable rule that refuses unboud methods that could scope `this` - "prettier/prettier": "error" + "@typescript-eslint/unbound-method": "off", // Disable rule that refuses unbound methods that could scope `this` + "prettier/prettier": "error", + "function-paren-newline": "off", + "function-call-argument-newline": "off" } } diff --git a/frontend/.prettierrc b/frontend/.prettierrc index a05a2b1e..62d1b562 100644 --- a/frontend/.prettierrc +++ b/frontend/.prettierrc @@ -1,7 +1,11 @@ { "tabWidth": 4, - "semi": false, - "trailingComma": "none", - "bracketSpacing": true, - "singleQuote": true + "printWidth": 140, + "max_line_length": 140, + "semi": true, + "singleQuote": true, + "arrowParens": "always", + "wrapParens": "avoid", + "jsxBracketSameLine": true, + "bracketSameLine": true } \ No newline at end of file diff --git a/frontend/src/assets/scss/theme/_variables.scss b/frontend/src/assets/scss/theme/_variables.scss index 3664f1bd..72fa60b3 100644 --- a/frontend/src/assets/scss/theme/_variables.scss +++ b/frontend/src/assets/scss/theme/_variables.scss @@ -95,10 +95,10 @@ $inputListPadding:0 0 !default; $inputListItemPadding:.75rem 1.25rem !default; $inputListItemBg:transparent !default; $inputListItemTextColor:$shade700 !default; -$inputListItemHoverBg:$shade200 !default; -$inputListItemTextHoverColor:$shade700 !default; +$inputListItemHoverBg:$highlightBg !default; +$inputListItemTextHoverColor:$primaryColor !default; $inputListItemFocusBg:$shade300 !default; -$inputListItemTextFocusColor:$shade700 !default; +$inputListItemTextFocusColor: red !default; $inputListItemBorder:0 none !default; $inputListItemBorderRadius:0 !default; $inputListItemMargin:0 !default; @@ -112,8 +112,8 @@ $inputListHeaderBorder:1px solid $shade300 !default; //inputs with overlays (e.g. autocomplete, dropdown, multiselect) $inputOverlayBg:$inputListBg !default; $inputOverlayHeaderBg:$inputListHeaderBg !default; -$inputOverlayBorder:0 none !default; -$inputOverlayShadow:0 2px 12px 0 rgba(0,0,0,.1) !default; +$inputOverlayBorder: 1px solid $highlightBg !default; +$inputOverlayShadow: none !default; //password $passwordMeterBg:$shade300 !default; diff --git a/frontend/src/assets/scss/theme/base/components/input/_dropdown.scss b/frontend/src/assets/scss/theme/base/components/input/_dropdown.scss index d41348dc..8b5f11c4 100644 --- a/frontend/src/assets/scss/theme/base/components/input/_dropdown.scss +++ b/frontend/src/assets/scss/theme/base/components/input/_dropdown.scss @@ -169,7 +169,7 @@ input.p-dropdown-label { background: $inputOverlayBg; color: $inputListTextColor; border: $inputOverlayBorder; - border-radius: $borderRadius; + border-radius:0; box-shadow: $inputOverlayShadow; .p-dropdown-header { @@ -206,14 +206,14 @@ input.p-dropdown-label { &:first-child { margin-top: 0; - border-top-left-radius: $borderRadius; - border-top-right-radius: $borderRadius; + border-top-left-radius:0; + border-top-right-radius:0; } &:last-child { margin-bottom: 0; - border-bottom-left-radius: $borderRadius; - border-bottom-right-radius: $borderRadius; + border-bottom-left-radius:0; + border-bottom-right-radius:0; } &.p-highlight { diff --git a/frontend/src/assets/scss/theme/theme.scss b/frontend/src/assets/scss/theme/theme.scss index 6c7bdf8d..c8359a42 100644 --- a/frontend/src/assets/scss/theme/theme.scss +++ b/frontend/src/assets/scss/theme/theme.scss @@ -12,7 +12,7 @@ $secondaryTextColor: #000000 !default; $highlightBg: $primaryLightColor !default; $highlightTextColor: $primaryDarkerColor !default; -$highlightFocusBg: rgba($primaryColor, .24) !default; +$highlightFocusBg: rgba($primaryColor, .1) !default; @import 'variables'; @import 'extensions'; diff --git a/frontend/src/components/Dummy.vue b/frontend/src/components/Dummy.vue index 56b87abc..514b58f4 100644 --- a/frontend/src/components/Dummy.vue +++ b/frontend/src/components/Dummy.vue @@ -1,5 +1,5 @@