Skip to content

Commit

Permalink
fix: small layout changes (#476)
Browse files Browse the repository at this point in the history
* chore: merge

* chore: added translations

* chore: small changes

* chore: submission layout

* feat: fixes for demo

* chore: merge

* chore: added translations

* chore: small changes

* chore: submission layout

* feat: fixes for demo

* fix: submissions layout

* chore: update package.json

* fix: fixed colors on check status badges

* fix: fixed colors on check status badges

* chore: linting

* chore: linting

---------

Co-authored-by: lander <[email protected]>
  • Loading branch information
EwoutV and DeLany123 authored May 24, 2024
1 parent 4e01eac commit 61c07ed
Show file tree
Hide file tree
Showing 30 changed files with 192 additions and 133 deletions.
2 changes: 1 addition & 1 deletion backend/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python 3.11.4
python 3.11.8
8 changes: 8 additions & 0 deletions backend/api/permissions/submission_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def has_object_permission(self, request: Request, view: APIView, obj: Submission
return obj.group.students.filter(id=user.id).exists()


class SubmissionFeedbackPermission(SubmissionPermission):
def has_permission(self, request: Request, view: APIView) -> bool:
return True

def has_object_permission(self, request: Request, view: APIView, obj: Submission) -> bool:
return True


class StructureCheckResultPermission(SubmissionPermission):
def has_object_permission(self, request: Request, view: APIView, obj: StructureCheckResult) -> bool:
return super().has_object_permission(request, view, obj.submission)
Expand Down
5 changes: 3 additions & 2 deletions backend/api/views/submission_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

from api.models.submission import Submission, StructureCheckResult, ExtraCheckResult
from api.permissions.submission_permissions import SubmissionPermission, StructureCheckResultPermission, \
ExtraCheckResultPermission, ExtraCheckResultArtifactPermission, ExtraCheckResultLogPermission
ExtraCheckResultPermission, ExtraCheckResultArtifactPermission, ExtraCheckResultLogPermission, \
SubmissionFeedbackPermission
from api.serializers.feedback_serializer import FeedbackSerializer
from api.serializers.submission_serializer import (
ExtraCheckResultSerializer, StructureCheckResultSerializer,
Expand All @@ -29,7 +30,7 @@ def zip(self, request, **__):

return FileResponse(open(submission.zip.path, "rb"), as_attachment=True)

@action(detail=True, methods=["get"])
@action(detail=True, methods=["get"], permission_classes=[IsAdminUser | SubmissionFeedbackPermission])
def feedback(self, request, **_) -> Response:
"""Returns all the feedback for the given submission"""
submission = self.get_object()
Expand Down
16 changes: 0 additions & 16 deletions backend/ypovoli/asgi.py

This file was deleted.

5 changes: 2 additions & 3 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 @@ -40,6 +40,7 @@
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@vitejs/plugin-vue": "^5.0.4",
"prettier": "^3.2.5",
"cypress": "^13.7.1",
"cypress-vite": "^1.5.0",
"eslint": "^8.57.0",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/assets/lang/app/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@
"scoreVisibility": "Make score, when uploaded, automatically visible to students",
"submissionStructure": "Structure of how a submission should be made",
"noStudents": "No students in this group",
"alreadyStarted": "The project has already started",
"locked": "Closed",
"unlocked": "Open",
"structureChecks": {
"title": "Structure checks",
"placeholder": "Give a name to this folder",
"cancelSelection": "Deselect {0}",
"newFolder": "New folder",
"noChecks": "Your submission does not have to comply with a specific structure.",
"obligatedExtensions": "Obligated extensions",
"blockedExtensions": "Blocked extensions"
},
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/assets/lang/app/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@
"publishScores": "Publiceer scores",
"groupName": "Groepsnaam",
"groupPopulation": "Grootte",
"alreadyStarted": "Project is al gestart",
"groupStatus": "Status",
"start": "Startdatum",
"submissionStatus": "Indienstatus",
"group": "Groep",
"groups": "Groepen",
"groupSize": "Individueel | Groepen van {count} personen",
"noGroups": "Geen groepen beschikbaar",
"noGroups": "Geen groepen beschikbaar.",
"groupMembers": "Groepsleden",
"chooseGroup": "Kies een groep",
"joinGroup": "Kies groep",
Expand All @@ -99,7 +100,8 @@
"cancelSelection": "Deselecteer {0}",
"obligatedExtensions": "Verplichte extensies",
"blockedExtensions": "Niet toegelaten extensies",
"newFolder": "Nieuwe map"
"newFolder": "Nieuwe map",
"noChecks": "Je indiening moet niet voldoen aan een specifieke structuur."
},
"extraChecks": {
"title": "Automatische checks op een indiening",
Expand Down Expand Up @@ -260,7 +262,7 @@
},
"noIncomingProjects": "Geen projecten met een deadline binnen de 7 dagen.",
"selectCourse": "Selecteer het vak waarvoor je een project wil maken:",
"showPastProjects": "Projecten met verstreken deadline"
"showPastProjects": "Toon projecten met verstreken deadline"
}
},
"types": {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/projects/ProjectDeadlineCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const { t } = useI18n();
},
}"
>
<div class="p-5 surface-300 border-round">
<div class="flex align-items-center gap-5">
<div class="px-3 py-4 md:p-5 surface-300 border-round">
<div class="flex align-items-center gap-3 md:gap-5">
<i class="pi pi-clock text-6xl text-primary" />
<div class="w-full">
<h3 class="m-0">{{ project.name }}</h3>
Expand Down
16 changes: 9 additions & 7 deletions frontend/src/components/projects/ProjectList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import moment from 'moment';
import InputSwitch from 'primevue/inputswitch';
import Checkbox from 'primevue/checkbox';
import ProjectDetailCard from '@/components/projects/ProjectDetailCard.vue';
import ProjectDeadlineCard from '@/components/projects/ProjectDeadlineCard.vue';
import Button from 'primevue/button';
Expand Down Expand Up @@ -28,7 +28,7 @@ const { student, getStudentByID } = useStudents();
function getUserGroups(): Group[] {
if (user.value !== null && user.value?.isStudent()) {
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
return student.value !== null && student.value.groups !== null ? student.value?.groups : [];
return student.value !== null ? student.value?.groups : [];
}
return [];
}
Expand Down Expand Up @@ -67,11 +67,13 @@ const incomingProjects = computed<Project[]>(() => {
<template>
<div>
<!-- Show past projects switch -->
<div class="flex gap-3 align-items-center mb-5">
<InputSwitch input-id="show-past" v-model="showPast" />
<label for="show-past">
{{ t('components.list.showPastProjects') }}
</label>
<div class="p-4 surface-100 inline-block mb-5">
<div class="flex gap-3 align-items-center">
<Checkbox input-id="show-past" v-model="showPast" binary />
<label for="show-past">
{{ t('components.list.showPastProjects') }}
</label>
</div>
</div>
<!-- Project list -->
<template v-if="sortedProjects.length > 0">
Expand Down
14 changes: 11 additions & 3 deletions frontend/src/components/projects/groups/GroupChooseCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Button from 'primevue/button';
import DataTable from 'primevue/datatable';
import Column from 'primevue/column';
import Message from 'primevue/message';
import moment from 'moment';
import { ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { type Group } from '@/types/Group.ts';
Expand Down Expand Up @@ -57,9 +58,16 @@ async function joinSelectedGroup(): Promise<void> {
<h2 class="mt-0">
{{ t('views.projects.chooseGroup') }}
</h2>
<Message severity="warn" class="my-4 text-sm" :closable="false">
{{ t('views.projects.chooseGroupMessage', [project.getFormattedStartDate()]) }}
</Message>
<template v-if="!moment(project.start_date).isBefore()">
<Message severity="warn" class="my-4 text-sm" :closable="false">
{{ t('views.projects.chooseGroupMessage', [project.getFormattedStartDate()]) }}
</Message>
</template>
<template v-else>
<Message severity="warn" class="my-4 text-sm" :closable="false">
{{ t('views.projects.alreadyStarted', [project.getFormattedStartDate()]) }}
</Message>
</template>
<template v-if="groups.length > 0 && !project.isLocked()">
<DataTable
:value="groups"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async function expandGroup(event: DataTableRowExpandEvent): Promise<void> {
</div>
<div class="col">
<h3>{{ t('views.projects.submissionStatus') }}</h3>
<AllSubmission :submissions="data.submissions" />
<AllSubmission :submissions="data.submissions" :group="data" />
</div>
</div>
</template>
Expand Down
Loading

0 comments on commit 61c07ed

Please sign in to comment.