@burdenoff/microfe-planmagnet 2026.930.14 → 2026.930.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/planmagnet/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +162 -129
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +243 -227
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/comments/RoadmapComments.d.ts +29 -0
- package/dist/planmagnet/comments/RoadmapComments.d.ts.map +1 -0
- package/dist/planmagnet/comments/RoadmapComments.js +310 -0
- package/dist/planmagnet/comments/RoadmapComments.js.map +1 -0
- package/dist/planmagnet/dashboards/DashboardUI.d.ts +79 -0
- package/dist/planmagnet/dashboards/DashboardUI.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/DashboardUI.js +126 -0
- package/dist/planmagnet/dashboards/DashboardUI.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/DeliveryTimelineCard.d.ts +7 -0
- package/dist/planmagnet/dashboards/cards/DeliveryTimelineCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/DeliveryTimelineCard.js +92 -0
- package/dist/planmagnet/dashboards/cards/DeliveryTimelineCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/ObjectivesProgressCard.d.ts +7 -0
- package/dist/planmagnet/dashboards/cards/ObjectivesProgressCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/ObjectivesProgressCard.js +68 -0
- package/dist/planmagnet/dashboards/cards/ObjectivesProgressCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/PortfolioHealthCard.d.ts +5 -0
- package/dist/planmagnet/dashboards/cards/PortfolioHealthCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/PortfolioHealthCard.js +118 -0
- package/dist/planmagnet/dashboards/cards/PortfolioHealthCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/QualityMetricsCard.d.ts +8 -0
- package/dist/planmagnet/dashboards/cards/QualityMetricsCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/QualityMetricsCard.js +94 -0
- package/dist/planmagnet/dashboards/cards/QualityMetricsCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/RiskSeverityCard.d.ts +6 -0
- package/dist/planmagnet/dashboards/cards/RiskSeverityCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/RiskSeverityCard.js +90 -0
- package/dist/planmagnet/dashboards/cards/RiskSeverityCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/RoadmapHorizonCard.d.ts +5 -0
- package/dist/planmagnet/dashboards/cards/RoadmapHorizonCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/RoadmapHorizonCard.js +242 -0
- package/dist/planmagnet/dashboards/cards/RoadmapHorizonCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.d.ts +5 -0
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.js +125 -0
- package/dist/planmagnet/dashboards/cards/SprintCapacityCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/TaskCompletionCard.d.ts +6 -0
- package/dist/planmagnet/dashboards/cards/TaskCompletionCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/TaskCompletionCard.js +85 -0
- package/dist/planmagnet/dashboards/cards/TaskCompletionCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/TeamCapacityCard.d.ts +10 -0
- package/dist/planmagnet/dashboards/cards/TeamCapacityCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/TeamCapacityCard.js +115 -0
- package/dist/planmagnet/dashboards/cards/TeamCapacityCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/TeamOverviewCard.d.ts +5 -0
- package/dist/planmagnet/dashboards/cards/TeamOverviewCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/TeamOverviewCard.js +70 -0
- package/dist/planmagnet/dashboards/cards/TeamOverviewCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/TeamWorkloadCard.d.ts +9 -0
- package/dist/planmagnet/dashboards/cards/TeamWorkloadCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/TeamWorkloadCard.js +373 -0
- package/dist/planmagnet/dashboards/cards/TeamWorkloadCard.js.map +1 -0
- package/dist/planmagnet/dashboards/cards/TimeLoggedCard.d.ts +8 -0
- package/dist/planmagnet/dashboards/cards/TimeLoggedCard.d.ts.map +1 -0
- package/dist/planmagnet/dashboards/cards/TimeLoggedCard.js +247 -0
- package/dist/planmagnet/dashboards/cards/TimeLoggedCard.js.map +1 -0
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.d.ts +8 -0
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.js +61 -0
- package/dist/planmagnet/pages/DashboardsExecutivePagePage.js.map +1 -0
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.d.ts +8 -0
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.js +62 -0
- package/dist/planmagnet/pages/DashboardsLeadershipPagePage.js.map +1 -0
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.d.ts +7 -0
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js +117 -0
- package/dist/planmagnet/pages/DashboardsProjectManagerPagePage.js.map +1 -0
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.d.ts +6 -0
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js +84 -0
- package/dist/planmagnet/pages/DashboardsTeamUtilizationPagePage.js.map +1 -0
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +130 -112
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/analytics/SprintDeliveryCards.d.ts +10 -0
- package/dist/planmagnet/pages/analytics/SprintDeliveryCards.d.ts.map +1 -0
- package/dist/planmagnet/pages/analytics/SprintDeliveryCards.js +219 -0
- package/dist/planmagnet/pages/analytics/SprintDeliveryCards.js.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +157 -151
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapReviewPanel.d.ts +4 -0
- package/dist/planmagnet/roadmaps/RoadmapReviewPanel.d.ts.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapReviewPanel.js +370 -0
- package/dist/planmagnet/roadmaps/RoadmapReviewPanel.js.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.d.ts +4 -0
- package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.d.ts.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.js +396 -0
- package/dist/planmagnet/roadmaps/RoadmapVersionsPanel.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { DashboardCard as e, StatTile as t, ratePercentLabel as n } from "../DashboardUI.js";
|
|
2
|
+
import { Bug as r } from "lucide-react";
|
|
3
|
+
import { gql as i } from "@apollo/client";
|
|
4
|
+
import { useQuery as a } from "@apollo/client/react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
//#region src/planmagnet/dashboards/cards/QualityMetricsCard.tsx
|
|
8
|
+
var l = i`
|
|
9
|
+
query DashboardQualityMetrics(
|
|
10
|
+
$workspaceId: ID!
|
|
11
|
+
$projectId: ID
|
|
12
|
+
$startDate: DateTime
|
|
13
|
+
$endDate: DateTime
|
|
14
|
+
) {
|
|
15
|
+
planmagnetQualityMetrics(
|
|
16
|
+
workspaceId: $workspaceId
|
|
17
|
+
projectId: $projectId
|
|
18
|
+
startDate: $startDate
|
|
19
|
+
endDate: $endDate
|
|
20
|
+
) {
|
|
21
|
+
bugsOpened
|
|
22
|
+
bugsResolved
|
|
23
|
+
defectRatio
|
|
24
|
+
openBugs
|
|
25
|
+
gatePassRate
|
|
26
|
+
meanTimeToResolveHours
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
function u(e) {
|
|
31
|
+
return e == null ? "—" : e < 48 ? `${e < 10 ? e.toFixed(1) : Math.round(e)} h` : `${(e / 24).toFixed(1)} d`;
|
|
32
|
+
}
|
|
33
|
+
function d({ workspaceId: i, projectId: d, startDate: f, endDate: p, onDrillDown: m }) {
|
|
34
|
+
let { t: h } = c(), { data: g, loading: _, error: v } = a(l, {
|
|
35
|
+
variables: {
|
|
36
|
+
workspaceId: i,
|
|
37
|
+
projectId: d,
|
|
38
|
+
startDate: f,
|
|
39
|
+
endDate: p
|
|
40
|
+
},
|
|
41
|
+
skip: !i || !d
|
|
42
|
+
}), y = g?.planmagnetQualityMetrics;
|
|
43
|
+
return /* @__PURE__ */ o(e, {
|
|
44
|
+
icon: /* @__PURE__ */ o(r, { className: "h-4 w-4" }),
|
|
45
|
+
title: h("planmagnet.dashboards.pm.quality.title", "Quality & defects"),
|
|
46
|
+
definition: h("planmagnet.dashboards.pm.quality.definition", "Bugs opened/resolved and quality-gate pass rate for the selected project, last 30 days."),
|
|
47
|
+
loading: _ && !g,
|
|
48
|
+
error: v,
|
|
49
|
+
empty: !d,
|
|
50
|
+
emptyMessage: h("planmagnet.dashboards.pm.quality.noProject", "Select a project above."),
|
|
51
|
+
drillDown: {
|
|
52
|
+
label: h("planmagnet.dashboards.pm.quality.drillDown", "Open quality gates"),
|
|
53
|
+
onClick: m
|
|
54
|
+
},
|
|
55
|
+
children: y ? /* @__PURE__ */ s("div", {
|
|
56
|
+
className: "space-y-3",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ s("div", {
|
|
59
|
+
className: "grid grid-cols-2 gap-3",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ o(t, {
|
|
62
|
+
label: h("planmagnet.dashboards.pm.quality.opened", "Bugs opened (30d)"),
|
|
63
|
+
value: String(y.bugsOpened)
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ o(t, {
|
|
66
|
+
label: h("planmagnet.dashboards.pm.quality.resolved", "Bugs resolved (30d)"),
|
|
67
|
+
value: String(y.bugsResolved)
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ o(t, {
|
|
70
|
+
label: h("planmagnet.dashboards.pm.quality.open", "Open bugs now"),
|
|
71
|
+
value: String(y.openBugs)
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ o(t, {
|
|
74
|
+
label: h("planmagnet.dashboards.pm.quality.mttr", "Mean time to resolve"),
|
|
75
|
+
value: u(y.meanTimeToResolveHours)
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ s("div", {
|
|
80
|
+
className: "flex items-center justify-between text-xs text-muted-foreground",
|
|
81
|
+
children: [/* @__PURE__ */ o("span", { children: h("planmagnet.dashboards.pm.quality.defectRatio", "Defect ratio") }), /* @__PURE__ */ o("span", { children: y.defectRatio == null ? h("planmagnet.dashboards.pm.quality.noNonBugWork", "no non-bug work done in range") : y.defectRatio.toFixed(2) })]
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ s("div", {
|
|
84
|
+
className: "flex items-center justify-between text-xs text-muted-foreground",
|
|
85
|
+
children: [/* @__PURE__ */ o("span", { children: h("planmagnet.dashboards.pm.quality.gatePassRate", "Quality gate pass rate") }), /* @__PURE__ */ o("span", { children: n(y.gatePassRate) })]
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
}) : null
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { d as QualityMetricsCard };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=QualityMetricsCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QualityMetricsCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/QualityMetricsCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Bug } from 'lucide-react';\nimport { DashboardCard, StatTile, ratePercentLabel } from '../DashboardUI';\n\n/** Quality/defects (ANR-07): `planmagnetQualityMetrics` (ANR-20) for one project, over the trailing 30 days. */\nconst GET_QUALITY_METRICS = gql`\n query DashboardQualityMetrics(\n $workspaceId: ID!\n $projectId: ID\n $startDate: DateTime\n $endDate: DateTime\n ) {\n planmagnetQualityMetrics(\n workspaceId: $workspaceId\n projectId: $projectId\n startDate: $startDate\n endDate: $endDate\n ) {\n bugsOpened\n bugsResolved\n defectRatio\n openBugs\n gatePassRate\n meanTimeToResolveHours\n }\n }\n`;\n\ninterface QualityMetricsData {\n planmagnetQualityMetrics: {\n bugsOpened: number;\n bugsResolved: number;\n defectRatio: number | null;\n openBugs: number;\n gatePassRate: number | null;\n meanTimeToResolveHours: number | null;\n };\n}\n\nfunction formatResolveTime(hours: number | null): string {\n if (hours == null) return '—';\n if (hours < 48) return `${hours < 10 ? hours.toFixed(1) : Math.round(hours)} h`;\n return `${(hours / 24).toFixed(1)} d`;\n}\n\nexport function QualityMetricsCard({\n workspaceId,\n projectId,\n startDate,\n endDate,\n onDrillDown,\n}: {\n workspaceId?: string | null;\n projectId: string;\n startDate: string;\n endDate: string;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<QualityMetricsData>(GET_QUALITY_METRICS, {\n variables: { workspaceId, projectId, startDate, endDate },\n skip: !workspaceId || !projectId,\n });\n const q = data?.planmagnetQualityMetrics;\n\n return (\n <DashboardCard\n icon={<Bug className=\"h-4 w-4\" />}\n title={t('planmagnet.dashboards.pm.quality.title', 'Quality & defects')}\n definition={t(\n 'planmagnet.dashboards.pm.quality.definition',\n 'Bugs opened/resolved and quality-gate pass rate for the selected project, last 30 days.'\n )}\n loading={loading && !data}\n error={error}\n empty={!projectId}\n emptyMessage={t('planmagnet.dashboards.pm.quality.noProject', 'Select a project above.')}\n drillDown={{\n label: t('planmagnet.dashboards.pm.quality.drillDown', 'Open quality gates'),\n onClick: onDrillDown,\n }}\n >\n {q ? (\n <div className=\"space-y-3\">\n <div className=\"grid grid-cols-2 gap-3\">\n <StatTile\n label={t('planmagnet.dashboards.pm.quality.opened', 'Bugs opened (30d)')}\n value={String(q.bugsOpened)}\n />\n <StatTile\n label={t('planmagnet.dashboards.pm.quality.resolved', 'Bugs resolved (30d)')}\n value={String(q.bugsResolved)}\n />\n <StatTile\n label={t('planmagnet.dashboards.pm.quality.open', 'Open bugs now')}\n value={String(q.openBugs)}\n />\n <StatTile\n label={t('planmagnet.dashboards.pm.quality.mttr', 'Mean time to resolve')}\n value={formatResolveTime(q.meanTimeToResolveHours)}\n />\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{t('planmagnet.dashboards.pm.quality.defectRatio', 'Defect ratio')}</span>\n <span>\n {q.defectRatio == null\n ? t(\n 'planmagnet.dashboards.pm.quality.noNonBugWork',\n 'no non-bug work done in range'\n )\n : q.defectRatio.toFixed(2)}\n </span>\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>\n {t('planmagnet.dashboards.pm.quality.gatePassRate', 'Quality gate pass rate')}\n </span>\n <span>{ratePercentLabel(q.gatePassRate)}</span>\n </div>\n </div>\n ) : null}\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;AAOA,IAAM,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;;AAkC/B,SAAS,EAAkB,GAA8B;AAGvD,QAFI,KAAS,OAAa,MACtB,IAAQ,KAAW,GAAG,IAAQ,KAAK,EAAM,QAAQ,EAAE,GAAG,KAAK,MAAM,EAAM,CAAC,MACrE,IAAI,IAAQ,IAAI,QAAQ,EAAE,CAAC;;AAGpC,SAAgB,EAAmB,EACjC,gBACA,cACA,cACA,YACA,kBAOC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,YAAS,aAAU,EAA6B,GAAqB;EACjF,WAAW;GAAE;GAAa;GAAW;GAAW;GAAS;EACzD,MAAM,CAAC,KAAe,CAAC;EACxB,CAAC,EACI,IAAI,GAAM;AAEhB,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAK,WAAU,WAAY,CAAA;EACjC,OAAO,EAAE,0CAA0C,oBAAoB;EACvE,YAAY,EACV,+CACA,0FACD;EACD,SAAS,KAAW,CAAC;EACd;EACP,OAAO,CAAC;EACR,cAAc,EAAE,8CAA8C,0BAA0B;EACxF,WAAW;GACT,OAAO,EAAE,8CAA8C,qBAAqB;GAC5E,SAAS;GACV;YAEA,IACC,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD;OACE,OAAO,EAAE,2CAA2C,oBAAoB;OACxE,OAAO,OAAO,EAAE,WAAW;OAC3B,CAAA;MACF,kBAAC,GAAD;OACE,OAAO,EAAE,6CAA6C,sBAAsB;OAC5E,OAAO,OAAO,EAAE,aAAa;OAC7B,CAAA;MACF,kBAAC,GAAD;OACE,OAAO,EAAE,yCAAyC,gBAAgB;OAClE,OAAO,OAAO,EAAE,SAAS;OACzB,CAAA;MACF,kBAAC,GAAD;OACE,OAAO,EAAE,yCAAyC,uBAAuB;OACzE,OAAO,EAAkB,EAAE,uBAAuB;OAClD,CAAA;MACE;;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD,EAAA,UAAO,EAAE,gDAAgD,eAAe,EAAQ,CAAA,EAChF,kBAAC,QAAD,EAAA,UACG,EAAE,eAAe,OACd,EACE,iDACA,gCACD,GACD,EAAE,YAAY,QAAQ,EAAE,EACvB,CAAA,CACH;;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD,EAAA,UACG,EAAE,iDAAiD,yBAAyB,EACxE,CAAA,EACP,kBAAC,QAAD,EAAA,UAAO,EAAiB,EAAE,aAAa,EAAQ,CAAA,CAC3C;;IACF;OACJ;EACU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RiskSeverityCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/RiskSeverityCard.tsx"],"names":[],"mappings":"AA8CA,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,SAAS,EACT,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CAyDA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { DashboardCard as e } from "../DashboardUI.js";
|
|
2
|
+
import { ShieldAlert as t } from "lucide-react";
|
|
3
|
+
import { gql as n } from "@apollo/client";
|
|
4
|
+
import { useQuery as r } from "@apollo/client/react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { Badge as s } from "@burdenoff/fe-libs/ui";
|
|
8
|
+
//#region src/planmagnet/dashboards/cards/RiskSeverityCard.tsx
|
|
9
|
+
var c = n`
|
|
10
|
+
query DashboardProjectRisks($workspaceId: ID!, $projectId: String!) {
|
|
11
|
+
planmagnetRisks(
|
|
12
|
+
workspaceId: $workspaceId
|
|
13
|
+
filter: { projectId: $projectId }
|
|
14
|
+
pagination: { first: 100 }
|
|
15
|
+
) {
|
|
16
|
+
items {
|
|
17
|
+
id
|
|
18
|
+
severity
|
|
19
|
+
status
|
|
20
|
+
}
|
|
21
|
+
totalCount
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`, l = new Set([
|
|
25
|
+
"ACCEPTED",
|
|
26
|
+
"RESOLVED",
|
|
27
|
+
"CLOSED"
|
|
28
|
+
]), u = [
|
|
29
|
+
"CRITICAL",
|
|
30
|
+
"HIGH",
|
|
31
|
+
"MEDIUM",
|
|
32
|
+
"LOW",
|
|
33
|
+
"NEGLIGIBLE"
|
|
34
|
+
], d = {
|
|
35
|
+
CRITICAL: "destructive",
|
|
36
|
+
HIGH: "destructive",
|
|
37
|
+
MEDIUM: "warning",
|
|
38
|
+
LOW: "secondary",
|
|
39
|
+
NEGLIGIBLE: "secondary"
|
|
40
|
+
};
|
|
41
|
+
function f({ workspaceId: n, projectId: f, onDrillDown: p }) {
|
|
42
|
+
let { t: m } = o(), { data: h, loading: g, error: _ } = r(c, {
|
|
43
|
+
variables: {
|
|
44
|
+
workspaceId: n,
|
|
45
|
+
projectId: f
|
|
46
|
+
},
|
|
47
|
+
skip: !n || !f
|
|
48
|
+
}), v = h?.planmagnetRisks.items ?? [], y = h?.planmagnetRisks.totalCount ?? v.length, b = v.filter((e) => !l.has(e.status)), x = /* @__PURE__ */ new Map();
|
|
49
|
+
for (let e of b) x.set(e.severity, (x.get(e.severity) ?? 0) + 1);
|
|
50
|
+
return /* @__PURE__ */ i(e, {
|
|
51
|
+
icon: /* @__PURE__ */ i(t, { className: "h-4 w-4" }),
|
|
52
|
+
title: m("planmagnet.dashboards.pm.risks.title", "Risk & issue tracking"),
|
|
53
|
+
definition: m("planmagnet.dashboards.pm.risks.definition", "Open risks for the selected project, by severity."),
|
|
54
|
+
loading: g && !h,
|
|
55
|
+
error: _,
|
|
56
|
+
empty: !f,
|
|
57
|
+
emptyMessage: m("planmagnet.dashboards.pm.risks.noProject", "Select a project above."),
|
|
58
|
+
drillDown: {
|
|
59
|
+
label: m("planmagnet.dashboards.pm.risks.drillDown", "Open risk register"),
|
|
60
|
+
onClick: p
|
|
61
|
+
},
|
|
62
|
+
children: f ? /* @__PURE__ */ a("div", {
|
|
63
|
+
className: "space-y-3",
|
|
64
|
+
children: [y > v.length ? /* @__PURE__ */ i("p", {
|
|
65
|
+
className: "text-xs text-muted-foreground",
|
|
66
|
+
children: m("planmagnet.dashboards.pm.risks.capped", "Counted from the first {{shown}} of {{total}} risks for this project.", {
|
|
67
|
+
shown: v.length,
|
|
68
|
+
total: y
|
|
69
|
+
})
|
|
70
|
+
}) : null, b.length === 0 ? /* @__PURE__ */ i("p", {
|
|
71
|
+
className: "text-sm text-muted-foreground",
|
|
72
|
+
children: m("planmagnet.dashboards.pm.risks.noneOpen", "No open risks for this project.")
|
|
73
|
+
}) : /* @__PURE__ */ i("div", {
|
|
74
|
+
className: "flex flex-wrap gap-2",
|
|
75
|
+
children: u.filter((e) => x.has(e)).map((e) => /* @__PURE__ */ a(s, {
|
|
76
|
+
variant: d[e],
|
|
77
|
+
children: [
|
|
78
|
+
e.toLowerCase(),
|
|
79
|
+
": ",
|
|
80
|
+
x.get(e)
|
|
81
|
+
]
|
|
82
|
+
}, e))
|
|
83
|
+
})]
|
|
84
|
+
}) : null
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { f as RiskSeverityCard };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=RiskSeverityCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RiskSeverityCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/RiskSeverityCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Badge } from '@burdenoff/fe-libs/ui';\nimport { ShieldAlert } from 'lucide-react';\nimport { DashboardCard } from '../DashboardUI';\n\n/** Risk/issue tracking (ANR-07): open risks by severity for one project. `RiskStatus.ACCEPTED/RESOLVED/CLOSED`\n * are terminal — the same \"open\" definition `releases/ReleaseReadinessCard.tsx`'s CLOSED_RISK set uses. */\nconst GET_PROJECT_RISKS = gql`\n query DashboardProjectRisks($workspaceId: ID!, $projectId: String!) {\n planmagnetRisks(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n severity\n status\n }\n totalCount\n }\n }\n`;\n\ninterface RiskRow {\n id: string;\n severity: string;\n status: string;\n}\n\ninterface ProjectRisksData {\n planmagnetRisks: { items: RiskRow[]; totalCount: number };\n}\n\nconst CLOSED_STATUSES = new Set(['ACCEPTED', 'RESOLVED', 'CLOSED']);\nconst SEVERITY_ORDER = ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW', 'NEGLIGIBLE'] as const;\nconst SEVERITY_BADGE: Record<string, 'destructive' | 'warning' | 'secondary'> = {\n CRITICAL: 'destructive',\n HIGH: 'destructive',\n MEDIUM: 'warning',\n LOW: 'secondary',\n NEGLIGIBLE: 'secondary',\n};\n\nexport function RiskSeverityCard({\n workspaceId,\n projectId,\n onDrillDown,\n}: {\n workspaceId?: string | null;\n projectId: string;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<ProjectRisksData>(GET_PROJECT_RISKS, {\n variables: { workspaceId, projectId },\n skip: !workspaceId || !projectId,\n });\n const items = data?.planmagnetRisks.items ?? [];\n const totalCount = data?.planmagnetRisks.totalCount ?? items.length;\n const open = items.filter((r) => !CLOSED_STATUSES.has(r.status));\n const bySeverity = new Map<string, number>();\n for (const r of open) bySeverity.set(r.severity, (bySeverity.get(r.severity) ?? 0) + 1);\n\n return (\n <DashboardCard\n icon={<ShieldAlert className=\"h-4 w-4\" />}\n title={t('planmagnet.dashboards.pm.risks.title', 'Risk & issue tracking')}\n definition={t(\n 'planmagnet.dashboards.pm.risks.definition',\n 'Open risks for the selected project, by severity.'\n )}\n loading={loading && !data}\n error={error}\n empty={!projectId}\n emptyMessage={t('planmagnet.dashboards.pm.risks.noProject', 'Select a project above.')}\n drillDown={{\n label: t('planmagnet.dashboards.pm.risks.drillDown', 'Open risk register'),\n onClick: onDrillDown,\n }}\n >\n {projectId ? (\n <div className=\"space-y-3\">\n {totalCount > items.length ? (\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'planmagnet.dashboards.pm.risks.capped',\n 'Counted from the first {{shown}} of {{total}} risks for this project.',\n { shown: items.length, total: totalCount }\n )}\n </p>\n ) : null}\n {open.length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.dashboards.pm.risks.noneOpen', 'No open risks for this project.')}\n </p>\n ) : (\n <div className=\"flex flex-wrap gap-2\">\n {SEVERITY_ORDER.filter((s) => bySeverity.has(s)).map((severity) => (\n <Badge key={severity} variant={SEVERITY_BADGE[severity]}>\n {severity.toLowerCase()}: {bySeverity.get(severity)}\n </Badge>\n ))}\n </div>\n )}\n </div>\n ) : null}\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;;AASA,IAAM,IAAoB,CAAG;;;;;;;;;;;;;;;GA2BvB,IAAkB,IAAI,IAAI;CAAC;CAAY;CAAY;CAAS,CAAC,EAC7D,IAAiB;CAAC;CAAY;CAAQ;CAAU;CAAO;CAAa,EACpE,IAA0E;CAC9E,UAAU;CACV,MAAM;CACN,QAAQ;CACR,KAAK;CACL,YAAY;CACb;AAED,SAAgB,EAAiB,EAC/B,gBACA,cACA,kBAKC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,YAAS,aAAU,EAA2B,GAAmB;EAC7E,WAAW;GAAE;GAAa;GAAW;EACrC,MAAM,CAAC,KAAe,CAAC;EACxB,CAAC,EACI,IAAQ,GAAM,gBAAgB,SAAS,EAAE,EACzC,IAAa,GAAM,gBAAgB,cAAc,EAAM,QACvD,IAAO,EAAM,QAAQ,MAAM,CAAC,EAAgB,IAAI,EAAE,OAAO,CAAC,EAC1D,oBAAa,IAAI,KAAqB;AAC5C,MAAK,IAAM,KAAK,EAAM,GAAW,IAAI,EAAE,WAAW,EAAW,IAAI,EAAE,SAAS,IAAI,KAAK,EAAE;AAEvF,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAa,WAAU,WAAY,CAAA;EACzC,OAAO,EAAE,wCAAwC,wBAAwB;EACzE,YAAY,EACV,6CACA,oDACD;EACD,SAAS,KAAW,CAAC;EACd;EACP,OAAO,CAAC;EACR,cAAc,EAAE,4CAA4C,0BAA0B;EACtF,WAAW;GACT,OAAO,EAAE,4CAA4C,qBAAqB;GAC1E,SAAS;GACV;YAEA,IACC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,IAAa,EAAM,SAClB,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,yCACA,yEACA;KAAE,OAAO,EAAM;KAAQ,OAAO;KAAY,CAC3C;IACC,CAAA,GACF,MACH,EAAK,WAAW,IACf,kBAAC,KAAD;IAAG,WAAU;cACV,EAAE,2CAA2C,kCAAkC;IAC9E,CAAA,GAEJ,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAe,QAAQ,MAAM,EAAW,IAAI,EAAE,CAAC,CAAC,KAAK,MACpD,kBAAC,GAAD;KAAsB,SAAS,EAAe;eAA9C;MACG,EAAS,aAAa;MAAC;MAAG,EAAW,IAAI,EAAS;MAC7C;OAFI,EAEJ,CACR;IACE,CAAA,CAEJ;OACJ;EACU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoadmapHorizonCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/RoadmapHorizonCard.tsx"],"names":[],"mappings":"AAwLA,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CAoFA"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { DashboardCard as e, cappedSubtitle as t } from "../DashboardUI.js";
|
|
2
|
+
import { Map as n } from "lucide-react";
|
|
3
|
+
import { gql as r } from "@apollo/client";
|
|
4
|
+
import { useQuery as i } from "@apollo/client/react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
//#region src/planmagnet/dashboards/cards/RoadmapHorizonCard.tsx
|
|
8
|
+
var c = 6, l = r`
|
|
9
|
+
query DashboardRoadmapList($workspaceId: ID!) {
|
|
10
|
+
planmagnetRoadmaps(workspaceId: $workspaceId, pagination: { first: 6 }) {
|
|
11
|
+
items {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
}
|
|
15
|
+
totalCount
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`, u = r`
|
|
19
|
+
query DashboardRoadmapHorizonCounts(
|
|
20
|
+
$workspaceId: ID!
|
|
21
|
+
$r0: String!
|
|
22
|
+
$r1: String!
|
|
23
|
+
$r2: String!
|
|
24
|
+
$r3: String!
|
|
25
|
+
$r4: String!
|
|
26
|
+
$r5: String!
|
|
27
|
+
) {
|
|
28
|
+
r0_now: planmagnetRoadmapItems(
|
|
29
|
+
workspaceId: $workspaceId
|
|
30
|
+
filter: { roadmapId: $r0, horizon: NOW }
|
|
31
|
+
pagination: { first: 1 }
|
|
32
|
+
) {
|
|
33
|
+
totalCount
|
|
34
|
+
}
|
|
35
|
+
r0_next: planmagnetRoadmapItems(
|
|
36
|
+
workspaceId: $workspaceId
|
|
37
|
+
filter: { roadmapId: $r0, horizon: NEXT }
|
|
38
|
+
pagination: { first: 1 }
|
|
39
|
+
) {
|
|
40
|
+
totalCount
|
|
41
|
+
}
|
|
42
|
+
r0_later: planmagnetRoadmapItems(
|
|
43
|
+
workspaceId: $workspaceId
|
|
44
|
+
filter: { roadmapId: $r0, horizon: LATER }
|
|
45
|
+
pagination: { first: 1 }
|
|
46
|
+
) {
|
|
47
|
+
totalCount
|
|
48
|
+
}
|
|
49
|
+
r1_now: planmagnetRoadmapItems(
|
|
50
|
+
workspaceId: $workspaceId
|
|
51
|
+
filter: { roadmapId: $r1, horizon: NOW }
|
|
52
|
+
pagination: { first: 1 }
|
|
53
|
+
) {
|
|
54
|
+
totalCount
|
|
55
|
+
}
|
|
56
|
+
r1_next: planmagnetRoadmapItems(
|
|
57
|
+
workspaceId: $workspaceId
|
|
58
|
+
filter: { roadmapId: $r1, horizon: NEXT }
|
|
59
|
+
pagination: { first: 1 }
|
|
60
|
+
) {
|
|
61
|
+
totalCount
|
|
62
|
+
}
|
|
63
|
+
r1_later: planmagnetRoadmapItems(
|
|
64
|
+
workspaceId: $workspaceId
|
|
65
|
+
filter: { roadmapId: $r1, horizon: LATER }
|
|
66
|
+
pagination: { first: 1 }
|
|
67
|
+
) {
|
|
68
|
+
totalCount
|
|
69
|
+
}
|
|
70
|
+
r2_now: planmagnetRoadmapItems(
|
|
71
|
+
workspaceId: $workspaceId
|
|
72
|
+
filter: { roadmapId: $r2, horizon: NOW }
|
|
73
|
+
pagination: { first: 1 }
|
|
74
|
+
) {
|
|
75
|
+
totalCount
|
|
76
|
+
}
|
|
77
|
+
r2_next: planmagnetRoadmapItems(
|
|
78
|
+
workspaceId: $workspaceId
|
|
79
|
+
filter: { roadmapId: $r2, horizon: NEXT }
|
|
80
|
+
pagination: { first: 1 }
|
|
81
|
+
) {
|
|
82
|
+
totalCount
|
|
83
|
+
}
|
|
84
|
+
r2_later: planmagnetRoadmapItems(
|
|
85
|
+
workspaceId: $workspaceId
|
|
86
|
+
filter: { roadmapId: $r2, horizon: LATER }
|
|
87
|
+
pagination: { first: 1 }
|
|
88
|
+
) {
|
|
89
|
+
totalCount
|
|
90
|
+
}
|
|
91
|
+
r3_now: planmagnetRoadmapItems(
|
|
92
|
+
workspaceId: $workspaceId
|
|
93
|
+
filter: { roadmapId: $r3, horizon: NOW }
|
|
94
|
+
pagination: { first: 1 }
|
|
95
|
+
) {
|
|
96
|
+
totalCount
|
|
97
|
+
}
|
|
98
|
+
r3_next: planmagnetRoadmapItems(
|
|
99
|
+
workspaceId: $workspaceId
|
|
100
|
+
filter: { roadmapId: $r3, horizon: NEXT }
|
|
101
|
+
pagination: { first: 1 }
|
|
102
|
+
) {
|
|
103
|
+
totalCount
|
|
104
|
+
}
|
|
105
|
+
r3_later: planmagnetRoadmapItems(
|
|
106
|
+
workspaceId: $workspaceId
|
|
107
|
+
filter: { roadmapId: $r3, horizon: LATER }
|
|
108
|
+
pagination: { first: 1 }
|
|
109
|
+
) {
|
|
110
|
+
totalCount
|
|
111
|
+
}
|
|
112
|
+
r4_now: planmagnetRoadmapItems(
|
|
113
|
+
workspaceId: $workspaceId
|
|
114
|
+
filter: { roadmapId: $r4, horizon: NOW }
|
|
115
|
+
pagination: { first: 1 }
|
|
116
|
+
) {
|
|
117
|
+
totalCount
|
|
118
|
+
}
|
|
119
|
+
r4_next: planmagnetRoadmapItems(
|
|
120
|
+
workspaceId: $workspaceId
|
|
121
|
+
filter: { roadmapId: $r4, horizon: NEXT }
|
|
122
|
+
pagination: { first: 1 }
|
|
123
|
+
) {
|
|
124
|
+
totalCount
|
|
125
|
+
}
|
|
126
|
+
r4_later: planmagnetRoadmapItems(
|
|
127
|
+
workspaceId: $workspaceId
|
|
128
|
+
filter: { roadmapId: $r4, horizon: LATER }
|
|
129
|
+
pagination: { first: 1 }
|
|
130
|
+
) {
|
|
131
|
+
totalCount
|
|
132
|
+
}
|
|
133
|
+
r5_now: planmagnetRoadmapItems(
|
|
134
|
+
workspaceId: $workspaceId
|
|
135
|
+
filter: { roadmapId: $r5, horizon: NOW }
|
|
136
|
+
pagination: { first: 1 }
|
|
137
|
+
) {
|
|
138
|
+
totalCount
|
|
139
|
+
}
|
|
140
|
+
r5_next: planmagnetRoadmapItems(
|
|
141
|
+
workspaceId: $workspaceId
|
|
142
|
+
filter: { roadmapId: $r5, horizon: NEXT }
|
|
143
|
+
pagination: { first: 1 }
|
|
144
|
+
) {
|
|
145
|
+
totalCount
|
|
146
|
+
}
|
|
147
|
+
r5_later: planmagnetRoadmapItems(
|
|
148
|
+
workspaceId: $workspaceId
|
|
149
|
+
filter: { roadmapId: $r5, horizon: LATER }
|
|
150
|
+
pagination: { first: 1 }
|
|
151
|
+
) {
|
|
152
|
+
totalCount
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
function d(e, t) {
|
|
157
|
+
return e?.[t]?.totalCount ?? 0;
|
|
158
|
+
}
|
|
159
|
+
function f({ workspaceId: r, onDrillDown: f }) {
|
|
160
|
+
let { t: p } = s(), m = i(l, {
|
|
161
|
+
variables: { workspaceId: r },
|
|
162
|
+
skip: !r
|
|
163
|
+
}), h = m.data?.planmagnetRoadmaps.items ?? [], g = m.data?.planmagnetRoadmaps.totalCount ?? h.length, _ = Array.from({ length: c }, (e, t) => h[t]?.id ?? ""), v = i(u, {
|
|
164
|
+
variables: {
|
|
165
|
+
workspaceId: r,
|
|
166
|
+
r0: _[0],
|
|
167
|
+
r1: _[1],
|
|
168
|
+
r2: _[2],
|
|
169
|
+
r3: _[3],
|
|
170
|
+
r4: _[4],
|
|
171
|
+
r5: _[5]
|
|
172
|
+
},
|
|
173
|
+
skip: !r || h.length === 0
|
|
174
|
+
}), y = m.loading && !m.data || v.loading && !v.data, b = m.error ?? v.error;
|
|
175
|
+
return /* @__PURE__ */ a(e, {
|
|
176
|
+
icon: /* @__PURE__ */ a(n, { className: "h-4 w-4" }),
|
|
177
|
+
title: p("planmagnet.dashboards.roadmaps.title", "Roadmap horizons"),
|
|
178
|
+
definition: p("planmagnet.dashboards.roadmaps.definition", "Items placed in Now/Next/Later per roadmap."),
|
|
179
|
+
loading: y,
|
|
180
|
+
error: b,
|
|
181
|
+
empty: !y && h.length === 0,
|
|
182
|
+
emptyMessage: p("planmagnet.dashboards.roadmaps.empty", "No roadmaps yet."),
|
|
183
|
+
drillDown: {
|
|
184
|
+
label: p("planmagnet.dashboards.viewAll", "View all roadmaps"),
|
|
185
|
+
onClick: f
|
|
186
|
+
},
|
|
187
|
+
children: /* @__PURE__ */ o("div", {
|
|
188
|
+
className: "space-y-3",
|
|
189
|
+
children: [/* @__PURE__ */ a("p", {
|
|
190
|
+
className: "text-xs text-muted-foreground",
|
|
191
|
+
children: t(h.length, g, "roadmap(s)")
|
|
192
|
+
}), /* @__PURE__ */ o("table", {
|
|
193
|
+
className: "w-full text-sm",
|
|
194
|
+
children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", {
|
|
195
|
+
className: "text-left text-xs text-muted-foreground",
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ a("th", {
|
|
198
|
+
className: "py-1 pr-2 font-normal",
|
|
199
|
+
children: p("planmagnet.dashboards.roadmaps.name", "Roadmap")
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ a("th", {
|
|
202
|
+
className: "py-1 pr-2 text-right font-normal",
|
|
203
|
+
children: p("planmagnet.dashboards.roadmaps.now", "Now")
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ a("th", {
|
|
206
|
+
className: "py-1 pr-2 text-right font-normal",
|
|
207
|
+
children: p("planmagnet.dashboards.roadmaps.next", "Next")
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ a("th", {
|
|
210
|
+
className: "py-1 text-right font-normal",
|
|
211
|
+
children: p("planmagnet.dashboards.roadmaps.later", "Later")
|
|
212
|
+
})
|
|
213
|
+
]
|
|
214
|
+
}) }), /* @__PURE__ */ a("tbody", { children: h.map((e, t) => /* @__PURE__ */ o("tr", {
|
|
215
|
+
className: "border-t",
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ a("td", {
|
|
218
|
+
className: "py-1.5 pr-2 font-medium",
|
|
219
|
+
children: e.name
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ a("td", {
|
|
222
|
+
className: "py-1.5 pr-2 text-right tabular-nums",
|
|
223
|
+
children: d(v.data, `r${t}_now`)
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ a("td", {
|
|
226
|
+
className: "py-1.5 pr-2 text-right tabular-nums",
|
|
227
|
+
children: d(v.data, `r${t}_next`)
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ a("td", {
|
|
230
|
+
className: "py-1.5 text-right tabular-nums",
|
|
231
|
+
children: d(v.data, `r${t}_later`)
|
|
232
|
+
})
|
|
233
|
+
]
|
|
234
|
+
}, e.id)) })]
|
|
235
|
+
})]
|
|
236
|
+
})
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
//#endregion
|
|
240
|
+
export { f as RoadmapHorizonCard };
|
|
241
|
+
|
|
242
|
+
//# sourceMappingURL=RoadmapHorizonCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoadmapHorizonCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/RoadmapHorizonCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Map } from 'lucide-react';\nimport { DashboardCard, cappedSubtitle } from '../DashboardUI';\n\n/**\n * Roadmap Now/Next/Later counts per roadmap (CWF-31's product-strategy section). Two requests total, however\n * many roadmaps exist: the roadmap list, then ONE query that reads every listed roadmap's three horizon\n * counts via GraphQL aliases (the same static-alias technique `hooks/useCounts.ts` uses for status counts) —\n * never one request per roadmap. `roadmapId` on `PlanmagnetRoadmapItemFilter` is a plain nullable String, so\n * an unused slot is padded with `\"\"`, which matches no roadmap and comes back as a harmless 0 rather than a\n * GraphQL error.\n */\nconst MAX_ROADMAPS = 6;\n\nconst LIST_ROADMAPS = gql`\n query DashboardRoadmapList($workspaceId: ID!) {\n planmagnetRoadmaps(workspaceId: $workspaceId, pagination: { first: 6 }) {\n items {\n id\n name\n }\n totalCount\n }\n }\n`;\n\nconst GET_ROADMAP_HORIZON_COUNTS = gql`\n query DashboardRoadmapHorizonCounts(\n $workspaceId: ID!\n $r0: String!\n $r1: String!\n $r2: String!\n $r3: String!\n $r4: String!\n $r5: String!\n ) {\n r0_now: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r0, horizon: NOW }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r0_next: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r0, horizon: NEXT }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r0_later: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r0, horizon: LATER }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r1_now: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r1, horizon: NOW }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r1_next: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r1, horizon: NEXT }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r1_later: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r1, horizon: LATER }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r2_now: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r2, horizon: NOW }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r2_next: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r2, horizon: NEXT }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r2_later: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r2, horizon: LATER }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r3_now: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r3, horizon: NOW }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r3_next: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r3, horizon: NEXT }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r3_later: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r3, horizon: LATER }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r4_now: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r4, horizon: NOW }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r4_next: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r4, horizon: NEXT }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r4_later: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r4, horizon: LATER }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r5_now: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r5, horizon: NOW }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r5_next: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r5, horizon: NEXT }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n r5_later: planmagnetRoadmapItems(\n workspaceId: $workspaceId\n filter: { roadmapId: $r5, horizon: LATER }\n pagination: { first: 1 }\n ) {\n totalCount\n }\n }\n`;\n\ninterface RoadmapRow {\n id: string;\n name: string;\n}\n\ninterface RoadmapListData {\n planmagnetRoadmaps: { items: RoadmapRow[]; totalCount: number };\n}\n\n/** One `{ totalCount }` result per aliased field — every slot in the horizon-counts query has this shape. */\ntype TotalCountResult = { totalCount: number } | null | undefined;\ntype RoadmapHorizonCountsData = Record<string, TotalCountResult>;\n\nfunction countOf(data: RoadmapHorizonCountsData | undefined, key: string): number {\n return data?.[key]?.totalCount ?? 0;\n}\n\nexport function RoadmapHorizonCard({\n workspaceId,\n onDrillDown,\n}: {\n workspaceId?: string | null;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const list = useQuery<RoadmapListData>(LIST_ROADMAPS, {\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const roadmaps = list.data?.planmagnetRoadmaps.items ?? [];\n const totalCount = list.data?.planmagnetRoadmaps.totalCount ?? roadmaps.length;\n const slots = Array.from({ length: MAX_ROADMAPS }, (_, i) => roadmaps[i]?.id ?? '');\n\n const counts = useQuery<RoadmapHorizonCountsData>(GET_ROADMAP_HORIZON_COUNTS, {\n variables: {\n workspaceId,\n r0: slots[0],\n r1: slots[1],\n r2: slots[2],\n r3: slots[3],\n r4: slots[4],\n r5: slots[5],\n },\n skip: !workspaceId || roadmaps.length === 0,\n });\n\n const loading = (list.loading && !list.data) || (counts.loading && !counts.data);\n const error = list.error ?? counts.error;\n\n return (\n <DashboardCard\n icon={<Map className=\"h-4 w-4\" />}\n title={t('planmagnet.dashboards.roadmaps.title', 'Roadmap horizons')}\n definition={t(\n 'planmagnet.dashboards.roadmaps.definition',\n 'Items placed in Now/Next/Later per roadmap.'\n )}\n loading={loading}\n error={error}\n empty={!loading && roadmaps.length === 0}\n emptyMessage={t('planmagnet.dashboards.roadmaps.empty', 'No roadmaps yet.')}\n drillDown={{\n label: t('planmagnet.dashboards.viewAll', 'View all roadmaps'),\n onClick: onDrillDown,\n }}\n >\n <div className=\"space-y-3\">\n <p className=\"text-xs text-muted-foreground\">\n {cappedSubtitle(roadmaps.length, totalCount, 'roadmap(s)')}\n </p>\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"text-left text-xs text-muted-foreground\">\n <th className=\"py-1 pr-2 font-normal\">\n {t('planmagnet.dashboards.roadmaps.name', 'Roadmap')}\n </th>\n <th className=\"py-1 pr-2 text-right font-normal\">\n {t('planmagnet.dashboards.roadmaps.now', 'Now')}\n </th>\n <th className=\"py-1 pr-2 text-right font-normal\">\n {t('planmagnet.dashboards.roadmaps.next', 'Next')}\n </th>\n <th className=\"py-1 text-right font-normal\">\n {t('planmagnet.dashboards.roadmaps.later', 'Later')}\n </th>\n </tr>\n </thead>\n <tbody>\n {roadmaps.map((r, i) => (\n <tr key={r.id} className=\"border-t\">\n <td className=\"py-1.5 pr-2 font-medium\">{r.name}</td>\n <td className=\"py-1.5 pr-2 text-right tabular-nums\">\n {countOf(counts.data, `r${i}_now`)}\n </td>\n <td className=\"py-1.5 pr-2 text-right tabular-nums\">\n {countOf(counts.data, `r${i}_next`)}\n </td>\n <td className=\"py-1.5 text-right tabular-nums\">\n {countOf(counts.data, `r${i}_later`)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;AAcA,IAAM,IAAe,GAEf,IAAgB,CAAG;;;;;;;;;;GAYnB,IAA6B,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwJtC,SAAS,EAAQ,GAA4C,GAAqB;AAChF,QAAO,IAAO,IAAM,cAAc;;AAGpC,SAAgB,EAAmB,EACjC,gBACA,kBAIC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,IAAO,EAA0B,GAAe;EACpD,WAAW,EAAE,gBAAa;EAC1B,MAAM,CAAC;EACR,CAAC,EACI,IAAW,EAAK,MAAM,mBAAmB,SAAS,EAAE,EACpD,IAAa,EAAK,MAAM,mBAAmB,cAAc,EAAS,QAClE,IAAQ,MAAM,KAAK,EAAE,QAAQ,GAAc,GAAG,GAAG,MAAM,EAAS,IAAI,MAAM,GAAG,EAE7E,IAAS,EAAmC,GAA4B;EAC5E,WAAW;GACT;GACA,IAAI,EAAM;GACV,IAAI,EAAM;GACV,IAAI,EAAM;GACV,IAAI,EAAM;GACV,IAAI,EAAM;GACV,IAAI,EAAM;GACX;EACD,MAAM,CAAC,KAAe,EAAS,WAAW;EAC3C,CAAC,EAEI,IAAW,EAAK,WAAW,CAAC,EAAK,QAAU,EAAO,WAAW,CAAC,EAAO,MACrE,IAAQ,EAAK,SAAS,EAAO;AAEnC,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAK,WAAU,WAAY,CAAA;EACjC,OAAO,EAAE,wCAAwC,mBAAmB;EACpE,YAAY,EACV,6CACA,8CACD;EACQ;EACF;EACP,OAAO,CAAC,KAAW,EAAS,WAAW;EACvC,cAAc,EAAE,wCAAwC,mBAAmB;EAC3E,WAAW;GACT,OAAO,EAAE,iCAAiC,oBAAoB;GAC9D,SAAS;GACV;YAED,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cACV,EAAe,EAAS,QAAQ,GAAY,aAAa;IACxD,CAAA,EACJ,kBAAC,SAAD;IAAO,WAAU;cAAjB,CACE,kBAAC,SAAD,EAAA,UACE,kBAAC,MAAD;KAAI,WAAU;eAAd;MACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,uCAAuC,UAAU;OACjD,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,sCAAsC,MAAM;OAC5C,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,uCAAuC,OAAO;OAC9C,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,wCAAwC,QAAQ;OAChD,CAAA;MACF;QACC,CAAA,EACR,kBAAC,SAAD,EAAA,UACG,EAAS,KAAK,GAAG,MAChB,kBAAC,MAAD;KAAe,WAAU;eAAzB;MACE,kBAAC,MAAD;OAAI,WAAU;iBAA2B,EAAE;OAAU,CAAA;MACrD,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAQ,EAAO,MAAM,IAAI,EAAE,MAAM;OAC/B,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAQ,EAAO,MAAM,IAAI,EAAE,OAAO;OAChC,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAQ,EAAO,MAAM,IAAI,EAAE,QAAQ;OACjC,CAAA;MACF;OAXI,EAAE,GAWN,CACL,EACI,CAAA,CACF;MACJ;;EACQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SprintCapacityCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/SprintCapacityCard.tsx"],"names":[],"mappings":"AAkDA,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CA0GA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { PersonAvatar as e } from "../../people/People.js";
|
|
2
|
+
import { DashboardCard as t } from "../DashboardUI.js";
|
|
3
|
+
import { Users as n } from "lucide-react";
|
|
4
|
+
import { gql as r } from "@apollo/client";
|
|
5
|
+
import { useQuery as i } from "@apollo/client/react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
//#region src/planmagnet/dashboards/cards/SprintCapacityCard.tsx
|
|
9
|
+
var c = r`
|
|
10
|
+
query DashboardSprintCapacity($sprintId: ID!) {
|
|
11
|
+
planmagnetSprintCapacity(sprintId: $sprintId) {
|
|
12
|
+
sprintId
|
|
13
|
+
crewfoundryUnavailable
|
|
14
|
+
unmatchedAssigneeIds
|
|
15
|
+
members {
|
|
16
|
+
actorId
|
|
17
|
+
employeeName
|
|
18
|
+
position
|
|
19
|
+
department
|
|
20
|
+
allocatedHours
|
|
21
|
+
billableHours
|
|
22
|
+
utilizationPercent
|
|
23
|
+
assignedWorkItemCount
|
|
24
|
+
assignedStoryPoints
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
function l({ sprintId: r, onDrillDown: l }) {
|
|
30
|
+
let { t: u } = s(), { data: d, loading: f, error: p } = i(c, {
|
|
31
|
+
variables: { sprintId: r },
|
|
32
|
+
skip: !r
|
|
33
|
+
}), m = d?.planmagnetSprintCapacity;
|
|
34
|
+
return /* @__PURE__ */ a(t, {
|
|
35
|
+
icon: /* @__PURE__ */ a(n, { className: "h-4 w-4" }),
|
|
36
|
+
title: u("planmagnet.dashboards.pm.capacity.title", "Capacity"),
|
|
37
|
+
definition: u("planmagnet.dashboards.pm.capacity.definition", "Real CrewFoundry allocation for the active sprint's assignees — hours and story points, per person."),
|
|
38
|
+
loading: f && !d,
|
|
39
|
+
error: p,
|
|
40
|
+
empty: !r || !!m && m.members.length === 0 && !m.crewfoundryUnavailable,
|
|
41
|
+
emptyMessage: r ? u("planmagnet.dashboards.pm.capacity.noMembers", "No CrewFoundry-matched assignees in this sprint.") : u("planmagnet.dashboards.pm.capacity.noSprint", "No active sprint for this project."),
|
|
42
|
+
drillDown: {
|
|
43
|
+
label: u("planmagnet.dashboards.pm.capacity.drillDown", "Open project"),
|
|
44
|
+
onClick: l
|
|
45
|
+
},
|
|
46
|
+
children: m ? m.crewfoundryUnavailable ? /* @__PURE__ */ a("p", {
|
|
47
|
+
className: "text-sm text-muted-foreground",
|
|
48
|
+
children: u("planmagnet.dashboards.pm.capacity.unavailable", "Capacity data is unavailable — CrewFoundry could not be reached, or this workspace has no CrewFoundry roster.")
|
|
49
|
+
}) : /* @__PURE__ */ o("div", {
|
|
50
|
+
className: "space-y-2",
|
|
51
|
+
children: [/* @__PURE__ */ o("table", {
|
|
52
|
+
className: "w-full text-sm",
|
|
53
|
+
children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", {
|
|
54
|
+
className: "text-left text-xs text-muted-foreground",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ a("th", {
|
|
57
|
+
className: "py-1 pr-2 font-normal",
|
|
58
|
+
children: u("planmagnet.dashboards.pm.capacity.person", "Person")
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ a("th", {
|
|
61
|
+
className: "py-1 pr-2 text-right font-normal",
|
|
62
|
+
children: u("planmagnet.dashboards.pm.capacity.allocated", "Allocated h")
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ a("th", {
|
|
65
|
+
className: "py-1 pr-2 text-right font-normal",
|
|
66
|
+
children: u("planmagnet.dashboards.pm.capacity.utilization", "Utilization")
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ a("th", {
|
|
69
|
+
className: "py-1 text-right font-normal",
|
|
70
|
+
children: u("planmagnet.dashboards.pm.capacity.items", "Items (pts)")
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}) }), /* @__PURE__ */ a("tbody", { children: m.members.map((t) => /* @__PURE__ */ o("tr", {
|
|
74
|
+
className: "border-t",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ a("td", {
|
|
77
|
+
className: "py-1.5 pr-2",
|
|
78
|
+
children: /* @__PURE__ */ o("div", {
|
|
79
|
+
className: "flex items-center gap-2",
|
|
80
|
+
children: [/* @__PURE__ */ a(e, {
|
|
81
|
+
id: t.actorId,
|
|
82
|
+
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary"
|
|
83
|
+
}), /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("div", {
|
|
84
|
+
className: "font-medium",
|
|
85
|
+
children: t.employeeName
|
|
86
|
+
}), /* @__PURE__ */ o("div", {
|
|
87
|
+
className: "text-xs text-muted-foreground",
|
|
88
|
+
children: [
|
|
89
|
+
t.position,
|
|
90
|
+
" · ",
|
|
91
|
+
t.department
|
|
92
|
+
]
|
|
93
|
+
})] })]
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ a("td", {
|
|
97
|
+
className: "py-1.5 pr-2 text-right tabular-nums",
|
|
98
|
+
children: t.allocatedHours.toFixed(1)
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ a("td", {
|
|
101
|
+
className: "py-1.5 pr-2 text-right tabular-nums",
|
|
102
|
+
children: t.utilizationPercent == null ? "—" : `${t.utilizationPercent}%`
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ o("td", {
|
|
105
|
+
className: "py-1.5 text-right tabular-nums",
|
|
106
|
+
children: [
|
|
107
|
+
t.assignedWorkItemCount,
|
|
108
|
+
" (",
|
|
109
|
+
t.assignedStoryPoints,
|
|
110
|
+
")"
|
|
111
|
+
]
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}, t.actorId)) })]
|
|
115
|
+
}), m.unmatchedAssigneeIds.length > 0 ? /* @__PURE__ */ a("p", {
|
|
116
|
+
className: "text-xs text-muted-foreground",
|
|
117
|
+
children: u("planmagnet.dashboards.pm.capacity.unmatched", "{{count}} sprint assignee(s) could not be matched to a CrewFoundry employee record.", { count: m.unmatchedAssigneeIds.length })
|
|
118
|
+
}) : null]
|
|
119
|
+
}) : null
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { l as SprintCapacityCard };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=SprintCapacityCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SprintCapacityCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/SprintCapacityCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Users } from 'lucide-react';\nimport { DashboardCard } from '../DashboardUI';\nimport { PersonAvatar } from '../../people/People';\n\n/** Capacity (ANR-07): `planmagnetSprintCapacity` (BOFF-4444) of the active sprint — real CrewFoundry\n * allocation/availability per assignee, cross-layer. There is no \"skill\" concept anywhere in this data:\n * capacity is hours and story points, per person, never per skill (the PM dashboard says so separately). */\nconst GET_SPRINT_CAPACITY = gql`\n query DashboardSprintCapacity($sprintId: ID!) {\n planmagnetSprintCapacity(sprintId: $sprintId) {\n sprintId\n crewfoundryUnavailable\n unmatchedAssigneeIds\n members {\n actorId\n employeeName\n position\n department\n allocatedHours\n billableHours\n utilizationPercent\n assignedWorkItemCount\n assignedStoryPoints\n }\n }\n }\n`;\n\ninterface SprintCapacityData {\n planmagnetSprintCapacity: {\n sprintId: string;\n crewfoundryUnavailable: boolean;\n unmatchedAssigneeIds: string[];\n members: {\n actorId: string;\n employeeName: string;\n position: string;\n department: string;\n allocatedHours: number;\n billableHours: number;\n utilizationPercent: number | null;\n assignedWorkItemCount: number;\n assignedStoryPoints: number;\n }[];\n };\n}\n\nexport function SprintCapacityCard({\n sprintId,\n onDrillDown,\n}: {\n sprintId: string;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<SprintCapacityData>(GET_SPRINT_CAPACITY, {\n variables: { sprintId },\n skip: !sprintId,\n });\n const capacity = data?.planmagnetSprintCapacity;\n\n return (\n <DashboardCard\n icon={<Users className=\"h-4 w-4\" />}\n title={t('planmagnet.dashboards.pm.capacity.title', 'Capacity')}\n definition={t(\n 'planmagnet.dashboards.pm.capacity.definition',\n \"Real CrewFoundry allocation for the active sprint's assignees — hours and story points, per person.\"\n )}\n loading={loading && !data}\n error={error}\n empty={\n !sprintId ||\n (!!capacity && capacity.members.length === 0 && !capacity.crewfoundryUnavailable)\n }\n emptyMessage={\n !sprintId\n ? t('planmagnet.dashboards.pm.capacity.noSprint', 'No active sprint for this project.')\n : t(\n 'planmagnet.dashboards.pm.capacity.noMembers',\n 'No CrewFoundry-matched assignees in this sprint.'\n )\n }\n drillDown={{\n label: t('planmagnet.dashboards.pm.capacity.drillDown', 'Open project'),\n onClick: onDrillDown,\n }}\n >\n {capacity ? (\n capacity.crewfoundryUnavailable ? (\n <p className=\"text-sm text-muted-foreground\">\n {t(\n 'planmagnet.dashboards.pm.capacity.unavailable',\n 'Capacity data is unavailable — CrewFoundry could not be reached, or this workspace has no CrewFoundry roster.'\n )}\n </p>\n ) : (\n <div className=\"space-y-2\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"text-left text-xs text-muted-foreground\">\n <th className=\"py-1 pr-2 font-normal\">\n {t('planmagnet.dashboards.pm.capacity.person', 'Person')}\n </th>\n <th className=\"py-1 pr-2 text-right font-normal\">\n {t('planmagnet.dashboards.pm.capacity.allocated', 'Allocated h')}\n </th>\n <th className=\"py-1 pr-2 text-right font-normal\">\n {t('planmagnet.dashboards.pm.capacity.utilization', 'Utilization')}\n </th>\n <th className=\"py-1 text-right font-normal\">\n {t('planmagnet.dashboards.pm.capacity.items', 'Items (pts)')}\n </th>\n </tr>\n </thead>\n <tbody>\n {capacity.members.map((m) => (\n <tr key={m.actorId} className=\"border-t\">\n <td className=\"py-1.5 pr-2\">\n <div className=\"flex items-center gap-2\">\n <PersonAvatar\n id={m.actorId}\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary\"\n />\n <div>\n <div className=\"font-medium\">{m.employeeName}</div>\n <div className=\"text-xs text-muted-foreground\">\n {m.position} · {m.department}\n </div>\n </div>\n </div>\n </td>\n <td className=\"py-1.5 pr-2 text-right tabular-nums\">\n {m.allocatedHours.toFixed(1)}\n </td>\n <td className=\"py-1.5 pr-2 text-right tabular-nums\">\n {m.utilizationPercent == null ? '—' : `${m.utilizationPercent}%`}\n </td>\n <td className=\"py-1.5 text-right tabular-nums\">\n {m.assignedWorkItemCount} ({m.assignedStoryPoints})\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n {capacity.unmatchedAssigneeIds.length > 0 ? (\n <p className=\"text-xs text-muted-foreground\">\n {t(\n 'planmagnet.dashboards.pm.capacity.unmatched',\n '{{count}} sprint assignee(s) could not be matched to a CrewFoundry employee record.',\n { count: capacity.unmatchedAssigneeIds.length }\n )}\n </p>\n ) : null}\n </div>\n )\n ) : null}\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;AAwC/B,SAAgB,EAAmB,EACjC,aACA,kBAIC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,YAAS,aAAU,EAA6B,GAAqB;EACjF,WAAW,EAAE,aAAU;EACvB,MAAM,CAAC;EACR,CAAC,EACI,IAAW,GAAM;AAEvB,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA;EACnC,OAAO,EAAE,2CAA2C,WAAW;EAC/D,YAAY,EACV,gDACA,sGACD;EACD,SAAS,KAAW,CAAC;EACd;EACP,OACE,CAAC,KACA,CAAC,CAAC,KAAY,EAAS,QAAQ,WAAW,KAAK,CAAC,EAAS;EAE5D,cACG,IAEG,EACE,+CACA,mDACD,GAJD,EAAE,8CAA8C,qCAAqC;EAM3F,WAAW;GACT,OAAO,EAAE,+CAA+C,eAAe;GACvE,SAAS;GACV;YAEA,IACC,EAAS,yBACP,kBAAC,KAAD;GAAG,WAAU;aACV,EACC,iDACA,gHACD;GACC,CAAA,GAEJ,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,SAAD;IAAO,WAAU;cAAjB,CACE,kBAAC,SAAD,EAAA,UACE,kBAAC,MAAD;KAAI,WAAU;eAAd;MACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,4CAA4C,SAAS;OACrD,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,+CAA+C,cAAc;OAC7D,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,iDAAiD,cAAc;OAC/D,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,2CAA2C,cAAc;OACzD,CAAA;MACF;QACC,CAAA,EACR,kBAAC,SAAD,EAAA,UACG,EAAS,QAAQ,KAAK,MACrB,kBAAC,MAAD;KAAoB,WAAU;eAA9B;MACE,kBAAC,MAAD;OAAI,WAAU;iBACZ,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD;SACE,IAAI,EAAE;SACN,WAAU;SACV,CAAA,EACF,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;SAAK,WAAU;mBAAe,EAAE;SAAmB,CAAA,EACnD,kBAAC,OAAD;SAAK,WAAU;mBAAf;UACG,EAAE;UAAS;UAAI,EAAE;UACd;WACF,EAAA,CAAA,CACF;;OACH,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,eAAe,QAAQ,EAAE;OACzB,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,sBAAsB,OAAO,MAAM,GAAG,EAAE,mBAAmB;OAC3D,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBAAd;QACG,EAAE;QAAsB;QAAG,EAAE;QAAoB;QAC/C;;MACF;OAxBI,EAAE,QAwBN,CACL,EACI,CAAA,CACF;OACP,EAAS,qBAAqB,SAAS,IACtC,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,+CACA,uFACA,EAAE,OAAO,EAAS,qBAAqB,QAAQ,CAChD;IACC,CAAA,GACF,KACA;OAEN;EACU,CAAA"}
|