Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milestone 3 #198

Merged
merged 534 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
534 commits
Select commit Hold shift + click to select a range
b28235b
Added multiple skeletons for loading components throughout the pages …
Thibaud-Collyn May 19, 2024
6231db0
add migrations
axellorreyne May 19, 2024
d54e312
mockdata and more general feedback on submissions
RunoBoy May 19, 2024
b9ba6f1
Most pages have redirects to 403 page when no access is granted(based…
Thibaud-Collyn May 19, 2024
22ec22e
All 403 redirects based on role have been implemented.
Thibaud-Collyn May 19, 2024
dcf8d05
uploading dockerfile in ui
robinpdev May 19, 2024
cc42b7e
Merge branch '148-advanced-tests' of github.com:SELab-2/UGent-1 into …
robinpdev May 19, 2024
d028afe
Improved required_files in project view
RunoBoy May 19, 2024
4aba071
Merge pull request #177 from SELab-2/simple_test_improved_feedback
robinpdev May 19, 2024
8a422f9
saem result in docker and local, add command makefile
AlexanderVanOyen May 19, 2024
7ab2bef
Merge branch 'develop' into frontend-tests
AlexanderVanOyen May 19, 2024
0dae859
Improved status on required files
RunoBoy May 19, 2024
4f0ada0
Fix tests
RunoBoy May 19, 2024
423656f
Fix locale on project/id/groups
RunoBoy May 19, 2024
a09f09c
Can now only go to course details page when part of a course.
Thibaud-Collyn May 19, 2024
27425ee
Join a group before uploading check
RunoBoy May 19, 2024
50d671b
Submit button disabled when submitting empty file
RunoBoy May 19, 2024
3ebadab
only admins can see site-users
RunoBoy May 19, 2024
470641b
Buttons are centerd nicely
RunoBoy May 19, 2024
cec10e5
Use MUI components
RunoBoy May 19, 2024
53e4ee2
Merge branch 'develop' into 163-banner-image
gilles-arnout May 20, 2024
579cadd
Merge pull request #169 from SELab-2/163-banner-image
gilles-arnout May 20, 2024
b501820
Merge branch 'develop' of https://github.com/SELab-2/UGent-1 into imp…
gilles-arnout May 20, 2024
bd0811a
Merge pull request #178 from SELab-2/improve_required_files
gilles-arnout May 20, 2024
f0e4791
Started implementing 403 redirects based on course access of a user
Thibaud-Collyn May 20, 2024
4824b47
first calendar implementation
ReinhardDP May 20, 2024
3781698
registry experiment
robinpdev May 20, 2024
481e62a
Merge branch 'develop' into frontend-tests
AlexanderVanOyen May 20, 2024
fdf753f
test for traefik config
robinpdev May 20, 2024
06e55d8
correction to port?
robinpdev May 20, 2024
90c9b76
fix duplicate port?
robinpdev May 20, 2024
f83d1cb
host wrong?
robinpdev May 20, 2024
6294472
add address and change position
robinpdev May 20, 2024
2295026
wrong port lmao
robinpdev May 20, 2024
1ad49bf
hosting behind slash prefix
robinpdev May 20, 2024
3b8c5ac
container name
robinpdev May 20, 2024
e3ba7dd
try 2002 last time
robinpdev May 20, 2024
a28e301
comon
robinpdev May 20, 2024
c532b24
is it joever?
robinpdev May 20, 2024
5cacb8d
react error fixed
ReinhardDP May 20, 2024
7c3a5cd
huh?
robinpdev May 20, 2024
572c217
All 403 redirects on access rights should be implemented + minor styl…
Thibaud-Collyn May 20, 2024
bf8e4b7
Admin button hotfix
Thibaud-Collyn May 20, 2024
c3168a0
address fix
robinpdev May 20, 2024
a72cd63
i forgor
robinpdev May 20, 2024
0435818
Merge branch 'develop' into fix-page-loading
Thibaud-Collyn May 20, 2024
097d708
example advanced test
robinpdev May 20, 2024
b9eff98
date error fixed, component added
ReinhardDP May 20, 2024
eb647e6
Merge branch 'calendar' of github.com:SELab-2/UGent-1 into calendar
ReinhardDP May 20, 2024
15ae790
fix createsuperuser in Makefile
axellorreyne May 20, 2024
02aacef
add docker cli to backend
robinpdev May 20, 2024
6e7089e
registry login in backend entrypoint
robinpdev May 20, 2024
52ea32e
working calendar
ReinhardDP May 20, 2024
198d1c2
tests
AlexanderVanOyen May 20, 2024
01ab439
added all submissions page
gilles-arnout May 20, 2024
b234252
added all submissions page
gilles-arnout May 20, 2024
4294e52
Merge branch 'improve_required_files' of https://github.com/SELab-2/U…
gilles-arnout May 20, 2024
189b548
UI and database changes for registry model
robinpdev May 20, 2024
de36e76
All pages should not flash into view if the user has no access to the…
Thibaud-Collyn May 20, 2024
64f1fe3
Fixed issue with loading the user(getUserData still used old cashing …
Thibaud-Collyn May 21, 2024
a8d8b65
listview reload fix
PJDeSmijter May 21, 2024
0b4382b
Merge pull request #179 from SELab-2/fix-page-loading
PJDeSmijter May 21, 2024
cfda2af
Hotfix StatusButton.tsx
RunoBoy May 21, 2024
9d598a5
Update manual
RunoBoy May 21, 2024
b732969
mui component added, functionality works
ReinhardDP May 21, 2024
d0356f0
trying to test listview
AlexanderVanOyen May 21, 2024
efe30b8
fix YearStateComponent by mocking other components
AlexanderVanOyen May 21, 2024
c4eb6b0
Text now edits, image doesn't...
Thibaud-Collyn May 21, 2024
65aefc2
Better error handling + better required files
RunoBoy May 21, 2024
27434f2
Edit user page looks a bit more streamlined now.
Thibaud-Collyn May 21, 2024
c6019ba
Removing unnecessary logs and imports
RunoBoy May 21, 2024
39afeaf
Merge pull request #184 from SELab-2/hotfix_statusbutton
PJDeSmijter May 21, 2024
93f02d2
Merge pull request #170 from SELab-2/frontend-tests
PJDeSmijter May 21, 2024
37e961a
Merge branch 'develop' into 148-advanced-tests
PJDeSmijter May 21, 2024
5156348
add template env file
axellorreyne May 21, 2024
d3e0a99
HOTFIX: User now has access to the submit page.
Thibaud-Collyn May 21, 2024
55f4666
fix lint
axellorreyne May 22, 2024
d0fb8f8
fix lint
axellorreyne May 22, 2024
de2e3b2
fix mount path
axellorreyne May 22, 2024
02a3fd2
Merge branch 'develop' into 148-advanced-tests
robinpdev May 22, 2024
4813326
precommit
gilles-arnout May 22, 2024
cb837bf
hotfix: remove filter button
gilles-arnout May 22, 2024
f8f6ede
Merge branch 'develop' of https://github.com/SELab-2/UGent-1 into dev…
gilles-arnout May 22, 2024
27b549d
hotfix: remove filter button
gilles-arnout May 22, 2024
24c8eec
clean up project edit old stuff
robinpdev May 22, 2024
9251271
add switch for forwarded host to env to get debug messages on production
robinpdev May 22, 2024
91375d3
fix bug in docker-py by changing affected requests package
robinpdev May 22, 2024
2a916fa
HOTFIX: Test if inf loading problem is resolved in admin page.
Thibaud-Collyn May 22, 2024
db2609c
Merge remote-tracking branch 'origin/develop' into develop
Thibaud-Collyn May 22, 2024
9e2334b
fix eval method in model
robinpdev May 22, 2024
60d6149
change example to reflect volumes on backend
robinpdev May 22, 2024
f47b11f
HOTFIX: Inf loading should be fixed now.
Thibaud-Collyn May 22, 2024
4f0faaa
fix distinction between hostside and dockerside paths
robinpdev May 22, 2024
45681d1
lint
axellorreyne May 22, 2024
0378fff
e2e submission fixed
ReinhardDP May 22, 2024
65f7911
Merge branch 'frontend-tests' of github.com:SELab-2/UGent-1 into fron…
ReinhardDP May 22, 2024
8b81973
course image edit fixed
ReinhardDP May 22, 2024
ea86a4f
Merge branch 'frontend-tests' into hotfix-edit-course
AlexanderVanOyen May 22, 2024
001ece7
added package.json
ReinhardDP May 22, 2024
30b9ab0
tests should pass
AlexanderVanOyen May 22, 2024
aebb464
Merge branch 'develop' into hotfix-edit-course
AlexanderVanOyen May 22, 2024
0ba7156
Merge branch 'develop' into frontend-tests
AlexanderVanOyen May 22, 2024
1fbf8df
Tooltip + repositioning of StatusButton
Thibaud-Collyn May 22, 2024
c795c5f
merge with dev and style fix
ReinhardDP May 22, 2024
27691da
Merge pull request #186 from SELab-2/required-files-cleanup
PJDeSmijter May 22, 2024
800b880
Merge pull request #185 from SELab-2/hotfix-edit-course
PJDeSmijter May 22, 2024
797aff9
fix production submissions volume bind
robinpdev May 22, 2024
19ce34f
Merge branch 'develop' into styling-edit-user-form
ReinhardDP May 22, 2024
01c727e
typo smh
robinpdev May 22, 2024
1dab329
fix production docker cli install
robinpdev May 22, 2024
5e61117
Merge pull request #183 from SELab-2/styling-edit-user-form
PJDeSmijter May 22, 2024
298cf03
remove container again
robinpdev May 22, 2024
cadc916
Hotfix: teachers can't see admin button anymore
Thibaud-Collyn May 22, 2024
af8dd23
Merge branch 'develop' into 148-advanced-tests
robinpdev May 22, 2024
54b8478
deadline==null fix
ReinhardDP May 22, 2024
f763222
archived fix
ReinhardDP May 22, 2024
246a2fc
Merge branch 'refs/heads/develop' into 148-advanced-tests
axellorreyne May 22, 2024
269748e
Merge branch 'develop' of https://github.com/SELab-2/UGent-1 into 180…
gilles-arnout May 22, 2024
8e980b0
titles added
ReinhardDP May 22, 2024
39f011b
re added all submission page
gilles-arnout May 22, 2024
bafc408
title added
ReinhardDP May 22, 2024
65940e0
merge dev conflicts fixed
ReinhardDP May 22, 2024
c2830e0
Merge branch '148-advanced-tests' of github.com:SELab-2/UGent-1 into …
robinpdev May 22, 2024
9d13a84
more component tests
AlexanderVanOyen May 22, 2024
c6dc17d
Merge pull request #187 from SELab-2/180-bring-back-all-submission-page
PJDeSmijter May 22, 2024
28d80c9
fix admin panel and saving for evaluation
robinpdev May 22, 2024
4856879
Merge branch 'develop' into 148-advanced-tests
robinpdev May 22, 2024
3816a50
fix mockdata for simple tests
axellorreyne May 22, 2024
b6cadea
Merge remote-tracking branch 'origin/develop' into develop
axellorreyne May 22, 2024
4cff058
course edit fix
ReinhardDP May 22, 2024
d58d6af
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
ReinhardDP May 22, 2024
b6b9aa4
fix submission admin
axellorreyne May 22, 2024
a1647d9
Merge remote-tracking branch 'origin/develop' into develop
axellorreyne May 22, 2024
228b980
lint fix
robinpdev May 22, 2024
1ee2647
Merge branch 'develop' into 148-advanced-tests
robinpdev May 22, 2024
04ecec8
more components tested
AlexanderVanOyen May 22, 2024
155a065
add local registry for development
robinpdev May 22, 2024
cdca24b
even more tests
AlexanderVanOyen May 22, 2024
6abe522
Simple tests in frontend
RunoBoy May 22, 2024
008e2ae
Updated status in listview
RunoBoy May 22, 2024
0e4d81a
merge with dev
RunoBoy May 22, 2024
97f3281
fixed import missing
RunoBoy May 22, 2024
cf70fce
almost done with testing all components
AlexanderVanOyen May 22, 2024
7c8e8c3
Fixed style of the project calendar page and also added Badges on dat…
Thibaud-Collyn May 22, 2024
3249a66
about 80% coverage
AlexanderVanOyen May 22, 2024
baf53c4
Merge branch 'develop' into frontend-tests
AlexanderVanOyen May 22, 2024
159f8d6
fix test
AlexanderVanOyen May 22, 2024
84e631d
add push registry command to makefile
axellorreyne May 22, 2024
9d18c8b
Fix admin submission tests for advanced evaluation
axellorreyne May 22, 2024
e000a10
fixed import missing + hotfix edit project with no required files
RunoBoy May 22, 2024
985df71
add registry entry for image that always succeeds
axellorreyne May 22, 2024
9a19dd2
fix always succeed image
axellorreyne May 22, 2024
e98c318
fix + clean teacher, amdin and unauth tests
axellorreyne May 22, 2024
791c345
fix + clean student submission view tests
axellorreyne May 22, 2024
0705be6
add fibonacci evaluation example + solution
axellorreyne May 23, 2024
6ff69f0
add submit test script
axellorreyne May 23, 2024
b27c366
fix evaluation result saving on succeed and fail
axellorreyne May 23, 2024
1e04b9c
Merge branch 'refs/heads/develop' into 148-advanced-tests
axellorreyne May 23, 2024
6570721
add artifacts + update example
axellorreyne May 23, 2024
50180c8
add artifacts download view
axellorreyne May 23, 2024
5293c04
fix submission test view
axellorreyne May 23, 2024
7b37cd5
Merge branch 'develop' into calendar
gilles-arnout May 23, 2024
af66343
Merge pull request #182 from SELab-2/calendar
gilles-arnout May 23, 2024
b68c5ec
Merge pull request #189 from SELab-2/simple_test_feedback
gilles-arnout May 23, 2024
d13851d
add production registry push command in makefile
robinpdev May 23, 2024
d4d7653
try to fix production testing env vars
robinpdev May 23, 2024
7ee0059
Merge branch 'develop' into 148-advanced-tests
robinpdev May 23, 2024
8681700
merge migrations
robinpdev May 23, 2024
0d958db
default values for env vars to get github actions working
robinpdev May 23, 2024
16c324e
Hotfix calendar annotating days outside of the month
RunoBoy May 23, 2024
8db5b82
Merge branch 'calendar' of github.com:SELab-2/UGent-1 into calendar
RunoBoy May 23, 2024
e237a6c
Hotfix calendar annotating days outside of the month
RunoBoy May 23, 2024
dba7df7
Project Calendar bugfixes, should work properly now.
Thibaud-Collyn May 23, 2024
9cf4202
user manual update with evaluations and new frontend
PJDeSmijter May 23, 2024
b5fd7b7
Merge remote-tracking branch 'origin/calendar' into calendar
Thibaud-Collyn May 23, 2024
cb8441f
readme fix
PJDeSmijter May 23, 2024
159955f
Merge branch 'develop' into calendar
Thibaud-Collyn May 23, 2024
643cc88
fix some stuff in submission detail but still broken
robinpdev May 23, 2024
182bfa7
fix advanced testing logic and submission details GUI
robinpdev May 23, 2024
f1b3a9d
more info on failed tests and listview result fix
robinpdev May 23, 2024
e7ea25b
Also added loading to the calendar.
Thibaud-Collyn May 23, 2024
51fb8e0
gyatt damn lint fix
robinpdev May 23, 2024
7a5da4a
Merge pull request #149 from SELab-2/148-advanced-tests
robinpdev May 23, 2024
2022145
Bump requests from 2.31.0 to 2.32.2 in /backend
dependabot[bot] May 23, 2024
b2dde38
Merge branch 'develop' into frontend-tests
AlexanderVanOyen May 23, 2024
33ebf3d
Add fixed version of docker-py
robinpdev May 23, 2024
c295544
Merge pull request #193 from SELab-2/dependabot/pip/backend/requests-…
PJDeSmijter May 23, 2024
105d599
Merge branch 'develop' into calendar
PJDeSmijter May 23, 2024
42b4c5a
Merge pull request #192 from SELab-2/calendar
PJDeSmijter May 23, 2024
87226c7
Merge branch 'user-manual' of github.com:SELab-2/UGent-1 into user-ma…
PJDeSmijter May 23, 2024
ab76f6e
link to manual fix
PJDeSmijter May 23, 2024
36b8ca6
fix default banner null
axellorreyne May 23, 2024
95c9872
Hotfix: navbar menu admin page button also works
Thibaud-Collyn May 23, 2024
0134f8e
Merge remote-tracking branch 'origin/develop' into develop
Thibaud-Collyn May 23, 2024
4ff702b
submission detail update
ReinhardDP May 23, 2024
c761a8b
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
ReinhardDP May 23, 2024
1a3553c
Hotfix: Removed admin page button from home page + reduced amount of …
Thibaud-Collyn May 23, 2024
65603b6
Merge remote-tracking branch 'origin/develop' into develop
Thibaud-Collyn May 23, 2024
6119700
Merge pull request #119 from SELab-2/user-manual
ReinhardDP May 23, 2024
98caa0c
fix archive page
PJDeSmijter May 23, 2024
f15e1b0
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
PJDeSmijter May 23, 2024
9e62e7c
archive course edit page fix
ReinhardDP May 23, 2024
da1b079
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
ReinhardDP May 23, 2024
134adf3
update mockdata for advanced and simple tests
axellorreyne May 23, 2024
db3d153
update submission admin page
axellorreyne May 23, 2024
5cea005
test
AlexanderVanOyen May 23, 2024
6641cf8
fix links in SubmissionDetailsPage
axellorreyne May 23, 2024
f561179
fix links in SubmissionDetailsPage
axellorreyne May 23, 2024
da7ba2d
Merge remote-tracking branch 'origin/develop' into develop
axellorreyne May 23, 2024
f66e1d5
fix tests passing
AlexanderVanOyen May 23, 2024
2b4d681
Merge pull request #188 from SELab-2/frontend-tests
PJDeSmijter May 23, 2024
ffbb310
Fix file_structure in mockdata.py
RunoBoy May 23, 2024
9a614b3
fix download artifacts permission
axellorreyne May 23, 2024
b93320e
change artifact generation order in fibonacci eval example
axellorreyne May 23, 2024
af89911
Only admin can change role
RunoBoy May 23, 2024
6834860
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
RunoBoy May 23, 2024
775251f
production compatible mockdata hotfix
robinpdev May 23, 2024
3c62cc1
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
robinpdev May 23, 2024
451b718
user manual update
PJDeSmijter May 23, 2024
5762335
Merge branch 'user-manual' of https://github.com/SELab-2/UGent-1 into…
PJDeSmijter May 23, 2024
0b89cfa
Merge branch 'user-manual' into develop
PJDeSmijter May 23, 2024
939a8b5
Merge branch 'develop' of https://github.com/SELab-2/UGent-1 into dev…
PJDeSmijter May 23, 2024
6318423
login redirect bug hotfix (epic style swag)
robinpdev May 23, 2024
c2f5ef5
add latest group submissions endpoint
axellorreyne May 23, 2024
670d6d1
add latest group submissions view
axellorreyne May 23, 2024
dc3dc7d
Merge branch 'refs/heads/develop' into 149-latest-group-submission
axellorreyne May 23, 2024
adaf04c
default banner hotfix
robinpdev May 23, 2024
3b8ae71
fix listview submission list
PJDeSmijter May 23, 2024
18ec2b2
fix permissions
PJDeSmijter May 23, 2024
ed98348
hotfix backend testen
PJDeSmijter May 23, 2024
504d52f
Merge pull request #195 from SELab-2/149-latest-group-submission
PJDeSmijter May 23, 2024
63da8af
Added code documentation, code cleanup and a couple of bugfixes
Thibaud-Collyn May 23, 2024
41864d3
fix submission download
axellorreyne May 23, 2024
fb5bb8a
Merge branch 'develop' into code-documentation
Thibaud-Collyn May 23, 2024
bdb5aea
Set image as null when creating course with default image
RunoBoy May 23, 2024
5723394
tests fixed
ReinhardDP May 23, 2024
8217e61
tests fix 2
ReinhardDP May 23, 2024
f03bc45
Merge pull request #197 from SELab-2/code-documentation
PJDeSmijter May 23, 2024
da0710f
Check if new image is uploaded
RunoBoy May 23, 2024
a097d11
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
RunoBoy May 23, 2024
d54bba1
Editing project now fills in in projectEditForm.tsx
RunoBoy May 23, 2024
1395468
permission fix submission list
PJDeSmijter May 23, 2024
7f49112
Merge branch '149-latest-group-submission' into develop
PJDeSmijter May 23, 2024
4b12cfd
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
PJDeSmijter May 23, 2024
25c6157
Revert "Merge branch 'develop' of github.com:SELab-2/UGent-1 into dev…
PJDeSmijter May 23, 2024
efb10a6
Revert "Merge branch '149-latest-group-submission' into develop"
PJDeSmijter May 23, 2024
342df0c
fix selection download
robinpdev May 23, 2024
37463b6
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
robinpdev May 23, 2024
70f7d1b
listview fix
ReinhardDP May 23, 2024
34668da
Merge branch 'develop' of github.com:SELab-2/UGent-1 into develop
ReinhardDP May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
pip install -r ./backend/requirements.txt
- name: Running Django tests
run: |
source /home/selab2/hosting/.env.test
sh ./backend/runtests.sh

frontend-test:
Expand Down
23 changes: 23 additions & 0 deletions .template.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
DATABASE=postgres
DEBUG=1
DJANGO_ALLOWED_HOSTS='localhost example.com 127.0.0.1 [::1] django'
[email protected]
DJANGO_SUPERUSER_PASSWORD=abc
FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_REDIRECT_URL=/redirect
OAUTH_CLIENT_ID=1234
OAUTH_CLIENT_SECRET=1234
OAUTH_TENANT_ID=1234
REGISTRY_NAME=sel2-1.ugent.be:2002
REGISTRY_PASSWORD=testding
REGISTRY_URL=https://sel2-1.ugent.be:2002
REGISTRY_USER=test
SECRET_KEY=development_key
SQL_DATABASE=pigeonhole_dev
SQL_ENGINE=django.db.backends.postgresql
SQL_HOST=pigeonhole-database
SQL_PASSWORD=password
SQL_PORT=5432
SQL_USER=pigeonhole
SUBMISSIONS_PATH=./backend/uploads/submissions/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
RUN apk update \
&& apk add postgresql-dev gcc python3-dev musl-dev
&& apk add postgresql-dev gcc python3-dev musl-dev docker-cli

# install dependencies
RUN pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN mkdir $APP_HOME/uploads
WORKDIR $APP_HOME

# install dependencies
RUN apk update && apk add libpq
RUN apk update && apk add libpq docker-cli
COPY --from=builder /usr/src/app/wheels /wheels
COPY --from=builder /usr/src/app/requirements.txt .
RUN pip install --no-cache /wheels/*
Expand Down
37 changes: 36 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ superuser:
mockdata:
docker exec -it pigeonhole-backend python manage.py runscript mockdata

registry:
docker build examples/advanced-evaluation/always-succeed -t test-always-succeed
docker tag test-always-succeed localhost:5000/test-always-succeed
docker push localhost:5000/test-always-succeed
docker build examples/advanced-evaluation/helloworld -t test-helloworld
docker tag test-helloworld localhost:5000/test-helloworld
docker push localhost:5000/test-helloworld
docker build examples/advanced-evaluation/fibonacci-python -t fibonacci-python
docker tag fibonacci-python localhost:5000/fibonacci-python
docker push localhost:5000/fibonacci-python

evaltest:
docker exec -it pigeonhole-backend python manage.py runscript eval_test

submit:
docker exec -it pigeonhole-backend python manage.py runscript submit

reset:
docker image prune -af
docker system prune
Expand All @@ -30,5 +47,23 @@ frontshell:
componenttest:
docker exec -it pigeonhole-frontend npx jest

coveragecomponenttest:
docker exec -it pigeonhole-frontend npx jest --coverage --silent

silentcomponenttest:
docker exec -it pigeonhole-frontend npx jest --silent
docker exec -it pigeonhole-frontend npx jest --silent

resetdb:
docker exec pigeonhole-backend python manage.py flush --noinput
docker exec -it pigeonhole-backend python manage.py runscript mockdata

prodregistry:
docker build examples/advanced-evaluation/always-succeed -t test-always-succeed
docker tag test-always-succeed sel2-1.ugent.be:2002/test-always-succeed
docker push sel2-1.ugent.be:2002/test-always-succeed
docker build examples/advanced-evaluation/helloworld -t test-helloworld
docker tag test-helloworld sel2-1.ugent.be:2002/test-helloworld
docker push sel2-1.ugent.be:2002/test-helloworld
docker build examples/advanced-evaluation/fibonacci-python -t fibonacci-python
docker tag fibonacci-python sel2-1.ugent.be:2002/fibonacci-python
docker push sel2-1.ugent.be:2002/fibonacci-python
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
- Rune Dyselinck: Secretary

## Bekijk de [wiki](https://github.com/SELab-2/UGent-1/wiki) om alles over de applicatie te weten te komen.

## Bekijk de [user manual](https://github.com/SELab-2/UGent-1/blob/user-manual/user_manual/manual.pdf) voor de gebruikershandleiding.
1 change: 1 addition & 0 deletions backend/entrypoint.prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ python manage.py runscript push_site

python manage.py collectstatic --noinput

docker login $REGISTRY_URL -u $REGISTRY_USER -p $REGISTRY_PASSWORD

exec "$@"
2 changes: 2 additions & 0 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ python manage.py runscript push_site

python manage.py createsuperuser --noinput --email $DJANGO_SUPERUSER_EMAIL

docker login $REGISTRY_URL -u $REGISTRY_USER -p $REGISTRY_PASSWORD

exec "$@"
8 changes: 8 additions & 0 deletions backend/pigeonhole/apps/courses/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ class CourseAdmin(admin.ModelAdmin):
'open_course',
)
}
),
(
'banner',
{
'fields': (
'banner',
)
}
)
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.2 on 2024-04-27 11:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('courses', '0005_alter_course_banner'),
]

operations = [
migrations.AddField(
model_name='course',
name='archived',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='course',
name='year',
field=models.IntegerField(blank=True, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.2 on 2024-04-30 21:06

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('courses', '0006_course_archived_course_year'),
]

operations = [
migrations.AlterField(
model_name='course',
name='year',
field=models.IntegerField(default=2024),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.11 on 2024-05-23 12:40

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('courses', '0007_alter_course_year'),
]

operations = [
migrations.AlterField(
model_name='course',
name='banner',
field=models.FileField(blank=True, null=True, upload_to='course_banners/'),
),
]
8 changes: 4 additions & 4 deletions backend/pigeonhole/apps/courses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from rest_framework import serializers


# Create your models here.
class Course(models.Model):
course_id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=256)
description = models.TextField()
open_course = models.BooleanField(default=False)
invite_token = models.CharField(max_length=20, blank=True, null=True)
banner = models.FileField(upload_to='course_banners/', blank=True, null=False,
default='course_banners/ugent_banner.png')
banner = models.FileField(upload_to='course_banners/', blank=True, null=True)
archived = models.BooleanField(default=False)
year = models.IntegerField(default=2024)

objects = models.Manager()

Expand All @@ -34,7 +34,7 @@ class CourseSerializer(serializers.ModelSerializer):

class Meta:
model = Course
fields = ['course_id', 'name', 'open_course', 'description', 'invite_token', 'banner']
fields = ['course_id', 'name', 'open_course', 'description', 'invite_token', 'banner', 'archived', 'year']

def to_representation(self, instance):
data = super().to_representation(instance)
Expand Down
5 changes: 3 additions & 2 deletions backend/pigeonhole/apps/courses/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def has_permission(self, request, view):
"leave_course",
"get_teachers",
"get_students",
"get_archived_courses",
"get_open_courses"
]:
return True

if request.user.is_teacher:
if view.action in ["create", "list", "retrieve"]:
return True
elif (
view.action in ["update", "partial_update", "destroy",
"get_projects"]
view.action in ["update", "partial_update", "destroy", "get_projects"]
and User.objects.filter(
id=request.user.id, course=view.kwargs["pk"]
).exists()
Expand Down
53 changes: 51 additions & 2 deletions backend/pigeonhole/apps/courses/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django_filters.rest_framework import DjangoFilterBackend

from backend.pigeonhole.apps.courses.models import CourseSerializer
from backend.pigeonhole.apps.groups.models import Group
from backend.pigeonhole.apps.groups.models import Group, GroupSerializer
from backend.pigeonhole.apps.projects.models import Project
from backend.pigeonhole.apps.projects.models import ProjectSerializer
from backend.pigeonhole.apps.users.models import User, UserSerializer
Expand Down Expand Up @@ -59,6 +59,21 @@ def join_course(self, request, *args, **kwargs):
if request.user.is_student:
if course.open_course:
user.course.add(course)

# Join all individual projects of the course
projects = Project.objects.filter(course_id=course, group_size=1)
for project in projects:
group_data = {
"project_id": project.project_id,
"user": [user.id],
"feedback": None,
"final_score": None,
"visible": False,
}
group_serializer = GroupSerializer(data=group_data)
group_serializer.is_valid(raise_exception=True)
group_serializer.save()

return Response(status=status.HTTP_200_OK)
else:
return Response(
Expand All @@ -81,6 +96,22 @@ def join_course_with_token(self, request, *args, **kwargs):

if invite_token == course.invite_token:
user.course.add(course)

# Join all individual projects of the course
if request.user.is_student:
projects = Project.objects.filter(course_id=course, group_size=1)
for project in projects:
group_data = {
"project_id": project.project_id,
"user": [user.id],
"feedback": None,
"final_score": None,
"visible": False,
}
group_serializer = GroupSerializer(data=group_data)
group_serializer.is_valid(raise_exception=True)
group_serializer.save()

return Response(
{"message": "Successfully joined the course with invite token."},
status=status.HTTP_200_OK,
Expand Down Expand Up @@ -112,7 +143,7 @@ def leave_course(self, request, *args, **kwargs):
@action(detail=False, methods=["GET"])
def get_selected_courses(self, request, *args, **kwargs):
user = request.user
courses = Course.objects.filter(user=user)
courses = Course.objects.filter(user=user, archived=False)
course_filter = CourseFilter(request.GET, queryset=courses)
paginated_queryset = self.paginate_queryset(course_filter.qs)
queryset = self.order_queryset(paginated_queryset)
Expand Down Expand Up @@ -162,3 +193,21 @@ def get_projects(self, request, *args, **kwargs):
paginated_queryset = self.paginate_queryset(queryset)
serializer = ProjectSerializer(paginated_queryset, many=True)
return self.get_paginated_response(serializer.data)

@action(detail=False, methods=["GET"])
def get_archived_courses(self, request, *args, **kwargs):
user = request.user
courses = Course.objects.filter(user=user, archived=True)
course_filter = CourseFilter(request.GET, queryset=courses)
paginated_queryset = self.paginate_queryset(course_filter.qs)
queryset = self.order_queryset(paginated_queryset)
serializer = CourseSerializer(queryset, many=True)
return self.get_paginated_response(serializer.data)

@action(detail=False, methods=["GET"])
def get_open_courses(self, request, *args, **kwargs):
courses = Course.objects.filter(open_course=True)
course_filter = CourseFilter(request.GET, queryset=courses)
queryset = self.order_queryset(course_filter.qs)
serializer = CourseSerializer(self.paginate_queryset(queryset), many=True)
return self.get_paginated_response(serializer.data)
8 changes: 8 additions & 0 deletions backend/pigeonhole/apps/projects/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ class ProjectAdmin(admin.ModelAdmin):
)
}
),
(
'test docker image',
{
'fields': (
'test_docker_image',
)
}
),
)

raw_id_fields = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.13 on 2024-05-19 11:35

import backend.pigeonhole.apps.projects.models
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
('projects', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='project',
name='test_dockerfile',
field=models.FileField(blank=True, null=True,
upload_to=backend.pigeonhole.apps.projects.models.get_upload_to),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.13 on 2024-05-19 16:38

import backend.pigeonhole.apps.projects.models
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
('projects', '0002_project_test_dockerfile'),
]

operations = [
migrations.AlterField(
model_name='project',
name='test_dockerfile',
field=models.FileField(blank=True, null=True,
upload_to=backend.pigeonhole.apps.projects.models.dockerfile_path),
),
migrations.AlterField(
model_name='project',
name='test_files',
field=models.FileField(blank=True, null=True,
upload_to=backend.pigeonhole.apps.projects.models.testfile_path),
),
]
Loading
Loading