diff --git a/projects/msp-tools/bug-tracker/dashboard.html b/projects/msp-tools/bug-tracker/dashboard.html index 33e3eeba..7ece16a7 100644 --- a/projects/msp-tools/bug-tracker/dashboard.html +++ b/projects/msp-tools/bug-tracker/dashboard.html @@ -203,18 +203,8 @@ const SECTIONS = [ { id: 'ct-projects', label: 'Projects', repos: ['claudetools'], filter: i => (getType(i)==='project' || getType(i)==='feature') && !isClientProject(i) }, ]; // Client project sections — built dynamically from labels -const CLIENT_SECTIONS = [ - { id: 'cp-all', label: 'All Client Projects', client: null }, - { id: 'cp-cascades', label: 'Cascades', client: 'client:cascades' }, - { id: 'cp-glaztech', label: 'GlazTech', client: 'client:glaztech' }, - { id: 'cp-sif', label: 'SIF / Oidak', client: 'client:sif-oidak' }, - { id: 'cp-goldstein', label: 'Goldstein', client: 'client:goldstein' }, - { id: 'cp-prairie', label: 'Prairie Schooner', client: 'client:prairie-schooner' }, - { id: 'cp-cryoweave', label: 'CryoWeave', client: 'client:cryoweave' }, - { id: 'cp-tedards', label: 'Tedards Law', client: 'client:tedards' }, - { id: 'cp-vwp', label: 'Valley Water Pumps', client: 'client:vwp' }, - { id: 'cp-acg', label: 'ACG Internal', client: 'client:acg' }, -]; +// Client sections are built dynamically from labels — only clients with issues appear in sidebar +const CLIENT_SECTIONS = []; const ALL_REPOS = ['gururmm','guru-rmm','guru-connect','claudetools']; const REPO_NAMES = { 'gururmm':'GuruRMM', 'guru-rmm':'GuruRMM', 'guru-connect':'GuruConnect', 'claudetools':'ClaudeTools' }; @@ -329,11 +319,11 @@ function tagStyle(l) { return `background:#${l.color}20;color:#${l.color};`; } function getFiltered() { let items = allIssues; if (currentSection.startsWith('cp-')) { - // Client project section - const cs = CLIENT_SECTIONS.find(s=>s.id===currentSection); - if (cs) { - items = items.filter(i => isClientProject(i)); - if (cs.client) items = items.filter(i => i.labels.some(l => l.name === cs.client)); + // Client project section — dynamic + items = items.filter(i => isClientProject(i)); + if (currentSection !== 'cp-all') { + const clientTag = 'client:' + currentSection.slice(3); + items = items.filter(i => i.labels.some(l => l.name === clientTag)); } } else if (currentSection === 'all') { // Exclude client projects from "all issues" @@ -388,24 +378,24 @@ function renderSidebar() { `; } - // Client projects section - const cpCount = (cs) => { - let items = allIssues.filter(i => i.state !== 'closed' && isClientProject(i)); - if (cs && cs.client) items = items.filter(i => i.labels.some(l => l.name === cs.client)); - return items.length; - }; - const totalCp = cpCount(null); + // Client projects section — built dynamically from issue labels + const cpItems = allIssues.filter(i => i.state !== 'closed' && isClientProject(i)); + const clientCounts = {}; + for (const i of cpItems) { + const cl = getClient(i); + if (cl) clientCounts[cl] = (clientCounts[cl] || 0) + 1; + } + const totalCp = cpItems.length; html += ``; html += ``; - for (const cs of CLIENT_SECTIONS.filter(s=>s.client)) { - const cnt = cpCount(cs); - if (cnt > 0) { - html += ``; - } + for (const [cl, cnt] of Object.entries(clientCounts).sort((a,b)=>b[1]-a[1])) { + const sid = 'cp-' + cl.replace('client:',''); + const displayName = cl.split(':')[1].replace(/-/g,' ').replace(/\b\w/g,c=>c.toUpperCase()); + html += ``; } sb.innerHTML = html; @@ -669,20 +659,6 @@ function showNewIssue() {