Compare commits

...

4 Commits

Author SHA1 Message Date
Renovate Bot
3807ccb2a3 Update dependency react-dom to v19.1.0
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 11m52s
Playwright Tests / test (pull_request) Failing after 4m37s
Check usage of free licenses / build-static-assets (pull_request) Successful in 9m10s
Build Nginx-based docker image / build-static-assets (push) Failing after 27m5s
2025-07-09 02:07:06 +00:00
fdffbdf5ef Merge pull request 'Generate invitations PDF asynchronously' (#311) from generate-invitations-doc-async into main
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 36s
Playwright Tests / test (push) Successful in 3m52s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m27s
Reviewed-on: #311
2025-07-08 17:49:17 +00:00
fba75025d4 Use a Toast to inform the user about the email that will be sent
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m3s
Check usage of free licenses / build-static-assets (pull_request) Successful in 2m2s
Build Nginx-based docker image / build-static-assets (push) Successful in 4m31s
Playwright Tests / test (pull_request) Successful in 11m42s
2025-07-08 19:37:01 +02:00
8f5c038f9c Modify the behavior of the download invitations button to send them via email 2025-07-08 19:26:38 +02:00
4 changed files with 55 additions and 36 deletions

View File

@ -10,6 +10,8 @@ export interface Api<T extends Entity> {
create(serializable: Serializable<T>, object: T, callback: (object: T) => void): void;
update(serializable: Serializable<T>, object: T, callback: () => void): void;
destroy(serializable: Serializable<T>, object: T, callback: () => void): void;
post(serializable: Serializable<T>, path: string, callback: () => void): void;
}
export interface Serializable<T> {
@ -98,4 +100,14 @@ export class AbstractApi<T extends Entity> implements Api<T> {
}).then(callback)
.catch((error) => console.error(error));
}
post(serializable: Serializable<T>, path: string, callback: () => void): void {
fetch(`/api/${getSlug()}/${serializable.apiPath()}/${path}`, {
method: 'POST',
headers: {
'X-CSRF-TOKEN': getCsrfToken(),
}
}).then(callback)
.catch((error) => console.error(error));
}
}

View File

@ -11,6 +11,7 @@ import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline";
import { useEffect, useRef } from "react";
import { useState } from "react";
import { classNames } from "../components/button";
import { Toast } from "primereact/toast";
function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
invitation: Invitation,
@ -117,6 +118,7 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
guests: Array<Guest>,
invitations: Array<Invitation>
}) {
const toast = useRef<Toast>(null);
const api = new AbstractApi<Invitation>();
const serializer = new InvitationSerializer();
@ -146,14 +148,19 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
}
function handleDownloadQrCodes() {
api.getAllPdf(serializer, () => {
console.log("QR codes downloaded");
api.post(serializer, 'email', () => {
toast.current?.show({
severity: 'success',
summary: 'Email scheduled',
detail: 'A document with the QR codes will be sent to the organizer\'s email.'
});
})
}
return (
<div className="flex h-screen">
{/* Left Column: Guests */}
<Toast ref={toast} />
<div className="w-1/4 h-full overflow-auto border-r border-gray-300 p-4">
<h2 className="text-lg font-semibold mb-4">{unassignedGuests.length} guests without invitation</h2>
<div>
@ -180,7 +187,7 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
onClick={handleDownloadQrCodes}
className={classNames('primary')}
>
Download QR codes
Send QR codes via email
</button>

View File

@ -22,7 +22,7 @@
"primeicons": "^7.0.0",
"primereact": "^10.8.2",
"react": "19.0.0-rc-f38c22b244-20240704",
"react-dom": "19.0.0-rc-f38c22b244-20240704",
"react-dom": "19.1.0",
"tailwindcss": "3.4.17",
"typescript": "5.8.3",
"use-debounce": "^10.0.1",
@ -34,7 +34,7 @@
"@types/bcrypt": "^5.0.2",
"@types/node": "24.0.10",
"@types/react": "18.3.23",
"@types/react-dom": "18.3.7",
"@types/react-dom": "19.1.6",
"wait-on": "^8.0.3"
},
"engines": {

62
pnpm-lock.yaml generated
View File

@ -22,7 +22,7 @@ importers:
version: 2.23.0
'@tiptap/react':
specifier: ^2.14.0
version: 2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
version: 2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
'@tiptap/starter-kit':
specifier: ^2.14.0
version: 2.14.0
@ -40,10 +40,10 @@ importers:
version: 3.2.6
next:
specifier: 15.3.5
version: 15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
version: 15.3.5(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
next-auth:
specifier: 5.0.0-beta.29
version: 5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
version: 5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
postcss:
specifier: 8.5.6
version: 8.5.6
@ -52,13 +52,13 @@ importers:
version: 7.0.0
primereact:
specifier: ^10.8.2
version: 10.9.6(@types/react@18.3.23)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
version: 10.9.6(@types/react@18.3.23)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
react:
specifier: 19.0.0-rc-f38c22b244-20240704
version: 19.0.0-rc-f38c22b244-20240704
react-dom:
specifier: 19.0.0-rc-f38c22b244-20240704
version: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
specifier: 19.1.0
version: 19.1.0(react@19.0.0-rc-f38c22b244-20240704)
tailwindcss:
specifier: 3.4.17
version: 3.4.17
@ -88,8 +88,8 @@ importers:
specifier: 18.3.23
version: 18.3.23
'@types/react-dom':
specifier: 18.3.7
version: 18.3.7(@types/react@18.3.23)
specifier: 19.1.6
version: 19.1.6(@types/react@18.3.23)
wait-on:
specifier: ^8.0.3
version: 8.0.3
@ -517,10 +517,10 @@ packages:
'@types/prop-types@15.7.12':
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
'@types/react-dom@18.3.7':
resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==}
'@types/react-dom@19.1.6':
resolution: {integrity: sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==}
peerDependencies:
'@types/react': ^18.0.0
'@types/react': ^19.0.0
'@types/react-transition-group@4.4.12':
resolution: {integrity: sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==}
@ -1179,10 +1179,10 @@ packages:
raf-schd@4.0.3:
resolution: {integrity: sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==}
react-dom@19.0.0-rc-f38c22b244-20240704:
resolution: {integrity: sha512-g89q2pf3irdpKFUMgCQgtxgqo3TSV1k1J6Sc8God4FwfxuNmAOOthkijENe5XZe6VeV1tor9DPzpjdTD9EyvNw==}
react-dom@19.1.0:
resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==}
peerDependencies:
react: 19.0.0-rc-f38c22b244-20240704
react: ^19.1.0
react-is@16.13.1:
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
@ -1221,8 +1221,8 @@ packages:
rxjs@7.8.2:
resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==}
scheduler@0.25.0-rc-f38c22b244-20240704:
resolution: {integrity: sha512-uAELK9fHhvg7kDQhk29+uO8FUMWUpkg9WpzkNXFP+BJy5HEtqnajde3CxuSgh202WH9TqoaiWT1mdA3DvUu6cQ==}
scheduler@0.26.0:
resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==}
semver@7.7.1:
resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==}
@ -1710,7 +1710,7 @@ snapshots:
prosemirror-transform: 1.10.4
prosemirror-view: 1.40.0
'@tiptap/react@2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)':
'@tiptap/react@2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)':
dependencies:
'@tiptap/core': 2.14.0(@tiptap/pm@2.23.0)
'@tiptap/extension-bubble-menu': 2.25.0(@tiptap/core@2.14.0(@tiptap/pm@2.23.0))(@tiptap/pm@2.23.0)
@ -1719,7 +1719,7 @@ snapshots:
'@types/use-sync-external-store': 0.0.6
fast-deep-equal: 3.1.3
react: 19.0.0-rc-f38c22b244-20240704
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
react-dom: 19.1.0(react@19.0.0-rc-f38c22b244-20240704)
use-sync-external-store: 1.5.0(react@19.0.0-rc-f38c22b244-20240704)
'@tiptap/starter-kit@2.14.0':
@ -1765,7 +1765,7 @@ snapshots:
'@types/prop-types@15.7.12': {}
'@types/react-dom@18.3.7(@types/react@18.3.23)':
'@types/react-dom@19.1.6(@types/react@18.3.23)':
dependencies:
'@types/react': 18.3.23
@ -2160,13 +2160,13 @@ snapshots:
nanoid@3.3.11: {}
next-auth@5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
next-auth@5.0.0-beta.29(next@15.3.5(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
dependencies:
'@auth/core': 0.40.0
next: 15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
next: 15.3.5(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
react: 19.0.0-rc-f38c22b244-20240704
next@15.3.5(@playwright/test@1.53.2)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
next@15.3.5(@playwright/test@1.53.2)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
dependencies:
'@next/env': 15.3.5
'@swc/counter': 0.1.3
@ -2175,7 +2175,7 @@ snapshots:
caniuse-lite: 1.0.30001702
postcss: 8.4.31
react: 19.0.0-rc-f38c22b244-20240704
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
react-dom: 19.1.0(react@19.0.0-rc-f38c22b244-20240704)
styled-jsx: 5.1.6(react@19.0.0-rc-f38c22b244-20240704)
optionalDependencies:
'@next/swc-darwin-arm64': 15.3.5
@ -2286,12 +2286,12 @@ snapshots:
primeicons@7.0.0: {}
primereact@10.9.6(@types/react@18.3.23)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
primereact@10.9.6(@types/react@18.3.23)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
dependencies:
'@types/react-transition-group': 4.4.12(@types/react@18.3.23)
react: 19.0.0-rc-f38c22b244-20240704
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
react-transition-group: 4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
react-dom: 19.1.0(react@19.0.0-rc-f38c22b244-20240704)
react-transition-group: 4.4.5(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
optionalDependencies:
'@types/react': 18.3.23
@ -2412,21 +2412,21 @@ snapshots:
raf-schd@4.0.3: {}
react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704):
react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704):
dependencies:
react: 19.0.0-rc-f38c22b244-20240704
scheduler: 0.25.0-rc-f38c22b244-20240704
scheduler: 0.26.0
react-is@16.13.1: {}
react-transition-group@4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
react-transition-group@4.4.5(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
dependencies:
'@babel/runtime': 7.27.6
dom-helpers: 5.2.1
loose-envify: 1.4.0
prop-types: 15.8.1
react: 19.0.0-rc-f38c22b244-20240704
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
react-dom: 19.1.0(react@19.0.0-rc-f38c22b244-20240704)
react@19.0.0-rc-f38c22b244-20240704: {}
@ -2456,7 +2456,7 @@ snapshots:
dependencies:
tslib: 2.8.1
scheduler@0.25.0-rc-f38c22b244-20240704: {}
scheduler@0.26.0: {}
semver@7.7.1:
optional: true