feat(sponsor): quick setup with guest drivers, shared rental cars, rotating heats and A/B finals (1.63.0)

This commit is contained in:
larssand committed 2026-11-05 18:31:57 +01:00
1 parent 6142b14e47
commit d0a5df6992
19 files changed
+511 -54

No files matched your search

+3 -3
View File
@@ -434,7 +434,7 @@ export function ensureRaceParticipantsConfigured(event, { state }) {
if (event.raceConfig?.participantsConfigured) {
return;
}
const classDrivers = state.drivers.filter((driver) => !event.classId || driver.classId === event.classId);
const classDrivers = state.drivers.filter((driver) => !driver.guestEventId && (!event.classId || driver.classId === event.classId));
event.raceConfig.driverIds = classDrivers.map((driver) => driver.id);
event.raceConfig.participantsConfigured = true;
}
@@ -575,7 +575,7 @@ export function getRaceWizardSessionPlan(draft, { t }) {
export function getEventDrivers(event, { state }) {
const classDrivers = state.drivers.filter((driver) => !event?.classId || driver.classId === event.classId);
const classDrivers = state.drivers.filter((driver) => !driver.guestEventId && (!event?.classId || driver.classId === event.classId));
if (!event?.raceConfig?.participantsConfigured) {
return classDrivers;
}
@@ -637,7 +637,7 @@ export function getTeamDriverPool(event, { getEventDrivers, state }) {
// No driver matched the event's class or configured participant list (e.g. a team is
// being set up before drivers/participants exist yet) - fall back to every driver in
// the club rather than leaving the admin with zero checkboxes and no way to proceed.
const allDrivers = Array.isArray(state?.drivers) ? [...state.drivers] : [];
const allDrivers = Array.isArray(state?.drivers) ? state.drivers.filter((driver) => !driver.guestEventId) : [];
return { drivers: allDrivers, fallback: allDrivers.length > 0 };
}