Add simplified Open Practice flow and reorganize

This commit is contained in:
larssand
2026-08-24 19:25:21 +02:00
parent 5a6e51c51b
commit 2e6866a013
13 changed files with 481 additions and 55 deletions

View File

@@ -28,6 +28,14 @@ export function getRaceSummaryItems(event, sessions, raceDrivers, selectedPreset
const scoringLabel = cfg.qualifyingScoring === "best" ? t("events.qualifying_scoring_best") : t("events.qualifying_scoring_points");
const lapWindow = `${((cfg.minLapMs || 0) / 1000).toFixed(1)}s / ${((cfg.maxLapMs || 0) / 1000).toFixed(1)}s`;
const isEndurancePreset = selectedPreset?.id === "endurance";
if (cfg.practiceOnly === true) {
return [
{ label: t("events.race_summary_focus"), value: t("events.quick_open_practice_title") },
{ label: t("table.duration"), value: t("events.open_practice_untimed") },
{ label: t("events.race_summary_participants"), value: t("events.open_practice_all_transponders") },
{ label: t("events.race_summary_created_sessions"), value: String(practiceCount) },
];
}
if (isEndurancePreset) {
return [
{ label: t("events.race_summary_preset"), value: selectedPreset?.label || t("events.preset_custom") },
@@ -59,6 +67,10 @@ export function getRaceSummaryWarnings(event, sessions, raceDrivers, raceTeams,
const hasQualifying = sessions.some((session) => session.type === "qualification");
const hasFinals = sessions.some((session) => session.type === "final");
const hasAnySession = sessions.length > 0;
if (cfg.practiceOnly === true) {
if (!hasAnySession) warnings.push({ message: t("events.summary_warning_no_sessions"), target: "manage-session-plan" });
return warnings;
}
if (participantCount <= 0) warnings.push({ message: t("events.summary_warning_no_participants"), target: "manage-setup-participants" });
if (!hasAnySession) warnings.push({ message: t("events.summary_warning_no_sessions"), target: "manage-session-plan" });
if (!isEndurancePreset && !hasQualifying) warnings.push({ message: t("events.summary_warning_no_qualifying"), target: "manage-generation" });