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

Release: v2.2.0 #1108

Merged
merged 213 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
1240cc9
Add Question model
albertas-jn Apr 11, 2024
3363c21
Update tests for Question model
albertas-jn Apr 12, 2024
28bcfad
Fix linter errors
albertas-jn Apr 12, 2024
fd8a6c9
Fix linter errors 2
albertas-jn Apr 12, 2024
07f0199
Fix linter errors 3
albertas-jn Apr 12, 2024
ce73f21
Merge develop
albertas-jn Apr 16, 2024
9805400
Fix migration conflicts
albertas-jn Apr 16, 2024
0455b1e
Modify button text, Add rules' default and save
albertas-jn Apr 17, 2024
8074536
Do not add default questions to experiment if question_series does no…
albertas-jn Apr 22, 2024
0b96862
Move question to own app
albertas-jn May 10, 2024
ce1ba2d
Merge develop
albertas-jn May 10, 2024
dc264c8
First createquestions then boostrap, add default question series to b…
albertas-jn May 10, 2024
8ff247a
Convert indentation to spaces in experiment_admin.js and questionseri…
albertas-jn May 10, 2024
65375bf
Randomize MSI_F3 questions in rhythm_battery_final.py (former gold_ms…
albertas-jn May 10, 2024
a52f9f2
Add tests for createquestions command
albertas-jn May 10, 2024
0fc8474
Cleanup: remove get_default_question_keys()
albertas-jn May 10, 2024
64d1692
Add docstrings to question app
albertas-jn May 10, 2024
a323cfe
Move createquestions command tests to question app
albertas-jn May 12, 2024
8f32b4a
chore: Update package version to 2.1.0 (#1026)
drikusroor May 27, 2024
b5d7330
fix: return correct content for first_round
BeritJanssen May 27, 2024
dc7449e
CI: Configure deployment to Production server (#1015)
drikusroor May 27, 2024
0bc37e2
Merge pull request #1029 from Amsterdam-Music-Lab/fix/thats-my-song-c…
BeritJanssen May 27, 2024
85862a6
chore: Update package version to 2.1.1 (#1031)
drikusroor May 27, 2024
ab1ed01
fix: pick correct first_round action in That's My Song
BeritJanssen May 27, 2024
a551e3d
Fixed (CI): Trigger workflow (not just job) on release creation as we…
drikusroor May 27, 2024
8415495
feat: altered plink version
BeritJanssen May 28, 2024
0e63675
feat: make copies of toontjehoger rules
BeritJanssen May 28, 2024
e89b497
Merge branch 'hotfix/speech2song' into develop
BeritJanssen May 28, 2024
1488446
Added: Add server-side playlist validation to rules files (#995)
drikusroor May 28, 2024
c61a977
Add score and rank to header
Evert-R May 28, 2024
851ce12
fix test_header_serializer
Evert-R May 28, 2024
c45af91
remove duplicate MarkdownPreviewTextInput
BeritJanssen May 28, 2024
eef4fbe
fix logo display
BeritJanssen May 28, 2024
ff5dd2f
chore: os.path.join sections
BeritJanssen May 28, 2024
cb0ddb8
adjust footer serialization
BeritJanssen May 28, 2024
2d407d4
add Footer component
BeritJanssen May 28, 2024
ddd731a
add beat alignment / toontjehoger kids version
BeritJanssen May 29, 2024
e07fe9f
feat: Enable sourcemap generation in build configuration (#1041)
drikusroor May 29, 2024
eb9083f
Code correction
Evert-R May 30, 2024
5684c40
Merge branch 'develop' into feature-er/score-in-header
Evert-R May 30, 2024
9349a31
fix: Do not call onNext in onResult when we should break the round (#…
drikusroor May 30, 2024
f403bb5
add Footer unit test
BeritJanssen Jun 3, 2024
5e4f400
change privacy message to render html (needs to be able to display li…
BeritJanssen Jun 3, 2024
058c282
fix: Fix return value in the experiment form's clean_playlists method
drikusroor May 28, 2024
99fedd3
Merge pull request #1039 from Amsterdam-Music-Lab/fix/experiment-rule…
drikusroor Jun 3, 2024
7c9b5d0
fix: include footer in ExperimentCollection unit test
BeritJanssen Jun 3, 2024
22202ff
feat: Add file existence validation for section files in Playlist model
drikusroor May 29, 2024
81f9ded
feat: Add file existence validation for section files in Playlist adm…
drikusroor May 29, 2024
f68da8c
feat: Refactor playlist file validation in Playlist model
drikusroor May 29, 2024
9a608a8
feat: Remove unused import in section/forms.py
drikusroor May 29, 2024
9bc80a6
refactor: Update unecessary section model file field validators
drikusroor May 29, 2024
154ead1
fix: Fix file input by removing an erroneous comma that made the file…
drikusroor May 29, 2024
a1b8958
fix: pass key to elements in logo array
BeritJanssen Jun 3, 2024
161b248
Merge pull request #1042 from Amsterdam-Music-Lab/enhance/playlist-va…
drikusroor Jun 3, 2024
0aebf7f
feat: Add Dockerfile and test scripts for running Selenium tests in a…
drikusroor May 13, 2024
58e3bae
refactor: Improve readability of e2e tests
drikusroor May 13, 2024
5326243
feat: Update e2e run-tests script to support interactive mode
drikusroor May 13, 2024
8b63918
refactor: Improve readability e2e tests
drikusroor May 13, 2024
b93cec8
feat: Use BASE_URL from environment variables
drikusroor May 13, 2024
a929a01
chore: Temporarily turn on e2e testing for this feature branch
drikusroor May 13, 2024
3a50889
fix: Fix script filename
drikusroor May 13, 2024
95f7c43
chore: Update e2e tests to print base URL before running
drikusroor May 14, 2024
50aa23d
refactor: Update e2e run-tests script to pass BASE_URL as environment…
drikusroor May 14, 2024
b03a6bc
refactor: Update e2e run-tests script to pass BASE_URL as environment…
drikusroor May 22, 2024
973f7ac
refactor: Update BAT e2e test to according to current situation and t…
drikusroor May 22, 2024
661a825
chore: Use actual ACC subdomain as the E2E's target BASE_URL
drikusroor May 22, 2024
bd29723
refactor: Update e2e tests to use correct Eurovision slug
drikusroor May 22, 2024
1f4c544
refactor: Fix eurovision test
drikusroor May 22, 2024
852fd6d
chore: Print a successful google is working message
drikusroor May 22, 2024
b9d8077
refactor: Update e2e test for categorization
drikusroor May 23, 2024
9f89f00
refactor: Wrap the other experiments in try-catch as well and abstrac…
drikusroor May 23, 2024
2cdea33
fix: Fix the cat tests partially
drikusroor May 23, 2024
8b0d3b1
chore: Uncomment e2e tests
drikusroor May 23, 2024
8a9f72d
ci: Add step to upload screenshots on test failure
drikusroor May 23, 2024
5744433
refactor: Use a more readable datetime string format
drikusroor May 23, 2024
0eeb580
chore: Update upload-artifact action to v4 in podman.yml
drikusroor May 23, 2024
b73cddc
chore: Update upload-artifact action to v4 and path in podman.yml
drikusroor May 23, 2024
62fffbe
fix: Fix cat e2e test
drikusroor May 24, 2024
b614369
fix: Fix categorization test
drikusroor May 24, 2024
630b4fe
chore: Remove screenshots for now
drikusroor May 24, 2024
342a9b3
chore: Enable other tests
drikusroor May 27, 2024
8548c59
chore: Update podman.yml to include temporary branch for e2e testing
drikusroor May 28, 2024
6f48a89
chore: Update SENTRY_ENVIRONMENT to "production" in podman.yml for de…
drikusroor May 28, 2024
543005d
fix: Add agree_to_consent method for handling informed consent in e2e…
drikusroor May 28, 2024
a186ed5
fix: Wait for informed consent to appear
drikusroor May 28, 2024
88441b9
fix: Don't wait for initial next button
drikusroor May 28, 2024
4b27042
chore: Add print statement to indicate start of a round in eurovision…
drikusroor May 28, 2024
6918793
chore: Remove temporary branch for e2e testing in podman.yml
drikusroor Jun 3, 2024
ccb0307
fix backend test
BeritJanssen Jun 3, 2024
1eee254
wrap footer html in divs
BeritJanssen Jun 3, 2024
a6ab844
Merge pull request #1010 from Amsterdam-Music-Lab/poc/enable-e2e
drikusroor Jun 3, 2024
9636bde
add: Mozart text adjustments and new files
BeritJanssen Jun 3, 2024
4171000
add: Preverbal text adjustments and video
BeritJanssen Jun 3, 2024
b4edc40
adjust texts for ToontjehogerKids3-6
BeritJanssen Jun 3, 2024
5505d90
fix: correct Toontjehoger Mozart & implement inheritance
BeritJanssen Jun 3, 2024
36328b6
fix: correct Toontjehoger Preverbal & implement inheritance
BeritJanssen Jun 3, 2024
bc17dc3
Update frontend/src/components/Footer/Footer.tsx
BeritJanssen Jun 3, 2024
5ffe285
Update frontend/src/components/Footer/Footer.scss
BeritJanssen Jun 3, 2024
260a68d
Update frontend/src/components/Footer/Footer.scss
BeritJanssen Jun 3, 2024
eb90032
Update frontend/src/components/AppBar/AppBar.jsx
BeritJanssen Jun 3, 2024
af3ea6f
fix: adjust privacy className
BeritJanssen Jun 3, 2024
c6969ad
fix: adjust selector for privacy
BeritJanssen Jun 3, 2024
f3ae126
fix thk 4 texts and implement inheritance
BeritJanssen Jun 4, 2024
2270db6
fix problem with round counter
BeritJanssen Jun 4, 2024
44ee4a6
fix first_round and implement inheritance Toontjehoger 5
BeritJanssen Jun 4, 2024
4aa7c16
Move totalScore from theme to experimentCollection
Evert-R Jun 4, 2024
a5b3982
Optimize animated score
Evert-R Jun 4, 2024
cc9f4a2
code correction
Evert-R Jun 4, 2024
52f9563
code correction
Evert-R Jun 4, 2024
f3e1397
Fixed: Fix theme serialization in get_experiment view (#1050)
drikusroor Jun 4, 2024
140f1e0
fix first_round and implement inheritance toontjehoger 6
BeritJanssen Jun 4, 2024
967bdb7
chore: move tests and fix score unit test
BeritJanssen Jun 4, 2024
b910303
fix linting issues
BeritJanssen Jun 4, 2024
cdbfcfa
Merge pull request #1048 from Amsterdam-Music-Lab/feature/display-footer
BeritJanssen Jun 4, 2024
434aad3
Add test for total score grouped experiments
Evert-R Jun 4, 2024
253e066
Merge branch 'develop' into feature-er/score-in-header
Evert-R Jun 4, 2024
f812c6b
feat: remove session information from Dashboard tiles
BeritJanssen Jun 4, 2024
533f03e
Bundle score properties
Evert-R Jun 4, 2024
11b3eee
Fixed: Fix play again URL rendering (#1056)
drikusroor Jun 4, 2024
b0f5201
fix: integrate image in dashboard
BeritJanssen Jun 4, 2024
42df321
Added: Add admin interface app for global admin dashboard theming and…
drikusroor Jun 4, 2024
7e71ce6
Added (CI): Add schedule for database backup (#1045)
drikusroor Jun 4, 2024
7b080c7
Update backend/experiment/rules/toontjehogerkids_4_absolute.py
BeritJanssen Jun 4, 2024
0a835cf
Merge pull request #1052 from Amsterdam-Music-Lab/feature/th-kids
BeritJanssen Jun 4, 2024
75d0a4f
feat: add color schemes
BeritJanssen Jun 4, 2024
76df53c
Merge branch 'develop' into feature/dashboard-adjustments
BeritJanssen Jun 4, 2024
1bf80c1
fix tests
Evert-R Jun 4, 2024
2d7964c
fix: add color scheme Toontjehoger
BeritJanssen Jun 4, 2024
4b41d01
Merge pull request #1038 from Amsterdam-Music-Lab/feature-er/score-in…
Evert-R Jun 4, 2024
96a8bf7
fix backend unit test and linting issue
BeritJanssen Jun 4, 2024
2eb0ca8
fix frontend unit tests
BeritJanssen Jun 4, 2024
0d18790
add toontjehogerkids debriefs
BeritJanssen Jun 4, 2024
a759cb0
Add react-helmet-async package and configure head/og tags (#993)
drikusroor Jun 4, 2024
9995f41
reduce debrief to one template, rendered with context dictionary
BeritJanssen Jun 4, 2024
d99146e
fix linting issue
BeritJanssen Jun 4, 2024
288815c
Fixed: Fix internal Final button link (v2) (#1066)
drikusroor Jun 5, 2024
71f41db
feat: Allow SVG & WebP images to be uploaded in the Image model (#1067)
drikusroor Jun 6, 2024
5cc83a8
Merge pull request #1064 from Amsterdam-Music-Lab/feature/thk-debriefs
BeritJanssen Jun 6, 2024
ad48b7d
fix: implement review suggestions
BeritJanssen Jun 7, 2024
e47f4d3
Merge pull request #1062 from Amsterdam-Music-Lab/feature/dashboard-a…
BeritJanssen Jun 7, 2024
7a3bba3
Added: Style play buttons according to neutral-inverted style (#1068)
drikusroor Jun 7, 2024
3dc7bda
Merge develop
albertas-jn Jun 8, 2024
64f08fc
Move create_default_questions() to bootstrap.py
albertas-jn Jun 8, 2024
529810b
Data migration: add default questions to experiment only if rules exist
albertas-jn Jun 8, 2024
89b0b33
Remove call_command() from test_createquestions()
albertas-jn Jun 8, 2024
ccf8854
Merge pull request #946 from Amsterdam-Music-Lab/aj/feat/question-ord…
albertas-jn Jun 8, 2024
295a3ff
Added: Add validate_playlist method for Toontje Hoger 1 - Mozart expe…
drikusroor Jun 10, 2024
7d47e00
feat: add Plink validation
BeritJanssen Jun 10, 2024
9270bd3
check and fix imports
BeritJanssen Jun 10, 2024
2c08c0c
fix circular import
BeritJanssen Jun 10, 2024
0566048
fix linting issue
BeritJanssen Jun 10, 2024
a0f0a9c
Merge pull request #1085 from Amsterdam-Music-Lab/fix/question-models
BeritJanssen Jun 10, 2024
25beadb
feat: validate Preverbal playlist
BeritJanssen Jun 5, 2024
2fa7ebd
Merge pull request #1086 from Amsterdam-Music-Lab/feature/th-2-valida…
BeritJanssen Jun 10, 2024
8ba7d7c
feat: th 6 playlist validation
BeritJanssen Jun 10, 2024
1f1776b
shut down containers in test deploy scenario
BeritJanssen Jun 10, 2024
b929575
feat: Add playlist group validation to ToontjeHoger5Tempo rule (#1080)
drikusroor Jun 10, 2024
b52d9ac
remove force-recreate flag
BeritJanssen Jun 10, 2024
ebeacba
Merge pull request #1088 from Amsterdam-Music-Lab/ci/podman-down
BeritJanssen Jun 10, 2024
4b63b7b
Refactor deployment process to properly stop containers before deploy…
drikusroor Jun 10, 2024
930fec4
fix: check that sections have groups ['1','2']
BeritJanssen Jun 10, 2024
b45c295
fix: optionally include subpath in image file serialization
BeritJanssen Jun 10, 2024
f4c12ed
fix: use string formatting for image serialization
BeritJanssen Jun 10, 2024
b043f11
fix: do not prefix API_ROOT for frontend image fetch
BeritJanssen Jun 10, 2024
617ce89
fix: use image serializer for experiment.views
BeritJanssen Jun 10, 2024
0b8a704
fix: remove API_BASE_URL from Footer image fetch
BeritJanssen Jun 10, 2024
6555e9d
fix footer_serializer unit test
BeritJanssen Jun 10, 2024
2294630
fix frontend unit test
BeritJanssen Jun 10, 2024
1b64cf4
fix image serialization in experiment views
BeritJanssen Jun 10, 2024
a98defb
fix passing of styles from Toontjehoger2
BeritJanssen Jun 11, 2024
b808e3a
fix: change serialization case
BeritJanssen Jun 11, 2024
21d98ee
remove started_session_count and finished_session_count
BeritJanssen Jun 11, 2024
eb84a92
fix image dimensions
BeritJanssen Jun 11, 2024
a18ad9b
Merge pull request #1087 from Amsterdam-Music-Lab/feature/th-6-valida…
BeritJanssen Jun 11, 2024
418748b
Merge pull request #1084 from Amsterdam-Music-Lab/feature/validate-plink
BeritJanssen Jun 11, 2024
3793db1
fix backend unit tests
BeritJanssen Jun 11, 2024
7a04b4b
remove frontend references to session counts
BeritJanssen Jun 11, 2024
934174d
TH5 Playlist Validation: Add playlist tag validation to ToontjeHoger(…
drikusroor Jun 11, 2024
5b0d001
fix frontend unit test
BeritJanssen Jun 11, 2024
468ddca
add alt / href test strings to experiment serialization test
BeritJanssen Jun 11, 2024
6a1fdaa
TH4 Playlist validation (groups & tags) (#1090)
drikusroor Jun 11, 2024
38669ad
Merge pull request #1093 from Amsterdam-Music-Lab/fix/image-path
BeritJanssen Jun 11, 2024
e015f50
adjust colour schemes
BeritJanssen Jun 11, 2024
3c22265
outfactor Logo component
BeritJanssen Jun 11, 2024
30e641e
adjust styles for logo in AppBar / dashboard
BeritJanssen Jun 11, 2024
9cf22fd
include `BASE_URL` in image serialization
BeritJanssen Jun 11, 2024
2989ea1
Merge branch 'develop' into fix/logos
BeritJanssen Jun 11, 2024
233d180
fix: do not include API_BASE_URL in frontend logo fetch
BeritJanssen Jun 11, 2024
9456cc5
fix backend unit tests
BeritJanssen Jun 11, 2024
47e3cc8
fix: apply text changes from Leiden team
BeritJanssen Jun 11, 2024
7e65e49
add interface translations
BeritJanssen Jun 11, 2024
1261aed
fix: center div, remove max-width rule
BeritJanssen Jun 11, 2024
3f63cc4
Merge pull request #1097 from Amsterdam-Music-Lab/fix/logos
BeritJanssen Jun 11, 2024
d7a98bd
Merge pull request #1098 from Amsterdam-Music-Lab/feat/thk-updates
BeritJanssen Jun 11, 2024
905411e
fix: correct preverbal playlist validation
BeritJanssen Jun 11, 2024
925efb3
Merge branch 'develop' into fix/thk-playlists
BeritJanssen Jun 11, 2024
ea8c316
fix: override `validate_era_and_mood` in thk plink
BeritJanssen Jun 11, 2024
46a1fd9
fix: toontjehoger4 playlist validation and kids version override
BeritJanssen Jun 11, 2024
1a1071f
fix: simplify section selection and feedback thk tempo
BeritJanssen Jun 11, 2024
314ea67
Merge pull request #1096 from Amsterdam-Music-Lab/fix/preverbal
BeritJanssen Jun 11, 2024
70b7531
fix unit test
BeritJanssen Jun 11, 2024
070b7e6
fix translation
BeritJanssen Jun 12, 2024
fcd1047
fix: change totalScore / nextExperiment to camel case in ExperimentCo…
BeritJanssen Jun 12, 2024
834a518
Merge pull request #1095 from Amsterdam-Music-Lab/fix/next-experiment
BeritJanssen Jun 12, 2024
63a6be7
Merge pull request #1099 from Amsterdam-Music-Lab/fix/thk-playlists
BeritJanssen Jun 12, 2024
059402c
Added: Show experiment collection title & description (#1102)
drikusroor Jun 12, 2024
6d84ceb
Fixed: update max-width in Footer.scss to 1200px (#1103)
drikusroor Jun 12, 2024
4d33a66
style: Improve spacing between experiment collection intro & score (#…
drikusroor Jun 12, 2024
14c25a7
chore: Update package.json version to 2.2.0
drikusroor Jun 12, 2024
beb3b7f
Merge branch 'main' into release/2.2.0
drikusroor Jun 12, 2024
ac24b93
turn off markdown safe mode
BeritJanssen Jun 12, 2024
e4f35c8
Merge pull request #1109 from Amsterdam-Music-Lab/fix/markup-safe-mode
BeritJanssen Jun 12, 2024
0b20a27
Merge branch 'develop' into release/2.2.0
drikusroor Jun 12, 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
25 changes: 25 additions & 0 deletions .github/workflows/db-backup-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Database Backup Template

on:
workflow_call:
inputs:
runner:
required: true
type: string

jobs:
backup:
runs-on: ${{ inputs.runner }}
steps:

- name: Set Date
id: date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV

- name: Backup Database
run: |
podman exec muscle_db_1 sh -c "pg_dump -Fc > /backups/${{ env.DATE }}.dump"

- name: Remove Old Backups (older than 7 days)
run: |
podman exec muscle_db_1 sh -c "find /backups -type f -name '*.dump' -mtime +7 -exec rm {} \;"
32 changes: 27 additions & 5 deletions .github/workflows/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
types: [created]

jobs:

deploy-test:
name: Deploy to test environment
environment: Test
Expand Down Expand Up @@ -79,8 +80,10 @@ jobs:
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
- name: Shut down running containers
run: podman compose -f docker-compose-deploy.yml down
- name: Deploy Podman images
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate
run: podman-compose -f docker-compose-deploy.yml up -d
- name: Notify Sentry of new release
run: |
curl -X POST "https://sentry.io/api/0/organizations/uva-aml/releases/" \
Expand Down Expand Up @@ -169,8 +172,10 @@ jobs:
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
- name: Shut down running containers
run: podman compose -f docker-compose-deploy.yml down
- name: Deploy Podman images
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate
run: podman-compose -f docker-compose-deploy.yml up -d
- name: Notify Sentry of new release
run: |
curl -X POST "https://sentry.io/api/0/organizations/uva-aml/releases/" \
Expand Down Expand Up @@ -209,7 +214,7 @@ jobs:
AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }}
AML_SUBPATH: ${{ vars.AML_SUBPATH }}
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }}
SENTRY_ENVIRONMENT: "acceptance"
SENTRY_ENVIRONMENT: "production"
SQL_DATABASE: ${{ vars.SQL_DATABASE }}
SQL_HOST: ${{ vars.SQL_HOST }}
SQL_PORT: ${{ vars.SQL_PORT }}
Expand Down Expand Up @@ -256,8 +261,10 @@ jobs:
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
- name: Shut down running containers
run: podman compose -f docker-compose-deploy.yml down
- name: Deploy Podman images
run: podman-compose -f docker-compose-deploy.yml up -d --force-recreate
run: podman-compose -f docker-compose-deploy.yml up -d
- name: Notify Sentry of new release
run: |
curl -X POST "https://sentry.io/api/0/organizations/uva-aml/releases/" \
Expand All @@ -275,4 +282,19 @@ jobs:
- name: Prune old images
run: podman image prune -a -f
- name: Check Podman images
run: podman-compose -f docker-compose-deploy.yml ps
run: podman-compose -f docker-compose-deploy.yml ps

e2e-acceptance:
name: E2E tests on acceptance environment
runs-on: ACC
# temporarily true to test e2e tests
if: github.ref == 'refs/heads/main' || github.ref == 'refs/tags/*' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')

env:
BASE_URL: "https://acc.amsterdammusiclab.nl"

steps:

- uses: actions/checkout@v4
- name: Run E2E tests
run: cd e2e && bash run-tests
13 changes: 13 additions & 0 deletions .github/workflows/schedule-db-backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Schedule Database Backup

on:
schedule:
- cron: '0 0 * * *' # Runs every night at midnight UTC
workflow_dispatch: # Allows manual triggering

jobs:

backup-production:
uses: ./.github/workflows/db-backup-template.yml
with:
runner: PRD
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ yarn.lock
tests/*.ini
tests/*.log
tests/__pycache__

e2e/screenshots
Empty file.
105 changes: 105 additions & 0 deletions backend/admin_interface/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
from django.contrib import admin
from django.utils.html import format_html
from .models import AdminInterfaceConfiguration, AdminInterfaceThemeConfiguration
from .forms import AdminInterfaceConfigurationForm, AdminInterfaceThemeConfigurationForm


class AdminInterfaceThemeConfigurationInline(admin.StackedInline):
model = AdminInterfaceThemeConfiguration
form = AdminInterfaceThemeConfigurationForm
extra = 0
fields = (
# Color scheme

# - Official Django colors

# -- Main colors
'color_primary',
'color_secondary',
'color_accent',
'color_primary_fg',

# -- Body
'color_body_fg',
'color_body_bg',
'color_body_quiet_color',
'color_body_loud_color',

# -- Header
'color_header_color',

# -- Breadcumbs
'color_breadcrumbs_fg',

# -- Link
'color_link_fg',
'color_link_hover_color',
'color_link_selected_fg',

# -- Borders
'color_hairline_color',
'color_border_color',

# -- Error
'color_error_fg',

# -- Message
'color_message_success_bg',
'color_message_warning_bg',
'color_message_error_bg',

# -- Darkened
'color_darkened_bg',

# -- Selected
'color_selected_bg',
'color_selected_row',

# -- Button
'color_button_fg',
'color_button_bg',
'color_button_hover_bg',
'color_default_button_bg',
'color_default_button_hover_bg',
'color_close_button_bg',
'color_close_button_hover_bg',
'color_delete_button_bg',
'color_delete_button_hover_bg',

# Custom colors
'color_default_bg',
'color_default_fg',
'color_success_bg',
'color_success_fg',
'color_warning_bg',
'color_warning_fg',
'color_error_bg',
)


class AdminInterfaceConfigurationAdmin(admin.ModelAdmin):
list_display = ('name', 'description', 'theme_overview', 'active',)

form = AdminInterfaceConfigurationForm
inlines = [AdminInterfaceThemeConfigurationInline]

def theme_overview(self, obj):
theme = obj.theme if hasattr(obj, 'theme') else None

if not theme:
return "No theme assigned"

fields = AdminInterfaceThemeConfigurationInline.fields
color_fields = [f for f in fields if f.startswith('color_')]
color_overview = ''.join(
f'<span style="display: inline-block; width: 20px; height: 20px; background-color: {getattr(theme, f)}; margin-right: 5px;"></span>'
for f in color_fields
)

return format_html(f'<div>{color_overview}</div>')


admin.site.register(
AdminInterfaceConfiguration,
AdminInterfaceConfigurationAdmin,
)
6 changes: 6 additions & 0 deletions backend/admin_interface/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class AdminInterfaceConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'admin_interface'
19 changes: 19 additions & 0 deletions backend/admin_interface/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

from django import forms
from .models import AdminInterfaceConfiguration


class AdminInterfaceConfigurationForm(forms.ModelForm):

class Meta:
model = AdminInterfaceConfiguration
fields = '__all__'


class AdminInterfaceThemeConfigurationForm(forms.ModelForm):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

for field in self.fields:
self.fields[field].widget = forms.TextInput(attrs={'type': 'color'})
69 changes: 69 additions & 0 deletions backend/admin_interface/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Generated by Django 3.2.25 on 2024-05-01 14:23

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='AdminInterfaceConfiguration',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(default='Default', max_length=255, unique=True)),
('description', models.TextField(blank=True, default='')),
('active', models.BooleanField(default=True)),
],
),
migrations.CreateModel(
name='AdminInterfaceThemeConfiguration',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('color_primary', models.CharField(blank=True, default='#79aec8', max_length=255)),
('color_secondary', models.CharField(blank=True, default='#417690', max_length=255)),
('color_accent', models.CharField(blank=True, default='#f5dd5d', max_length=255)),
('color_primary_fg', models.CharField(blank=True, default='#ffffff', max_length=255)),
('color_body_fg', models.CharField(blank=True, default='#333333', max_length=255)),
('color_body_bg', models.CharField(blank=True, default='#ffffff', max_length=255)),
('color_body_quiet_color', models.CharField(blank=True, default='#666666', max_length=255)),
('color_body_loud_color', models.CharField(blank=True, default='#000000', max_length=255)),
('color_header_color', models.CharField(blank=True, default='#ffffcc', max_length=255)),
('color_breadcrumbs_fg', models.CharField(blank=True, default='#c4dce8', max_length=255)),
('color_link_fg', models.CharField(blank=True, default='#447e9b', max_length=255)),
('color_link_hover_color', models.CharField(blank=True, default='#003366', max_length=255)),
('color_link_selected_fg', models.CharField(blank=True, default='#5b80b2', max_length=255)),
('color_hairline_color', models.CharField(blank=True, default='#e8e8e8', max_length=255)),
('color_border_color', models.CharField(blank=True, default='#cccccc', max_length=255)),
('color_error_fg', models.CharField(blank=True, default='#ba2121', max_length=255)),
('color_message_success_bg', models.CharField(blank=True, default='#ddffdd', max_length=255)),
('color_message_warning_bg', models.CharField(blank=True, default='#ffffcc', max_length=255)),
('color_message_error_bg', models.CharField(blank=True, default='#ffefef', max_length=255)),
('color_darkened_bg', models.CharField(blank=True, default='#f8f8f8', max_length=255)),
('color_selected_bg', models.CharField(blank=True, default='#e4e4e4', max_length=255)),
('color_selected_row', models.CharField(blank=True, default='#ffffcc', max_length=255)),
('color_button_fg', models.CharField(blank=True, default='#ffffff', max_length=255)),
('color_button_bg', models.CharField(blank=True, default='#79aec8', max_length=255)),
('color_button_hover_bg', models.CharField(blank=True, default='#609ab6', max_length=255)),
('color_default_button_bg', models.CharField(blank=True, default='#417690', max_length=255)),
('color_default_button_hover_bg', models.CharField(blank=True, default='#205067', max_length=255)),
('color_close_button_bg', models.CharField(blank=True, default='#888888', max_length=255)),
('color_close_button_hover_bg', models.CharField(blank=True, default='#747474', max_length=255)),
('color_delete_button_bg', models.CharField(blank=True, default='#ba2121', max_length=255)),
('color_delete_button_hover_bg', models.CharField(blank=True, default='#a41515', max_length=255)),
('color_default_bg', models.CharField(blank=True, default='#f8d7da', max_length=255)),
('color_default_fg', models.CharField(blank=True, default='#721c24', max_length=255)),
('color_success_bg', models.CharField(blank=True, default='#d4edda', max_length=255)),
('color_success_fg', models.CharField(blank=True, default='#155724', max_length=255)),
('color_warning_bg', models.CharField(blank=True, default='#fff3cd', max_length=255)),
('color_warning_fg', models.CharField(blank=True, default='#856404', max_length=255)),
('color_error_bg', models.CharField(blank=True, default='#f8d7da', max_length=255)),
('configuration', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='theme', to='admin_interface.admininterfaceconfiguration')),
],
),
]
Empty file.
Loading
Loading