From ca4c64bbb03f33442c919fa9197c77aa137eb00a Mon Sep 17 00:00:00 2001 From: Bastien COIGNOUX Date: Fri, 24 Apr 2026 11:50:39 +0200 Subject: [PATCH] init --- package-lock.json | 222 ++++++++++++++++ package.json | 2 + src/App.tsx | 125 ++++++++- src/api/jiraClient.ts | 1 + src/components/BurnupChart.tsx | 49 +++- src/components/DashboardSettingsModal.tsx | 189 ++++++++++++- src/components/ExecutiveSummary.tsx | 19 +- src/components/ExportDashboardButton.tsx | 80 ++++++ src/components/LaneTicketsListView.tsx | 310 ++++++++++++++++++++++ src/components/ManagementOverview.tsx | 192 ++++++++++++++ src/components/MilestonesTimeline.tsx | 206 +++++++++++--- src/components/PhaseDistributionChart.tsx | 76 ++++++ src/components/PhaseLaneIcons.tsx | 13 +- src/components/PipelineOverview.tsx | 138 ++++++++++ src/components/ProjectRoadmapBar.tsx | 39 +++ src/components/StoryCard.tsx | 14 +- src/context/LaneLabelsContext.tsx | 19 ++ src/context/StatusBucketContext.tsx | 19 ++ src/lib/dashboardConfig.ts | 67 +++++ src/lib/executiveHealth.ts | 100 +++++++ src/lib/executiveKpis.ts | 67 +++-- src/lib/executiveLanding.ts | 110 ++++++++ src/lib/laneDetection.ts | 96 ++++++- src/lib/milestoneStatus.ts | 69 ++++- src/lib/phaseAggregate.ts | 13 + src/lib/statusBuckets.ts | 125 +++++++++ src/lib/storyMetrics.ts | 23 +- src/types/jira.ts | 2 + 28 files changed, 2269 insertions(+), 116 deletions(-) create mode 100644 src/components/ExportDashboardButton.tsx create mode 100644 src/components/LaneTicketsListView.tsx create mode 100644 src/components/ManagementOverview.tsx create mode 100644 src/components/PhaseDistributionChart.tsx create mode 100644 src/components/PipelineOverview.tsx create mode 100644 src/components/ProjectRoadmapBar.tsx create mode 100644 src/context/LaneLabelsContext.tsx create mode 100644 src/context/StatusBucketContext.tsx create mode 100644 src/lib/executiveHealth.ts create mode 100644 src/lib/executiveLanding.ts create mode 100644 src/lib/phaseAggregate.ts create mode 100644 src/lib/statusBuckets.ts diff --git a/package-lock.json b/package-lock.json index 42318b6..4a70481 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "0.0.0", "dependencies": { "axios": "^1.15.2", + "html2canvas": "^1.4.1", + "jspdf": "^4.2.1", "react": "^19.2.5", "react-dom": "^19.2.5", "recharts": "^3.8.1" @@ -23,6 +25,15 @@ "vite": "^8.0.10" } }, + "node_modules/@babel/runtime": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz", + "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@emnapi/core": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", @@ -794,6 +805,19 @@ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", "license": "MIT" }, + "node_modules/@types/pako": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz", + "integrity": "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==", + "license": "MIT" + }, + "node_modules/@types/raf": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", + "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==", + "license": "MIT", + "optional": true + }, "node_modules/@types/react": { "version": "19.2.14", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", @@ -814,6 +838,13 @@ "@types/react": "^19.2.0" } }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, "node_modules/@types/use-sync-external-store": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", @@ -870,6 +901,15 @@ "proxy-from-env": "^2.1.0" } }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -883,6 +923,26 @@ "node": ">= 0.4" } }, + "node_modules/canvg": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz", + "integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@babel/runtime": "^7.12.5", + "@types/raf": "^3.4.0", + "core-js": "^3.8.3", + "raf": "^3.4.1", + "regenerator-runtime": "^0.13.7", + "rgbcolor": "^1.0.1", + "stackblur-canvas": "^2.0.0", + "svg-pathdata": "^6.0.3" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -904,6 +964,27 @@ "node": ">= 0.8" } }, + "node_modules/core-js": { + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.49.0.tgz", + "integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "license": "MIT", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -1057,6 +1138,16 @@ "node": ">=8" } }, + "node_modules/dompurify": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.1.tgz", + "integrity": "sha512-JahakDAIg1gyOm7dlgWSDjV4n7Ip2PKR55NIT6jrMfIgLFgWo81vdr1/QGqWtFNRqXP9UV71oVePtjqS2ebnPw==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optional": true, + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -1146,6 +1237,17 @@ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", "license": "MIT" }, + "node_modules/fast-png": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/fast-png/-/fast-png-6.4.0.tgz", + "integrity": "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==", + "license": "MIT", + "dependencies": { + "@types/pako": "^2.0.3", + "iobuffer": "^5.3.2", + "pako": "^2.1.0" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -1164,6 +1266,12 @@ } } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, "node_modules/follow-redirects": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", @@ -1319,6 +1427,19 @@ "node": ">= 0.4" } }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "license": "MIT", + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/immer": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz", @@ -1338,6 +1459,12 @@ "node": ">=12" } }, + "node_modules/iobuffer": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/iobuffer/-/iobuffer-5.4.0.tgz", + "integrity": "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==", + "license": "MIT" + }, "node_modules/jiti": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", @@ -1348,6 +1475,23 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/jspdf": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-4.2.1.tgz", + "integrity": "sha512-YyAXyvnmjTbR4bHQRLzex3CuINCDlQnBqoSYyjJwTP2x9jDLuKDzy7aKUl0hgx3uhcl7xzg32agn5vlie6HIlQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.28.6", + "fast-png": "^6.2.0", + "fflate": "^0.8.1" + }, + "optionalDependencies": { + "canvg": "^3.0.11", + "core-js": "^3.6.0", + "dompurify": "^3.3.1", + "html2canvas": "^1.0.0-rc.5" + } + }, "node_modules/lightningcss": { "version": "1.32.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", @@ -1668,6 +1812,19 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", + "license": "(MIT AND Zlib)" + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT", + "optional": true + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -1726,6 +1883,16 @@ "node": ">=10" } }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "license": "MIT", + "optional": true, + "dependencies": { + "performance-now": "^2.1.0" + } + }, "node_modules/react": { "version": "19.2.5", "resolved": "https://registry.npmjs.org/react/-/react-19.2.5.tgz", @@ -1822,12 +1989,29 @@ "redux": "^5.0.0" } }, + "node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "license": "MIT", + "optional": true + }, "node_modules/reselect": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==", "license": "MIT" }, + "node_modules/rgbcolor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", + "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==", + "license": "MIT OR SEE LICENSE IN FEEL-FREE.md", + "optional": true, + "engines": { + "node": ">= 0.8.15" + } + }, "node_modules/rolldown": { "version": "1.0.0-rc.17", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.17.tgz", @@ -1878,6 +2062,26 @@ "node": ">=0.10.0" } }, + "node_modules/stackblur-canvas": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", + "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.14" + } + }, + "node_modules/svg-pathdata": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz", + "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/tailwindcss": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.4.tgz", @@ -1899,6 +2103,15 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "license": "MIT", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", @@ -1953,6 +2166,15 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "license": "MIT", + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, "node_modules/victory-vendor": { "version": "37.3.6", "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz", diff --git a/package.json b/package.json index 6727e91..167d728 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ }, "dependencies": { "axios": "^1.15.2", + "html2canvas": "^1.4.1", + "jspdf": "^4.2.1", "react": "^19.2.5", "react-dom": "^19.2.5", "recharts": "^3.8.1" diff --git a/src/App.tsx b/src/App.tsx index 8909940..d3468a7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,9 +1,19 @@ -import { useCallback, useEffect, useMemo, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import type { StoryGroup } from './types/jira' import { fetchAllIssuesByJql, MIGRATION_EPIC_KEY, MIGRATION_JQL, jiraClient } from './api/jiraClient' import { groupSubtasksUnderStories } from './lib/groupIssues' -import { statusToPhase } from './lib/statusPhase' import { appendBurnupSnapshot, loadBurnupHistory, type BurnupPoint } from './lib/burnupHistory' +import { isIssueDone } from './lib/statusBuckets' +import { computeLandingEstimate } from './lib/executiveLanding' +import { + computeVerdict, + criticalMilestoneImpactMessages, + deadlineHealthScore, + latestMilestoneDateIso, + resourceHealthScore, + scopeCompletionPercent, +} from './lib/executiveHealth' +import { countSubtasksByPhase } from './lib/phaseAggregate' import { loadDashboardConfig, saveDashboardConfig, @@ -18,10 +28,18 @@ import { BoardView } from './components/BoardView' import { DashboardSkeleton } from './components/DashboardSkeleton' import { MilestonesTimeline } from './components/MilestonesTimeline' import { DashboardSettingsModal } from './components/DashboardSettingsModal' +import { ManagementOverview } from './components/ManagementOverview' +import { PhaseDistributionChart } from './components/PhaseDistributionChart' +import { ExportDashboardButton } from './components/ExportDashboardButton' +import { StatusBucketProvider } from './context/StatusBucketContext' +import { LaneLabelsProvider } from './context/LaneLabelsContext' +import { PipelineOverview } from './components/PipelineOverview' +import { LaneTicketsListView } from './components/LaneTicketsListView' type ViewMode = 'list' | 'board' export default function App() { + const dashboardRef = useRef(null) const [groups, setGroups] = useState([]) const [loading, setLoading] = useState(true) const [error, setError] = useState(null) @@ -31,6 +49,9 @@ export default function App() { const [dashboardCfg, setDashboardCfg] = useState(() => loadDashboardConfig()) const [settingsOpen, setSettingsOpen] = useState(false) + const statusBucketsRef = useRef(dashboardCfg.statusBuckets) + statusBucketsRef.current = dashboardCfg.statusBuckets + const myViewActive = Boolean(dashboardCfg.myViewActive) const displayGroups = useMemo(() => { @@ -40,6 +61,67 @@ export default function App() { ) }, [groups, myViewActive, dashboardCfg]) + const landing = useMemo( + () => + computeLandingEstimate( + groups, + burnupData, + dashboardCfg.teamCapacity, + dashboardCfg.baselineCapacity, + dashboardCfg.statusBuckets, + ), + [ + groups, + burnupData, + dashboardCfg.teamCapacity, + dashboardCfg.baselineCapacity, + dashboardCfg.statusBuckets, + ], + ) + + const finalMilestoneIso = useMemo( + () => latestMilestoneDateIso(dashboardCfg.milestones), + [dashboardCfg.milestones], + ) + + const health = useMemo(() => { + const deadlineScore = deadlineHealthScore(landing.estimatedLanding, finalMilestoneIso) + const scopeScore = scopeCompletionPercent(groups, dashboardCfg.statusBuckets) + const resourceScore = resourceHealthScore( + landing.remainingSubtasks, + dashboardCfg.teamCapacity, + dashboardCfg.wipSlotsPerDev, + ) + const verdict = computeVerdict(deadlineScore, scopeScore, resourceScore) + return { deadlineScore, scopeScore, resourceScore, verdict } + }, [ + landing.estimatedLanding, + landing.remainingSubtasks, + finalMilestoneIso, + groups, + dashboardCfg.teamCapacity, + dashboardCfg.wipSlotsPerDev, + dashboardCfg.statusBuckets, + ]) + + const impactMessages = useMemo( + () => + criticalMilestoneImpactMessages( + dashboardCfg.milestones, + groups, + landing.effectiveVelocityPerDay, + dashboardCfg.statusBuckets, + ), + [ + dashboardCfg.milestones, + dashboardCfg.statusBuckets, + groups, + landing.effectiveVelocityPerDay, + ], + ) + + const phaseCounts = useMemo(() => countSubtasksByPhase(groups), [groups]) + const toggleMyView = () => { const next: DashboardConfig = { ...dashboardCfg, myViewActive: !myViewActive } setDashboardCfg(next) @@ -61,10 +143,9 @@ export default function App() { setUpdatedAt(new Date()) const totalSubs = grouped.reduce((acc, g) => acc + g.subtasks.length, 0) + const cfg = statusBucketsRef.current const doneSubs = grouped.reduce( - (acc, g) => - acc + - g.subtasks.filter((s) => statusToPhase(s.fields.status.name) === 'done').length, + (acc, g) => acc + g.subtasks.filter((s) => isIssueDone(s, cfg)).length, 0, ) setBurnupData(appendBurnupSnapshot(doneSubs, totalSubs)) @@ -99,6 +180,8 @@ export default function App() { const baseOk = import.meta.env.DEV ? true : Boolean(jiraClient.defaults.baseURL) return ( + +
@@ -162,6 +245,9 @@ export default function App() {
+ {!loading && groups.length > 0 && ( + + )} {updatedAt && !loading && ( Mis à jour {updatedAt.toLocaleTimeString('fr-FR')} @@ -206,20 +292,37 @@ export default function App() { )} {!loading && !error && groups.length > 0 && ( - <> +
setSettingsOpen(true)} + impactMessages={impactMessages} + /> + + -
+ + + + +

- Burnup + Reporting

- +
+ + +
@@ -248,7 +351,7 @@ export default function App() { )}
- +
)} @@ -259,5 +362,7 @@ export default function App() { onSave={saveSettings} />
+ + ) } diff --git a/src/api/jiraClient.ts b/src/api/jiraClient.ts index 58d9e23..c091dba 100644 --- a/src/api/jiraClient.ts +++ b/src/api/jiraClient.ts @@ -84,6 +84,7 @@ export async function fetchAllIssuesByJql( 'priority', 'assignee', 'timetracking', + 'labels', storyPointsField, ] as const diff --git a/src/components/BurnupChart.tsx b/src/components/BurnupChart.tsx index ad61de9..72180c5 100644 --- a/src/components/BurnupChart.tsx +++ b/src/components/BurnupChart.tsx @@ -1,5 +1,6 @@ import { CartesianGrid, + Legend, Line, LineChart, ResponsiveContainer, @@ -13,6 +14,16 @@ type Props = { data: BurnupPoint[] } +function withIdealLine(points: BurnupPoint[]): (BurnupPoint & { ideal: number })[] { + if (points.length === 0) return [] + const target = points[points.length - 1]!.total + const n = points.length + return points.map((p, i) => ({ + ...p, + ideal: n <= 1 ? target : (i / (n - 1)) * target, + })) +} + export function BurnupChart({ data }: Props) { if (data.length === 0) { return ( @@ -22,18 +33,21 @@ export function BurnupChart({ data }: Props) { ) } + const chartData = withIdealLine(data) + return ( -
-

- Burnup — terminés vs périmètre +

+

+ Burn-up — objectif vs réalisé

- - +
+ + d.slice(5)} + tickFormatter={(d) => String(d).slice(5)} /> `Date : ${l}`} /> + + - - + + +
) } diff --git a/src/components/DashboardSettingsModal.tsx b/src/components/DashboardSettingsModal.tsx index 3adda58..b9f678a 100644 --- a/src/components/DashboardSettingsModal.tsx +++ b/src/components/DashboardSettingsModal.tsx @@ -3,9 +3,57 @@ import { exportConfigJson, mergeImportedConfig, type DashboardConfig, + type LaneLabelsConfig, type Milestone, + type StatusBucketConfig, } from '../lib/dashboardConfig' +function parseBucketLines(raw: string): string[] { + return raw + .split(/[\n,;]+/) + .map((s) => s.trim()) + .filter(Boolean) +} + +const BUCKET_FIELD_DEFS: { + key: keyof StatusBucketConfig + title: string + hint: string +}[] = [ + { key: 'todo', title: 'À faire', hint: 'Ex. À faire, Open, Backlog' }, + { key: 'in_progress', title: 'En cours', hint: 'Ex. In Progress, Code Review, Recette' }, + { key: 'blocked', title: 'Bloqué', hint: 'Ex. Bloqué, Blocked' }, + { key: 'done', title: 'Terminé', hint: 'Ex. Done, Terminé, Closed, Livré' }, + { key: 'cancel', title: 'Annulé', hint: 'Ex. Annulé, Cancelled, Won\'t fix' }, +] + +const LANE_LABEL_FIELD_DEFS: { + key: keyof LaneLabelsConfig + title: string + hint: string +}[] = [ + { + key: 'analyse', + title: 'Piste Analyse', + hint: 'Étiquettes Jira comptées comme Analyse (ex. analyse). Une par ligne ou virgules.', + }, + { + key: 'design', + title: 'Piste Design', + hint: 'Ex. design, maquette (si vous utilisez ces étiquettes en Jira).', + }, + { + key: 'integration', + title: 'Piste Intégration', + hint: 'Ex. integration — ou tout libellé d’étiquette utilisé côté dev / recette.', + }, + { + key: 'blocked', + title: 'Marquage bloqué (étiquettes)', + hint: 'Ex. blocked : les tickets portant l’une de ces étiquettes sont signalés comme bloqués par étiquette (liste et tooltips).', + }, +] + type Props = { open: boolean config: DashboardConfig @@ -19,6 +67,7 @@ function newMilestone(): Milestone { title: '', date: new Date().toISOString().slice(0, 10), linkedStoryKeys: [], + critical: false, } } @@ -96,6 +145,66 @@ export function DashboardSettingsModal({ open, config, onClose, onSave }: Props)
+
+

+ Capacité & reporting +

+
+
+ + + setDraft((d) => ({ + ...d, + teamCapacity: Math.max(0.25, Number(e.target.value) || 0.25), + })) + } + /> +
+
+ + + setDraft((d) => ({ + ...d, + baselineCapacity: Math.max(0.25, Number(e.target.value) || 0.25), + })) + } + /> +
+
+ + + setDraft((d) => ({ + ...d, + wipSlotsPerDev: Math.max(1, Math.floor(Number(e.target.value) || 1)), + })) + } + /> +
+
+

+ La date d’atterrissage utilise : vélocité × (effectif / baseline). WIP = créneaux + nominaux pour la jauge « Ressources ». +

+
+
+
+

+ Cartographie des statuts Jira +

+

+ Libellés exacts des statuts dans Jira (un par ligne ou séparés par des virgules). La + comparaison ignore casse et accents. Si un statut n’est dans aucune liste, la catégorie + Jira (nouveau, en cours, terminé) sert de secours. Les listes vides au prochain + chargement reprennent les valeurs par défaut. +

+
+ {BUCKET_FIELD_DEFS.map(({ key, title, hint }) => ( +
+ +

{hint}

+