dev #105

Merged
Thibaut merged 8 commits from dev into master 2026-01-23 15:49:25 +00:00
5 changed files with 54 additions and 9 deletions
Showing only changes of commit 78d22b466d - Show all commits

View File

@ -322,6 +322,7 @@ public class CompetitionService {
return uni return uni
.call(l -> Mutiny.fetch(c.getGuests()) .call(l -> Mutiny.fetch(c.getGuests())
.onItem().transformToMulti(Multi.createFrom()::iterable) .onItem().transformToMulti(Multi.createFrom()::iterable)
.filter(g -> !g.isTeam())
.onItem().call(guest -> Mutiny.fetch(guest.getCategoriesInscrites())) .onItem().call(guest -> Mutiny.fetch(guest.getCategoriesInscrites()))
.map(guest -> SimpleRegisterComb.fromModel(guest) .map(guest -> SimpleRegisterComb.fromModel(guest)
.setCategorieInscrite(guest.getCategoriesInscrites())) .setCategorieInscrite(guest.getCategoriesInscrites()))

View File

@ -558,6 +558,7 @@
"validée": "Validated", "validée": "Validated",
"voir/modifierLesParticipants": "View/Edit participants", "voir/modifierLesParticipants": "View/Edit participants",
"voirLesStatues": "View statues", "voirLesStatues": "View statues",
"vousNêtesPasEncoreInscrit": "You are not yet registered or your registration has not yet been entered on the intranet",
"à": "at", "à": "at",
"étatDeLaDemande": "Request status" "étatDeLaDemande": "Request status"
} }

View File

@ -558,6 +558,7 @@
"validée": "Validée", "validée": "Validée",
"voir/modifierLesParticipants": "Voir/Modifier les participants", "voir/modifierLesParticipants": "Voir/Modifier les participants",
"voirLesStatues": "Voir les statues", "voirLesStatues": "Voir les statues",
"vousNêtesPasEncoreInscrit": "Vous n'êtes pas encore inscrit ou votre inscription n'a pas encore été rentrée sur l'intranet",
"à": "à", "à": "à",
"étatDeLaDemande": "État de la demande" "étatDeLaDemande": "État de la demande"
} }

View File

@ -8,7 +8,7 @@ import {apiAxios, applyOverCategory, CatList, getCatName, getToastMessage} from
import {toast} from "react-toastify"; import {toast} from "react-toastify";
import {SimpleReducer} from "../../utils/SimpleReducer.jsx"; import {SimpleReducer} from "../../utils/SimpleReducer.jsx";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faAdd, faGavel, faTrashCan} from "@fortawesome/free-solid-svg-icons"; import {faAdd, faGavel, faLock, faTrashCan} from "@fortawesome/free-solid-svg-icons";
import "./CompetitionRegisterAdmin.css" import "./CompetitionRegisterAdmin.css"
import * as XLSX from "xlsx-js-style"; import * as XLSX from "xlsx-js-style";
import {useCountries} from "../../hooks/useCountries.jsx"; import {useCountries} from "../../hooks/useCountries.jsx";
@ -67,7 +67,7 @@ export function CompetitionRegisterAdmin({source}) {
data={state.filter(s => (clubFilter.length === 0 || s.data.club.name === clubFilter) data={state.filter(s => (clubFilter.length === 0 || s.data.club.name === clubFilter)
&& (catAgeFilter.length === 0 || s.data.categorie === catAgeFilter) && (catAgeFilter.length === 0 || s.data.categorie === catAgeFilter)
&& (catFilter === -1 || s.data.categoriesInscrites.includes(catFilter)))} && (catFilter === -1 || s.data.categoriesInscrites.includes(catFilter)))}
dispatch={dispatch} id={id} setModalState={setModalState} source={source}/> data2={data2} dispatch={dispatch} id={id} setModalState={setModalState} source={source}/>
</div> : error ? <AxiosError error={error}/> : <Def/>} </div> : error ? <AxiosError error={error}/> : <Def/>}
</div> </div>
<div className="col-lg-3"> <div className="col-lg-3">
@ -132,7 +132,7 @@ function QuickAdd({sendRegister, source, data2, error2}) {
<label htmlFor="inputState2" className="form-label align-self-center" style={{margin: "0 0.5em 0 0"}}> <label htmlFor="inputState2" className="form-label align-self-center" style={{margin: "0 0.5em 0 0"}}>
{t('catégorieàAjouter')}<br/> <small>({t('siDisponiblePourLaCatégorieDages')})</small> {t('catégorieàAjouter')}<br/> <small>({t('siDisponiblePourLaCatégorieDages')})</small>
</label> </label>
<CategoriesList error2={error2} availableCats={data2.sort((a, b) => a.name.localeCompare(b.name))} categories={categories} <CategoriesList error2={error2} availableCats={data2?.sort((a, b) => a.name.localeCompare(b.name))} categories={categories}
setCategories={setCategories_}/> setCategories={setCategories_}/>
</div> </div>
@ -590,7 +590,7 @@ function FiltreBar({data, data2, clubFilter, setClubFilter, catFilter, setCatFil
</div> </div>
} }
function MakeCentralPanel({data, dispatch, id, setModalState, source}) { function MakeCentralPanel({data, data2, dispatch, id, setModalState, source}) {
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const registerType = searchParams.get("type") || "FREE"; const registerType = searchParams.get("type") || "FREE";
const {t} = useTranslation(); const {t} = useTranslation();
@ -610,14 +610,22 @@ function MakeCentralPanel({data, dispatch, id, setModalState, source}) {
<div className="row"> <div className="row">
<span className="col-auto">{req.data.licence ? String(req.data.licence).padStart(5, '0') : "-------"}</span> <span className="col-auto">{req.data.licence ? String(req.data.licence).padStart(5, '0') : "-------"}</span>
<div className="ms-2 col-auto"> <div className="ms-2 col-auto">
<div><strong>{req.data.fname} {req.data.lname}</strong> <small>{req.data.genre}</small></div> <div><strong>{req.data.fname} {req.data.lname}</strong> <small>{req.data.lockEdit &&
<FontAwesomeIcon icon={faLock} style={{color: "#e40101",}}/>}{req.data.genre}</small></div>
<small>{req.data.club?.name || t("club", {count: 0})}</small> <small>{req.data.club?.name || t("club", {count: 0})}</small>
</div> </div>
</div> </div>
<div className="row"> <div className="row">
<div className="col-auto" style={{textAlign: "right"}}> <div className="col-auto" style={{textAlign: "right"}}>
<small>{t("comp.surclassement", {count: req.data.overCategory, cat: getCatName(req.data.categorie)})}<br/> <small>{t("comp.surclassement", {
{req.data.weight ? req.data.weight : "---"} kg count: req.data.overCategory,
cat: getCatName(req.data.categorie)
})} | {req.data.weight ? req.data.weight : "---"} kg</small>
<br/>
<small>
{req.data.categoriesInscrites.map(catId => data2?.find(c => c.id === catId)).filter(o => o !== undefined)
.sort((a, b) => a.name.localeCompare(b.name)).map(cat =>
<span key={cat.id} className="badge text-bg-secondary" style={{margin: "0 0.125em"}}>{cat.name}</span>)}
</small> </small>
</div> </div>
</div> </div>

View File

@ -74,8 +74,8 @@ function MakeContent({data}) {
disabled={new Date() < new Date(data.startRegister.split('+')[0]) || new Date() > new Date(data.endRegister.split('+')[0])} disabled={new Date() < new Date(data.startRegister.split('+')[0]) || new Date() > new Date(data.endRegister.split('+')[0])}
onClick={_ => navigate("/competition/" + data.id + "/club/register")}>{t('comp.inscription')}</button> onClick={_ => navigate("/competition/" + data.id + "/club/register")}>{t('comp.inscription')}</button>
} }
{data.registerMode === "FREE" && !isClubAdmin(userinfo) && {data.registerMode === "FREE" && !isClubAdmin(userinfo) && <SelfRegister/>
<SelfRegister data2={data}/> || <ShowRegister/>
} }
{data.registerMode === "HELLOASSO" && {data.registerMode === "HELLOASSO" &&
<p><strong>{t('comp.billetterie')} :</strong> <a <p><strong>{t('comp.billetterie')} :</strong> <a
@ -207,6 +207,40 @@ function SelfRegister({data2}) {
</> </>
} }
function ShowRegister() {
const {id} = useParams()
const setLoading = useLoadingSwitcher()
const {data, error} = useFetch(`/competition/${id}/register/user`, setLoading, 1)
const {data: data3, error: error2} = useFetch(`/competition/${id}/categories`, setLoading, 1)
const {t} = useTranslation();
return <>
{data ? data.length > 0
? <div style={{textAlign: "right", maxWidth: "30em"}}>
<h4 style={{textAlign: "left"}}>{t('comp.monInscription')}</h4>
<div style={{textAlign: "left"}}>{t('comp.catégorieNormalisée')} : {getCatName(data[0].categorie)}</div>
<div style={{textAlign: "left"}}>{t('comp.modal.surclassement')} :
{data[0].overCategory === 0 && ` ${t('aucun')}`}
{data[0].overCategory === 1 && ` ${t('1Catégorie')}`}
{data[0].overCategory === 2 && ` ${t('2Catégorie')}`}
</div>
<div style={{textAlign: "left"}}>{t("comp.modal.poids")} : {data[0].weight}</div>
<div style={{textAlign: "left"}}>{t('catégorie')} :
{error2 ? <AxiosError error={error2}/> : <>
{data3 && data3.length === 0 && <div>{t('aucuneCatégorieDisponible')}</div>}
{data3 && data3.filter(c => data[0].categoriesInscrites.includes(c.id)).sort((a, b) => a.name.localeCompare(b.name)).map(cat =>
<span key={cat.id} className="badge text-bg-secondary" style={{margin: "0 0.25em"}}>{cat.name}</span>)}
</>}
</div>
</div> : <span>{t('vousNêtesPasEncoreInscrit')}</span>
: error
? <AxiosError error={error}/>
: <Def/>
}
</>
}
function Def() { function Def() {
return <div className="list-group"> return <div className="list-group">
<li className="list-group-item"><ThreeDots/></li> <li className="list-group-item"><ThreeDots/></li>