feat(training): search, class filter and grouping in the club practice overview (1.89.18)

This commit is contained in:
larssand committed 2026-11-13 15:49:34 +01:00
1 parent f8080ffaeb
commit eefef11aaa
11 files changed
+129 -13

No files matched your search

+9
View File
@@ -56,3 +56,12 @@ export function removeDrivers(state, ids) {
});
return before - state.drivers.length;
}
// The training stats' club table (one row per driver and class): search on the name, one class,
// and only drivers who have trained.
export function trainingRowVisible(row, { search = "", classId = "", activeOnly = false } = {}) {
const needle = String(search || "").trim().toLowerCase();
if (needle && !String(row?.name || "").toLowerCase().includes(needle)) return false;
if (classId && String(row?.classId || "") !== String(classId)) return false;
return !activeOnly || Number(row?.laps || 0) > 0;
}