Skip to content

Commit

Permalink
pre-release 3 (#244)
Browse files Browse the repository at this point in the history
* sumbitpage + frontendtests

* Update frontend/src/views/subject/SubjectView.vue

Co-authored-by: Bram Reyniers <[email protected]>

* Update frontend/src/views/subject/SubjectsView.vue

Co-authored-by: Bram Reyniers <[email protected]>

* Update frontend/src/views/subject/SubjectsView.vue

Co-authored-by: Bram Reyniers <[email protected]>

* Update frontend/src/components/subject/body/projects/SubjectProjectsPage.vue

Co-authored-by: Bram Reyniers <[email protected]>

* upgrade @vue/test-utils (#181)

* sumbitpage + frontendtests

* tests cleanup en router fix

* layout rework

* format

* last test fix

* more test cleanup

* theme

* small fix

* adminpanel theme + tests (#177)

* testen proberen fixen

* admin frontend test

* format

* Groups (#182)

* quick commit

* quick commit

* quick commit

* almost finished

* finished + linter :)

* linter again :'(

* linter again x2 :'(

* groupsview fixes

* groupview fixes

* fix 'join group' button url

* fix type imports

* run formatter

* small fix

* linter :)

---------

Co-authored-by: Bram Reyniers <[email protected]>

* test

* theme

* test

* names switch

* requirements card

* frontend testen + locale fix

* project sidebar test

* needhelpbutton test

* linter

* format

* fixes #189

* beter zo

* fix: #187

* wip

* custom docker image tests

* handle docker run crashes

* autopep

* fix test 1

* fix tests 2

* Implement show all students in groups

* allow admin to set own teacher permissions

* delete user (frontend)

* delete user (frontend)

* delete user (backend)

* Add surname of users (#179)

* save surname of user in database #144

* help automatic migration

* run formatter

* use surname on homescreen

* run formatter

* remove print statement

* Update backend/src/auth/router.py

Co-authored-by: Xander Bil <[email protected]>

---------

Co-authored-by: Xander Bil <[email protected]>

* cleanup test style

* fix test runner

* autopep

* forcerm

* ???

* handle container create fail

* pyright

* prune

* rm prune

* prune 2

* prune 3

* prune weer weg, zou in orde moeten zijn

* button size

* add tags for container management

* navigation button to admin fix (#197)

* adminbutton fix

* Revert "adminbutton fix"

This reverts commit 366156f.

* same fix, with computed

---------

Co-authored-by: Bram Reyniers <[email protected]>

* test + internationalization + stling

* Implement isTeacher correctly

* implement surname where needed

* test fixes

* test fixes x2

* reroute whenever leaving/joining group

* is teacher for new subject button visibility

* buttons now only appearing when isTeacher/isInstructor

* deleted announcements

* removed intern skeleton loaders

* fixed pylint docker

* found another skeleton loader

* styling

* styling

* groups page styling

* group page style + redirects

* refactored components structure and added icons for student/teacher subjects

* made subjecticon component

* deleted non used css class

* test setup

* oké rebase werkt eindelijk

* move tests for consistency

* groupsview frontend test

* frontend testen

* format

* file extension warnings

* reroute whenever leaving/joining group

* cleanup

* tests

* fix backend tests

* formatter

* deleted tooltip + last refactoring before pull request

* npm run format

* refactored utils.py

* Query refactor (#152)

* fix useUserQuery

* remove top level package lock

* add some documentation to user queries

* useUserQuery now accepts either a ref or a raw value

* run formatter

* changed enabled from computed to getter

* update Subject queries, fixes: #143

* update mutation to register to subject

* improved authorized_fetch

* show projects on homescreen, fixes: #134

* run formatter

* fix download_file util

* clean up subject queries

* clean up user services

* clean up project queries and services

* review group services

* review submission services

* refactor submission queries

* optimistic updates for group queries

* fix views using group/submission queries

* try to fix some tests

* run formatter

* remove todo's

* frontend warnings fix

* fix subjects query

* run formatter

* fix useProjectGroupsQuery

* fix tests

* fix delete group mutation

* fix leave and join group mutations

* run formatter

* fix user groups query not refreshing

---------

Co-authored-by: Marieke <[email protected]>

* refactored utils.py 2

* solved merge conflicts

* fixed i18n

* run formater, linter

* refactored subject list into object with role

* changing icon on subjects page (ugly solution bug with enums)

* working on showing icon on subject page

* fixed subject uuid query + user

* linter + reformat

* Projectspage testen + styling (#198)

* projectspage theme and layout

* frontend test

* fix bug login not working on first ever login

* vuetify 3.5

* package lock

* undo backend response change

* undo backend response change

* register link button permissions

* removed deleted import

* fixed subject filter buttons

* surname appears in subject header card

* fixed some wishful filter behavior and no results

* added i18n

* fixed project title styling

* added quil

* fixed registerlinkbutton

* deleted radius corners

* run linter

* run linter

* refactored utils.py

* custom fetcherror + group fix

* status weg

* fix tests

* admin symbol when not student or instructor + fix edit subject button permission

* fix student not allowed icon

* linter

* useProjectGroupQuery zoals in #214

* changed emits

* fix width issue

* implemented requested pr changes

* run linter formater

* Homescreen deadlines (#214)

* filter and sort deadlines

* i18n formatting for deadline date

* show subject name instead of id

* also show projects as instructor

* project status on homescreen

* improve used group/submission queries

* Update frontend/src/queries/Submission.ts

Co-authored-by: Pieter Janin <[email protected]>

---------

Co-authored-by: Pieter Janin <[email protected]>

* added router to create SubjectsView.vue

* fix width issue fr

* added first form elements

* fixed academic year

* remove announcements

* frontend testen

* added submit button

* Fix projects page (#219)

* fix #218

* fix tests

* add instructor surname

* format

* create subject via frontend works

* fix: patch requirements

* Submission list voor een vak leerkracht of assistent (#190)

* theme fixes

* Implementing queries and views

* Implement beautiful sql query

* Finish frontend

* Solve pr issues

* feature: download all files from submission

* rebase dev and fix conflicts

* Fix: frontend tests

* implemented search

* Move submissions list to group page

* add users to instructors

* assign and delete users from instructors

* sort instructors

* import

Co-authored-by: Bram Reyniers <[email protected]>

* import

Co-authored-by: Bram Reyniers <[email protected]>

* begin styling create subject page

* more styling

* adding instsructors

* remove instructors

* assign yourself button works

* emit cleanup

* emitted events fixed

* add instructors to db

* form validation

* implemented dialog

* 404 not found + register to subject view: sytling + frontend tests (#213)

* notfound and register view style + testen

* notfound and register view style + testen

* fix

* already registered

* already registered

* change wording

* added i18n

* i18n bug fixed

* styling details

* redirect after hitting confirm

* lint + format

* Groep nummer ipv id (#221)

* Add auto generated column to group: num

* frontend: use group num instead of global id

* fix alembic downgrade script

---------

Co-authored-by: Bram Reyniers <[email protected]>

* subjects overflow fix

* subject title card scrollable

* scrolling on overflow

* added v-chips and sorted instructors on subjectpage

* format + linter

* style rollback subjects voor marieke

* linter format

* deleted bg container on create page for better designing patch

* last changes on create subject

* sort voor bram

* testfix na query aanpassing

* fix: #229

* fix tests

* Download alle indieningen (files) + csv (met indieningen info) in 1 keer als zip (#228)

* backend: implement project zip

* backend: implement csv

* frontend: download all submissions

* grouppagina en submissions testen + styling (#224)

* styling

* styling

* styling

* styling

* submissionslist test

* meer testen

* format

* merge conflicts

* lint + format

* fix test after dev merge

* Update frontend/src/i18n/locales/nl.ts

Co-authored-by: Bram Reyniers <[email protected]>

* fix test

---------

Co-authored-by: Bram Reyniers <[email protected]>

* allow teachers to get all users (#231)

* email and email rules

* added watcher

* added emits

* post mail fully functional

* removed on search loaded

* format linter

* update mutations for create subject

* Edit project (#196)

* paar fixes alvast

* almost

* files uploaden werkt

* formatting fixes

* bugfixes + added date fields in db

* formatting

* background container gone + no instructors found fix

* format

* basic

* temp

* begint ergens op te trekken

* update werkt!

* small change

* looking good

* edit fixes (almost there)

* files werken

* edit (improvements)

* updates

* filestructure visible

* werkt

* af?

* remove empty alembic revisions

* docker terug ok

* alert

* route fix

* linter

* add publish_date to mock projects

* reroute

* bijna

* requirements

* editfiles werkt

* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

* few fixes

* small time fix

* i18n

* format

* formatting

* final

* final

* vage fixes

* vage fixes 2

* tijd update nu ook

* test fix

* format

* schema optional added

* fix voor tests not found

* bram requests xoxo

* whoops

* Update frontend/src/components/RequirementsInput.vue

Co-authored-by: Pieter Janin <[email protected]>

* Update frontend/src/components/RequirementsInput.vue

Co-authored-by: Pieter Janin <[email protected]>

* Update frontend/src/queries/Project.ts

Co-authored-by: Pieter Janin <[email protected]>

* Update frontend/src/queries/Project.ts

Co-authored-by: Pieter Janin <[email protected]>

* Update frontend/src/components/RequirementsInput.vue

Co-authored-by: Pieter Janin <[email protected]>

* Update frontend/src/services/project.ts

Co-authored-by: Pieter Janin <[email protected]>

* Update frontend/src/components/project/DatePicker.vue

Co-authored-by: Pieter Janin <[email protected]>

* fixes

* loading fix

* Update frontend/src/components/project/DatePicker.vue

Co-authored-by: Pieter Janin <[email protected]>

* fixes vooral cleanup

* fixes vooral cleanup

* fixes vooral cleanup

* Revert "upgrade @vue/test-utils (#181)"

This reverts commit 87ed142.

* luxon weg?

* luxon echt weg?

* luxon echt echt weg?

* renaming + unused gone

* some small fixes

* bramfixes

---------

Co-authored-by: Bram Reyniers <[email protected]>
Co-authored-by: Pieter Janin <[email protected]>

* Update README.md

* Update README.md

* fix broken link

* Search users with throttle (#236)

* search users with throttle

* add throttle tests

* increase wait time in a throttle test

* algemene styling van website (#226)

* style

* style

* temp

* style

* style

* temp

* more styling

* testen

* lint

* format

* styling

* some styling en test fixes

* backbuttons

* subjects styling

* subject styling

* create project styling

* create subjects styling

* lint

* format

* format

* requested changes

* format

* fix show group

* more requested changes

* small groups fix

---------

Co-authored-by: Bram Reyniers <[email protected]>

* Permission checks for pages (#166)

* generic permission middleware

* placeholder middleware implementations

* implement isAdmin check

* permissions on admin page + fix typo

* logical functions for conditions

* pass MiddlewareContext to conditions

* permission to check if user is part of subject

* permission to check if user can create a project for a subject

* run formatter

* restructure navigation guard middlewares

* subject details permissions

* project details permissions

* go to /not-found instead of /forbidden

* create project permissions

* fix project permission checks

* permissions for submit page

* permissions for groups overview

* permissions for group details

* permissions for submission list of project

* remove unused imports

* Apply suggestions from code review

Co-authored-by: Xander Bil <[email protected]>

* permissions for new pages

* allow admins to visit all pages

---------

Co-authored-by: Xander Bil <[email protected]>

* Submissions teacher testen (#238)

* styling

* styling

* styling

* styling

* submissionslist test

* meer testen

* format

* merge conflicts

* lint + format

* button verplaatsen

* styling klaar

* testen

* fix test after dev merge

* projectview test

* more tests

* SubmissionsTeacherView.spec.ts

* button change position

* format

* change submissioncard

* format

* fix group id showing instead of num

* Revert "fix group id showing instead of num"

This reverts commit e84929e.

* Bug fixes (#243)

* fix: invalid redirect after create project

* frontend fix: joining group when automatically now works

* fix: register to subject both as student and instructor

* fix submect mail is null

* fix #185

* fix weird groups styling

* fix broken router push

* fix inconsistent academic year

* fix: duplicates in files

* format

* fix year

* fix test?

* fix group id showing instead of num

---------

Co-authored-by: Bram Reyniers <[email protected]>

---------

Co-authored-by: Michaël Boelaert <[email protected]>
Co-authored-by: Marieke <[email protected]>
Co-authored-by: Mattis Cauwel <[email protected]>
Co-authored-by: miboelae <[email protected]>
Co-authored-by: Pieter Janin <[email protected]>
Co-authored-by: Marieke Sinnaeve <[email protected]>
Co-authored-by: Xander Bil <[email protected]>
Co-authored-by: mattiscauwel <[email protected]>
Co-authored-by: Xander Bil <[email protected]>
Co-authored-by: drieshuybens <[email protected]>
  • Loading branch information
11 people authored May 22, 2024
1 parent 28f4f9c commit a83dfcf
Show file tree
Hide file tree
Showing 225 changed files with 14,509 additions and 2,451 deletions.
61 changes: 45 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,55 @@
# UGent-5
# Apollo

## Rolverdeling
Apollo is an online submission platform where instructors can flexibly set requirements for
student submissions. These requirements can range from simple checks on the submitted
file structure to test scripts that run when a submission is made.

| Rol | Verantwoordelijke |
| ------------- | ------------- |
| Groepsleider | Marieke Sinnaeve |
| Technische lead | Bram Reyniers |
| Systeembeheerder | Xander Bil |
| Customer Relations Officer | Pieter Janin |
| Frontendbeheerder | Mattis Cauwel |
| Backendbeheerder | Dries Huybens |
| Documentatiebeheerder | Pieter Janin |
| Testbeheerder | Michaël Boelaert |
Students quickly receive feedback on their submission, allowing them to know if it meets
the project requirements.

This repository hosts the web application's source code. To use Apollo, visit https://sel2-5.ugent.be.

## Wiki

Informatie over de gebruikte technologieën, de gebruikershandleiding en meer kan je vinden in de [wiki](https://github.com/SELab-2/UGent-5/wiki).
Documentation, including a user manual for teachers, can be found in the
[Apollo wiki](https://github.com/SELab-2/UGent-5/wiki).

## For Developers

## Setup ontwikkelomgeving
Instructions for setting up the frontend development environment can be found
[here](frontend/README.md).

De instructies voor het opzetten van de ontwikkelomgeving van de frontend kan je [hier](frontend/README.md) vinden. De instructies voor de backend staan [hier](backend/REAMDE.md).
Instructions for the backend are located [here](backend/README.md).

## API

Geautomatiseerde clients kunnen interageren met de webapplicatie via de [API](https://sel2-5.ugent.be/api/docs).
Automated clients can interact with the web application via the [API](https://sel2-5.ugent.be/api/docs).

## Used tools and frameworks

### Database
- Database system: [PostgreSQL](https://www.postgresql.org/)
- Database migrations: [alembic](https://github.com/sqlalchemy/alembic).

### Backend
- Backend framework: [FastAPI](https://fastapi.tiangolo.com/)
- Database interface: [SQLAlchemy](https://www.sqlalchemy.org/)
- JSON-validation: [Pydantic](https://github.com/pydantic/pydantic)
- Test framework: [pytest](https://github.com/pytest-dev/pytest)

### Frontend
- Frontend framework: [Vue.js](https://vuejs.org/) (Composition API) + [TypeScript](https://www.typescriptlang.org/)
- Component library: [Vuetify](https://dev.vuetifyjs.com/en/)
- Test framework: [Vitest](https://vitest.dev/)

## The team

| | |
|------------------|---------------------------------------------------|
| Xander Bil | System Administrator |
| Michaël Boelaert | Test Manager |
| Mattis Cauwel | Frontend Manager |
| Dries Huybens | Backend Manager |
| Pieter Janin | Customer Relations Officer, Documentation Manager |
| Bram Reyniers | Technical Lead |
| Marieke Sinnaeve | Team Lead |
4 changes: 3 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

```sh
# Create a python virtual environment
python -m venv venv
python3.12 -m venv venv
# Activate the environment
source venv/bin/activate
# Install dependencies
Expand Down Expand Up @@ -71,6 +71,8 @@ DATABASE_URI="postgresql://username:password@localhost:5432/dbname"
alembic upgrade head
```

You can find more info about alembic [here](alembic/README.md).

#### Managing the database
```sh
# Stop the database container
Expand Down
1 change: 0 additions & 1 deletion backend/alembic/README

This file was deleted.

43 changes: 43 additions & 0 deletions backend/alembic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Alembic

From the docs:

> [Alembic](https://alembic.sqlalchemy.org/en/latest/) is a lightweight database
migration tool for usage with the [SQLAlchemy](https://www.sqlalchemy.org/)
Database Toolkit for Python.

It allows us to generate database schemas from Python SQLAlchemy code, found in each
`models.py` file.

## Usage

Here are some of the most commonly used commands you might need.

#### Automatically generate a revision script after modifying database models in Python:

```sh
alembic revision --autogenerate -m "my_revision_name"
```

Make sure to review the generated script in `alembic/versions`
and make adjustments if needed.

#### Run a migration: this will upgrade the database schema to the most recent revision.

```sh
alembic upgrade head
```

#### Undo the most recent revision:

```sh
alembic downgrade -1
```

#### Reset the database to its initial (empty) state:

```sh
alembic downgrade base
```

For more examples, see the [official Alembic tutorial](https://alembic.sqlalchemy.org/en/latest/tutorial.html).
35 changes: 35 additions & 0 deletions backend/alembic/versions/18fb90307213_project_requirements_fix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""project_requirements_fix: fixes bug where project requirements would remain in the database after the parent
project would be deleted.
Revision ID: 18fb90307213
Revises: e0c97995e669
Create Date: 2024-05-04 15:42:43.114843
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '18fb90307213'
down_revision: Union[str, None] = 'e0c97995e669'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('requirement', 'project_id',
existing_type=sa.INTEGER(),
nullable=False)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('requirement', 'project_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
31 changes: 31 additions & 0 deletions backend/alembic/versions/566f33fb161f_add_user_surname.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""add user surname
Revision ID: 566f33fb161f
Revises: 18fb90307213
Create Date: 2024-05-06 15:32:33.617263
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '566f33fb161f'
down_revision: Union[str, None] = '18fb90307213'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('website_user', sa.Column('surname', sa.String(),
nullable=False, server_default='SURNAME_DEFAULT'))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('website_user', 'surname')
# ### end Alembic commands ###
44 changes: 44 additions & 0 deletions backend/alembic/versions/937c04aa37a1_add_group_num_column.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""add group num column
Revision ID: 937c04aa37a1
Revises: 566f33fb161f
Create Date: 2024-05-18 18:09:30.734349
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "937c04aa37a1"
down_revision: Union[str, None] = "566f33fb161f"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"team", sa.Column("num", sa.Integer(), nullable=False, server_default="0")
)
op.drop_column("team", "team_name")
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"team",
sa.Column(
"team_name",
sa.VARCHAR(),
autoincrement=False,
nullable=False,
server_default="DEFAULT_GROUP_NAME",
),
)
op.drop_column("team", "num")
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Add optional email to subject
Revision ID: e0c97995e669
Revises: d0e0719b1939
Create Date: 2024-05-01 14:23:11.789984
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = 'e0c97995e669'
down_revision: Union[str, None] = 'd0e0719b1939'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('project', 'publish_date',
existing_type=postgresql.TIMESTAMP(timezone=True),
nullable=True,
existing_server_default=sa.text('CURRENT_TIMESTAMP'))
op.add_column('subject', sa.Column('email', sa.String(), nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('subject', 'email')
op.alter_column('project', 'publish_date',
existing_type=postgresql.TIMESTAMP(timezone=True),
nullable=False,
existing_server_default=sa.text('CURRENT_TIMESTAMP'))
# ### end Alembic commands ###
6 changes: 5 additions & 1 deletion backend/src/auth/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,19 @@ async def token(
if not user or not attributes:
raise UnAuthenticated(detail="Invalid CAS ticket")
# Create user if not exists
if not await user_service.get_by_id(db, attributes["uid"]):
resolved_user = await user_service.get_by_id(db, attributes["uid"])
if not resolved_user:
await user_service.create_user(
db,
UserCreate(
given_name=attributes["givenname"],
surname=attributes["surname"],
uid=attributes["uid"],
mail=attributes["mail"],
),
)
elif resolved_user.surname == 'SURNAME_DEFAULT':
resolved_user.surname = attributes["surname"]

# Create JWT token
jwt_token = create_jwt_token(attributes["uid"])
Expand Down
20 changes: 20 additions & 0 deletions backend/src/docker_tests/dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import Generator, Any

import docker
from docker import DockerClient
from docker.errors import DockerException

from src.docker_tests.exceptions import DockerDeamonNotFound


def get_docker_client() -> Generator[DockerClient, Any, None]:
"""Creates docker client, which is closed afterwards"""
try:
client = docker.from_env()
except DockerException:
raise DockerDeamonNotFound()

try:
yield client
finally:
client.close()
Loading

0 comments on commit a83dfcf

Please sign in to comment.