Skip to content

Commit

Permalink
chore: improved project progressbar, linting
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed Apr 16, 2024
1 parent 748f69d commit e7f319b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion frontend/src/components/forms/Editor.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import Editor from 'primevue/editor';
import Button from 'primevue/button';
const model = defineModel();
</script>
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/projects/ProjectCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const { t } = useI18n();
>
<div class="p-5 surface-300 border-round">
<div class="flex align-items-center gap-5">
<i class="pi pi-clock text-6xl" />
<i class="pi pi-clock text-6xl text-primary" />
<div class="w-full">
<h3 class="m-0">{{ project.name }}</h3>
<div class="flex justify-content-between align-items-center mt-2">
Expand Down Expand Up @@ -96,7 +96,15 @@ const { t } = useI18n();
<b>{{ t('views.projects.submissionStatus') }}</b
>: ok
</div>
<ProgressBar class="mt-3" :value="project.getProgress()" />
<ProgressBar class="mt-3" :value="project.getProgress()">
{{
t(
'views.projects.days',
{ hour: moment(project.deadline).format('H:m') },
moment(project.deadline).diff(moment(), 'day'),
)
}}
</ProgressBar>
</template>
<template #footer>
<RouterLink
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 @@ -63,7 +63,7 @@ const incomingProjects = computed<Project[] | null>(() => {
<div class="grid">
<template v-if="incomingProjects !== null">
<template v-if="incomingProjects.length > 0">
<div class="col-12" v-for="project in incomingProjects">
<div class="col-12" v-for="project in incomingProjects" :key="project.id">
<ProjectCard
type="small"
:project="project"
Expand Down
1 change: 0 additions & 1 deletion frontend/src/test/unit/services/setup/get_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
structureChecks,
submissions,
} from './data';
import { json } from 'stream/consumers';

const baseUrl = 'http://localhost';

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/test/unit/types/course.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('course type', () => {

it('create a course instance from JSON data', () => {
const courseJSON = { ...courseData };
const course = Course.fromJSON(courseJSON as any);
const course = Course.fromJSON(courseJSON);

expect(course).toBeInstanceOf(Course);
expect(course.id).toBe(courseData.id);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/Course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class Course {
*
* @param course
*/
static fromJSON(course: Course|any): Course {
static fromJSON(course: Course): Course {
const faculty =
course.faculty !== undefined && course.faculty !== null ? Faculty.fromJSON(course.faculty) : null;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class Project {
*
* @param project
*/
static fromJSON(project: Project|any): Project {
static fromJSON(project: Project): Project {
let course = null;

if (project.course !== null && project.course !== undefined) {
Expand Down

0 comments on commit e7f319b

Please sign in to comment.