feat(dashboard): text filter for Overview workplans chart
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

Add a search field next to the Workplans by Repository mode selector so
operators can narrow large lists by title, repo, domain, filename, or owner.
This commit is contained in:
tegwick 2026-07-22 01:22:22 +02:00
parent c363549388
commit b5747d1104
4 changed files with 111 additions and 2 deletions

View file

@ -0,0 +1,22 @@
/**
* Case-insensitive substring match for Overview "Workplans by Repository".
* Matches title, repo, domain, filename, owner, and id.
*
* @param {object} workplan Row from overview workplan_rows
* @param {string} query Free-text filter
* @returns {boolean}
*/
export function workplanMatchesSearch(workplan, query) {
const q = String(query ?? "").trim().toLowerCase();
if (!q) return true;
if (!workplan || typeof workplan !== "object") return false;
const haystack = [
workplan.title,
workplan.repo_label,
workplan.domain,
workplan.workplan_filename,
workplan.owner,
workplan.id,
].filter(Boolean).join("\n").toLowerCase();
return haystack.includes(q);
}