Compare commits

...

3 Commits

Author SHA1 Message Date
Renovate Bot
c67708f02e Update dependency react-dom to v19.1.0
Some checks failed
Check usage of free licenses / build-static-assets (pull_request) Failing after 1m1s
Playwright Tests / test (pull_request) Failing after 25s
Add copyright notice / copyright_notice (pull_request) Successful in 5m57s
Build Nginx-based docker image / build-static-assets (push) Failing after 34m0s
2025-07-02 02:10:44 +00:00
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
5 changed files with 62 additions and 35 deletions

View File

@ -3,6 +3,7 @@
import { Entity } from '@/app/lib/definitions';
import { getCsrfToken, getSlug } from '@/app/lib/utils';
export interface Api<T extends Entity> {
getAll(serializable: Serializable<T>, callback: (objets: T[]) => void): void;
get(serializable: Serializable<T>, id: string, callback: (object: T) => void): void;
@ -30,6 +31,18 @@ export class AbstractApi<T extends Entity> implements Api<T> {
});
}
getAllPdf(serializable: Serializable<T>, callback: () => void): void {
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)

View File

@ -5,7 +5,7 @@ import clsx from "clsx";
type ButtonColor = 'primary' | 'blue' | 'green' | 'red' | 'yellow' | 'gray';
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-green-500 hover:bg-green-600': type === 'green',
'bg-red-500 hover:bg-red-600': type === 'red',

View File

@ -10,6 +10,7 @@ import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-d
import { LinkIcon, TrashIcon } from "@heroicons/react/24/outline";
import { useEffect, useRef } from "react";
import { useState } from "react";
import { classNames } from "../components/button";
function InvitationCard({ invitation, allGuests, onGuestAdded, onDestroy }: {
invitation: Invitation,
@ -144,6 +145,12 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
});
}
function handleDownloadQrCodes() {
api.getAllPdf(serializer, () => {
console.log("QR codes downloaded");
});
}
return (
<div className="flex h-screen">
{/* Left Column: Guests */}
@ -164,11 +171,18 @@ export default function InvitationsBoard({ guests, invitations: originalInvitati
<button
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
</button>
<button
onClick={handleDownloadQrCodes}
className={classNames('primary')}
>
Download QR codes
</button>
<div className="grid grid-cols-4 gap-6">

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.7",
"@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.22.3(@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.22.3(@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.4
version: 15.3.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.22.3(@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.22.3(@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.22.3(@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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(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.4(@playwright/test@1.53.1)(react-dom@19.1.0(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704):
dependencies:
'@next/env': 15.3.4
'@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.4
@ -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