diff --git a/frontend/.vite/deps/_metadata.json b/frontend/.vite/deps/_metadata.json new file mode 100644 index 00000000..b4fda3be --- /dev/null +++ b/frontend/.vite/deps/_metadata.json @@ -0,0 +1,8 @@ +{ + "hash": "2a2f1b62", + "configHash": "3d49becc", + "lockfileHash": "e3b0c442", + "browserHash": "86f7c323", + "optimized": {}, + "chunks": {} +} \ No newline at end of file diff --git a/frontend/.vite/deps/package.json b/frontend/.vite/deps/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/frontend/.vite/deps/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/frontend/package-lock.json b/frontend/package-lock.json index fe4ecfea..332f22c7 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -26,6 +26,7 @@ }, "devDependencies": { "@types/js-cookie": "^3.0.6", + "@types/jsdom": "^21.1.6", "@types/node": "^20.11.30", "@typescript-eslint/eslint-plugin": "^6.21.0", "@vitejs/plugin-vue": "^5.0.4", @@ -1088,6 +1089,17 @@ "integrity": "sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==", "dev": true }, + "node_modules/@types/jsdom": { + "version": "21.1.6", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.6.tgz", + "integrity": "sha512-/7kkMsC+/kMs7gAYmmBR9P0vGTnOoLhQhyhQJSlXGI5bzTHp6xdo0TtKWQAsz6pmSAeVqKSbqeyP6hytqr9FDw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1139,6 +1151,12 @@ "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.5.tgz", "integrity": "sha512-jmIUGWrAiwu3dZpxntxieC+1n/5c3mjrImkmOSQ2NC5uP6cYO4aAZDdSmRcI5C1oiTmqlZGHC+/NmJrKogbP5A==" }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true + }, "node_modules/@types/web-bluetooth": { "version": "0.0.20", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz", diff --git a/frontend/package.json b/frontend/package.json index da6f688c..7e95e033 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -33,6 +33,7 @@ }, "devDependencies": { "@types/js-cookie": "^3.0.6", + "@types/jsdom": "^21.1.6", "@types/node": "^20.11.30", "@typescript-eslint/eslint-plugin": "^6.21.0", "@vitejs/plugin-vue": "^5.0.4", diff --git a/frontend/src/components/courses/CourseGeneralCard.vue b/frontend/src/components/courses/CourseGeneralCard.vue index a2bb3ac2..8243b985 100644 --- a/frontend/src/components/courses/CourseGeneralCard.vue +++ b/frontend/src/components/courses/CourseGeneralCard.vue @@ -4,6 +4,7 @@ import type { Course } from '@/types/Course.ts'; import { type Faculty } from '@/types/Faculty.ts'; import { useAuthStore } from '@/store/authentication.store.ts'; import { storeToRefs } from 'pinia'; +import { type Student } from '@/types/users/Student.ts'; /* Props */ defineProps<{ @@ -11,7 +12,7 @@ defineProps<{ }>(); /* Composable injections */ -const { user, student } = storeToRefs(useAuthStore()); +const { user } = storeToRefs(useAuthStore()); /* State */ const images = Object.keys( @@ -52,7 +53,7 @@ function getFacultyIcon(faculty: Faculty): string {
- +
diff --git a/frontend/src/components/projects/ProjectList.vue b/frontend/src/components/projects/ProjectList.vue index 85571b7e..7c43b201 100644 --- a/frontend/src/components/projects/ProjectList.vue +++ b/frontend/src/components/projects/ProjectList.vue @@ -65,7 +65,7 @@ watch( diff --git a/frontend/src/composables/services/assistant.service.ts b/frontend/src/composables/services/assistant.service.ts index aa7e6a3f..e30c15ee 100644 --- a/frontend/src/composables/services/assistant.service.ts +++ b/frontend/src/composables/services/assistant.service.ts @@ -9,7 +9,7 @@ interface AssistantState { assistants: Ref; assistant: Ref; response: Ref; - getAssistantByID: (id: string, init: boolean) => Promise; + getAssistantByID: (id: string, init?: boolean) => Promise; getAssistantByCourse: (courseId: string) => Promise; getAssistants: () => Promise; assistantJoinCourse: (courseId: string, assistantId: string) => Promise; diff --git a/frontend/src/composables/services/students.service.ts b/frontend/src/composables/services/students.service.ts index dcf0ba53..ddd296cb 100644 --- a/frontend/src/composables/services/students.service.ts +++ b/frontend/src/composables/services/students.service.ts @@ -9,7 +9,7 @@ interface StudentsState { students: Ref; student: Ref; response: Ref; - getStudentByID: (id: string, init: boolean) => Promise; + getStudentByID: (id: string, init?: boolean) => Promise; getStudents: () => Promise; getStudentsByCourse: (courseId: string) => Promise; getStudentsByGroup: (groupId: string) => Promise; diff --git a/frontend/src/composables/services/teachers.service.ts b/frontend/src/composables/services/teachers.service.ts index 22ada208..474b9ec6 100644 --- a/frontend/src/composables/services/teachers.service.ts +++ b/frontend/src/composables/services/teachers.service.ts @@ -10,7 +10,7 @@ interface TeacherState { teachers: Ref; teacher: Ref; response: Ref; - getTeacherByID: (id: string, init: boolean) => Promise; + getTeacherByID: (id: string, init?: boolean) => Promise; getTeacherByCourse: (courseId: string) => Promise; getTeachers: () => Promise; teacherJoinCourse: (courseId: string, teacherId: string) => Promise; diff --git a/frontend/src/test/unit/admin_service.test.ts b/frontend/src/test/unit/admin_service.test.ts index 2c5a62c4..630394ae 100644 --- a/frontend/src/test/unit/admin_service.test.ts +++ b/frontend/src/test/unit/admin_service.test.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useAdmin } from '@/composables/services/admins.service.ts'; -import { User } from '../../types/users/User'; +import { User } from '@/types/users/User.ts'; const { admins, @@ -10,7 +10,6 @@ const { getAdmins, createAdmin, - deleteAdmin, } = useAdmin(); describe('admin', (): void => { diff --git a/frontend/src/test/unit/assistant_service.test.ts b/frontend/src/test/unit/assistant_service.test.ts index 5629f0ea..9a165a5a 100644 --- a/frontend/src/test/unit/assistant_service.test.ts +++ b/frontend/src/test/unit/assistant_service.test.ts @@ -1,23 +1,17 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useAssistant } from '@/composables/services/assistant.service.ts'; -import { User } from '../../types/users/User'; import { Assistant } from '@/types/users/Assistant'; const { assistants, assistant, - response, getAssistantByID, getAssistantByCourse, getAssistants, createAssistant, - deleteAssistant, - - assistantJoinCourse, - assistantLeaveCourse, } = useAssistant(); describe('assistant', (): void => { diff --git a/frontend/src/test/unit/faculty_service.test.ts b/frontend/src/test/unit/faculty_service.test.ts index c5f819b9..411e2d2b 100644 --- a/frontend/src/test/unit/faculty_service.test.ts +++ b/frontend/src/test/unit/faculty_service.test.ts @@ -1,16 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useFaculty } from '@/composables/services/faculties.service.ts'; -const { - faculties, - faculty, - getFacultyByID, - getFaculties, - - createFaculty, - deleteFaculty, -} = useFaculty(); +const { faculties, faculty, getFacultyByID, getFaculties } = useFaculty(); describe('faculty', (): void => { it('gets faculty data by id', async () => { diff --git a/frontend/src/test/unit/group_service.test.ts b/frontend/src/test/unit/group_service.test.ts index 0eec15ed..782f757a 100644 --- a/frontend/src/test/unit/group_service.test.ts +++ b/frontend/src/test/unit/group_service.test.ts @@ -1,17 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useGroup } from '@/composables/services/groups.service.ts'; -const { - groups, - group, - getGroupByID, - getGroupsByProject, - getGroupsByStudent, - - createGroup, - deleteGroup, -} = useGroup(); +const { groups, group, getGroupByID, getGroupsByProject, getGroupsByStudent } = useGroup(); describe('group', (): void => { it('gets group data by id', async () => { diff --git a/frontend/src/test/unit/student_service.test.ts b/frontend/src/test/unit/student_service.test.ts index a10cc132..484a751f 100644 --- a/frontend/src/test/unit/student_service.test.ts +++ b/frontend/src/test/unit/student_service.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useStudents } from '@/composables/services/students.service.ts'; import { Student } from '@/types/users/Student'; @@ -7,20 +7,11 @@ const { students, student, - response, - getStudentByID, getStudents, getStudentsByCourse, - getStudentsByGroup, createStudent, - deleteStudent, - - studentJoinCourse, - studentLeaveCourse, - studentJoinGroup, - studentLeaveGroup, } = useStudents(); describe('students', (): void => { diff --git a/frontend/src/test/unit/submission_service.test.ts b/frontend/src/test/unit/submission_service.test.ts index e555aa3f..1b484c50 100644 --- a/frontend/src/test/unit/submission_service.test.ts +++ b/frontend/src/test/unit/submission_service.test.ts @@ -1,17 +1,8 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useSubmission } from '@/composables/services/submission.service.ts'; -const { - submissions, - submission, - getSubmissionByID, - getSubmissionByProject, - getSubmissionByGroup, - - createSubmission, - deleteSubmission, -} = useSubmission(); +const { submissions, submission, getSubmissionByID, getSubmissionByProject, getSubmissionByGroup } = useSubmission(); describe('submissions', (): void => { it('gets submissions data by id', async () => { diff --git a/frontend/src/test/unit/submission_status_service.test.ts b/frontend/src/test/unit/submission_status_service.test.ts index 0573af2c..30aeb982 100644 --- a/frontend/src/test/unit/submission_status_service.test.ts +++ b/frontend/src/test/unit/submission_status_service.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useSubmissionStatus } from '@/composables/services/submission_status.service.ts'; const { submissionStatus, getSubmissionStatusByProject } = useSubmissionStatus(); diff --git a/frontend/src/test/unit/teacher_service.test.ts b/frontend/src/test/unit/teacher_service.test.ts index e0816395..c29dc6bf 100644 --- a/frontend/src/test/unit/teacher_service.test.ts +++ b/frontend/src/test/unit/teacher_service.test.ts @@ -1,21 +1,14 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, it, expect, beforeEach } from 'vitest'; +import { describe, it, expect } from 'vitest'; import { useTeacher } from '@/composables/services/teachers.service.ts'; const { teachers, teacher, - response, getTeacherByID, getTeacherByCourse, getTeachers, - - createTeacher, - deleteTeacher, - - teacherJoinCourse, - teacherLeaveCourse, } = useTeacher(); describe('teachers', (): void => { diff --git a/frontend/src/types/users/Assistant.ts b/frontend/src/types/users/Assistant.ts index 0f2604e6..a6e3d02c 100644 --- a/frontend/src/types/users/Assistant.ts +++ b/frontend/src/types/users/Assistant.ts @@ -29,7 +29,6 @@ export class Assistant extends User { faculties, create_time, last_login, - courses, ); } diff --git a/frontend/src/types/users/Teacher.ts b/frontend/src/types/users/Teacher.ts index 1273a3c5..b1b1662b 100644 --- a/frontend/src/types/users/Teacher.ts +++ b/frontend/src/types/users/Teacher.ts @@ -29,7 +29,6 @@ export class Teacher extends User { faculties, create_time, last_login, - courses, ); } diff --git a/frontend/src/views/projects/ProjectView.vue b/frontend/src/views/projects/ProjectView.vue index d3ef4c47..c7fca835 100644 --- a/frontend/src/views/projects/ProjectView.vue +++ b/frontend/src/views/projects/ProjectView.vue @@ -33,7 +33,7 @@ const filteredCourses = computed(
{{ t('views.dashboard.projects') }} - +