Compare commits

..

83 Commits

Author SHA1 Message Date
7e31629de6 Merge pull request 'Add a button to download a PDF file with all QR codes' (#306) from invitations-download-pdf into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 54s
Playwright Tests / test (push) Successful in 4m15s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m54s
Reviewed-on: #306
2025-07-01 15:54:30 +00:00
b4ec903ce0 Add a button to download a PDF file with all QR codes
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 29s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m34s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m17s
Playwright Tests / test (pull_request) Successful in 4m18s
2025-07-01 17:49:49 +02:00
d390d6e055 Merge pull request 'Update dependency node to v24.3.0' (#300) from renovate/node-24.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 43s
Playwright Tests / test (push) Successful in 5m12s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m31s
Reviewed-on: #300
2025-06-30 15:47:28 +00:00
Renovate Bot
f4e49d2594 Update dependency node to v24.3.0
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 8m31s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m20s
Build Nginx-based docker image / build-static-assets (push) Successful in 1h5m37s
Playwright Tests / test (pull_request) Successful in 58m48s
2025-06-30 02:06:50 +00:00
Renovate Bot
140650d682 Update dependency next-auth to v5.0.0-beta.29
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 4m11s
Playwright Tests / test (push) Successful in 19m33s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m7s
Add copyright notice / copyright_notice (pull_request) Successful in 7m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 29m53s
Playwright Tests / test (pull_request) Successful in 18m56s
2025-06-29 02:04:57 +00:00
Renovate Bot
c239f81e8b Update dependency @atlaskit/pragmatic-drag-and-drop to v1.7.4
All checks were successful
Build Nginx-based docker image / build-static-assets (push) Successful in 38m37s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m39s
Add copyright notice / copyright_notice (pull_request) Successful in 2m41s
Playwright Tests / test (pull_request) Successful in 20m17s
Check usage of free licenses / build-static-assets (push) Successful in 4m0s
Playwright Tests / test (push) Successful in 18m22s
2025-06-28 02:03:55 +00:00
1e52f68d16 Merge pull request 'Update dependency @tiptap/pm to v2.23.0' (#302) from renovate/tiptap-pm-2.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 54s
Playwright Tests / test (push) Successful in 6m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 8m56s
Reviewed-on: #302
2025-06-27 06:44:21 +00:00
Renovate Bot
7ee0502a66 Update dependency @tiptap/pm to v2.23.0
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m12s
Build Nginx-based docker image / build-static-assets (push) Successful in 46m44s
Playwright Tests / test (pull_request) Successful in 52m0s
2025-06-27 02:07:15 +00:00
Renovate Bot
f3af4ade2b Update pnpm to v10.12.3
Some checks failed
Playwright Tests / test (push) Failing after 50m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 1h12m32s
Playwright Tests / test (pull_request) Successful in 28m38s
Check usage of free licenses / build-static-assets (push) Successful in 4m50s
Check usage of free licenses / build-static-assets (pull_request) Successful in 7m2s
Add copyright notice / copyright_notice (pull_request) Successful in 7m17s
2025-06-25 02:05:37 +00:00
Renovate Bot
0788f7c6e4 Update dependency @tiptap/react to v2.22.3
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 4m18s
Playwright Tests / test (push) Successful in 17m12s
Build Nginx-based docker image / build-static-assets (push) Successful in 18m55s
Add copyright notice / copyright_notice (pull_request) Successful in 2m28s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m9s
Playwright Tests / test (pull_request) Successful in 33m8s
2025-06-23 02:07:12 +00:00
203887da10 Merge pull request 'Update dependency zod to v3.25.67' (#289) from renovate/zod-3.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m16s
Playwright Tests / test (push) Successful in 4m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m28s
Reviewed-on: #289
2025-06-22 08:55:25 +00:00
fc7bb9729d Merge pull request 'Update dependency @tiptap/pm to v2.22.3' (#292) from renovate/tiptap-pm-2.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #292
2025-06-22 08:55:19 +00:00
Renovate Bot
d354c15e64 Update dependency @tiptap/pm to v2.22.3
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m47s
Playwright Tests / test (pull_request) Successful in 39m17s
Build Nginx-based docker image / build-static-assets (push) Successful in 52m56s
2025-06-22 02:07:23 +00:00
Renovate Bot
79e4998e3c Update dependency zod to v3.25.67
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m34s
Add copyright notice / copyright_notice (pull_request) Successful in 2m49s
Build Nginx-based docker image / build-static-assets (push) Successful in 39m48s
Playwright Tests / test (pull_request) Successful in 40m34s
2025-06-22 02:07:11 +00:00
Renovate Bot
07e89b4717 Update dependency @atlaskit/pragmatic-drag-and-drop to v1.7.3
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 1m49s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m2s
Playwright Tests / test (pull_request) Successful in 39m15s
Check usage of free licenses / build-static-assets (push) Successful in 1m34s
Playwright Tests / test (push) Failing after 40m27s
Build Nginx-based docker image / build-static-assets (push) Successful in 58m2s
2025-06-21 02:06:39 +00:00
4c52444110 Merge pull request 'Update dependency @playwright/test to v1.53.1' (#290) from renovate/playwright-test-1.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m32s
Playwright Tests / test (push) Successful in 6m25s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m47s
Reviewed-on: #290
2025-06-20 09:12:56 +00:00
cb51fbddd7 Merge pull request 'Update dependency @tiptap/react to v2.14.1' (#293) from renovate/tiptap-react-2.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #293
2025-06-20 09:12:46 +00:00
Renovate Bot
dcd61a0f38 Update dependency @tiptap/react to v2.14.1
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m16s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 28m24s
Playwright Tests / test (pull_request) Successful in 35m45s
2025-06-20 02:06:59 +00:00
Renovate Bot
4e908ba62a Update dependency @playwright/test to v1.53.1
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m29s
Add copyright notice / copyright_notice (pull_request) Successful in 2m27s
Build Nginx-based docker image / build-static-assets (push) Successful in 27m52s
Playwright Tests / test (pull_request) Successful in 32m21s
2025-06-20 02:06:48 +00:00
b8ecc6de98 Merge pull request 'Update dependency next to v15.3.4' (#291) from renovate/next-15.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 56s
Playwright Tests / test (push) Successful in 7m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m35s
Reviewed-on: #291
2025-06-19 06:59:27 +00:00
Renovate Bot
3338dcb604 Update dependency next to v15.3.4
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m30s
Add copyright notice / copyright_notice (pull_request) Successful in 4m31s
Playwright Tests / test (pull_request) Successful in 30m41s
Build Nginx-based docker image / build-static-assets (push) Successful in 36m59s
2025-06-19 02:07:50 +00:00
e09a6892cc Merge pull request 'Improve groups specs and add confirmation dialog to delete action' (#288) from groups-specs into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 39s
Playwright Tests / test (push) Successful in 4m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m38s
Reviewed-on: #288
2025-06-17 18:45:56 +00:00
bcc86f2c3b Add specs when group is deleted (+ add confirmation dialog)
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m9s
Add copyright notice / copyright_notice (pull_request) Successful in 1m33s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m29s
Playwright Tests / test (pull_request) Successful in 4m40s
2025-06-17 20:39:40 +02:00
1b957879d4 Add specs for group update operation 2025-06-17 20:35:50 +02:00
536f74cd7a Merge pull request 'Update dependency @types/node to v24.0.3' (#286) from renovate/node-24.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m7s
Playwright Tests / test (push) Successful in 6m48s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m34s
Reviewed-on: #286
2025-06-17 17:15:54 +00:00
2399f6238c Merge pull request 'Update dependency postcss to v8.5.6' (#287) from renovate/postcss-8.x into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Has been cancelled
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #287
2025-06-17 17:15:39 +00:00
Renovate Bot
5d2c43cfef Update dependency postcss to v8.5.6
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 6m3s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m24s
Build Nginx-based docker image / build-static-assets (push) Successful in 16m33s
Playwright Tests / test (pull_request) Successful in 11m1s
2025-06-17 02:04:30 +00:00
Renovate Bot
2055c95c82 Update dependency @types/node to v24.0.3
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 5m3s
Add copyright notice / copyright_notice (pull_request) Successful in 6m14s
Build Nginx-based docker image / build-static-assets (push) Successful in 16m45s
Playwright Tests / test (pull_request) Successful in 17m23s
2025-06-17 02:04:23 +00:00
71a976eced Merge pull request 'Update node Docker tag to v24' (#249) from renovate/node-24.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 31s
Playwright Tests / test (push) Successful in 4m22s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m20s
Reviewed-on: #249
2025-06-15 13:37:43 +00:00
41bd2ad2b5 Fix CI to use the node versino defined in .nvmrc
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 4m27s
Add copyright notice / copyright_notice (pull_request) Successful in 4m37s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m2s
Playwright Tests / test (pull_request) Successful in 8m10s
2025-06-15 13:35:24 +02:00
cd6574389f Merge pull request 'Add a confirmation dialog before deleting a guest' (#284) from confirmation-dialog-remove-guest into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 51s
Playwright Tests / test (push) Successful in 11m49s
Build Nginx-based docker image / build-static-assets (push) Successful in 12m11s
Reviewed-on: #284
2025-06-15 11:28:14 +00:00
e9e0ec7c13 Update .nvmrc
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m21s
Add copyright notice / copyright_notice (pull_request) Successful in 1m59s
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Playwright Tests / test (pull_request) Successful in 11m39s
2025-06-15 13:27:44 +02:00
cb89310425 Update specs accordingly
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 55s
Add copyright notice / copyright_notice (pull_request) Successful in 1m7s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m53s
Playwright Tests / test (pull_request) Successful in 4m0s
2025-06-15 13:24:09 +02:00
1e2829da25 Merge pull request 'Fix the color of the table arrangements' (#285) from fix-table-arrangement-colors into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 41s
Playwright Tests / test (push) Successful in 5m37s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m4s
Reviewed-on: #285
2025-06-15 10:45:35 +00:00
4d1f83cc33 Fix the color of the table arrangements
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m8s
Add copyright notice / copyright_notice (pull_request) Successful in 1m8s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m13s
Playwright Tests / test (pull_request) Successful in 4m6s
2025-06-15 12:32:06 +02:00
471b98fb53 Add a confirmation dialog before deleting a guest
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m44s
Add copyright notice / copyright_notice (pull_request) Successful in 2m24s
Build Nginx-based docker image / build-static-assets (push) Successful in 8m30s
Playwright Tests / test (pull_request) Failing after 8m55s
2025-06-15 12:12:04 +02:00
Renovate Bot
055ef75510 Update node Docker tag to v24
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 2m49s
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m50s
Build Nginx-based docker image / build-static-assets (push) Successful in 10m4s
Playwright Tests / test (pull_request) Successful in 10m24s
2025-06-15 02:04:31 +00:00
8306cfe249 Merge pull request 'Adjust group creation to avoid a full reload' (#283) from group-specs into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 44s
Playwright Tests / test (push) Successful in 4m18s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m1s
Reviewed-on: #283
2025-06-14 17:05:46 +00:00
67e4ad5d16 Refactor feature to add groups avoiding reload and improve specs
All checks were successful
Build Nginx-based docker image / build-static-assets (push) Successful in 2m0s
Check usage of free licenses / build-static-assets (pull_request) Successful in 45s
Add copyright notice / copyright_notice (pull_request) Successful in 59s
Playwright Tests / test (pull_request) Successful in 3m44s
2025-06-14 11:27:44 +02:00
5164491e64 Merge pull request 'Extract API mocks to their own file' (#282) from extract-mocks into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 34s
Playwright Tests / test (push) Successful in 4m7s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m44s
Reviewed-on: #282
2025-06-14 07:49:10 +00:00
89e9c211d7 Refactor: extract groups specs to their own file 2025-06-14 09:46:35 +02:00
02760e5068 Extract API mocks to their own file
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m11s
Add copyright notice / copyright_notice (pull_request) Successful in 1m27s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m12s
Playwright Tests / test (pull_request) Successful in 4m18s
2025-06-14 09:44:31 +02:00
2ebd9796e3 Merge pull request 'Fix minor UI bugs and test guest CRUD' (#281) from improve-specs-guests into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 46s
Playwright Tests / test (push) Successful in 4m14s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m46s
Reviewed-on: #281
2025-06-14 06:35:14 +00:00
c50263f760 Fix bug where updated guest is duplicated
All checks were successful
Build Nginx-based docker image / build-static-assets (push) Successful in 2m20s
Check usage of free licenses / build-static-assets (pull_request) Successful in 42s
Add copyright notice / copyright_notice (pull_request) Successful in 55s
Playwright Tests / test (pull_request) Successful in 3m3s
2025-06-14 08:22:13 +02:00
5c524c2559 Merge create and list guests into a single test 2025-06-14 07:28:03 +02:00
ae5a986f25 Merge pull request 'Update dependency bcrypt to v6' (#251) from renovate/bcrypt-6.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 53s
Playwright Tests / test (push) Successful in 4m13s
Build Nginx-based docker image / build-static-assets (push) Successful in 5m21s
Reviewed-on: #251
2025-06-14 05:18:57 +00:00
0a28127c4d Merge pull request 'Update dependency @types/node to v22.15.31' (#276) from renovate/node-22.x into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #276
2025-06-14 05:18:51 +00:00
7ae23204ff Merge pull request 'Update dependency zod to v3.25.64' (#266) from renovate/zod-3.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #266
2025-06-14 05:18:41 +00:00
c000d1c9b4 Merge pull request 'Update dependency postcss to v8.5.5' (#280) from renovate/postcss-8.x into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #280
2025-06-14 05:18:26 +00:00
Renovate Bot
3b95dde33e Update dependency bcrypt to v6
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m29s
Add copyright notice / copyright_notice (pull_request) Successful in 3m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 21m46s
Playwright Tests / test (pull_request) Successful in 19m39s
2025-06-14 02:05:44 +00:00
Renovate Bot
2cae594794 Update dependency zod to v3.25.64
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 9m30s
Check usage of free licenses / build-static-assets (pull_request) Successful in 9m53s
Build Nginx-based docker image / build-static-assets (push) Successful in 29m18s
Playwright Tests / test (pull_request) Successful in 23m16s
2025-06-14 02:05:27 +00:00
Renovate Bot
46fa8133c3 Update dependency postcss to v8.5.5
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m26s
Add copyright notice / copyright_notice (pull_request) Successful in 2m26s
Playwright Tests / test (pull_request) Successful in 18m57s
Build Nginx-based docker image / build-static-assets (push) Successful in 24m30s
2025-06-14 02:05:11 +00:00
Renovate Bot
5c5766dfe0 Update dependency @types/node to v22.15.31
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 2m11s
Check usage of free licenses / build-static-assets (pull_request) Successful in 58s
Build Nginx-based docker image / build-static-assets (push) Successful in 21m10s
Playwright Tests / test (pull_request) Successful in 24m7s
2025-06-14 02:05:02 +00:00
02a7270da0 Merge pull request 'Update dependency primereact to v10.9.6' (#265) from renovate/primereact-10.x-lockfile into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m7s
Playwright Tests / test (push) Successful in 5m0s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m36s
Reviewed-on: #265
2025-06-13 10:40:18 +00:00
759fcde872 Merge pull request 'Update dependency use-debounce to v10.0.5' (#275) from renovate/use-debounce-10.x-lockfile into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Reviewed-on: #275
2025-06-13 10:40:09 +00:00
b1a5ea5a1f Merge pull request 'Update dependency @playwright/test to v1.53.0' (#277) from renovate/playwright-test-1.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #277
2025-06-13 10:40:00 +00:00
Renovate Bot
1bea961002 Update dependency @playwright/test to v1.53.0
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 5m50s
Add copyright notice / copyright_notice (pull_request) Successful in 8m0s
Playwright Tests / test (pull_request) Successful in 25m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m17s
2025-06-13 02:06:43 +00:00
Renovate Bot
83c2f1c43e Update dependency use-debounce to v10.0.5
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m51s
Add copyright notice / copyright_notice (pull_request) Successful in 8m49s
Build Nginx-based docker image / build-static-assets (push) Successful in 46m7s
Playwright Tests / test (pull_request) Successful in 49m58s
2025-06-13 02:06:07 +00:00
Renovate Bot
c5bd36d230 Update dependency primereact to v10.9.6
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 2m36s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m33s
Playwright Tests / test (pull_request) Successful in 46m21s
Build Nginx-based docker image / build-static-assets (push) Successful in 48m54s
2025-06-13 02:05:56 +00:00
a74ef0c8b6 Merge pull request 'Add a link to the invitation in the invitation card' (#262) from invitation-link into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 59s
Playwright Tests / test (push) Successful in 6m35s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m18s
Reviewed-on: #262
2025-06-12 21:08:05 +00:00
87cf2d3bb2 Merge pull request 'Display a basic invitation form on invites page' (#279) from invitation-form into main
Some checks failed
Check usage of free licenses / build-static-assets (push) Successful in 1m57s
Playwright Tests / test (push) Has been cancelled
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Reviewed-on: #279
2025-06-12 21:04:34 +00:00
5c1f8b0dbe Update the path of the invitation
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 57s
Add copyright notice / copyright_notice (pull_request) Successful in 1m15s
Build Nginx-based docker image / build-static-assets (push) Successful in 11m23s
2025-06-12 22:56:37 +02:00
24e60231d0 Display a basic invitation form on invites page
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 22s
Add copyright notice / copyright_notice (pull_request) Successful in 26s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m22s
Playwright Tests / test (pull_request) Successful in 9m39s
2025-06-12 22:54:25 +02:00
943da9c7e8 Merge pull request 'Store the current slug when accessing the website directly' (#278) from fix/slug-website into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 37s
Playwright Tests / test (push) Successful in 4m2s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m23s
Reviewed-on: #278
2025-06-12 17:11:22 +00:00
cc698102f2 Store the current slug when accessing the website directly
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 30s
Add copyright notice / copyright_notice (pull_request) Successful in 58s
Build Nginx-based docker image / build-static-assets (push) Successful in 2m58s
Playwright Tests / test (pull_request) Successful in 4m25s
2025-06-12 19:06:23 +02:00
Renovate Bot
79f499b8a6 Update pnpm to v10.12.1
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 8m10s
Add copyright notice / copyright_notice (pull_request) Successful in 8m38s
Playwright Tests / test (pull_request) Successful in 25m49s
Playwright Tests / test (push) Failing after 4s
Check usage of free licenses / build-static-assets (push) Successful in 1m3s
Build Nginx-based docker image / build-static-assets (push) Successful in 47m47s
2025-06-10 02:06:48 +00:00
845a2bcfa1 Merge pull request 'Update dependency @types/node to v22.15.30' (#268) from renovate/node-22.x into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m8s
Playwright Tests / test (push) Successful in 6m32s
Build Nginx-based docker image / build-static-assets (push) Successful in 9m19s
Reviewed-on: #268
2025-06-09 06:15:30 +00:00
6ae0b70213 Merge pull request 'Update dependency @atlaskit/pragmatic-drag-and-drop to v1.7.2' (#264) from renovate/atlaskit-pragmatic-drag-and-drop-1.x-lockfile into main
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
Reviewed-on: #264
2025-06-09 06:15:19 +00:00
Renovate Bot
91557fa332 Update dependency @types/node to v22.15.30
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 3m11s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m18s
Playwright Tests / test (pull_request) Successful in 18m16s
Build Nginx-based docker image / build-static-assets (push) Successful in 1h21m43s
2025-06-09 02:04:42 +00:00
Renovate Bot
6a4a20fae9 Update dependency @atlaskit/pragmatic-drag-and-drop to v1.7.2
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m16s
Add copyright notice / copyright_notice (pull_request) Successful in 3m33s
Playwright Tests / test (pull_request) Successful in 20m4s
Build Nginx-based docker image / build-static-assets (push) Successful in 1h9m28s
2025-06-09 02:04:27 +00:00
0dc182f712 Merge pull request 'Render the website inside an iframe to preview the changes being applied' (#273) from website-preview-iframe into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 1m7s
Playwright Tests / test (push) Successful in 6m17s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m42s
Reviewed-on: #273
2025-06-08 21:43:46 +00:00
0d35668efe Render the website inside an iframe to preview the changes being applied
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m39s
Add copyright notice / copyright_notice (pull_request) Successful in 2m15s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m45s
Playwright Tests / test (pull_request) Successful in 6m46s
2025-06-08 23:36:32 +02:00
a60523b97a Merge pull request 'Implement WYSIWYG to edit the website content' (#272) from website-editor into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 43s
Playwright Tests / test (push) Successful in 4m13s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m14s
Reviewed-on: #272
2025-06-08 19:10:41 +00:00
55a2703577 Fix interface of API
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m4s
Add copyright notice / copyright_notice (pull_request) Successful in 2m37s
Playwright Tests / test (pull_request) Successful in 9m15s
Build Nginx-based docker image / build-static-assets (push) Successful in 10m53s
2025-06-08 20:59:45 +02:00
981f5079e3 Use dompurify to sanitize content before rendering
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 54s
Playwright Tests / test (pull_request) Failing after 1m9s
Add copyright notice / copyright_notice (pull_request) Successful in 1m14s
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
2025-06-08 20:57:22 +02:00
0b8a444b39 Implement debouncing
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 50s
Playwright Tests / test (pull_request) Failing after 54s
Add copyright notice / copyright_notice (pull_request) Successful in 1m5s
Build Nginx-based docker image / build-static-assets (push) Failing after 2m51s
2025-06-08 20:52:16 +02:00
847666bfc8 Configure API to send website updates on change 2025-06-08 20:52:16 +02:00
97d47b339a Add copyright notice
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Successful in 48s
Add copyright notice / copyright_notice (pull_request) Successful in 1m56s
Build Nginx-based docker image / build-static-assets (push) Successful in 7m30s
Playwright Tests / test (pull_request) Failing after 10m28s
2025-06-08 18:04:42 +00:00
82f9cf8e4b Initial steps to create a WYSIWYG for the website
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Has been cancelled
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m20s
Add copyright notice / copyright_notice (pull_request) Successful in 1m28s
Playwright Tests / test (pull_request) Successful in 6m58s
2025-06-08 20:03:23 +02:00
2e7043bb3c Merge pull request 'Make website design responsive' (#271) from website-responsive into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 31s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m3s
Playwright Tests / test (push) Successful in 5m5s
Reviewed-on: #271
2025-06-08 17:26:00 +00:00
965b6ccd22 Make website design responsive
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 42s
Add copyright notice / copyright_notice (pull_request) Successful in 53s
Build Nginx-based docker image / build-static-assets (push) Successful in 3m51s
Playwright Tests / test (pull_request) Successful in 4m46s
2025-06-08 19:20:57 +02:00
1a5424fc8a Merge pull request 'Create the layout of the public website' (#270) from website into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 42s
Playwright Tests / test (push) Successful in 3m26s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m5s
Reviewed-on: #270
2025-06-08 16:53:59 +00:00
87bd3fac4b Add a link to the invitation in the invitation card
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 38s
Add copyright notice / copyright_notice (pull_request) Successful in 39s
Build Nginx-based docker image / build-static-assets (push) Successful in 2m20s
2025-06-02 00:08:42 +02:00
26 changed files with 1367 additions and 1273 deletions

View File

@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: lts/* node-version-file: .nvmrc
- name: Install dependencies - name: Install dependencies
run: npm install -g pnpm && pnpm install run: npm install -g pnpm && pnpm install
- name: Build the service that will be tested - name: Build the service that will be tested

2
.nvmrc
View File

@ -1 +1 @@
23.11.1 24.3.0

View File

@ -1,6 +1,6 @@
# Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile # Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:23-alpine AS base FROM node:24-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps

View File

@ -1,6 +1,6 @@
# Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile # Based on https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
FROM node:23-alpine AS base FROM node:24-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps

View File

@ -18,6 +18,7 @@ import { Toast } from 'primereact/toast';
import { Suspense, useEffect, useRef, useState } from 'react'; import { Suspense, useEffect, useRef, useState } from 'react';
import InvitationsBoard from '@/app/ui/invitations/board'; import InvitationsBoard from '@/app/ui/invitations/board';
import { Invitation, InvitationSerializer } from '@/app/lib/invitation'; import { Invitation, InvitationSerializer } from '@/app/lib/invitation';
import { Entity } from '@/app/lib/definitions';
export default function Page() { export default function Page() {
@ -88,7 +89,22 @@ export default function Page() {
const [invitations, setInvitations] = useState<Array<Invitation>>([]); const [invitations, setInvitations] = useState<Array<Invitation>>([]);
function updateList<T extends Entity>(originalList: T[], element: T): T[] {
{
const index = originalList.findIndex(g => g.id === element?.id);
if (index !== -1) {
// Replace existing element
return [
element!,
...originalList.slice(0, index),
...originalList.slice(index + 1)
];
} else {
// Add new element at the start
return [element!, ...originalList];
}
}
}
return ( return (
<div className="w-full"> <div className="w-full">
@ -100,8 +116,8 @@ export default function Page() {
key={guestBeingEdited?.id} key={guestBeingEdited?.id}
groups={groups} groups={groups}
onCreate={(newGuest) => { onCreate={(newGuest) => {
setGuests([newGuest!, ...guests]); setGuests(guests => updateList(guests, newGuest));
setGuestBeingEdited(undefined) ; setGuestBeingEdited(undefined);
}} }}
guest={guestBeingEdited} guest={guestBeingEdited}
visible={guestBeingEdited !== undefined} visible={guestBeingEdited !== undefined}
@ -128,7 +144,10 @@ export default function Page() {
<GroupFormDialog <GroupFormDialog
key={groupBeingEdited?.id} key={groupBeingEdited?.id}
groups={groups} groups={groups}
onCreate={() => { refreshGroups(); setGroupBeingEdited(undefined) }} onCreate={(newGroup) => {
setGroups(groups => updateList(groups, newGroup));
setGroupBeingEdited(undefined)
}}
group={groupBeingEdited} group={groupBeingEdited}
visible={groupBeingEdited !== undefined} visible={groupBeingEdited !== undefined}
onHide={() => { setGroupBeingEdited(undefined) }} onHide={() => { setGroupBeingEdited(undefined) }}
@ -152,7 +171,7 @@ export default function Page() {
</div> </div>
</ TabPanel> </ TabPanel>
<TabPanel header="Invitations" leftIcon="pi pi-envelope mx-2"> <TabPanel header="Invitations" leftIcon="pi pi-envelope mx-2">
<InvitationsBoard guests={guests} invitations={invitations}/> <InvitationsBoard guests={guests} invitations={invitations} />
</TabPanel> </TabPanel>
</ TabView> </ TabView>
</div> </div>

View File

@ -0,0 +1,65 @@
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
'use client'
import { AbstractApi } from '@/app/api/abstract-api';
import { getSlug } from '@/app/lib/utils';
import { Website, WebsiteSerializer } from '@/app/lib/website';
import { useEffect, useState } from 'react';
import Tiptap from '../../../components/Tiptap';
export default function Page() {
const [website, setWebsite] = useState<Website>()
const api = new AbstractApi<Website>();
const serializer = new WebsiteSerializer();
const [slug, setSlug] = useState<string>("default");
useEffect(() => { setSlug(getSlug()) }, []);
const [iframeKey, setIframeKey] = useState<number>(Math.random());
const [timeoutId, setTimeoutId] = useState<NodeJS.Timeout | null>(null);
useEffect(() => {
api.get(serializer, undefined, (loadedWebsite) => {
setWebsite(loadedWebsite);
});
}, []);
const updateWebsite = (newContent: string) => {
// Debounce API update: send after 500ms of no further changes
if (timeoutId) {
clearTimeout(timeoutId);
}
setTimeoutId(
setTimeout(() => {
api.update(serializer, new Website('', newContent), () => {
setIframeKey(Math.random()); // Change key to force iframe reload
});
}, 500)
);
}
return (
<div className="flex">
<div className="w-1/2 border rounded-lg p-4">
<Tiptap
key={website?.content ?? 'empty'}
content={website?.content || ''}
onUpdate={updateWebsite}
/>
</div>
<div className="w-1/2 border rounded-lg p-4 ml-4">
<iframe
key={iframeKey}
src={`/${slug}/site`}
title="Website Preview"
className="w-full h-[80vh] rounded"
/>
</div>
</div>
);
}

View File

@ -0,0 +1,119 @@
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
'use client'
import { AbstractApi } from "@/app/api/abstract-api";
import { Invitation, InvitationSerializer } from "@/app/lib/invitation";
import { useParams } from "next/navigation";
import { useEffect, useState } from "react";
import { FloatLabel } from "primereact/floatlabel";
import { Dropdown } from "primereact/dropdown";
import { Guest, GuestSerializer, GuestStatus } from "@/app/lib/guest";
import { Button } from "primereact/button";
type FormResponse = {
attendance: GuestStatus;
};
function GuestForm({ guest, idx }: { guest: Guest, idx: number }) {
const [response, setResponse] = useState<FormResponse>({
attendance: guest.status!
});
const [pendingChanges, setPendingChanges] = useState(false);
const [sending, setSending] = useState(false);
console.log('GuestForm response', response.attendance);
const attendanceOptions: { name: string, code: GuestStatus }[] = [
{
name: 'Attending',
code: 'confirmed'
},
{
name: 'Declined',
code: 'declined'
},
{
name: 'Tentative',
code: 'tentative'
}
];
const api = new AbstractApi<Guest>();
const serializer = new GuestSerializer();
const submitForm = () => {
setSending(true);
setPendingChanges(false);
api.update(serializer, {
id: guest.id!,
status: response.attendance,
}, () => setSending(false));
}
return (
<div
key={guest.id}
className={`px-2 py-6 flex flex-col items-center ${idx !== 0 ? 'border-t border-gray-300' : ''}`}
>
<h2 className="m-2 text-xl font-semibold">{guest.name}</h2>
<Dropdown
value={response.attendance}
options={attendanceOptions}
optionLabel="name"
optionValue="code"
className="rounded-md w-full max-w-xs border border-gray-300"
checkmark={true}
highlightOnSelect={false}
onChange={(e) => {
setPendingChanges(true);
setResponse({ ...response, attendance: e.value })
}}
/>
<Button
label="Save"
icon="pi pi-save"
loading={sending}
onClick={submitForm}
disabled={!pendingChanges || sending}
className="mt-4 max-w-xs"
/>
</div>
)
}
export default function Page() {
const params = useParams<{ slug: string, id: string }>()
const [invitation, setInvitation] = useState<Invitation>();
useEffect(() => {
localStorage.setItem('slug', params.slug);
const api = new AbstractApi<Invitation>();
const serializer = new InvitationSerializer();
api.get(serializer, params.id, (invitation: Invitation) => {
setInvitation(invitation);
});
}, []);
return (
<div className="flex flex-col items-center">
<h1 className="text-2xl font-bold mb-4">Invitation</h1>
{invitation ? (
<div>
<p>We have reserved {invitation.guests.length} seats in your honor. Please, confirm attendance submitting the following form:</p>
{invitation.guests.map((guest, idx) => (
<GuestForm key={guest.id} guest={guest} idx={idx} />
))}
</div>
) : (
<p>Loading...</p>
)}
</div>
);
}

View File

@ -6,7 +6,7 @@ import Image from 'next/image';
export default function Layout({ children }: { children: React.ReactNode }) { export default function Layout({ children }: { children: React.ReactNode }) {
return ( return (
<div className="flex h-screen flex-col"> <div className="flex h-screen flex-col">
<div className="w-full h-72 relative"> <div className="w-full lg:h-72 h-36 relative">
<Image <Image
src="/header.png" src="/header.png"
alt="Header" alt="Header"
@ -15,8 +15,8 @@ export default function Layout({ children }: { children: React.ReactNode }) {
priority priority
/> />
</div> </div>
<div className="flex-grow flex items-center justify-center p-24 bg-[#e1d5c7] relative"> <div className="flex-grow flex items-center justify-center lg:p-24 py-8 bg-[#e1d5c7] relative">
<div className="absolute left-1/2 top-24 z-10 -translate-x-1/2 -translate-y-1/2 flex justify-center w-full pointer-events-none"> <div className="absolute left-1/2 lg:top-24 top-8 z-10 -translate-x-1/2 -translate-y-1/2 flex justify-center w-full pointer-events-none w-12 h-12 lg:w-24 lg:h-24">
<Image <Image
src="/stamp.png" src="/stamp.png"
alt="Stamp" alt="Stamp"
@ -29,7 +29,7 @@ export default function Layout({ children }: { children: React.ReactNode }) {
<div className="max-w-4xl w-full h-full bg-[#f9f9f7] shadow-lg"> <div className="max-w-4xl w-full h-full bg-[#f9f9f7] shadow-lg">
<div <div
className="max-w-4xl m-6 px-6 py-24 border-2 border-[#d3d3d1] rounded-xl text-[#958971] flex justify-center" className="max-w-4xl lg:m-6 m-3 lg:px-6 px-3 lg:py-24 py-2 border-2 border-[#d3d3d1] rounded-xl text-[#958971] flex justify-center"
style={{ height: 'calc(100% - 3rem)' }} style={{ height: 'calc(100% - 3rem)' }}
> >
{children} {children}

View File

@ -2,10 +2,33 @@
'use client' 'use client'
import { AbstractApi } from '@/app/api/abstract-api';
import { Website, WebsiteSerializer } from '@/app/lib/website';
import { useState, useEffect } from 'react';
import DOMPurify from "dompurify";
import { useParams } from 'next/navigation';
export default function Page() { export default function Page() {
const params = useParams<{ slug: string }>()
useEffect(() => {
if (typeof window !== 'undefined') {
localStorage.setItem('slug', params.slug);
}
}, []);
const [websiteContent, setWebsiteContent] = useState<string>("");
const api = new AbstractApi<Website>();
const serializer = new WebsiteSerializer();
useEffect(() => {
api.get(serializer, undefined, (loadedWebsite) => {
setWebsiteContent(loadedWebsite.content || "");
});
}, []);
return ( return (
"Helloworld" <div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(websiteContent) }} />
); );
} }

View File

@ -3,6 +3,7 @@
import { Entity } from '@/app/lib/definitions'; import { Entity } from '@/app/lib/definitions';
import { getCsrfToken, getSlug } from '@/app/lib/utils'; import { getCsrfToken, getSlug } from '@/app/lib/utils';
export interface Api<T extends Entity> { export interface Api<T extends Entity> {
getAll(serializable: Serializable<T>, callback: (objets: T[]) => void): void; getAll(serializable: Serializable<T>, callback: (objets: T[]) => void): void;
get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void; get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void;
@ -30,8 +31,21 @@ export class AbstractApi<T extends Entity> implements Api<T> {
}); });
} }
get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void { getAllPdf(serializable: Serializable<T>, callback: () => void): void {
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${id}`) fetch(`/api/${getSlug()}/${serializable.apiPath()}`, {
headers: {
'Accept': 'application/pdf',
}
}).then(res => res.blob())
.then(blob => {
var file = window.URL.createObjectURL(blob);
window.location.assign(file);
});
}
get(serializable: Serializable<T>, id: (string | undefined), callback: (object: T) => void): void {
const endpoint = id ? `/api/${getSlug()}/${serializable.apiPath()}/${id}` : `/api/${getSlug()}/${serializable.apiPath()}`;
fetch(endpoint)
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then((data) => {
callback(serializable.fromJson(data)); callback(serializable.fromJson(data));
@ -40,15 +54,21 @@ export class AbstractApi<T extends Entity> implements Api<T> {
}); });
} }
update(serializable: Serializable<T>, object: T, callback: () => void): void { update(serializable: Serializable<T>, object: T, callback: (updatedObject: T) => void): void {
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${object.id}`, { const endpoint = object.id ? `/api/${getSlug()}/${serializable.apiPath()}/${object.id}` : `/api/${getSlug()}/${serializable.apiPath()}`;
fetch(endpoint, {
method: 'PUT', method: 'PUT',
body: serializable.toJson(object), body: serializable.toJson(object),
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(), 'X-CSRF-TOKEN': getCsrfToken(),
} }
}).then(callback) }).then((response) => response.json())
.then((data) => {
callback(serializable.fromJson(data));
})
.catch((error) => console.error(error)); .catch((error) => console.error(error));
} }
@ -58,6 +78,7 @@ export class AbstractApi<T extends Entity> implements Api<T> {
body: serializable.toJson(object), body: serializable.toJson(object),
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json',
'X-CSRF-TOKEN': getCsrfToken(), 'X-CSRF-TOKEN': getCsrfToken(),
} }
}) })

22
app/components/Tiptap.tsx Normal file
View File

@ -0,0 +1,22 @@
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
'use client'
import { useEditor, EditorContent } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
const Tiptap = ({ content, onUpdate }: { content: string, onUpdate: (newContent:string) => void }) => {
const editor = useEditor({
extensions: [StarterKit],
content: content || '<p>Type something here...</p>',
onUpdate({ editor }) {
onUpdate(editor.getHTML());
},
immediatelyRender: false,
})
return <EditorContent editor={editor} />
}
export default Tiptap

View File

@ -34,7 +34,7 @@ export class TableSimulationSerializer implements Serializable<TableSimulation>
return new TableSimulation(data.id, data.tables.map((table: any) => { return new TableSimulation(data.id, data.tables.map((table: any) => {
return { return {
number: table.number, number: table.number,
guests: table.guests.map((guest: any) => new Guest(guest.id, guest.name, guest.group?.name, guest.group?.id, guest.color)), guests: table.guests.map((guest: any) => new Guest(guest.id, guest.name, guest.color, guest.status, [], guest.group)),
discomfort: { discomfort: {
discomfort: table.discomfort.discomfort, discomfort: table.discomfort.discomfort,
breakdown: { breakdown: {

30
app/lib/website.tsx Normal file
View File

@ -0,0 +1,30 @@
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
import { Serializable } from "../api/abstract-api";
import { Entity } from "./definitions";
export class Website implements Entity {
id?: string;
content?: string;
constructor(id: string, content: string) {
this.id = id;
this.content = content;
}
}
export class WebsiteSerializer implements Serializable<Website> {
fromJson(data: any): Website {
return new Website("", data.content);
}
toJson(website: Website): string {
return JSON.stringify({ website: { content: website.content } });
}
apiPath(): string {
return 'website';
}
}

View File

@ -5,7 +5,7 @@ import clsx from "clsx";
type ButtonColor = 'primary' | 'blue' | 'green' | 'red' | 'yellow' | 'gray'; type ButtonColor = 'primary' | 'blue' | 'green' | 'red' | 'yellow' | 'gray';
export function classNames(type: ButtonColor) { export function classNames(type: ButtonColor) {
return (clsx("text-white py-1 px-2 mx-1 rounded disabled:opacity-50 disabled:cursor-not-allowed", { return (clsx("text-white py-1 px-2 m-2 rounded disabled:opacity-50 disabled:cursor-not-allowed", {
'bg-blue-400 hover:bg-blue-600': type === 'primary' || type === 'blue', 'bg-blue-400 hover:bg-blue-600': type === 'primary' || type === 'blue',
'bg-green-500 hover:bg-green-600': type === 'green', 'bg-green-500 hover:bg-green-600': type === 'green',
'bg-red-500 hover:bg-red-600': type === 'red', 'bg-red-500 hover:bg-red-600': type === 'red',

View File

@ -14,7 +14,7 @@ import { useState } from 'react';
export default function GroupFormDialog({ groups, onCreate, onHide, group, visible }: { export default function GroupFormDialog({ groups, onCreate, onHide, group, visible }: {
groups: Group[], groups: Group[],
onCreate?: () => void, onCreate?: (newGroup: Group) => void,
onHide: () => void, onHide: () => void,
group?: Group, group?: Group,
visible: boolean, visible: boolean,
@ -46,15 +46,15 @@ export default function GroupFormDialog({ groups, onCreate, onHide, group, visib
group.color = color; group.color = color;
group.parentId = parentId; group.parentId = parentId;
api.update(serializer, group, () => { api.update(serializer, group, (newGroup) => {
resetForm(); resetForm();
onCreate && onCreate(); onCreate && onCreate(newGroup);
}); });
} else { } else {
api.create(serializer, new Group(undefined, name, undefined, icon, undefined, parentId, color), () => { api.create(serializer, new Group(undefined, name, undefined, icon, undefined, parentId, color), (newGroup) => {
resetForm(); resetForm();
onCreate && onCreate(); onCreate && onCreate(newGroup);
}); });
} }
} }

View File

@ -44,9 +44,9 @@ export default function GuestFormDialog({ groups, onCreate, onHide, guest, visib
guest.group!.id = group; guest.group!.id = group;
guest.status = status; guest.status = status;
api.update(serializer, guest, () => { api.update(serializer, guest, (updatedGuest) => {
resetForm(); resetForm();
onCreate && onCreate(guest); onCreate && onCreate(updatedGuest);
}); });
} else { } else {
api.create(serializer, new Guest(undefined, name, undefined, status, [], groups.find((g) => g.id === group)), (newGuest)=> { api.create(serializer, new Guest(undefined, name, undefined, status, [], groups.find((g) => g.id === group)), (newGuest)=> {
@ -62,8 +62,8 @@ export default function GuestFormDialog({ groups, onCreate, onHide, guest, visib
<Dialog header="Add guest" visible={visible} style={{ width: '60vw' }} onHide={onHide}> <Dialog header="Add guest" visible={visible} style={{ width: '60vw' }} onHide={onHide}>
<div className="card flex justify-evenly py-5"> <div className="card flex justify-evenly py-5">
<FloatLabel> <FloatLabel>
<InputText id="username" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} /> <InputText id="name" className='rounded-sm' value={name} onChange={(e) => setName(e.target.value)} />
<label htmlFor="username">Username</label> <label htmlFor="name">Name</label>
</FloatLabel> </FloatLabel>
<FloatLabel> <FloatLabel>
<Dropdown id="group" className='rounded-sm min-w-32' value={group} onChange={(e) => setGroup(e.target.value)} options={ <Dropdown id="group" className='rounded-sm min-w-32' value={group} onChange={(e) => setGroup(e.target.value)} options={

View File

@ -6,6 +6,7 @@ import {
UserGroupIcon, UserGroupIcon,
RectangleGroupIcon, RectangleGroupIcon,
BanknotesIcon, BanknotesIcon,
GlobeAltIcon,
} from '@heroicons/react/24/outline'; } from '@heroicons/react/24/outline';
import Link from 'next/link'; import Link from 'next/link';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
@ -26,6 +27,7 @@ export default function NavLinks() {
{ name: 'Guests', href: `/${slug}/dashboard/guests`, icon: UserGroupIcon }, { name: 'Guests', href: `/${slug}/dashboard/guests`, icon: UserGroupIcon },
{ name: 'Expenses', href: `/${slug}/dashboard/expenses`, icon: BanknotesIcon }, { name: 'Expenses', href: `/${slug}/dashboard/expenses`, icon: BanknotesIcon },
{ name: 'Table distributions', href: `/${slug}/dashboard/tables`, icon: RectangleGroupIcon }, { name: 'Table distributions', href: `/${slug}/dashboard/tables`, icon: RectangleGroupIcon },
{ name: 'Website builder', href: `/${slug}/dashboard/website`, icon: GlobeAltIcon },
]; ];
return ( return (

View File

@ -21,7 +21,12 @@ export default function GroupsTable({ groups, onUpdate, onEdit, onEditAffinities
const actions = (group: Group) => ( const actions = (group: Group) => (
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, group, onUpdate) }} /> <TrashIcon className='size-6 cursor-pointer' onClick={() => {
if (window.confirm(`Are you sure you want to delete guest "${group.name}"?`)) {
api.destroy(serializer, group, onUpdate)
}
}}
/>
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(group)} /> <PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(group)} />
<AdjustmentsHorizontalIcon className='size-6 cursor-pointer' onClick={() => onEditAffinities(group)} /> <AdjustmentsHorizontalIcon className='size-6 cursor-pointer' onClick={() => onEditAffinities(group)} />
</div> </div>

View File

@ -3,7 +3,7 @@
'use client'; 'use client';
import { AbstractApi } from '@/app/api/abstract-api'; import { AbstractApi } from '@/app/api/abstract-api';
import { Guest , GuestSerializer} from '@/app/lib/guest'; import { Guest, GuestSerializer } from '@/app/lib/guest';
import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline'; import { PencilIcon, TrashIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx'; import clsx from 'clsx';
import TableOfContents from '../components/table-of-contents'; import TableOfContents from '../components/table-of-contents';
@ -48,7 +48,12 @@ export default function guestsTable({ guests, onUpdate, onEdit }: {
</td> </td>
<td> <td>
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, guest, onUpdate)}} /> <TrashIcon className='size-6 cursor-pointer' onClick={() => {
if (window.confirm(`Are you sure you want to delete guest "${guest.name}"?`)) {
api.destroy(serializer, guest, onUpdate)
}
}}
/>
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(guest)} /> <PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(guest)} />
</div> </div>
</td> </td>

View File

@ -5,10 +5,12 @@
import { AbstractApi } from "@/app/api/abstract-api"; import { AbstractApi } from "@/app/api/abstract-api";
import { Guest } from "@/app/lib/guest"; import { Guest } from "@/app/lib/guest";
import { Invitation, InvitationSerializer } from "@/app/lib/invitation"; import { Invitation, InvitationSerializer } from "@/app/lib/invitation";
import { getSlug } from "@/app/lib/utils";
import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'; import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
import { TrashIcon } from "@heroicons/react/24/outline"; import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline";
import { useEffect, useRef } from "react"; import { useEffect, useRef } from "react";
import { useState } from "react"; import { useState } from "react";
import { classNames } from "../components/button";
function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: { function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
invitation: Invitation, invitation: Invitation,
@ -24,6 +26,8 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
const api = new AbstractApi<Invitation>(); const api = new AbstractApi<Invitation>();
const serializer = new InvitationSerializer(); const serializer = new InvitationSerializer();
const iconClassName = "w-5 h-5 text-white absolute top-2 opacity-0 group-hover:opacity-100 cursor-pointer";
useEffect(() => { useEffect(() => {
if (ref.current) { if (ref.current) {
return dropTargetForElements({ return dropTargetForElements({
@ -53,8 +57,14 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
className="relative flex items-center justify-center w-full bg-green-800 border border-green-900 group" className="relative flex items-center justify-center w-full bg-green-800 border border-green-900 group"
style={{ aspectRatio: "1.618 / 1" }} style={{ aspectRatio: "1.618 / 1" }}
> >
<LinkIcon
className={`${iconClassName} right-8`}
onClick={() => {
navigator.clipboard.writeText(`https://${window.location.host}/${getSlug()}/site/invitation/${invitation.id}`);
}}
/>
<TrashIcon <TrashIcon
className="w-5 h-5 text-white absolute top-2 right-2 opacity-0 group-hover:opacity-100 cursor-pointer" className={`${iconClassName} right-2`}
onClick={() => { onClick={() => {
if (window.confirm("Are you sure you want to delete this invitation?")) { if (window.confirm("Are you sure you want to delete this invitation?")) {
api.destroy(serializer, invitation, () => { api.destroy(serializer, invitation, () => {
@ -64,6 +74,7 @@ function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
}} }}
/> />
{guests.length === 0 ? ( {guests.length === 0 ? (
<p className="text-center text-yellow-500 text-lg italic"> <p className="text-center text-yellow-500 text-lg italic">
(empty invitation) (empty invitation)
@ -134,6 +145,12 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
}); });
} }
function handleDownloadQrCodes() {
api.getAllPdf(serializer, () => {
console.log("QR codes downloaded");
});
}
return ( return (
<div className="flex h-screen"> <div className="flex h-screen">
{/* Left Column: Guests */} {/* Left Column: Guests */}
@ -154,11 +171,18 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
<button <button
onClick={handleCreateInvitation} onClick={handleCreateInvitation}
className="mb-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600" className={classNames('primary')}
> >
Create New Invitation Create New Invitation
</button> </button>
<button
onClick={handleDownloadQrCodes}
className={classNames('primary')}
>
Download QR codes
</button>
<div className="grid grid-cols-4 gap-6"> <div className="grid grid-cols-4 gap-6">

View File

@ -9,12 +9,16 @@
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0", "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
"@heroicons/react": "^2.1.4", "@heroicons/react": "^2.1.4",
"@tailwindcss/forms": "^0.5.7", "@tailwindcss/forms": "^0.5.7",
"@tiptap/pm": "^2.14.0",
"@tiptap/react": "^2.14.0",
"@tiptap/starter-kit": "^2.14.0",
"autoprefixer": "10.4.21", "autoprefixer": "10.4.21",
"bcrypt": "^5.1.1", "bcrypt": "^6.0.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"next": "15.3.3", "dompurify": "^3.2.6",
"next-auth": "5.0.0-beta.28", "next": "15.3.4",
"postcss": "8.5.4", "next-auth": "5.0.0-beta.29",
"postcss": "8.5.6",
"primeicons": "^7.0.0", "primeicons": "^7.0.0",
"primereact": "^10.8.2", "primereact": "^10.8.2",
"react": "19.0.0-rc-f38c22b244-20240704", "react": "19.0.0-rc-f38c22b244-20240704",
@ -28,7 +32,7 @@
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.52.0", "@playwright/test": "^1.52.0",
"@types/bcrypt": "^5.0.2", "@types/bcrypt": "^5.0.2",
"@types/node": "22.15.29", "@types/node": "24.0.7",
"@types/react": "18.3.23", "@types/react": "18.3.23",
"@types/react-dom": "18.3.7", "@types/react-dom": "18.3.7",
"wait-on": "^8.0.3" "wait-on": "^8.0.3"
@ -36,5 +40,5 @@
"engines": { "engines": {
"node": ">=23.0.0" "node": ">=23.0.0"
}, },
"packageManager": "pnpm@10.11.1+sha512.e519b9f7639869dc8d5c3c5dfef73b3f091094b0a006d7317353c72b124e80e1afd429732e28705ad6bfa1ee879c1fce46c128ccebd3192101f43dd67c667912" "packageManager": "pnpm@10.12.3+sha512.467df2c586056165580ad6dfb54ceaad94c5a30f80893ebdec5a44c5aa73c205ae4a5bb9d5ed6bb84ea7c249ece786642bbb49d06a307df218d03da41c317417"
} }

1774
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

82
tests/groups.spec.ts Normal file
View File

@ -0,0 +1,82 @@
import { test, expect, Page } from '@playwright/test'
import mockGroupsAPI from './mocks/groups';
import mockGuestsAPI from './mocks/guests';
test('should allow CRUD on groups', async ({ page }) => {
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
await page.getByRole('tab', { name: 'Groups' }).click();
await expect(page.getByRole('button', { name: 'Add new' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Reset affinities' })).toBeVisible();
// List all groups
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(0)).toHaveText('Name');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(1)).toHaveText('Color');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(2)).toHaveText('Confirmed');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(3)).toHaveText('Tentative');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(4)).toHaveText('Pending');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(5)).toHaveText('Declined');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(6)).toHaveText('Considered');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(7)).toHaveText('Total');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(8)).toHaveText('Actions');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s family');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(3)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(4)).toHaveText('1');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('2');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('3');
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(0)).toContainText('Pam\'s work');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(3)).toHaveText('2');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(4)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(6)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(7)).toHaveText('2');
await expect(page.getByRole('row').nth(2).locator('svg:visible')).toHaveCount(3);
// Add a new group
await page.getByRole('button', { name: 'Add new' }).click();
const dialog = page.getByRole('dialog');
await expect(dialog).toBeVisible();
await dialog.getByLabel('Name').fill("Pam's friends");
await dialog.getByRole('button', { name: 'Create' }).click();
await expect(page.getByRole('row')).toHaveCount(4); // 1 header row + 3 data rows
await expect(dialog).not.toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s friends');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(3)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(4)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('0');
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
// Modify the newly added group
await page.getByRole('row').nth(1).locator('svg').nth(2).click(); // Click edit icon
await expect(dialog).toBeVisible();
await expect(dialog.getByLabel('Name')).toHaveValue("Pam's friends");
await dialog.getByLabel('Name').fill('Pam\'s best friends');
await dialog.getByRole('button', { name: 'Update' }).click();
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s best friends');
// Delete the newly added group
page.on('dialog', dialog => dialog.accept());
await page.getByRole('row').nth(1).locator('svg').nth(1).click(); // Click delete icon
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
});

View File

@ -1,88 +1,10 @@
import { test, expect, Page } from '@playwright/test' import { expect, test } from '@playwright/test';
import { mock } from 'node:test'; import mockGroupsAPI from './mocks/groups';
import mockGuestsAPI from './mocks/guests';
const mockGuestsAPI = ({ page }: { page: Page }) => { test('should allow CRUD on guests', async ({ page }) => {
page.route('*/**/api/default/guests', async route => {
if (route.request().method() === 'GET') {
const json = [
{
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
"status": "tentative",
"name": "Kristofer Rohan DVM",
"group": {
"id": "2fcb8b22-6b07-4c34-92e3-a2535dbc5b14",
"name": "Childhood friends",
}
},
{
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
"status": "invited",
"name": "Olevia Quigley Jr.",
"group": {
"id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
"name": "Work",
}
},
];
await route.fulfill({ json })
} else if (route.request().method() === 'POST') {
const json = {
"id":"ff58aa2d-643d-4c29-be9c-50e10ae6853c",
"name":"John Snow",
"status":"invited",
"group": {
"id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
"name": "Work",
}
};
await route.fulfill({ json });
}
})
}
const mockGroupsAPI = ({ page }: { page: Page }) => {
page.route('*/**/api/default/groups', async route => {
const json = [
{
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
"icon": "pi pi-users",
"parent_id": null,
"color": "#ff0000",
"attendance": {
"total": 3,
"considered": 2,
"invited": 1,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
},
{
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#00ff00",
"attendance": {
"total": 2,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 2
}
},
];
await route.fulfill({ json })
})
}
test('should display the list of guests', async ({ page }) => {
await mockGuestsAPI({ page }); await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests'); await page.goto('/default/dashboard/guests');
@ -92,89 +14,63 @@ test('should display the list of guests', async ({ page }) => {
await expect(page.getByRole('tab', { name: 'Groups' })).toBeVisible(); await expect(page.getByRole('tab', { name: 'Groups' })).toBeVisible();
await expect(page.getByRole('tab', { name: 'Invitations' })).toBeVisible(); await expect(page.getByRole('tab', { name: 'Invitations' })).toBeVisible();
// List all guests
await expect(page.getByText('There are 2 elements in the list')).toBeVisible(); await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Kristofer Rohan DVM' })).toBeVisible(); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Kristofer Rohan DVM' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Childhood friends' })).toBeVisible(); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: "Pam's family" })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Tentative' })).toBeVisible(); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Tentative' })).toBeVisible();
await expect(page.getByRole('row').nth(1).locator('svg')).toHaveCount(2); await expect(page.getByRole('row').nth(1).locator('svg')).toHaveCount(2);
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Olevia Quigley Jr.' })).toBeVisible(); await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Olevia Quigley Jr.' })).toBeVisible();
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Work' })).toBeVisible(); await expect(page.getByRole('row').nth(2).getByRole('cell', { name: "Pam's work" })).toBeVisible();
await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Invited' })).toBeVisible(); await expect(page.getByRole('row').nth(2).getByRole('cell', { name: 'Invited' })).toBeVisible();
await expect(page.getByRole('row').nth(2).locator('svg')).toHaveCount(2); await expect(page.getByRole('row').nth(2).locator('svg')).toHaveCount(2);
});
test('should allow creating a new guest', async ({ page }) => { // Add a new guest
await mockGuestsAPI({ page });
await mockGroupsAPI({ page });
await page.goto('/default/dashboard/guests');
await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
await page.getByRole('button', { name: 'Add new' }).click(); await page.getByRole('button', { name: 'Add new' }).click();
await page.getByRole('dialog').getByLabel('Name').fill('John Snow'); await page.getByRole('dialog').getByLabel('Name').fill('John Snow');
await page.keyboard.press('Tab'); await page.locator('#group').click();
await page.keyboard.press('ArrowDown'); await page.getByRole('option', { name: "Pam's work" }).click();
await page.keyboard.press('ArrowDown');
await page.keyboard.press('Enter');
await page.keyboard.press('Tab'); await page.locator('#status').click();
await page.keyboard.press('ArrowDown'); await page.getByRole('option', { name: 'Invited' }).click();
await page.keyboard.press('ArrowDown');
await page.keyboard.press('Enter');
await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click(); await page.getByRole('dialog').getByRole('button', { name: 'Create' }).click();
await expect(page.getByText('There are 3 elements in the list')).toBeVisible(); await expect(page.getByText('There are 3 elements in the list')).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'John Snow' })).toBeVisible(); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'John Snow' })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Work' })).toBeVisible(); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: "Pam\'s work" })).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Invited' })).toBeVisible(); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Invited' })).toBeVisible();
await expect(page.getByRole('row').nth(1).locator('svg')).toHaveCount(2); await expect(page.getByRole('row').nth(1).locator('svg')).toHaveCount(2);
});
// Edit the just-added John Snow
test('should display the list of groups', async ({ page }) => { await page.getByRole('row').nth(1).locator('svg').nth(1).click(); // Click edit icon
await mockGroupsAPI({ page });
const dialog = page.getByRole('dialog');
await page.goto('/default/dashboard/guests'); await expect(dialog.getByLabel('Name')).toHaveValue('John Snow');
await page.getByRole('tab', { name: 'Groups' }).click(); await dialog.getByLabel('Name').fill('John Fire');
await expect(page.getByRole('button', { name: 'Add new' })).toBeVisible(); await dialog.locator('#group').click();
await expect(page.getByRole('button', { name: 'Reset affinities' })).toBeVisible(); await page.getByRole('option', { name: "Pam's family" }).click();
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows await dialog.locator('#status').click();
await page.getByRole('option', { name: 'Declined' }).click();
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(0)).toHaveText('Name');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(1)).toHaveText('Color'); await dialog.getByRole('button', { name: 'Update' }).click();
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(2)).toHaveText('Confirmed');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(3)).toHaveText('Tentative'); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'John Fire' })).toBeVisible();
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(4)).toHaveText('Pending'); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Pam\'s Family' })).toBeVisible();
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(5)).toHaveText('Declined'); await expect(page.getByRole('row').nth(1).getByRole('cell', { name: 'Declined' })).toBeVisible();
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(6)).toHaveText('Considered');
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(7)).toHaveText('Total'); await expect(page.getByText('There are 3 elements in the list')).toBeVisible();
await expect(page.getByRole('row').nth(0).getByRole('columnheader').nth(8)).toHaveText('Actions');
// Delete John Fire
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s family'); page.on('dialog', dialog => dialog.accept());
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(2)).toHaveText('0'); await page.getByRole('row').nth(1).locator('svg').nth(0).click(); // Click delete icon
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(3)).toHaveText('0'); await expect(page.getByText('There are 2 elements in the list')).toBeVisible();
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(4)).toHaveText('1');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('2');
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('3');
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(0)).toContainText('Pam\'s work');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(2)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(3)).toHaveText('2');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(4)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(5)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(6)).toHaveText('0');
await expect(page.getByRole('row').nth(2).getByRole('cell').nth(7)).toHaveText('2');
await expect(page.getByRole('row').nth(2).locator('svg:visible')).toHaveCount(3);
}); });

86
tests/mocks/groups.tsx Normal file
View File

@ -0,0 +1,86 @@
import { Page } from "@playwright/test";
export default async function mockGroupsAPI({ page }: { page: Page }): Promise<void> {
page.route('*/**/api/default/groups', async route => {
if (route.request().method() === 'GET') {
const json = [
{
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
"icon": "pi pi-users",
"parent_id": null,
"color": "#ff0000",
"attendance": {
"total": 3,
"considered": 2,
"invited": 1,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
},
{
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#00ff00",
"attendance": {
"total": 2,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 2
}
},
];
await route.fulfill({ json })
} else if (route.request().method() === 'POST') {
const json = {
"id": "4d55bc34-6f42-4e2e-82a1-71ae32da2466",
"name": "Pam's friends",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#0000ff",
"attendance": {
"total": 0,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
}
await route.fulfill({ json })
}
})
page.route("*/**/api/default/groups/*", async route => {
if (route.request().method() === 'PUT') {
const json = {
"id": "4d55bc34-6f42-4e2e-82a1-71ae32da2466",
"name": "Pam's best friends",
"icon": "pi pi-desktop",
"parent_id": null,
"color": "#0000ff",
"attendance": {
"total": 0,
"considered": 0,
"invited": 0,
"confirmed": 0,
"declined": 0,
"tentative": 0
}
}
await route.fulfill({ json });
} else if (route.request().method() === 'DELETE') {
const json = {}
await route.fulfill({ json });
}
});
}

61
tests/mocks/guests.tsx Normal file
View File

@ -0,0 +1,61 @@
import { Page } from "@playwright/test";
export default async function mockGuestsAPI({ page }: { page: Page }): Promise<void> {
page.route('*/**/api/default/guests', async route => {
if (route.request().method() === 'GET') {
const json = [
{
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
"status": "tentative",
"name": "Kristofer Rohan DVM",
"group": {
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
}
},
{
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
"status": "invited",
"name": "Olevia Quigley Jr.",
"group": {
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
}
},
];
await route.fulfill({ json })
} else if (route.request().method() === 'POST') {
const json = {
"id": "ff58aa2d-643d-4c29-be9c-50e10ae6853c",
"name": "John Snow",
"status": "invited",
"group": {
"id": "c8bda6ca-d8af-4bb8-b2bf-e6ec1c21b1e6",
"name": "Pam's work",
}
};
await route.fulfill({ json });
}
})
page.route("*/**/api/default/guests/*", async route => {
if (route.request().method() === 'PUT') {
const json = {
"id": "ff58aa2d-643d-4c29-be9c-50e10ae6853c",
"name": "John Fire",
"status": "declined",
"group": {
"id": "ee44ffb9-1147-4842-a378-9eaeb0f0871a",
"name": "Pam's family",
}
}
await route.fulfill({ json });
} else if (route.request().method() === 'DELETE') {
const json = {}
await route.fulfill({ json });
}
});
}