fix(houseofrc): link hand-added drivers who enter later; fix qualifying rounds hint in the race wizard (1.84.1)

This commit is contained in:
larssand committed 2026-11-08 21:11:23 +01:00
1 parent 0a4c017e44
commit f14cdb8c97
8 files changed
+27 -8

No files matched your search

+4
View File
@@ -2222,6 +2222,7 @@ const TRANSLATIONS = {
"houseofrc.entries_class": "Klass hos oss",
"houseofrc.entries_hor_class": "Klass på House of RC",
"houseofrc.refresh_button": "Hämta ändringar från House of RC",
"houseofrc.refresh_link_only": "Kör redan – kopplas till anmälan",
"houseofrc.results_button": "Skicka resultat till House of RC",
"houseofrc.results_hint": "Förhandsgranska och skicka resultatet till {name}",
"houseofrc.results_title": "Skicka resultat till House of RC",
@@ -2336,6 +2337,7 @@ const TRANSLATIONS = {
"events.qualifying_scoring_best": "Bästa runda / rank",
"events.qualifying_rounds": "Antal kvalrundor",
"events.qualifying_rounds_hint": "Hur många kvalomgångar som ska skapas totalt.",
"events.wizard_use_qualifying_hint": "Kvalet ger placeringen in i finalerna. Längd och startsätt kommer från formatet och kan ändras i Hantera → Format.",
"events.cars_per_heat": "Förare per kvalheat",
"events.cars_per_heat_hint": "Hur många förare som placeras i varje kvalheat.",
"events.qual_duration": "Kvaltid (min)",
@@ -4463,6 +4465,7 @@ const TRANSLATIONS = {
"houseofrc.entries_class": "Our class",
"houseofrc.entries_hor_class": "Class on House of RC",
"houseofrc.refresh_button": "Fetch changes from House of RC",
"houseofrc.refresh_link_only": "Already racing – linked to the entry",
"houseofrc.results_button": "Send results to House of RC",
"houseofrc.results_hint": "Preview and send the results to {name}",
"houseofrc.results_title": "Send results to House of RC",
@@ -4577,6 +4580,7 @@ const TRANSLATIONS = {
"events.qualifying_scoring_best": "Best round / rank",
"events.qualifying_rounds": "Qualifying rounds",
"events.qualifying_rounds_hint": "How many qualifying rounds should be generated in total.",
"events.wizard_use_qualifying_hint": "Qualifying decides who goes into which final. Length and start mode come from the format and can be changed in Manage → Format.",
"events.cars_per_heat": "Drivers per qualifying heat",
"events.cars_per_heat_hint": "How many drivers go into each qualifying heat.",
"events.qual_duration": "Qualifying duration (min)",
+5 -2
View File
@@ -141,7 +141,7 @@ export function rememberHouseOfRcClass(classes = [], classId = "", name = "") {
// Re-fetch for a race made from House of RC: which entries of its class are new, and which of
// our participants' entries are gone (withdrawn or moved to the waiting list - the server
// leaves those out). Participants added by hand (no entry id) are never touched.
// leaves those out). Participants added by hand (no entry id) are never taken out.
export function diffHouseOfRcEntries(event, entries = [], drivers = []) {
const link = event?.houseOfRc || {};
const entryIds = link.entryIds || {};
@@ -149,7 +149,10 @@ export function diffHouseOfRcEntries(event, entries = [], drivers = []) {
const classEntries = entries.filter((entry) => link.classId == null || entry.classId === link.classId);
const known = new Set(Object.entries(entryIds).filter(([driverId]) => participants.has(driverId)).map(([, entryId]) => entryId));
const plan = planHouseOfRcEntries(classEntries, drivers, event?.classId || "");
const added = plan.filter((row) => !known.has(row.entry.entryId) && !(row.driverId && participants.has(row.driverId) && entryIds[row.driverId] == null));
// A participant added by hand who has now entered on House of RC is linked to the entry
// (linkOnly: already racing, so only the entry id is recorded, for the results).
const added = plan.filter((row) => !known.has(row.entry.entryId))
.map((row) => (row.driverId && participants.has(row.driverId) ? { ...row, linkOnly: true } : row));
const current = new Set(classEntries.map((entry) => entry.entryId));
const withdrawn = Object.entries(entryIds)
.filter(([driverId, entryId]) => participants.has(driverId) && !current.has(entryId))
+1 -1
View File
@@ -330,7 +330,7 @@ export async function openHouseOfRcEntryRefresh({ event, state, t, escapeHtml, m
<div class="table-wrap"><table class="hor-import-table"><tbody>${diff.added.map((row, index) => `<tr>
<td><input type="checkbox" data-hor-add="${index}" checked /></td>
<td>${escapeHtml(row.entry.name)}</td><td>${escapeHtml(row.entry.club || "–")}</td><td>${escapeHtml(row.entry.car || "–")}</td><td>${escapeHtml(row.transponder || "–")}</td>
<td><span class="pill ${row.status === "new" ? "pill-warn" : "pill-green"}">${escapeHtml(t(`houseofrc.entry_${row.status}`))}</span></td>
<td><span class="pill ${row.status === "new" ? "pill-warn" : "pill-green"}">${escapeHtml(t(row.linkOnly ? "houseofrc.refresh_link_only" : `houseofrc.entry_${row.status}`))}</span></td>
</tr>`).join("")}</tbody></table></div>` : ""}
${diff.withdrawn.length ? `<h4 class="mt-16">➖ ${escapeHtml(t("houseofrc.refresh_withdrawn", { count: diff.withdrawn.length }))}</h4>
<div class="table-wrap"><table class="hor-import-table"><tbody>${diff.withdrawn.map((driver) => `<tr>
+2 -2
View File
@@ -154,12 +154,12 @@ export function renderRaceWizardContent(draft, classOptions, wizardDrivers, pres
${!isEndurance ? `
<label class="field-card">
<span class="field-label">${t("events.wizard_use_qualifying")}</span>
<span class="field-hint">${t("events.qualifying_rounds_hint")}</span>
<span class="field-hint">${t("events.wizard_use_qualifying_hint")}</span>
<label class="toggle"><input type="checkbox" name="createQualifying" ${draft.createQualifying ? "checked" : ""} /><span>${t("events.wizard_use_qualifying")}</span></label>
</label>
<label class="field-card">
<span class="field-label">${t("events.wizard_qualifying_rounds")}</span>
<span class="field-hint">${t("events.qual_duration_hint")}</span>
<span class="field-hint">${t("events.qualifying_rounds_hint")}</span>
<input type="number" min="0" step="1" name="qualifyingRounds" value="${draft.qualifyingRounds}" ${draft.createQualifying ? "" : "disabled"} />
</label>
` : `