Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 12, 2024
1 parent 6f3468e commit d24003c
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 39 deletions.
7 changes: 6 additions & 1 deletion frontend/src/components/courses/CourseDetailCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ const { getRandomImport } = useGlob(import.meta.glob('@/assets/img/placeholders/
<template #footer>
<slot :course="course" name="footer">
<RouterLink :to="{ name: 'course', params: { courseId: course.id } }">
<Button :icon="PrimeIcons.ARROW_RIGHT" :label="t('components.card.open')" icon-pos="right" outlined />
<Button
:icon="PrimeIcons.ARROW_RIGHT"
:label="t('components.card.open')"
icon-pos="right"
outlined
/>
</RouterLink>
</slot>
</template>
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/courses/CourseList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ const { t } = useI18n();
<template #footer="{ course }">
<slot name="footer" :course="course">
<RouterLink :to="{ name: 'course', params: { courseId: course.id } }">
<Button :icon="PrimeIcons.ARROW_RIGHT" :label="t('components.card.open')" icon-pos="right" outlined />
<Button
:icon="PrimeIcons.ARROW_RIGHT"
:label="t('components.card.open')"
icon-pos="right"
outlined
/>
</RouterLink>
</slot>
</template>
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/components/projects/ProjectCreateButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const displayCourseSelection = ref(false);
class="m-3"
:draggable="false"
:contentStyle="{ 'min-width': '50vw' }"
modal>
modal
>
<template #header>
<h2 class="my-3 text-primary">
{{ t('views.dashboard.select_course') }}
Expand All @@ -46,7 +47,12 @@ const displayCourseSelection = ref(false);
<CourseList :cols="3" :courses="props.courses">
<template #footer="{ course }">
<RouterLink :to="{ name: 'project-create', params: { courseId: course.id } }">
<Button :icon="PrimeIcons.PLUS" :label="t('components.card.newProject')" icon-pos="right" outlined />
<Button
:icon="PrimeIcons.PLUS"
:label="t('components.card.newProject')"
icon-pos="right"
outlined
/>
</RouterLink>
</template>
</CourseList>
Expand All @@ -55,5 +61,4 @@ const displayCourseSelection = ref(false);
</div>
</template>

<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>
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 @@ -81,7 +81,7 @@ export function useStudents(): StudentsState {
endpoint,
{
user: studentData.id,
student_id: studentData.studentId
student_id: studentData.studentId,
},
student,
Student.fromJSON,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/composables/services/teachers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type Ref, ref } from 'vue';
import { endpoints } from '@/config/endpoints.ts';
import { get, getList, create, deleteId, deleteIdWithData } from '@/composables/services/helpers.ts';
import { useCourses } from '@/composables/services/courses.service.ts';
import { User } from '@/types/users/User.ts';
import { type User } from '@/types/users/User.ts';

interface TeacherState {
teachers: Ref<Teacher[] | null>;
Expand Down Expand Up @@ -63,7 +63,7 @@ export function useTeacher(): TeacherState {
await create<Teacher>(
endpoint,
{
user: user.id
user: user.id,
},
teacher,
Teacher.fromJSON,
Expand Down
16 changes: 7 additions & 9 deletions frontend/src/views/authentication/LoginView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,22 @@ const { t } = useI18n();
/>
</a>
</div>
<div class="w-12 md:w-7 flex flex-column md:flex-row align-items-center md:align-items-end justify-content-between relative surface-100">
<div
class="w-12 md:w-7 flex flex-column md:flex-row align-items-center md:align-items-end justify-content-between relative surface-100"
>
<img :src="Illustration" :alt="t('views.login.illustration')" class="w-10rem md:w-15rem m-4 ml-7" />
<div
class="bg-primary text-white p-4 w-full md:w-20rem"
>
<div class="bg-primary text-white p-4 w-full md:w-20rem">
<h1 class="mt-0">
{{ t('views.login.card.title') }}
</h1>
<span>
{{ t('views.login.card.subtitle') }}
</span>
{{ t('views.login.card.subtitle') }}
</span>
</div>
</div>
</div>
</div>
</BaseLayout>
</template>

<style lang="scss">
</style>
<style lang="scss"></style>
44 changes: 30 additions & 14 deletions frontend/src/views/calendar/CalendarView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const { query } = useRoute();
const { push } = useRouter();
/* Component state */
const allProjects = ref<Project[]|null>(null);
const allProjects = ref<Project[] | null>(null);
const selectedDate = ref<Date>(getQueryDate());
/* Service injection */
Expand All @@ -35,9 +35,11 @@ const formattedDate = computed(() => {
/* Filter the projects on the date selected on the calendar */
const projectsWithDeadline = computed(() => {
return allProjects.value?.filter((project) => {
return moment(project.deadline).isSame(moment(selectedDate.value), 'day');
}) ?? null;
return (
allProjects.value?.filter((project) => {
return moment(project.deadline).isSame(moment(selectedDate.value), 'day');
}) ?? null
);
});
/* Courses that take place on the selected date in the calendar => no display when the date is in the past */
Expand Down Expand Up @@ -191,7 +193,11 @@ watch(selectedDate, (date) => {
<template v-if="projectsWithDeadline !== null">
<template v-if="projectsWithDeadline.length > 0">
<!-- Project cards -->
<div class="flex flex-column xl:flex-row border-round-md" v-for="project in projectsWithDeadline" :key="project.id">
<div
class="flex flex-column xl:flex-row border-round-md"
v-for="project in projectsWithDeadline"
:key="project.id"
>
<!-- Icon -->
<div
class="bg-primary flex justify-content-center align-items-center p-4 xl:w-7rem xl:h-7rem"
Expand All @@ -204,12 +210,12 @@ watch(selectedDate, (date) => {
>
<RouterLink
:to="{
name: 'course-project',
params: {
courseId: project.course?.id,
projectId: project.id,
},
}"
name: 'course-project',
params: {
courseId: project.course?.id,
projectId: project.id,
},
}"
>
<h3 class="flex gap-3 align-items-center text-primary m-0 text-xl">
{{ project.name }} <span class="pi pi-arrow-right text-xl" />
Expand All @@ -226,13 +232,23 @@ watch(selectedDate, (date) => {
</template>
</template>
<template v-else>
<Skeleton height="7rem"/>
<Skeleton height="7rem" />
</template>
</div>

<template v-if="coursesWithProjectCreationPossibility.length > 0 && user?.isTeacher() || user?.isAssistant()">
<template
v-if="
(coursesWithProjectCreationPossibility.length > 0 && user?.isTeacher()) ||
user?.isAssistant()
"
>
<!-- Add project button -->
<ProjectCreateButton class="mt-5" :label="t('components.button.createProject')" severity="secondary" :courses="coursesWithProjectCreationPossibility" />
<ProjectCreateButton
class="mt-5"
:label="t('components.button.createProject')"
severity="secondary"
:courses="coursesWithProjectCreationPossibility"
/>
</template>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/dashboard/roles/StudentDashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ watch(

<template>
<!-- Course heading -->
<div class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mb-6">
<div
class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mb-6"
>
<!-- Course list title -->
<Title class="m-0">{{ t('views.dashboard.courses') }}</Title>

Expand Down
8 changes: 6 additions & 2 deletions frontend/src/views/dashboard/roles/TeacherDashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ watch(

<template>
<!-- Course heading -->
<div class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mb-6">
<div
class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mb-6"
>
<!-- Course list title -->
<Title class="m-0">{{ t('views.dashboard.courses') }}</Title>
<!-- Course list controls -->
Expand All @@ -66,7 +68,9 @@ watch(
<!-- Course list body -->
<CourseList :courses="filteredCourses" />
<!-- Project heading -->
<div class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mt-6 mb-5">
<div
class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mt-6 mb-5"
>
<!-- Project list title -->
<Title class="m-0">{{ t('views.dashboard.projects') }}</Title>

Expand Down
12 changes: 9 additions & 3 deletions frontend/src/views/projects/CreateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,14 @@ async function submitProject(): Promise<void> {
<label for="projectDescription">
{{ t('views.projects.description') }}
</label>
<Textarea id="projectDescription" class="w-full" v-model="form.description" autoResize rows="5" cols="30" />
<Textarea
id="projectDescription"
class="w-full"
v-model="form.description"
autoResize
rows="5"
cols="30"
/>
</div>
</div>

Expand Down Expand Up @@ -243,5 +250,4 @@ async function submitProject(): Promise<void> {
</BaseLayout>
</template>

<style scoped>
</style>
<style scoped></style>
4 changes: 3 additions & 1 deletion frontend/src/views/projects/ProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const filteredCourses = computed(
<template>
<BaseLayout>
<!-- Project heading -->
<div class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mb-5">
<div
class="flex gap-6 flex-column md:flex-row justify-content-between align-items-start md:align-items-center mb-5"
>
<!-- Project list title -->
<Title class="m-0">{{ t('views.dashboard.projects') }}</Title>
<YearSelector :years="allYears" v-model="selectedYear" v-if="user" />
Expand Down

0 comments on commit d24003c

Please sign in to comment.