Compare commits

...

3 Commits

Author SHA1 Message Date
Renovate Bot
7d9fca1116 Update dependency react to v19.1.1
Some checks failed
Build Nginx-based docker image / build-static-assets (push) Failing after 1s
Add copyright notice / copyright_notice (pull_request) Failing after 2s
Playwright Tests / test (pull_request) Failing after 1s
Check usage of free licenses / build-static-assets (pull_request) Failing after 2s
2025-09-16 22:24:03 +00:00
f6cbc88acd Display simulation progress (#329)
All checks were successful
Check usage of free licenses / build-static-assets (push) Successful in 52s
Build Nginx-based docker image / build-static-assets (push) Successful in 6m15s
Playwright Tests / test (push) Successful in 7m40s
2025-09-16 12:09:17 +00:00
17b9a5e5b4 Display simulation progress
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 3m26s
Check usage of free licenses / build-static-assets (pull_request) Successful in 3m37s
Build Nginx-based docker image / build-static-assets (push) Successful in 40m57s
Playwright Tests / test (pull_request) Successful in 4m16s
2025-09-08 22:47:16 +02:00
7 changed files with 84 additions and 75 deletions

View File

@ -8,7 +8,7 @@ import Arrangement from '@/app/ui/arrangements/arrangement';
import ArrangementsTable from '@/app/ui/arrangements/arrangements-table';
import { classNames } from '@/app/ui/components/button';
import { Toast } from 'primereact/toast';
import React, { useRef, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
export default function Page() {
const toast = useRef<Toast>(null);

View File

@ -13,6 +13,8 @@ export function loadTableSimulations(onLoad?: (tableSimulations: TableArrangemen
name: record.name,
discomfort: record.discomfort,
valid: record.valid,
progress: record.progress,
status : record.status
});
}));
}, (error) => {

View File

@ -14,6 +14,8 @@ export type TableArrangement = {
guests?: Guest[];
discomfort?: number;
valid?: boolean;
progress: number;
status: 'in_progress' | 'completed' | 'not_started';
}
export type User = {

View File

@ -22,10 +22,12 @@ export type Table = {
export class TableSimulation implements Entity {
id?: string;
tables: Table[];
progress: number;
constructor(id?: string, tables?: Table[]) {
constructor(id?: string, tables?: Table[], progress?: number) {
this.id = id;
this.tables = tables || [];
this.progress = progress || 0;
}
}
@ -43,7 +45,7 @@ export class TableSimulationSerializer implements Serializable<TableSimulation>
}
},
}
}));
}), data.progress);
}
toJson(simulation: TableSimulation): string {

View File

@ -10,11 +10,21 @@ import { loadTableSimulations } from "@/app/api/tableSimulations";
import { ArchiveBoxXMarkIcon, CheckBadgeIcon } from "@heroicons/react/24/outline";
import { Tooltip } from "primereact/tooltip";
import clsx from "clsx";
import { ProgressBar } from "primereact/progressbar";
import { useEffect } from "react";
import { TableSimulation, TableSimulationSerializer } from "@/app/lib/tableSimulation";
import { AbstractApi } from "@/app/api/abstract-api";
export default function ArrangementsTable({ onArrangementSelected }: { onArrangementSelected: (arrangementId: string) => void }) {
const [arrangements, setArrangements] = useState<Array<TableArrangement>>([]);
const [arrangementsLoaded, setArrangementsLoaded] = useState(false);
useEffect(() => {
refreshSimulations();
const interval = setInterval(refreshSimulations, 10000);
return () => clearInterval(interval);
}, []);
function refreshSimulations() {
loadTableSimulations((arrangements) => {
setArrangements(arrangements);
@ -26,11 +36,9 @@ export default function ArrangementsTable({ onArrangementSelected }: { onArrange
onArrangementSelected(e.currentTarget.getAttribute('data-arrangement-id') || '');
}
!arrangementsLoaded && refreshSimulations();
return (
<TableOfContents
headers={['Name', 'Discomfort', 'Actions', 'Status']}
headers={['Name', 'Discomfort', 'Status', 'Actions']}
caption='Simulations'
elements={arrangements}
rowRender={(arrangement) => (
@ -44,17 +52,18 @@ export default function ArrangementsTable({ onArrangementSelected }: { onArrange
<td className="px-6 py-4">
{arrangement.discomfort}
</td>
<td>
<button data-arrangement-id={arrangement.id} onClick={arrangementClicked} className={classNames('primary')}>Load</button>
</td>
<td>
<td className="px-4">
<Tooltip target=".tooltip-status" />
{
arrangement.valid ?
<CheckBadgeIcon className='size-6 tooltip-status' data-pr-position="right" data-pr-tooltip="Simulation is valid" /> :
<ArchiveBoxXMarkIcon className='size-6 tooltip-status' data-pr-position="right" data-pr-tooltip="Simulation is expired due to attendance or affinity changes" />
}
<>
{ arrangement.valid && arrangement.status === 'not_started' && <ProgressBar mode="indeterminate" style={{ height: '6px' }}></ProgressBar> }
{ arrangement.valid && arrangement.status !== 'not_started' && <ProgressBar value={(100 * arrangement.progress).toFixed(2) }></ProgressBar> }
{ !arrangement.valid && 'The list of potential guests has changed since this simulation.' }
</>
</td>
<td>
<button data-arrangement-id={arrangement.id} onClick={arrangementClicked} className={classNames('primary')}>Load</button>
</td>
</tr>
)}

View File

@ -21,7 +21,7 @@
"postcss": "8.5.6",
"primeicons": "^7.0.0",
"primereact": "^10.8.2",
"react": "19.0.0-rc-f38c22b244-20240704",
"react": "19.1.1",
"react-dom": "19.0.0-rc-f38c22b244-20240704",
"tailwindcss": "3.4.17",
"typescript": "5.8.3",
@ -33,7 +33,7 @@
"@playwright/test": "^1.52.0",
"@types/bcrypt": "^5.0.2",
"@types/node": "24.3.1",
"@types/react": "18.3.23",
"@types/react": "19.1.13",
"@types/react-dom": "18.3.7",
"wait-on": "^8.0.3"
},

110
pnpm-lock.yaml generated
View File

@ -13,7 +13,7 @@ importers:
version: 1.7.4
'@heroicons/react':
specifier: ^2.1.4
version: 2.2.0(react@19.0.0-rc-f38c22b244-20240704)
version: 2.2.0(react@19.1.1)
'@tailwindcss/forms':
specifier: ^0.5.7
version: 0.5.10(tailwindcss@3.4.17)
@ -22,7 +22,7 @@ importers:
version: 2.26.1
'@tiptap/react':
specifier: ^2.14.0
version: 2.26.1(@tiptap/core@2.26.1(@tiptap/pm@2.26.1))(@tiptap/pm@2.26.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704))(react@19.0.0-rc-f38c22b244-20240704)
version: 2.26.1(@tiptap/core@2.26.1(@tiptap/pm@2.26.1))(@tiptap/pm@2.26.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1)
'@tiptap/starter-kit':
specifier: ^2.14.0
version: 2.26.1
@ -40,10 +40,10 @@ importers:
version: 3.2.6
next:
specifier: 15.4.5
version: 15.4.5(@playwright/test@1.54.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.4.5(@playwright/test@1.54.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1)
next-auth:
specifier: 5.0.0-beta.29
version: 5.0.0-beta.29(next@15.4.5(@playwright/test@1.54.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.4.5(@playwright/test@1.54.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1))(react@19.1.1)
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@19.1.13)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1)
react:
specifier: 19.0.0-rc-f38c22b244-20240704
version: 19.0.0-rc-f38c22b244-20240704
specifier: 19.1.1
version: 19.1.1
react-dom:
specifier: 19.0.0-rc-f38c22b244-20240704
version: 19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704)
version: 19.0.0-rc-f38c22b244-20240704(react@19.1.1)
tailwindcss:
specifier: 3.4.17
version: 3.4.17
@ -67,7 +67,7 @@ importers:
version: 5.8.3
use-debounce:
specifier: ^10.0.1
version: 10.0.5(react@19.0.0-rc-f38c22b244-20240704)
version: 10.0.5(react@19.1.1)
uuid:
specifier: 11.1.0
version: 11.1.0
@ -85,11 +85,11 @@ importers:
specifier: 24.3.1
version: 24.3.1
'@types/react':
specifier: 18.3.23
version: 18.3.23
specifier: 19.1.13
version: 19.1.13
'@types/react-dom':
specifier: 18.3.7
version: 18.3.7(@types/react@18.3.23)
version: 18.3.7(@types/react@19.1.13)
wait-on:
specifier: ^8.0.3
version: 8.0.4
@ -523,9 +523,6 @@ packages:
'@types/node@24.3.1':
resolution: {integrity: sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==}
'@types/prop-types@15.7.12':
resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==}
'@types/react-dom@18.3.7':
resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==}
peerDependencies:
@ -536,8 +533,8 @@ packages:
peerDependencies:
'@types/react': '*'
'@types/react@18.3.23':
resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==}
'@types/react@19.1.13':
resolution: {integrity: sha512-hHkbU/eoO3EG5/MZkuFSKmYqPbSVk5byPFa3e7y/8TybHiLMACgI8seVYlicwk7H5K/rI2px9xrQp/C+AUDTiQ==}
'@types/trusted-types@2.0.7':
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
@ -1198,8 +1195,8 @@ packages:
react: '>=16.6.0'
react-dom: '>=16.6.0'
react@19.0.0-rc-f38c22b244-20240704:
resolution: {integrity: sha512-OP8O6Oc1rdR9IdIKJRKaL1PYd4eGkn6f88VqiygWyyG4P4RmPPix5pp7MatqSt9TnBOcVT+lBMGoVxRgUFeudQ==}
react@19.1.1:
resolution: {integrity: sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==}
engines: {node: '>=0.10.0'}
read-cache@1.0.0:
@ -1415,9 +1412,9 @@ snapshots:
dependencies:
'@hapi/hoek': 9.3.0
'@heroicons/react@2.2.0(react@19.0.0-rc-f38c22b244-20240704)':
'@heroicons/react@2.2.0(react@19.1.1)':
dependencies:
react: 19.0.0-rc-f38c22b244-20240704
react: 19.1.1
'@img/sharp-darwin-arm64@0.34.3':
optionalDependencies:
@ -1717,7 +1714,7 @@ snapshots:
prosemirror-transform: 1.10.4
prosemirror-view: 1.40.0
'@tiptap/react@2.26.1(@tiptap/core@2.26.1(@tiptap/pm@2.26.1))(@tiptap/pm@2.26.1)(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.26.1(@tiptap/core@2.26.1(@tiptap/pm@2.26.1))(@tiptap/pm@2.26.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1)':
dependencies:
'@tiptap/core': 2.26.1(@tiptap/pm@2.26.1)
'@tiptap/extension-bubble-menu': 2.26.1(@tiptap/core@2.26.1(@tiptap/pm@2.26.1))(@tiptap/pm@2.26.1)
@ -1725,9 +1722,9 @@ snapshots:
'@tiptap/pm': 2.26.1
'@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)
use-sync-external-store: 1.5.0(react@19.0.0-rc-f38c22b244-20240704)
react: 19.1.1
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.1)
use-sync-external-store: 1.5.0(react@19.1.1)
'@tiptap/starter-kit@2.26.1':
dependencies:
@ -1770,19 +1767,16 @@ snapshots:
dependencies:
undici-types: 7.10.0
'@types/prop-types@15.7.12': {}
'@types/react-dom@18.3.7(@types/react@18.3.23)':
'@types/react-dom@18.3.7(@types/react@19.1.13)':
dependencies:
'@types/react': 18.3.23
'@types/react': 19.1.13
'@types/react-transition-group@4.4.12(@types/react@18.3.23)':
'@types/react-transition-group@4.4.12(@types/react@19.1.13)':
dependencies:
'@types/react': 18.3.23
'@types/react': 19.1.13
'@types/react@18.3.23':
'@types/react@19.1.13':
dependencies:
'@types/prop-types': 15.7.12
csstype: 3.1.3
'@types/trusted-types@2.0.7':
@ -2163,21 +2157,21 @@ snapshots:
nanoid@3.3.11: {}
next-auth@5.0.0-beta.29(next@15.4.5(@playwright/test@1.54.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.4.5(@playwright/test@1.54.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1))(react@19.1.1):
dependencies:
'@auth/core': 0.40.0
next: 15.4.5(@playwright/test@1.54.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: 15.4.5(@playwright/test@1.54.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1)
react: 19.1.1
next@15.4.5(@playwright/test@1.54.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.4.5(@playwright/test@1.54.1)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1):
dependencies:
'@next/env': 15.4.5
'@swc/helpers': 0.5.15
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)
styled-jsx: 5.1.6(react@19.0.0-rc-f38c22b244-20240704)
react: 19.1.1
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.1)
styled-jsx: 5.1.6(react@19.1.1)
optionalDependencies:
'@next/swc-darwin-arm64': 15.4.5
'@next/swc-darwin-x64': 15.4.5
@ -2287,14 +2281,14 @@ 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@19.1.13)(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1):
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)
'@types/react-transition-group': 4.4.12(@types/react@19.1.13)
react: 19.1.1
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.1)
react-transition-group: 4.4.5(react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1)
optionalDependencies:
'@types/react': 18.3.23
'@types/react': 19.1.13
prop-types@15.8.1:
dependencies:
@ -2413,23 +2407,23 @@ snapshots:
raf-schd@4.0.3: {}
react-dom@19.0.0-rc-f38c22b244-20240704(react@19.0.0-rc-f38c22b244-20240704):
react-dom@19.0.0-rc-f38c22b244-20240704(react@19.1.1):
dependencies:
react: 19.0.0-rc-f38c22b244-20240704
react: 19.1.1
scheduler: 0.25.0-rc-f38c22b244-20240704
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.0.0-rc-f38c22b244-20240704(react@19.1.1))(react@19.1.1):
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: 19.1.1
react-dom: 19.0.0-rc-f38c22b244-20240704(react@19.1.1)
react@19.0.0-rc-f38c22b244-20240704: {}
react@19.1.1: {}
read-cache@1.0.0:
dependencies:
@ -2527,10 +2521,10 @@ snapshots:
dependencies:
ansi-regex: 6.0.1
styled-jsx@5.1.6(react@19.0.0-rc-f38c22b244-20240704):
styled-jsx@5.1.6(react@19.1.1):
dependencies:
client-only: 0.0.1
react: 19.0.0-rc-f38c22b244-20240704
react: 19.1.1
sucrase@3.35.0:
dependencies:
@ -2603,13 +2597,13 @@ snapshots:
escalade: 3.2.0
picocolors: 1.1.1
use-debounce@10.0.5(react@19.0.0-rc-f38c22b244-20240704):
use-debounce@10.0.5(react@19.1.1):
dependencies:
react: 19.0.0-rc-f38c22b244-20240704
react: 19.1.1
use-sync-external-store@1.5.0(react@19.0.0-rc-f38c22b244-20240704):
use-sync-external-store@1.5.0(react@19.1.1):
dependencies:
react: 19.0.0-rc-f38c22b244-20240704
react: 19.1.1
util-deprecate@1.0.2: {}