Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 9, 2024
1 parent 7850ce7 commit 858eb6a
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 70 deletions.
18 changes: 18 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/courses/CourseGeneralCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ 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<{
course: Course;
}>();
/* Composable injections */
const { user, student } = storeToRefs(useAuthStore());
const { user } = storeToRefs(useAuthStore());
/* State */
const images = Object.keys(
Expand Down Expand Up @@ -52,7 +53,7 @@ function getFacultyIcon(faculty: Faculty): string {
</div>
</div>
<div v-if="user && user.isStudent()">
<StudentCourseJoinButton :student="student" :course="course" />
<StudentCourseJoinButton :student="user as Student" :course="course" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/projects/ProjectList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ watch(
<template v-if="allProjects.length > 0">
<div class="grid align-items-stretch">
<div class="col-12 md:col-6 lg:col-4 xl:col-3" v-for="project in sortedProjects" :key="project.id">
<ProjectCard class="h-100" :project="project" :course="project.course" />
<ProjectCard class="h-100" :project="project" :course="project.course" v-if="project.course !== null" />
</div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/composables/services/assistant.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface AssistantState {
assistants: Ref<Assistant[] | null>;
assistant: Ref<Assistant | null>;
response: Ref<Response | null>;
getAssistantByID: (id: string, init: boolean) => Promise<void>;
getAssistantByID: (id: string, init?: boolean) => Promise<void>;
getAssistantByCourse: (courseId: string) => Promise<void>;
getAssistants: () => Promise<void>;
assistantJoinCourse: (courseId: string, assistantId: string) => Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/composables/services/students.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface StudentsState {
students: Ref<Student[] | null>;
student: Ref<Student | null>;
response: Ref<Response | null>;
getStudentByID: (id: string, init: boolean) => Promise<void>;
getStudentByID: (id: string, init?: boolean) => Promise<void>;
getStudents: () => Promise<void>;
getStudentsByCourse: (courseId: string) => Promise<void>;
getStudentsByGroup: (groupId: string) => Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/composables/services/teachers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface TeacherState {
teachers: Ref<Teacher[] | null>;
teacher: Ref<Teacher | null>;
response: Ref<Response | null>;
getTeacherByID: (id: string, init: boolean) => Promise<void>;
getTeacherByID: (id: string, init?: boolean) => Promise<void>;
getTeacherByCourse: (courseId: string) => Promise<void>;
getTeachers: () => Promise<void>;
teacherJoinCourse: (courseId: string, teacherId: string) => Promise<void>;
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/test/unit/admin_service.test.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -10,7 +10,6 @@ const {
getAdmins,

createAdmin,
deleteAdmin,
} = useAdmin();

describe('admin', (): void => {
Expand Down
8 changes: 1 addition & 7 deletions frontend/src/test/unit/assistant_service.test.ts
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down
12 changes: 2 additions & 10 deletions frontend/src/test/unit/faculty_service.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
13 changes: 2 additions & 11 deletions frontend/src/test/unit/group_service.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
11 changes: 1 addition & 10 deletions frontend/src/test/unit/student_service.test.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
/* 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';

const {
students,
student,

response,

getStudentByID,
getStudents,
getStudentsByCourse,
getStudentsByGroup,

createStudent,
deleteStudent,

studentJoinCourse,
studentLeaveCourse,
studentJoinGroup,
studentLeaveGroup,
} = useStudents();

describe('students', (): void => {
Expand Down
13 changes: 2 additions & 11 deletions frontend/src/test/unit/submission_service.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/test/unit/submission_status_service.test.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/test/unit/teacher_service.test.ts
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/types/users/Assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class Assistant extends User {
faculties,
create_time,
last_login,
courses,
);
}

Expand Down
1 change: 0 additions & 1 deletion frontend/src/types/users/Teacher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class Teacher extends User {
faculties,
create_time,
last_login,
courses,
);
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/projects/ProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const filteredCourses = computed(
<div class="flex justify-content-between align-items-center mb-6">
<!-- Project list title -->
<Title class="m-0">{{ t('views.dashboard.projects') }}</Title>
<YearSelector :years="user?.academic_years" v-model="selectedYear" />
<YearSelector :years="user.academic_years" v-model="selectedYear" v-if="user" />
</div>

<ProjectList v-if="filteredCourses" :courses="filteredCourses" />
Expand Down

0 comments on commit 858eb6a

Please sign in to comment.