Skip to content

Commit

Permalink
Layout changes extra checks selector (#420)
Browse files Browse the repository at this point in the history
* fix: make project creation working again after backend changes

* chore: init layout extra checks

* chore: data table for docker images

* chore: possibility to add private docker image

* chore: display list of extra checks that were made

* fix: refix code for sharing course link

* chore: backend requests for extra checks creation

* chore: working creation of extra check

* fix: translations + empty checks list

* fix: linting

* chore: extra checks services + edit project functionality

* fix: linting

* fix: fixes after review lander

* fix: linting

* fix: try fix margin
  • Loading branch information
BramMeir authored May 13, 2024
1 parent b8bcf11 commit 2dde1fe
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion backend/api/serializers/project_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def validate(self, attrs):
raise ValidationError(gettext("project.errors.context"))

# Check if start date of the project is not in the past
if "start_date" in attrs and attrs["start_date"] < timezone.now().replace(hour=0, minute=0, second=0):
if "start_date" in attrs and not self.partial and \
attrs["start_date"] < timezone.now().replace(hour=0, minute=0, second=0):
raise ValidationError(gettext("project.errors.start_date_in_past"))

# Set the start date depending on if it is a partial update and whether it was given by the user
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/assets/lang/app/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"max_score": "Maximum score that can be achieved",
"visibility": "Make project visible to students",
"scoreVisibility": "Make score, when uploaded, automatically visible to students",
"bashUpload": "Upload a bash script for automatic testing",
"submissionStructure": "Structure of how a submission should be made",
"noStudents": "No students in this group",
"locked": "Closed",
Expand All @@ -83,7 +82,7 @@
"dockerImage": "Docker image",
"timeLimit": "Time limit for execution (in seconds)",
"memoryLimit": "Memory limit for execution (in MB)",
"showLog": "Show logfile to students"
"showLog": "Making the extra logs of the docker container visible to the students"
}
},
"submissions": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/lang/app/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"dockerImage": "Docker image",
"timeLimit": "Tijdslimiet voor de uitvoering (in seconden)",
"memoryLimit": "Geheugenlimiet voor de uitvoering (in MB)",
"showLog": "Toon logbestand aan studenten"
"showLog": "Maak de extra logs van de docker container zichtbaar voor de studenten"
}
},
"submissions": {
Expand Down
21 changes: 11 additions & 10 deletions frontend/src/components/projects/ExtraChecksUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ onMounted(async () => {
<!-- List with the extra checks -->
<DataView :value="extraChecksList" data-key="id" v-if="extraChecksList.length > 0">
<template #list="slotProps">
<div
v-for="(item, index) in slotProps.items"
:key="index"
class="flex align-items-center justify-content-between mr-6"
>
<p class="text-lg font-semibold">{{ item.name }}</p>

<Button icon="pi pi-times" class="p-button p-button-danger" @click="extraChecksList.splice(index, 1)" />
<div v-for="(item, index) in slotProps.items" :key="index">
<div class="flex align-items-center justify-content-between">
<p style="max-width: 300px">{{ item.name }}</p>
<Button
icon="pi pi-times"
class="p-button-danger p-button-sm"
@click="extraChecksList.splice(index, 1)"
/>
</div>
</div>
</template>
</DataView>
Expand Down Expand Up @@ -277,8 +278,8 @@ onMounted(async () => {

<!-- Visibility of the log files for students -->
<div class="grid">
<div class="flex align-items-center field-checkbox col-12">
<InputSwitch id="showLog" v-model="form.showLog" />
<div class="field-checkbox col-12">
<InputSwitch id="showLog" v-model="form.showLog" style="min-width: 50px" />
<label for="showLog">{{ t('views.projects.extraChecks.showLog') }}</label>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/projects/CreateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ async function submitProject(): Promise<void> {

<div class="col-12 lg:col-6 checks">
<!-- Extra checks upload -->
<div class="field col">
<label for="extraChecks">{{ t('views.projects.extraChecks.title') }}</label>
<div class="field col-8">
<label for="extraChecks" class="mr-4">{{ t('views.projects.extraChecks.title') }}</label>
<ExtraChecksUpload
id="extraChecks"
:create-checks-backend="createExtraChecksBackend"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/projects/UpdateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ async function submitProject(): Promise<void> {

<div class="col-12 lg:col-6 checks">
<!-- Extra checks upload -->
<div class="field col">
<label for="extraChecks">{{ t('views.projects.extraChecks.title') }}</label>
<div class="field col-8">
<label for="extraChecks" class="mr-4">{{ t('views.projects.extraChecks.title') }}</label>
<ExtraChecksUpload
id="extraChecks"
:create-checks-backend="createExtraChecksBackend"
Expand Down

0 comments on commit 2dde1fe

Please sign in to comment.