add Participants in registration

This commit is contained in:
Mario Peters
2025-09-18 21:44:47 +02:00
parent c3e8aac314
commit cb62a4d478
15 changed files with 46 additions and 50 deletions

View File

@@ -1,8 +1,4 @@
# React + Vite
# Karateturniere.de
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
make a release:
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

28
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "kt-vite",
"version": "3.4.4",
"version": "3.5.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "kt-vite",
"version": "3.4.4",
"version": "3.5.0",
"dependencies": {
"@mui/icons-material": "^7.3.1",
"@mui/material": "^7.3.1",
@@ -26,7 +26,7 @@
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.33.0",
"@pigment-css/vite-plugin": "^0.0.30",
"@playwright/test": "^1.54.2",
"@playwright/test": "^1.55.0",
"@testing-library/jest-dom": "^6.7.0",
"@testing-library/react": "^16.3.0",
"@types/node": "^24.3.0",
@@ -1886,12 +1886,12 @@
}
},
"node_modules/@playwright/test": {
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.54.2.tgz",
"integrity": "sha512-A+znathYxPf+72riFd1r1ovOLqsIIB0jKIoPjyK2kqEIe30/6jF6BC7QNluHuwUmsD2tv1XZVugN8GqfTMOxsA==",
"version": "1.55.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz",
"integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==",
"dev": true,
"dependencies": {
"playwright": "1.54.2"
"playwright": "1.55.0"
},
"bin": {
"playwright": "cli.js"
@@ -7133,12 +7133,12 @@
}
},
"node_modules/playwright": {
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.54.2.tgz",
"integrity": "sha512-Hu/BMoA1NAdRUuulyvQC0pEqZ4vQbGfn8f7wPXcnqQmM+zct9UliKxsIkLNmz/ku7LElUNqmaiv1TG/aL5ACsw==",
"version": "1.55.0",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.0.tgz",
"integrity": "sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==",
"dev": true,
"dependencies": {
"playwright-core": "1.54.2"
"playwright-core": "1.55.0"
},
"bin": {
"playwright": "cli.js"
@@ -7151,9 +7151,9 @@
}
},
"node_modules/playwright-core": {
"version": "1.54.2",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.54.2.tgz",
"integrity": "sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA==",
"version": "1.55.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.0.tgz",
"integrity": "sha512-GvZs4vU3U5ro2nZpeiwyb0zuFaqb9sUiAJuyrWpcGouD8y9/HLgGbNRjIph7zU9D3hnPaisMl9zG9CgFi/biIg==",
"dev": true,
"bin": {
"playwright-core": "cli.js"

View File

@@ -1,6 +1,6 @@
{
"name": "kt-vite",
"version": "3.4.4",
"version": "3.5.0",
"private": true,
"homepage": "https://karateturniere.de",
"type": "module",
@@ -37,7 +37,7 @@
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.33.0",
"@pigment-css/vite-plugin": "^0.0.30",
"@playwright/test": "^1.54.2",
"@playwright/test": "^1.55.0",
"@testing-library/jest-dom": "^6.7.0",
"@testing-library/react": "^16.3.0",
"@types/node": "^24.3.0",
@@ -57,4 +57,4 @@
"vite-plugin-eslint": "^1.8.1",
"vitest": "^3.2.4"
}
}
}

View File

@@ -77,6 +77,7 @@
"invoice": "Faktura:",
"pay-notice": "Převeďte prosím celkovou částku na následující účet:",
"registrations": "Registrace",
"single-registration": "jednotlivá registrace",
"single-registrations": "jednotlivé registrace:",
"team-registration": "Registrace týmu",
"team-registrations": "registrace týmů:"

View File

@@ -77,6 +77,7 @@
"invoice": "Rechnung:",
"pay-notice": "Bitte überweisen Sie den Gesamtbetrag auf folgendes Konto:",
"registrations": "Meldungen",
"single-registration": "Einzel-Anmeldung",
"single-registrations": "Einzelmeldungen:",
"team-registration": "Team-Anmeldung",
"team-registrations": "Teammeldungen:"

View File

@@ -77,9 +77,10 @@
"invoice": "Invoice:",
"pay-notice": "Please transfer the total amount to the following account:",
"registrations": "registrations",
"single-registrations": "single registrations:",
"team-registration": "Team registration",
"team-registrations": "team registrations:"
"single-registration": "Single Registration",
"single-registrations": "Single Registrations:",
"team-registration": "Team Registration",
"team-registrations": "Team Registrations:"
},
"reset": "reset",
"salutation": "salutation",

View File

@@ -77,6 +77,7 @@
"invoice": "Factura:",
"pay-notice": "Transfiera el monto total a la siguiente cuenta:",
"registrations": "Inscripciones",
"single-registration": "Registro individual",
"single-registrations": "registros únicos:",
"team-registration": "Registro de equipo",
"team-registrations": "registros de equipo:"

View File

@@ -77,6 +77,7 @@
"invoice": "Facture :",
"pay-notice": "Veuillez transférer le montant total sur le compte suivant :",
"registrations": "Inscriptions",
"single-registration": "Inscription individuelle",
"single-registrations": "Inscriptions individuelles :",
"team-registration": "Inscription d'équipe",
"team-registrations": "Inscriptions d'équipe :"

View File

@@ -77,6 +77,7 @@
"invoice": "Fattura:",
"pay-notice": "Si prega di trasferire l'importo totale sul seguente conto:",
"registrations": "Iscrizioni",
"single-registration": "Registrazione individuale",
"single-registrations": "Iscrizioni singole:",
"team-registration": "Iscrizione squadra",
"team-registrations": "Iscrizioni squadre:"

View File

@@ -77,6 +77,7 @@
"invoice": "Faktura:",
"pay-notice": "Vennligst overfør totalbeløpet til følgende konto:",
"registrations": "Påmeldinger",
"single-registration": "Enkelpåmelding",
"single-registrations": "Enkelpåmeldinger:",
"team-registration": "Lagpåmelding",
"team-registrations": "Lagpåmeldinger:"
@@ -107,4 +108,4 @@
"street": "Gate"
},
"woman": "Kvinne"
}
}

View File

@@ -43,7 +43,7 @@ export default function App() {
const { t } = useTranslation('common')
const { data: groups, loading: loadingGroups } = useFetch(apiServer + '/groups')
//TODO: env variablen
// TODO: env variablen
// console.log('env',import.meta.env)
useEffect(() => {
@@ -120,21 +120,14 @@ export default function App() {
path="/"
element={
<>
{tournaments && (
<Tournaments
groups={groups}
tournaments={tournaments}
setTournaments={setTournaments}
/>
)}
{tournaments && <Tournaments groups={groups} tournaments={tournaments} setTournaments={setTournaments} />}
<br />
<br />
{!participants && (
<>
<h3>{t('headline.participants')}</h3>
<p>{t('no-login')}</p>
<Button onClick={() => openLoginDialog(null)} color="primary" variant="outlined" startIcon={<ExitToApp />}>
<Button data-testid="login-button" onClick={() => openLoginDialog(null)} color="primary" variant="outlined" startIcon={<ExitToApp />}>
{t('login')}
</Button>
</>

View File

@@ -22,7 +22,8 @@ const Root = styled('div')(({ theme }) => ({
},
}))
export default function Participants() {
export default function Participants({ switchRef, action, checkSingleRegistered, countSingle, getRegisteredSingle }) {
const { token, apiServer, setParticipants } = useUser()
const { t } = useTranslation('common')
const [edit, setEdit] = useState(null)
@@ -64,7 +65,7 @@ export default function Participants() {
<Root>
<h3>{t('headline.participants')}</h3>
<div className={classes.participantsContainer}>
<ParticipantsMobile deleteParticipant={handleDelete} addParticipant={handleAdd} editParticipant={handleEdit} setEdit={setEdit} />
<ParticipantsMobile deleteParticipant={handleDelete} addParticipant={handleAdd} editParticipant={handleEdit} setEdit={setEdit} switchRef={switchRef} action={action} checkSingleRegistered={checkSingleRegistered} countSingle={countSingle} getRegisteredSingle={getRegisteredSingle}/>
</div>
<br />
<Button data-testid="add-participant-button" variant="contained" color="primary" onClick={handleDialog}>

View File

@@ -115,6 +115,9 @@ export default function ParticipantsMobile({ action, checkSingleRegistered, coun
const [search, setSearch] = useState('')
const rowsPerPage = 10
if (participants.length === 0) return 'Keine Teilnehmer vorhanden'
const handleDeleteDialogOpen = (participant) => {
dialog.setContent(<DeleteDialog deleteParticipant={deleteParticipant} participant={participant} />)
dialog.setOpen()

View File

@@ -4,7 +4,7 @@ import { Button, IconButton, Snackbar } from '@mui/material'
import ArrowBackIcon from '@mui/icons-material/ArrowBack'
import CloseIcon from '@mui/icons-material/Close'
import { useTranslation } from 'react-i18next'
import ParticipantsMobile from '../components/Participants/ParticipantsMobile'
import Participants from '../components/Participants/Participants'
import TeamRegistrationMobile from '../components/Registration/TeamRegistrationMobile'
import Invoice from '../components/Registration/Invoice'
import { filterObject, findGroup, splitGroups } from '../utilities/Groups'
@@ -123,19 +123,15 @@ export default function Registration({ groups, tournaments }) {
<h3>
{t('registration.closing-date')} {new Date(tournament.meldeschluss).toLocaleDateString()}
</h3>
<ParticipantsMobile
switchRef={switchRef}
action={actions}
checkSingleRegistered={checkSingleRegistered}
countSingle={countSingle}
getRegisteredSingle={getRegisteredSingle}
/>
<br />
<h2>{t('registration.single-registration')}</h2>
<Participants switchRef={switchRef} action={actions} checkSingleRegistered={checkSingleRegistered} countSingle={countSingle} getRegisteredSingle={getRegisteredSingle} />
<br />
<br />
{teamGroups.length === 0 && <h3>Keine Teamgruppen vorhanden</h3>}
{countTeams && teamGroups.length > 0 && (
<>
<h3>{t('registration.team-registration')}</h3>
<h2>{t('registration.team-registration')}</h2>
<TeamRegistrationMobile
checkTeamsRegistered={checkTeamsRegistered}
countTeams={countTeams}

View File

@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'
const participants = [
{ name: 'test-user', vorname: '123', verein: 'KD tv remagen', guertel: '8. Kyu', geburtstag: '1111-11-11' },
{ name: 'test-user', vorname: '321', verein: 'DJKB', guertel: '6. Kyu', geburtstag: '1999-10-10' },
{ name: 'test-user', vorname: '321', verein: 'DJKB Karate', guertel: '6. Kyu', geburtstag: '1999-10-10' },
{ name: 'test-user', vorname: '456', verein: 'KD tv remagen', guertel: 'DAN', geburtstag: '1980-01-01' },
{ name: 'test-user', vorname: '789', verein: 'KD tv remagen', guertel: '1. Kyu', geburtstag: '2000-01-01' },
{ name: 'test-user', vorname: '000', verein: 'Ippon Frankfurt', guertel: '2. Kyu', geburtstag: '1999-10-10' },
@@ -30,7 +30,7 @@ const login = async (page) => {
const cleanLogin = async (page, email = 'mario@wattsche.de', password = 'mmario84') => {
await page.evaluate(() => window.localStorage.clear())
await page.evaluate(() => window.sessionStorage.clear())
await page.getByRole('banner').getByRole('button').nth(3).click()
await page.getByTestId('login-button').click()
await page.getByRole('textbox', { name: 'E-Mail' }).fill(email)
await page.getByRole('textbox', { name: 'Passwort' }).fill(password)
await page.getByRole('main').getByRole('button').click()