This commit is contained in:
Bastien COIGNOUX
2026-04-24 07:41:55 +02:00
commit 7cd2d6dc40
42 changed files with 4453 additions and 0 deletions

17
src/lib/boardGrouping.ts Normal file
View File

@ -0,0 +1,17 @@
import type { StoryGroup } from '../types/jira'
/** Regroupe les stories par premier composant Jira, sinon « Autres ». */
export function groupStoriesByComponent(groups: StoryGroup[]): Map<string, StoryGroup[]> {
const map = new Map<string, StoryGroup[]>()
for (const g of groups) {
const comps = g.story.fields.components
const label =
comps && comps.length > 0 ? comps[0]!.name : 'Autres'
if (!map.has(label)) map.set(label, [])
map.get(label)!.push(g)
}
const keys = [...map.keys()].sort((a, b) => a.localeCompare(b, 'fr'))
const sorted = new Map<string, StoryGroup[]>()
for (const k of keys) sorted.set(k, map.get(k)!)
return sorted
}