Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
BramMeir committed Apr 9, 2024
1 parent ee38acf commit 3446d62
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
2 changes: 0 additions & 2 deletions frontend/src/composables/services/courses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { endpoints } from '@/config/endpoints.ts';
import { get, getList, create, deleteId, getPaginatedList } from '@/composables/services/helpers.ts';
import { type PaginatorResponse } from '@/types/filter/Paginator.ts';
import { type Filter } from '@/types/filter/Filter.ts';
import { Response } from '@/types/Response.ts';

interface CoursesState {
pagination: Ref<PaginatorResponse<Course> | null>;
Expand All @@ -25,7 +24,6 @@ export function useCourses(): CoursesState {
const pagination = ref<PaginatorResponse<Course> | null>(null);
const courses = ref<Course[] | null>(null);
const course = ref<Course | null>(null);
const response = ref<Response | null>(null);

async function getCourseByID(id: string): Promise<void> {
const endpoint = endpoints.courses.retrieve.replace('{id}', id);
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/views/courses/CreateCourseView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const submitCourse = async (): Promise<void> => {
};
/* Get the current academic year */
const currentAcademicYear = () => {
const currentAcademicYear = (): number => {
if (new Date().getMonth() < 9) {
return new Date().getFullYear() - 1;
} else {
Expand Down Expand Up @@ -104,7 +104,13 @@ const currentAcademicYear = () => {
<!-- Course faculty -->
<div class="mb-4">
<label for="courseFaculty">{{ t('views.courses.faculty') }}</label>
<Dropdown id="courseFaculty" v-model="form.faculty" :options="faculties" optionLabel="name" v-if="faculties" />
<Dropdown
id="courseFaculty"
v-model="form.faculty"
:options="faculties"
optionLabel="name"
v-if="faculties"
/>
<ErrorMessage :field="v$.faculty" />
</div>

Expand Down
25 changes: 17 additions & 8 deletions frontend/src/views/projects/CreateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Calendar from 'primevue/calendar';
import BaseLayout from '@/components/layout/BaseLayout.vue';
import FileUpload from 'primevue/fileupload';
import Title from '@/components/layout/Title.vue';
import Tree from 'primevue/tree';
import { reactive, computed } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
Expand Down Expand Up @@ -55,16 +54,15 @@ const rules = computed(() => {
});
// Function to handle the file upload of a docker script
const onDockerScriptUpload = (event: any) => {
const onDockerScriptUpload = (event: any): void => {
form.dockerScript = event.files[0];
};
// Function to handle the file upload of a zip file containing the submission structure
const onZipStructureUpload = (event: any) => {
const onZipStructureUpload = (event: any): void => {
form.submissionStructure = event.files[0];
};
// useVuelidate function to perform form validation
const v$ = useVuelidate(rules, form);
Expand All @@ -88,7 +86,7 @@ const submitProject = async (): Promise<void> => {
form.maxScore,
form.scoreVisibility,
form.groupSize,
form.submissionStructure
form.submissionStructure,
),
params.courseId as string,
);
Expand Down Expand Up @@ -191,13 +189,25 @@ const submitProject = async (): Promise<void> => {
<!-- Upload field for docker script -->
<div class="mt-7 mb-4">
<label for="dockerScript">{{ t('views.projects.docker_upload') }}</label>
<FileUpload id="dockerScript" mode="basic" accept=".sh" :multiple="false" @select="onDockerScriptUpload"/>
<FileUpload
id="dockerScript"
mode="basic"
accept=".sh"
:multiple="false"
@select="onDockerScriptUpload"
/>
</div>

<!-- Upload field for a zip file that contains the submission structure -->
<div class="mb-4">
<label for="submissionStructure">{{ t('views.projects.submission_structure') }}</label>
<FileUpload id="submissionStructure" mode="basic" accept=".zip" :multiple="false" @select="onZipStructureUpload"/>
<FileUpload
id="submissionStructure"
mode="basic"
accept=".zip"
:multiple="false"
@select="onZipStructureUpload"
/>
</div>
</div>
</div>
Expand All @@ -222,5 +232,4 @@ label {
grid-template-columns: 1fr 1fr;
gap: 1rem;
}
</style>

0 comments on commit 3446d62

Please sign in to comment.