@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,79 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared building blocks for the four role dashboards (ANR-06/07/28, CWF-31): every card on every dashboard
|
|
5
|
+
* follows the same contract — a title, a one-line definition of what the number means, and loading/empty/
|
|
6
|
+
* error/forbidden states, so a viewer never has to guess whether a blank card means "nothing to show" or "this
|
|
7
|
+
* broke". `isForbidden` is the same RBAC-denial detector `releases/ReleaseReadinessCard.tsx`'s local `denied()`
|
|
8
|
+
* generalizes from (see `utils/graphqlErrors.ts`) — a card whose resource the caller's role cannot read says so
|
|
9
|
+
* instead of leaking an unreadable error string or silently rendering empty.
|
|
10
|
+
*/
|
|
11
|
+
/** A one-line link out of a card into the page that can show more. Rendered as a real button, not a link styled
|
|
12
|
+
* to look clickable, since it runs client-side navigation rather than following an href. */
|
|
13
|
+
export declare function DrillDownLink({ label, onClick }: {
|
|
14
|
+
label: string;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface DashboardCardProps {
|
|
18
|
+
icon: ReactNode;
|
|
19
|
+
title: string;
|
|
20
|
+
/** One line: what the number(s) on this card mean and where they come from. */
|
|
21
|
+
definition: string;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
error?: unknown;
|
|
24
|
+
/** True when the query succeeded but there is nothing to show. */
|
|
25
|
+
empty?: boolean;
|
|
26
|
+
emptyMessage?: string;
|
|
27
|
+
drillDown?: {
|
|
28
|
+
label: string;
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
};
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The full card shell: title + definition + icon in the header, then one of loading / forbidden / error / empty
|
|
35
|
+
* / content in the body, then an optional drill-down link. Use this for a card built fresh for the dashboards.
|
|
36
|
+
* For a card that already exists as its own `<Card>` (e.g. `BudgetPerformanceCard`), wrap it in
|
|
37
|
+
* `DashboardCardShell` instead so its own header isn't duplicated.
|
|
38
|
+
*/
|
|
39
|
+
export declare function DashboardCard({ icon, title, definition, loading, error, empty, emptyMessage, drillDown, children, }: DashboardCardProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* Wraps an already-complete card component (it renders its own `<Card>`, title and loading/empty/error states —
|
|
42
|
+
* `BudgetPerformanceCard`, `CycleTimeCard`, `SprintBurndownCard`, `SprintVelocityCard`) so it carries the
|
|
43
|
+
* `dashboard-card` testid and an optional drill-down link without duplicating its header.
|
|
44
|
+
*/
|
|
45
|
+
export declare function DashboardCardShell({ drillDown, children, }: {
|
|
46
|
+
drillDown?: {
|
|
47
|
+
label: string;
|
|
48
|
+
onClick: () => void;
|
|
49
|
+
};
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
/** "There is no skill concept in PlanMagnet" — stated once per page, never invented. */
|
|
53
|
+
export declare function NoSkillsNote({ message }: {
|
|
54
|
+
message: string;
|
|
55
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
/** A small number-and-label tile, the same shape `analytics/DeliveryHealthCards.tsx`'s local `StatTile` uses. */
|
|
57
|
+
export declare function StatTile({ label, value, hint }: {
|
|
58
|
+
label: string;
|
|
59
|
+
value: string;
|
|
60
|
+
hint?: string;
|
|
61
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* A labelled 0-100% meter, using the semantic `primary` token — never a raw color. `percent: null` means
|
|
64
|
+
* "not measured" (e.g. a rate whose denominator was 0 — nothing completed in the window to score), and
|
|
65
|
+
* renders an empty dashed track with a "—" label instead of a fabricated 0%. A 0%-filled bar is visually
|
|
66
|
+
* indistinguishable from "measured and it's zero" (total delivery failure), so coercing null to 0 here
|
|
67
|
+
* would mislead a viewer skimming the card — the caller's null case must flow through, never `?? 0`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function PercentBar({ percent, label }: {
|
|
70
|
+
percent: number | null;
|
|
71
|
+
label?: string;
|
|
72
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
/** "—" for a rate that is null because its denominator was 0 — never a fabricated 0% or 100%. */
|
|
74
|
+
export declare function ratePercentLabel(rate: number | null | undefined): string;
|
|
75
|
+
/** Minutes read naturally as hours (one decimal below 10h, whole hours above). */
|
|
76
|
+
export declare function formatHours(minutes: number): string;
|
|
77
|
+
/** Cap-aware "N of TOTAL" wording for a list a card intentionally truncates instead of paginating in place. */
|
|
78
|
+
export declare function cappedSubtitle(shown: number, total: number, noun: string): string;
|
|
79
|
+
//# sourceMappingURL=DashboardUI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardUI.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/dashboards/DashboardUI.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC;;;;;;;GAOG;AAEH;4FAC4F;AAC5F,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,2CAWvF;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACnD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,UAAU,EACV,OAAO,EACP,KAAK,EACL,KAAK,EACL,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE,kBAAkB,2CA+CpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IACnD,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAOA;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAM5D;AAED,iHAAiH;AACjH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,2CAQ/F;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,2CAyCxF;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAExE;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjF"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { isForbidden as e } from "../utils/graphqlErrors.js";
|
|
2
|
+
import { ArrowRight as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { useI18n as i } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
5
|
+
import { Card as a, CardContent as o, CardHeader as s, CardTitle as c } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
//#region src/planmagnet/dashboards/DashboardUI.tsx
|
|
7
|
+
function l({ label: e, onClick: i }) {
|
|
8
|
+
return /* @__PURE__ */ r("button", {
|
|
9
|
+
type: "button",
|
|
10
|
+
onClick: i,
|
|
11
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
|
|
12
|
+
children: [e, /* @__PURE__ */ n(t, {
|
|
13
|
+
className: "h-3 w-3",
|
|
14
|
+
"aria-hidden": !0
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function u({ icon: t, title: u, definition: d, loading: f, error: p, empty: m, emptyMessage: h, drillDown: g, children: _ }) {
|
|
19
|
+
let { t: v } = i(), y = e(p), b = y ? "dashboard-card-forbidden" : "dashboard-card", x;
|
|
20
|
+
return x = p ? /* @__PURE__ */ n("p", {
|
|
21
|
+
className: "text-sm text-muted-foreground",
|
|
22
|
+
children: y ? v("planmagnet.dashboards.forbidden", "You do not have access to {{title}}.", { title: u }) : v("planmagnet.dashboards.error", "Could not be loaded: {{message}}", { message: p instanceof Error ? p.message : "unknown error" })
|
|
23
|
+
}) : f ? /* @__PURE__ */ n("p", {
|
|
24
|
+
className: "text-sm text-muted-foreground",
|
|
25
|
+
children: v("planmagnet.dashboards.loading", "Loading…")
|
|
26
|
+
}) : m ? /* @__PURE__ */ n("p", {
|
|
27
|
+
className: "text-sm text-muted-foreground",
|
|
28
|
+
children: h ?? v("planmagnet.dashboards.empty", "Nothing to show yet.")
|
|
29
|
+
}) : _, /* @__PURE__ */ r(a, {
|
|
30
|
+
"data-testid": b,
|
|
31
|
+
children: [/* @__PURE__ */ r(s, {
|
|
32
|
+
className: "space-y-1",
|
|
33
|
+
children: [/* @__PURE__ */ r(c, {
|
|
34
|
+
className: "flex items-center gap-2 text-base",
|
|
35
|
+
children: [t, u]
|
|
36
|
+
}), /* @__PURE__ */ n("p", {
|
|
37
|
+
className: "text-xs text-muted-foreground",
|
|
38
|
+
children: d
|
|
39
|
+
})]
|
|
40
|
+
}), /* @__PURE__ */ r(o, {
|
|
41
|
+
className: "space-y-3",
|
|
42
|
+
children: [x, g && !f ? /* @__PURE__ */ n(l, { ...g }) : null]
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function d({ drillDown: e, children: t }) {
|
|
47
|
+
return /* @__PURE__ */ r("div", {
|
|
48
|
+
"data-testid": "dashboard-card",
|
|
49
|
+
className: "space-y-2",
|
|
50
|
+
children: [t, e ? /* @__PURE__ */ n("div", {
|
|
51
|
+
className: "px-1",
|
|
52
|
+
children: /* @__PURE__ */ n(l, { ...e })
|
|
53
|
+
}) : null]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function f({ message: e }) {
|
|
57
|
+
return /* @__PURE__ */ n("p", {
|
|
58
|
+
"data-testid": "dashboard-no-skills-note",
|
|
59
|
+
className: "text-xs italic text-muted-foreground",
|
|
60
|
+
children: e
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function p({ label: e, value: t, hint: i }) {
|
|
64
|
+
return /* @__PURE__ */ r("div", {
|
|
65
|
+
className: "rounded-md border p-3",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ n("p", {
|
|
68
|
+
className: "text-xs text-muted-foreground",
|
|
69
|
+
children: e
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ n("p", {
|
|
72
|
+
className: "mt-1 text-2xl font-semibold",
|
|
73
|
+
children: t
|
|
74
|
+
}),
|
|
75
|
+
i ? /* @__PURE__ */ n("p", {
|
|
76
|
+
className: "mt-0.5 text-xs text-muted-foreground",
|
|
77
|
+
children: i
|
|
78
|
+
}) : null
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function m({ percent: e, label: t }) {
|
|
83
|
+
if (e == null) return /* @__PURE__ */ r("div", {
|
|
84
|
+
className: "space-y-1",
|
|
85
|
+
children: [t ? /* @__PURE__ */ r("div", {
|
|
86
|
+
className: "flex justify-between text-xs text-muted-foreground",
|
|
87
|
+
children: [/* @__PURE__ */ n("span", { children: t }), /* @__PURE__ */ n("span", { children: "—" })]
|
|
88
|
+
}) : null, /* @__PURE__ */ n("div", {
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
className: "h-2 w-full overflow-hidden rounded-full border border-dashed border-muted-foreground/30"
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
let i = Math.max(0, Math.min(100, Math.round(e)));
|
|
94
|
+
return /* @__PURE__ */ r("div", {
|
|
95
|
+
className: "space-y-1",
|
|
96
|
+
children: [t ? /* @__PURE__ */ r("div", {
|
|
97
|
+
className: "flex justify-between text-xs text-muted-foreground",
|
|
98
|
+
children: [/* @__PURE__ */ n("span", { children: t }), /* @__PURE__ */ r("span", { children: [i, "%"] })]
|
|
99
|
+
}) : null, /* @__PURE__ */ n("div", {
|
|
100
|
+
role: "meter",
|
|
101
|
+
"aria-valuemin": 0,
|
|
102
|
+
"aria-valuemax": 100,
|
|
103
|
+
"aria-valuenow": i,
|
|
104
|
+
"aria-label": t ?? `${i}%`,
|
|
105
|
+
className: "h-2 w-full overflow-hidden rounded-full bg-muted",
|
|
106
|
+
children: /* @__PURE__ */ n("div", {
|
|
107
|
+
className: "h-full rounded-full bg-primary transition-all",
|
|
108
|
+
style: { width: `${i}%` }
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function h(e) {
|
|
114
|
+
return e == null ? "—" : `${Math.round(e * 100)}%`;
|
|
115
|
+
}
|
|
116
|
+
function g(e) {
|
|
117
|
+
let t = e / 60;
|
|
118
|
+
return `${t < 10 ? t.toFixed(1) : Math.round(t)} h`;
|
|
119
|
+
}
|
|
120
|
+
function _(e, t, n) {
|
|
121
|
+
return t > e ? `Showing ${e} of ${t} ${n}` : `${t} ${n}`;
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { u as DashboardCard, d as DashboardCardShell, f as NoSkillsNote, m as PercentBar, p as StatTile, _ as cappedSubtitle, g as formatHours, h as ratePercentLabel };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=DashboardUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardUI.js","names":[],"sources":["../../../src/planmagnet/dashboards/DashboardUI.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { ArrowRight } from 'lucide-react';\nimport { isForbidden } from '../utils/graphqlErrors';\n\n/**\n * Shared building blocks for the four role dashboards (ANR-06/07/28, CWF-31): every card on every dashboard\n * follows the same contract — a title, a one-line definition of what the number means, and loading/empty/\n * error/forbidden states, so a viewer never has to guess whether a blank card means \"nothing to show\" or \"this\n * broke\". `isForbidden` is the same RBAC-denial detector `releases/ReleaseReadinessCard.tsx`'s local `denied()`\n * generalizes from (see `utils/graphqlErrors.ts`) — a card whose resource the caller's role cannot read says so\n * instead of leaking an unreadable error string or silently rendering empty.\n */\n\n/** A one-line link out of a card into the page that can show more. Rendered as a real button, not a link styled\n * to look clickable, since it runs client-side navigation rather than following an href. */\nexport function DrillDownLink({ label, onClick }: { label: string; onClick: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n {label}\n <ArrowRight className=\"h-3 w-3\" aria-hidden={true} />\n </button>\n );\n}\n\nexport interface DashboardCardProps {\n icon: ReactNode;\n title: string;\n /** One line: what the number(s) on this card mean and where they come from. */\n definition: string;\n loading: boolean;\n error?: unknown;\n /** True when the query succeeded but there is nothing to show. */\n empty?: boolean;\n emptyMessage?: string;\n drillDown?: { label: string; onClick: () => void };\n children: ReactNode;\n}\n\n/**\n * The full card shell: title + definition + icon in the header, then one of loading / forbidden / error / empty\n * / content in the body, then an optional drill-down link. Use this for a card built fresh for the dashboards.\n * For a card that already exists as its own `<Card>` (e.g. `BudgetPerformanceCard`), wrap it in\n * `DashboardCardShell` instead so its own header isn't duplicated.\n */\nexport function DashboardCard({\n icon,\n title,\n definition,\n loading,\n error,\n empty,\n emptyMessage,\n drillDown,\n children,\n}: DashboardCardProps) {\n const { t } = useI18n();\n const forbidden = isForbidden(error);\n const testId = forbidden ? 'dashboard-card-forbidden' : 'dashboard-card';\n\n let body: ReactNode;\n if (error) {\n body = (\n <p className=\"text-sm text-muted-foreground\">\n {forbidden\n ? t('planmagnet.dashboards.forbidden', 'You do not have access to {{title}}.', { title })\n : t('planmagnet.dashboards.error', 'Could not be loaded: {{message}}', {\n message: error instanceof Error ? error.message : 'unknown error',\n })}\n </p>\n );\n } else if (loading) {\n body = (\n <p className=\"text-sm text-muted-foreground\">\n {t('planmagnet.dashboards.loading', 'Loading…')}\n </p>\n );\n } else if (empty) {\n body = (\n <p className=\"text-sm text-muted-foreground\">\n {emptyMessage ?? t('planmagnet.dashboards.empty', 'Nothing to show yet.')}\n </p>\n );\n } else {\n body = children;\n }\n\n return (\n <Card data-testid={testId}>\n <CardHeader className=\"space-y-1\">\n <CardTitle className=\"flex items-center gap-2 text-base\">\n {icon}\n {title}\n </CardTitle>\n <p className=\"text-xs text-muted-foreground\">{definition}</p>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {body}\n {drillDown && !loading ? <DrillDownLink {...drillDown} /> : null}\n </CardContent>\n </Card>\n );\n}\n\n/**\n * Wraps an already-complete card component (it renders its own `<Card>`, title and loading/empty/error states —\n * `BudgetPerformanceCard`, `CycleTimeCard`, `SprintBurndownCard`, `SprintVelocityCard`) so it carries the\n * `dashboard-card` testid and an optional drill-down link without duplicating its header.\n */\nexport function DashboardCardShell({\n drillDown,\n children,\n}: {\n drillDown?: { label: string; onClick: () => void };\n children: ReactNode;\n}) {\n return (\n <div data-testid=\"dashboard-card\" className=\"space-y-2\">\n {children}\n {drillDown ? <div className=\"px-1\">{<DrillDownLink {...drillDown} />}</div> : null}\n </div>\n );\n}\n\n/** \"There is no skill concept in PlanMagnet\" — stated once per page, never invented. */\nexport function NoSkillsNote({ message }: { message: string }) {\n return (\n <p data-testid=\"dashboard-no-skills-note\" className=\"text-xs italic text-muted-foreground\">\n {message}\n </p>\n );\n}\n\n/** A small number-and-label tile, the same shape `analytics/DeliveryHealthCards.tsx`'s local `StatTile` uses. */\nexport function StatTile({ label, value, hint }: { label: string; value: string; hint?: string }) {\n return (\n <div className=\"rounded-md border p-3\">\n <p className=\"text-xs text-muted-foreground\">{label}</p>\n <p className=\"mt-1 text-2xl font-semibold\">{value}</p>\n {hint ? <p className=\"mt-0.5 text-xs text-muted-foreground\">{hint}</p> : null}\n </div>\n );\n}\n\n/**\n * A labelled 0-100% meter, using the semantic `primary` token — never a raw color. `percent: null` means\n * \"not measured\" (e.g. a rate whose denominator was 0 — nothing completed in the window to score), and\n * renders an empty dashed track with a \"—\" label instead of a fabricated 0%. A 0%-filled bar is visually\n * indistinguishable from \"measured and it's zero\" (total delivery failure), so coercing null to 0 here\n * would mislead a viewer skimming the card — the caller's null case must flow through, never `?? 0`.\n */\nexport function PercentBar({ percent, label }: { percent: number | null; label?: string }) {\n if (percent == null) {\n return (\n <div className=\"space-y-1\">\n {label ? (\n <div className=\"flex justify-between text-xs text-muted-foreground\">\n <span>{label}</span>\n <span>—</span>\n </div>\n ) : null}\n <div\n aria-hidden=\"true\"\n className=\"h-2 w-full overflow-hidden rounded-full border border-dashed border-muted-foreground/30\"\n />\n </div>\n );\n }\n const pct = Math.max(0, Math.min(100, Math.round(percent)));\n return (\n <div className=\"space-y-1\">\n {label ? (\n <div className=\"flex justify-between text-xs text-muted-foreground\">\n <span>{label}</span>\n <span>{pct}%</span>\n </div>\n ) : null}\n <div\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={pct}\n aria-label={label ?? `${pct}%`}\n className=\"h-2 w-full overflow-hidden rounded-full bg-muted\"\n >\n <div\n className=\"h-full rounded-full bg-primary transition-all\"\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n}\n\n/** \"—\" for a rate that is null because its denominator was 0 — never a fabricated 0% or 100%. */\nexport function ratePercentLabel(rate: number | null | undefined): string {\n return rate == null ? '—' : `${Math.round(rate * 100)}%`;\n}\n\n/** Minutes read naturally as hours (one decimal below 10h, whole hours above). */\nexport function formatHours(minutes: number): string {\n const hours = minutes / 60;\n return `${hours < 10 ? hours.toFixed(1) : Math.round(hours)} h`;\n}\n\n/** Cap-aware \"N of TOTAL\" wording for a list a card intentionally truncates instead of paginating in place. */\nexport function cappedSubtitle(shown: number, total: number, noun: string): string {\n return total > shown ? `Showing ${shown} of ${total} ${noun}` : `${total} ${noun}`;\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,EAAc,EAAE,UAAO,cAAmD;AACxF,QACE,kBAAC,UAAD;EACE,MAAK;EACI;EACT,WAAU;YAHZ,CAKG,GACD,kBAAC,GAAD;GAAY,WAAU;GAAU,eAAa;GAAQ,CAAA,CAC9C;;;AAwBb,SAAgB,EAAc,EAC5B,SACA,UACA,eACA,YACA,UACA,UACA,iBACA,cACA,eACqB;CACrB,IAAM,EAAE,SAAM,GAAS,EACjB,IAAY,EAAY,EAAM,EAC9B,IAAS,IAAY,6BAA6B,kBAEpD;AA2BJ,QA1BA,AAuBE,IAvBE,IAEA,kBAAC,KAAD;EAAG,WAAU;YACV,IACG,EAAE,mCAAmC,wCAAwC,EAAE,UAAO,CAAC,GACvF,EAAE,+BAA+B,oCAAoC,EACnE,SAAS,aAAiB,QAAQ,EAAM,UAAU,iBACnD,CAAC;EACJ,CAAA,GAEG,IAEP,kBAAC,KAAD;EAAG,WAAU;YACV,EAAE,iCAAiC,WAAW;EAC7C,CAAA,GAEG,IAEP,kBAAC,KAAD;EAAG,WAAU;YACV,KAAgB,EAAE,+BAA+B,uBAAuB;EACvE,CAAA,GAGC,GAIP,kBAAC,GAAD;EAAM,eAAa;YAAnB,CACE,kBAAC,GAAD;GAAY,WAAU;aAAtB,CACE,kBAAC,GAAD;IAAW,WAAU;cAArB,CACG,GACA,EACS;OACZ,kBAAC,KAAD;IAAG,WAAU;cAAiC;IAAe,CAAA,CAClD;MACb,kBAAC,GAAD;GAAa,WAAU;aAAvB,CACG,GACA,KAAa,CAAC,IAAU,kBAAC,GAAD,EAAe,GAAI,GAAa,CAAA,GAAG,KAChD;KACT;;;AASX,SAAgB,EAAmB,EACjC,cACA,eAIC;AACD,QACE,kBAAC,OAAD;EAAK,eAAY;EAAiB,WAAU;YAA5C,CACG,GACA,IAAY,kBAAC,OAAD;GAAK,WAAU;aAAQ,kBAAC,GAAD,EAAe,GAAI,GAAa,CAAA;GAAO,CAAA,GAAG,KAC1E;;;AAKV,SAAgB,EAAa,EAAE,cAAgC;AAC7D,QACE,kBAAC,KAAD;EAAG,eAAY;EAA2B,WAAU;YACjD;EACC,CAAA;;AAKR,SAAgB,EAAS,EAAE,UAAO,UAAO,WAAyD;AAChG,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,KAAD;IAAG,WAAU;cAAiC;IAAU,CAAA;GACxD,kBAAC,KAAD;IAAG,WAAU;cAA+B;IAAU,CAAA;GACrD,IAAO,kBAAC,KAAD;IAAG,WAAU;cAAwC;IAAS,CAAA,GAAG;GACrE;;;AAWV,SAAgB,EAAW,EAAE,YAAS,YAAqD;AACzF,KAAI,KAAW,KACb,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,IACC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD,EAAA,UAAO,GAAa,CAAA,EACpB,kBAAC,QAAD,EAAA,UAAM,KAAQ,CAAA,CACV;OACJ,MACJ,kBAAC,OAAD;GACE,eAAY;GACZ,WAAU;GACV,CAAA,CACE;;CAGV,IAAM,IAAM,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,EAAQ,CAAC,CAAC;AAC3D,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,IACC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD,EAAA,UAAO,GAAa,CAAA,EACpB,kBAAC,QAAD,EAAA,UAAA,CAAO,GAAI,IAAQ,EAAA,CAAA,CACf;OACJ,MACJ,kBAAC,OAAD;GACE,MAAK;GACL,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,cAAY,KAAS,GAAG,EAAI;GAC5B,WAAU;aAEV,kBAAC,OAAD;IACE,WAAU;IACV,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;IAC3B,CAAA;GACE,CAAA,CACF;;;AAKV,SAAgB,EAAiB,GAAyC;AACxE,QAAO,KAAQ,OAAO,MAAM,GAAG,KAAK,MAAM,IAAO,IAAI,CAAC;;AAIxD,SAAgB,EAAY,GAAyB;CACnD,IAAM,IAAQ,IAAU;AACxB,QAAO,GAAG,IAAQ,KAAK,EAAM,QAAQ,EAAE,GAAG,KAAK,MAAM,EAAM,CAAC;;AAI9D,SAAgB,EAAe,GAAe,GAAe,GAAsB;AACjF,QAAO,IAAQ,IAAQ,WAAW,EAAM,MAAM,EAAM,GAAG,MAAS,GAAG,EAAM,GAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function DeliveryTimelineCard({ workspaceId, startDate, endDate, onDrillDown, }: {
|
|
2
|
+
workspaceId?: string | null;
|
|
3
|
+
startDate: string;
|
|
4
|
+
endDate: string;
|
|
5
|
+
onDrillDown: () => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=DeliveryTimelineCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeliveryTimelineCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/DeliveryTimelineCard.tsx"],"names":[],"mappings":"AA6CA,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,SAAS,EACT,OAAO,EACP,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CAyFA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DashboardCard as e, PercentBar as t, ratePercentLabel as n } from "../DashboardUI.js";
|
|
2
|
+
import { CalendarClock 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/DeliveryTimelineCard.tsx
|
|
8
|
+
var l = i`
|
|
9
|
+
query DashboardDeliveryKpis($workspaceId: ID!, $startDate: DateTime, $endDate: DateTime) {
|
|
10
|
+
planmagnetDeliveryKpis(workspaceId: $workspaceId, startDate: $startDate, endDate: $endDate) {
|
|
11
|
+
sprintCount
|
|
12
|
+
sprintOnTimeRate
|
|
13
|
+
releaseCount
|
|
14
|
+
releaseOnTimeRate
|
|
15
|
+
milestoneCount
|
|
16
|
+
milestoneOnTimeRate
|
|
17
|
+
scopeAdherence {
|
|
18
|
+
adherenceRate
|
|
19
|
+
committedPoints
|
|
20
|
+
deliveredPoints
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
function u({ workspaceId: i, startDate: u, endDate: d, onDrillDown: f }) {
|
|
26
|
+
let { t: p } = c(), { data: m, loading: h, error: g } = a(l, {
|
|
27
|
+
variables: {
|
|
28
|
+
workspaceId: i,
|
|
29
|
+
startDate: u,
|
|
30
|
+
endDate: d
|
|
31
|
+
},
|
|
32
|
+
skip: !i
|
|
33
|
+
}), _ = m?.planmagnetDeliveryKpis, v = !!_ && _.sprintCount === 0 && _.releaseCount === 0 && _.milestoneCount === 0;
|
|
34
|
+
return /* @__PURE__ */ o(e, {
|
|
35
|
+
icon: /* @__PURE__ */ o(r, { className: "h-4 w-4" }),
|
|
36
|
+
title: p("planmagnet.dashboards.exec.timeline.title", "Timeline adherence"),
|
|
37
|
+
definition: p("planmagnet.dashboards.exec.timeline.definition", "On-time delivery and scope adherence, over sprints/releases/milestones completed in the last 90 days."),
|
|
38
|
+
loading: h && !m,
|
|
39
|
+
error: g,
|
|
40
|
+
empty: v,
|
|
41
|
+
emptyMessage: p("planmagnet.dashboards.exec.timeline.empty", "Nothing completed in the last 90 days."),
|
|
42
|
+
drillDown: {
|
|
43
|
+
label: p("planmagnet.dashboards.exec.timeline.drillDown", "Open delivery analytics"),
|
|
44
|
+
onClick: f
|
|
45
|
+
},
|
|
46
|
+
children: _ ? /* @__PURE__ */ s("div", {
|
|
47
|
+
className: "space-y-3",
|
|
48
|
+
children: [/* @__PURE__ */ s("div", {
|
|
49
|
+
className: "grid grid-cols-3 gap-3",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o(t, {
|
|
52
|
+
percent: _.sprintOnTimeRate == null ? null : _.sprintOnTimeRate * 100,
|
|
53
|
+
label: p("planmagnet.dashboards.exec.timeline.sprints", "Sprints on time")
|
|
54
|
+
}), /* @__PURE__ */ o("p", {
|
|
55
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
56
|
+
children: _.sprintOnTimeRate == null ? p("planmagnet.dashboards.exec.timeline.noPlan", "no plan to measure against") : `${_.sprintCount} ${p("planmagnet.dashboards.exec.timeline.completed", "completed")}`
|
|
57
|
+
})] }),
|
|
58
|
+
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o(t, {
|
|
59
|
+
percent: _.releaseOnTimeRate == null ? null : _.releaseOnTimeRate * 100,
|
|
60
|
+
label: p("planmagnet.dashboards.exec.timeline.releases", "Releases on time")
|
|
61
|
+
}), /* @__PURE__ */ o("p", {
|
|
62
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
63
|
+
children: _.releaseOnTimeRate == null ? p("planmagnet.dashboards.exec.timeline.noPlan", "no plan to measure against") : `${_.releaseCount} ${p("planmagnet.dashboards.exec.timeline.completed", "completed")}`
|
|
64
|
+
})] }),
|
|
65
|
+
/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o(t, {
|
|
66
|
+
percent: _.milestoneOnTimeRate == null ? null : _.milestoneOnTimeRate * 100,
|
|
67
|
+
label: p("planmagnet.dashboards.exec.timeline.milestones", "Milestones on time")
|
|
68
|
+
}), /* @__PURE__ */ o("p", {
|
|
69
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
70
|
+
children: _.milestoneOnTimeRate == null ? p("planmagnet.dashboards.exec.timeline.noPlan", "no plan to measure against") : `${_.milestoneCount} ${p("planmagnet.dashboards.exec.timeline.completed", "completed")}`
|
|
71
|
+
})] })
|
|
72
|
+
]
|
|
73
|
+
}), /* @__PURE__ */ s("div", {
|
|
74
|
+
className: "border-t pt-3",
|
|
75
|
+
children: [/* @__PURE__ */ s("div", {
|
|
76
|
+
className: "flex items-center justify-between text-xs text-muted-foreground",
|
|
77
|
+
children: [/* @__PURE__ */ o("span", { children: p("planmagnet.dashboards.exec.timeline.scopeAdherence", "Scope adherence") }), /* @__PURE__ */ o("span", { children: n(_.scopeAdherence.adherenceRate) })]
|
|
78
|
+
}), /* @__PURE__ */ o("p", {
|
|
79
|
+
className: "mt-0.5 text-xs text-muted-foreground",
|
|
80
|
+
children: p("planmagnet.dashboards.exec.timeline.scopeAdherenceDetail", "{{delivered}} of {{committed}} committed points delivered, across completed sprints with a plan.", {
|
|
81
|
+
delivered: _.scopeAdherence.deliveredPoints,
|
|
82
|
+
committed: _.scopeAdherence.committedPoints
|
|
83
|
+
})
|
|
84
|
+
})]
|
|
85
|
+
})]
|
|
86
|
+
}) : null
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { u as DeliveryTimelineCard };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=DeliveryTimelineCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeliveryTimelineCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/DeliveryTimelineCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { CalendarClock } from 'lucide-react';\nimport { DashboardCard, PercentBar, ratePercentLabel } from '../DashboardUI';\n\n/**\n * Timeline adherence (ANR-06): `planmagnetDeliveryKpis` (ANR-21) over the trailing 90 days — on-time rates for\n * sprints, releases and milestones, plus scope adherence (committed vs. delivered points). Workspace-wide, one\n * query, the server's own rates — never recomputed client-side.\n */\nconst GET_DELIVERY_KPIS = gql`\n query DashboardDeliveryKpis($workspaceId: ID!, $startDate: DateTime, $endDate: DateTime) {\n planmagnetDeliveryKpis(workspaceId: $workspaceId, startDate: $startDate, endDate: $endDate) {\n sprintCount\n sprintOnTimeRate\n releaseCount\n releaseOnTimeRate\n milestoneCount\n milestoneOnTimeRate\n scopeAdherence {\n adherenceRate\n committedPoints\n deliveredPoints\n }\n }\n }\n`;\n\ninterface DeliveryKpisData {\n planmagnetDeliveryKpis: {\n sprintCount: number;\n sprintOnTimeRate: number | null;\n releaseCount: number;\n releaseOnTimeRate: number | null;\n milestoneCount: number;\n milestoneOnTimeRate: number | null;\n scopeAdherence: {\n adherenceRate: number | null;\n committedPoints: number;\n deliveredPoints: number;\n };\n };\n}\n\nexport function DeliveryTimelineCard({\n workspaceId,\n startDate,\n endDate,\n onDrillDown,\n}: {\n workspaceId?: string | null;\n startDate: string;\n endDate: string;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<DeliveryKpisData>(GET_DELIVERY_KPIS, {\n variables: { workspaceId, startDate, endDate },\n skip: !workspaceId,\n });\n const kpis = data?.planmagnetDeliveryKpis;\n const nothingCompleted =\n !!kpis && kpis.sprintCount === 0 && kpis.releaseCount === 0 && kpis.milestoneCount === 0;\n\n return (\n <DashboardCard\n icon={<CalendarClock className=\"h-4 w-4\" />}\n title={t('planmagnet.dashboards.exec.timeline.title', 'Timeline adherence')}\n definition={t(\n 'planmagnet.dashboards.exec.timeline.definition',\n 'On-time delivery and scope adherence, over sprints/releases/milestones completed in the last 90 days.'\n )}\n loading={loading && !data}\n error={error}\n empty={nothingCompleted}\n emptyMessage={t(\n 'planmagnet.dashboards.exec.timeline.empty',\n 'Nothing completed in the last 90 days.'\n )}\n drillDown={{\n label: t('planmagnet.dashboards.exec.timeline.drillDown', 'Open delivery analytics'),\n onClick: onDrillDown,\n }}\n >\n {kpis ? (\n <div className=\"space-y-3\">\n <div className=\"grid grid-cols-3 gap-3\">\n <div>\n <PercentBar\n percent={kpis.sprintOnTimeRate == null ? null : kpis.sprintOnTimeRate * 100}\n label={t('planmagnet.dashboards.exec.timeline.sprints', 'Sprints on time')}\n />\n <p className=\"mt-1 text-xs text-muted-foreground\">\n {kpis.sprintOnTimeRate == null\n ? t('planmagnet.dashboards.exec.timeline.noPlan', 'no plan to measure against')\n : `${kpis.sprintCount} ${t('planmagnet.dashboards.exec.timeline.completed', 'completed')}`}\n </p>\n </div>\n <div>\n <PercentBar\n percent={kpis.releaseOnTimeRate == null ? null : kpis.releaseOnTimeRate * 100}\n label={t('planmagnet.dashboards.exec.timeline.releases', 'Releases on time')}\n />\n <p className=\"mt-1 text-xs text-muted-foreground\">\n {kpis.releaseOnTimeRate == null\n ? t('planmagnet.dashboards.exec.timeline.noPlan', 'no plan to measure against')\n : `${kpis.releaseCount} ${t('planmagnet.dashboards.exec.timeline.completed', 'completed')}`}\n </p>\n </div>\n <div>\n <PercentBar\n percent={kpis.milestoneOnTimeRate == null ? null : kpis.milestoneOnTimeRate * 100}\n label={t('planmagnet.dashboards.exec.timeline.milestones', 'Milestones on time')}\n />\n <p className=\"mt-1 text-xs text-muted-foreground\">\n {kpis.milestoneOnTimeRate == null\n ? t('planmagnet.dashboards.exec.timeline.noPlan', 'no plan to measure against')\n : `${kpis.milestoneCount} ${t('planmagnet.dashboards.exec.timeline.completed', 'completed')}`}\n </p>\n </div>\n </div>\n <div className=\"border-t pt-3\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>\n {t('planmagnet.dashboards.exec.timeline.scopeAdherence', 'Scope adherence')}\n </span>\n <span>{ratePercentLabel(kpis.scopeAdherence.adherenceRate)}</span>\n </div>\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {t(\n 'planmagnet.dashboards.exec.timeline.scopeAdherenceDetail',\n '{{delivered}} of {{committed}} committed points delivered, across completed sprints with a plan.',\n {\n delivered: kpis.scopeAdherence.deliveredPoints,\n committed: kpis.scopeAdherence.committedPoints,\n }\n )}\n </p>\n </div>\n </div>\n ) : null}\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;AAWA,IAAM,IAAoB,CAAG;;;;;;;;;;;;;;;;;AAkC7B,SAAgB,EAAqB,EACnC,gBACA,cACA,YACA,kBAMC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,YAAS,aAAU,EAA2B,GAAmB;EAC7E,WAAW;GAAE;GAAa;GAAW;GAAS;EAC9C,MAAM,CAAC;EACR,CAAC,EACI,IAAO,GAAM,wBACb,IACJ,CAAC,CAAC,KAAQ,EAAK,gBAAgB,KAAK,EAAK,iBAAiB,KAAK,EAAK,mBAAmB;AAEzF,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAe,WAAU,WAAY,CAAA;EAC3C,OAAO,EAAE,6CAA6C,qBAAqB;EAC3E,YAAY,EACV,kDACA,wGACD;EACD,SAAS,KAAW,CAAC;EACd;EACP,OAAO;EACP,cAAc,EACZ,6CACA,yCACD;EACD,WAAW;GACT,OAAO,EAAE,iDAAiD,0BAA0B;GACpF,SAAS;GACV;YAEA,IACC,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MACE,SAAS,EAAK,oBAAoB,OAAO,OAAO,EAAK,mBAAmB;MACxE,OAAO,EAAE,+CAA+C,kBAAkB;MAC1E,CAAA,EACF,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAK,oBAAoB,OACtB,EAAE,8CAA8C,6BAA6B,GAC7E,GAAG,EAAK,YAAY,GAAG,EAAE,iDAAiD,YAAY;MACxF,CAAA,CACA,EAAA,CAAA;KACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MACE,SAAS,EAAK,qBAAqB,OAAO,OAAO,EAAK,oBAAoB;MAC1E,OAAO,EAAE,gDAAgD,mBAAmB;MAC5E,CAAA,EACF,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAK,qBAAqB,OACvB,EAAE,8CAA8C,6BAA6B,GAC7E,GAAG,EAAK,aAAa,GAAG,EAAE,iDAAiD,YAAY;MACzF,CAAA,CACA,EAAA,CAAA;KACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;MACE,SAAS,EAAK,uBAAuB,OAAO,OAAO,EAAK,sBAAsB;MAC9E,OAAO,EAAE,kDAAkD,qBAAqB;MAChF,CAAA,EACF,kBAAC,KAAD;MAAG,WAAU;gBACV,EAAK,uBAAuB,OACzB,EAAE,8CAA8C,6BAA6B,GAC7E,GAAG,EAAK,eAAe,GAAG,EAAE,iDAAiD,YAAY;MAC3F,CAAA,CACA,EAAA,CAAA;KACF;OACN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD,EAAA,UACG,EAAE,sDAAsD,kBAAkB,EACtE,CAAA,EACP,kBAAC,QAAD,EAAA,UAAO,EAAiB,EAAK,eAAe,cAAc,EAAQ,CAAA,CAC9D;QACN,kBAAC,KAAD;KAAG,WAAU;eACV,EACC,4DACA,oGACA;MACE,WAAW,EAAK,eAAe;MAC/B,WAAW,EAAK,eAAe;MAChC,CACF;KACC,CAAA,CACA;MACF;OACJ;EACU,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function ObjectivesProgressCard({ workspaceId, title, definition, onDrillDown, }: {
|
|
2
|
+
workspaceId?: string | null;
|
|
3
|
+
title?: string;
|
|
4
|
+
definition?: string;
|
|
5
|
+
onDrillDown: () => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=ObjectivesProgressCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectivesProgressCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/ObjectivesProgressCard.tsx"],"names":[],"mappings":"AA4CA,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CA+CA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { DashboardCard as e, PercentBar as t, cappedSubtitle as n } from "../DashboardUI.js";
|
|
2
|
+
import { Flag 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/ObjectivesProgressCard.tsx
|
|
8
|
+
var l = i`
|
|
9
|
+
query DashboardActiveObjectives($workspaceId: ID!) {
|
|
10
|
+
planmagnetObjectives(
|
|
11
|
+
workspaceId: $workspaceId
|
|
12
|
+
filter: { status: ACTIVE }
|
|
13
|
+
pagination: { first: 8 }
|
|
14
|
+
) {
|
|
15
|
+
items {
|
|
16
|
+
id
|
|
17
|
+
title
|
|
18
|
+
progress
|
|
19
|
+
periodLabel
|
|
20
|
+
keyResults {
|
|
21
|
+
id
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
totalCount
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
function u({ workspaceId: i, title: u, definition: d, onDrillDown: f }) {
|
|
29
|
+
let { t: p } = c(), { data: m, loading: h, error: g } = a(l, {
|
|
30
|
+
variables: { workspaceId: i },
|
|
31
|
+
skip: !i
|
|
32
|
+
}), _ = m?.planmagnetObjectives.items ?? [], v = m?.planmagnetObjectives.totalCount ?? _.length;
|
|
33
|
+
return /* @__PURE__ */ o(e, {
|
|
34
|
+
icon: /* @__PURE__ */ o(r, { className: "h-4 w-4" }),
|
|
35
|
+
title: u ?? p("planmagnet.dashboards.objectives.title", "Strategic goal progress"),
|
|
36
|
+
definition: d ?? p("planmagnet.dashboards.objectives.definition", "Active objectives and their progress — the average of each one’s key results."),
|
|
37
|
+
loading: h && !m,
|
|
38
|
+
error: g,
|
|
39
|
+
empty: !h && _.length === 0,
|
|
40
|
+
emptyMessage: p("planmagnet.dashboards.objectives.empty", "No active objectives right now."),
|
|
41
|
+
drillDown: {
|
|
42
|
+
label: p("planmagnet.dashboards.viewAll", "View all objectives"),
|
|
43
|
+
onClick: f
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ s("div", {
|
|
46
|
+
className: "space-y-3",
|
|
47
|
+
children: [/* @__PURE__ */ o("p", {
|
|
48
|
+
className: "text-xs text-muted-foreground",
|
|
49
|
+
children: n(_.length, v, "active objective(s)")
|
|
50
|
+
}), _.map((e) => /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o(t, {
|
|
51
|
+
percent: e.progress,
|
|
52
|
+
label: e.title
|
|
53
|
+
}), /* @__PURE__ */ s("p", {
|
|
54
|
+
className: "mt-0.5 text-xs text-muted-foreground",
|
|
55
|
+
children: [
|
|
56
|
+
e.periodLabel,
|
|
57
|
+
" ·",
|
|
58
|
+
" ",
|
|
59
|
+
p("planmagnet.dashboards.objectives.keyResults", "{{count}} key result(s)", { count: e.keyResults.length })
|
|
60
|
+
]
|
|
61
|
+
})] }, e.id))]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { u as ObjectivesProgressCard };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=ObjectivesProgressCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectivesProgressCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/ObjectivesProgressCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Flag } from 'lucide-react';\nimport { DashboardCard, PercentBar, cappedSubtitle } from '../DashboardUI';\n\n/**\n * Strategic goal progress (ANR-06 \"Executive\", reused by CWF-31 \"Leadership\"'s product-strategy section —\n * same data, same card, two hosts). `progress` on `PlanmagnetObjective` is the live average of its key\n * results' own progress, computed server-side (`planmagnet-specs`); this card only ever reads it.\n */\nconst GET_ACTIVE_OBJECTIVES = gql`\n query DashboardActiveObjectives($workspaceId: ID!) {\n planmagnetObjectives(\n workspaceId: $workspaceId\n filter: { status: ACTIVE }\n pagination: { first: 8 }\n ) {\n items {\n id\n title\n progress\n periodLabel\n keyResults {\n id\n }\n }\n totalCount\n }\n }\n`;\n\ninterface ObjectiveRow {\n id: string;\n title: string;\n progress: number;\n periodLabel: string;\n keyResults: { id: string }[];\n}\n\ninterface ObjectivesData {\n planmagnetObjectives: { items: ObjectiveRow[]; totalCount: number };\n}\n\nexport function ObjectivesProgressCard({\n workspaceId,\n title,\n definition,\n onDrillDown,\n}: {\n workspaceId?: string | null;\n title?: string;\n definition?: string;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<ObjectivesData>(GET_ACTIVE_OBJECTIVES, {\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const objectives = data?.planmagnetObjectives.items ?? [];\n const totalCount = data?.planmagnetObjectives.totalCount ?? objectives.length;\n\n return (\n <DashboardCard\n icon={<Flag className=\"h-4 w-4\" />}\n title={title ?? t('planmagnet.dashboards.objectives.title', 'Strategic goal progress')}\n definition={\n definition ??\n t(\n 'planmagnet.dashboards.objectives.definition',\n 'Active objectives and their progress — the average of each one’s key results.'\n )\n }\n loading={loading && !data}\n error={error}\n empty={!loading && objectives.length === 0}\n emptyMessage={t('planmagnet.dashboards.objectives.empty', 'No active objectives right now.')}\n drillDown={{\n label: t('planmagnet.dashboards.viewAll', 'View all objectives'),\n onClick: onDrillDown,\n }}\n >\n <div className=\"space-y-3\">\n <p className=\"text-xs text-muted-foreground\">\n {cappedSubtitle(objectives.length, totalCount, 'active objective(s)')}\n </p>\n {objectives.map((o) => (\n <div key={o.id}>\n <PercentBar percent={o.progress} label={o.title} />\n <p className=\"mt-0.5 text-xs text-muted-foreground\">\n {o.periodLabel} ·{' '}\n {t('planmagnet.dashboards.objectives.keyResults', '{{count}} key result(s)', {\n count: o.keyResults.length,\n })}\n </p>\n </div>\n ))}\n </div>\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;AAWA,IAAM,IAAwB,CAAG;;;;;;;;;;;;;;;;;;;;AAiCjC,SAAgB,EAAuB,EACrC,gBACA,UACA,eACA,kBAMC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,YAAS,aAAU,EAAyB,GAAuB;EAC/E,WAAW,EAAE,gBAAa;EAC1B,MAAM,CAAC;EACR,CAAC,EACI,IAAa,GAAM,qBAAqB,SAAS,EAAE,EACnD,IAAa,GAAM,qBAAqB,cAAc,EAAW;AAEvE,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;EAClC,OAAO,KAAS,EAAE,0CAA0C,0BAA0B;EACtF,YACE,KACA,EACE,+CACA,gFACD;EAEH,SAAS,KAAW,CAAC;EACd;EACP,OAAO,CAAC,KAAW,EAAW,WAAW;EACzC,cAAc,EAAE,0CAA0C,kCAAkC;EAC5F,WAAW;GACT,OAAO,EAAE,iCAAiC,sBAAsB;GAChE,SAAS;GACV;YAED,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cACV,EAAe,EAAW,QAAQ,GAAY,sBAAsB;IACnE,CAAA,EACH,EAAW,KAAK,MACf,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD;IAAY,SAAS,EAAE;IAAU,OAAO,EAAE;IAAS,CAAA,EACnD,kBAAC,KAAD;IAAG,WAAU;cAAb;KACG,EAAE;KAAY;KAAG;KACjB,EAAE,+CAA+C,2BAA2B,EAC3E,OAAO,EAAE,WAAW,QACrB,CAAC;KACA;MACA,EAAA,EARI,EAAE,GAQN,CACN,CACE;;EACQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortfolioHealthCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/PortfolioHealthCard.tsx"],"names":[],"mappings":"AA6DA,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CA2EA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { DashboardCard as e, cappedSubtitle as t } from "../DashboardUI.js";
|
|
2
|
+
import { Briefcase 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/PortfolioHealthCard.tsx
|
|
8
|
+
var c = r`
|
|
9
|
+
query DashboardPortfolioHealth($workspaceId: ID!) {
|
|
10
|
+
planmagnetPortfolios(workspaceId: $workspaceId, pagination: { first: 8 }) {
|
|
11
|
+
items {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
status
|
|
15
|
+
budgetTotal
|
|
16
|
+
currency
|
|
17
|
+
projects {
|
|
18
|
+
id
|
|
19
|
+
status
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
totalCount
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`, l = new Set(["ON_HOLD", "CANCELLED"]);
|
|
26
|
+
function u(e, t) {
|
|
27
|
+
try {
|
|
28
|
+
return new Intl.NumberFormat(void 0, {
|
|
29
|
+
style: "currency",
|
|
30
|
+
currency: t ?? "USD",
|
|
31
|
+
maximumFractionDigits: 0
|
|
32
|
+
}).format(e);
|
|
33
|
+
} catch {
|
|
34
|
+
return `${Math.round(e).toLocaleString()} ${t ?? ""}`.trim();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function d({ workspaceId: r, onDrillDown: d }) {
|
|
38
|
+
let { t: f } = s(), { data: p, loading: m, error: h } = i(c, {
|
|
39
|
+
variables: { workspaceId: r },
|
|
40
|
+
skip: !r
|
|
41
|
+
}), g = p?.planmagnetPortfolios.items ?? [], _ = p?.planmagnetPortfolios.totalCount ?? g.length;
|
|
42
|
+
return /* @__PURE__ */ a(e, {
|
|
43
|
+
icon: /* @__PURE__ */ a(n, { className: "h-4 w-4" }),
|
|
44
|
+
title: f("planmagnet.dashboards.exec.portfolios.title", "Portfolio health"),
|
|
45
|
+
definition: f("planmagnet.dashboards.exec.portfolios.definition", "Every portfolio and how its projects are distributed by status."),
|
|
46
|
+
loading: m && !p,
|
|
47
|
+
error: h,
|
|
48
|
+
empty: !m && g.length === 0,
|
|
49
|
+
emptyMessage: f("planmagnet.dashboards.exec.portfolios.empty", "No portfolios yet."),
|
|
50
|
+
drillDown: {
|
|
51
|
+
label: f("planmagnet.dashboards.viewAll", "View all portfolios"),
|
|
52
|
+
onClick: d
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ o("div", {
|
|
55
|
+
className: "space-y-3",
|
|
56
|
+
children: [/* @__PURE__ */ a("p", {
|
|
57
|
+
className: "text-xs text-muted-foreground",
|
|
58
|
+
children: t(g.length, _, "portfolio(s)")
|
|
59
|
+
}), /* @__PURE__ */ o("table", {
|
|
60
|
+
className: "w-full text-sm",
|
|
61
|
+
children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", {
|
|
62
|
+
className: "text-left text-xs text-muted-foreground",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ a("th", {
|
|
65
|
+
className: "py-1 pr-2 font-normal",
|
|
66
|
+
children: f("planmagnet.dashboards.exec.portfolios.name", "Portfolio")
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ a("th", {
|
|
69
|
+
className: "py-1 pr-2 text-right font-normal",
|
|
70
|
+
children: f("planmagnet.dashboards.exec.portfolios.projects", "Projects")
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ a("th", {
|
|
73
|
+
className: "py-1 pr-2 text-right font-normal",
|
|
74
|
+
children: f("planmagnet.dashboards.exec.portfolios.atRisk", "At risk")
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ a("th", {
|
|
77
|
+
className: "py-1 text-right font-normal",
|
|
78
|
+
children: f("planmagnet.dashboards.exec.portfolios.budget", "Budget")
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}) }), /* @__PURE__ */ a("tbody", { children: g.map((e) => {
|
|
82
|
+
let t = e.projects.filter((e) => l.has(e.status)).length;
|
|
83
|
+
return /* @__PURE__ */ o("tr", {
|
|
84
|
+
className: "border-t align-middle",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ o("td", {
|
|
87
|
+
className: "py-1.5 pr-2",
|
|
88
|
+
children: [/* @__PURE__ */ a("span", {
|
|
89
|
+
className: "font-medium",
|
|
90
|
+
children: e.name
|
|
91
|
+
}), /* @__PURE__ */ a("span", {
|
|
92
|
+
className: "ml-1.5 text-xs text-muted-foreground",
|
|
93
|
+
children: e.status.toLowerCase()
|
|
94
|
+
})]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ a("td", {
|
|
97
|
+
className: "py-1.5 pr-2 text-right tabular-nums",
|
|
98
|
+
children: e.projects.length
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ a("td", {
|
|
101
|
+
className: `py-1.5 pr-2 text-right tabular-nums ${t > 0 ? "text-status-warning-text" : ""}`,
|
|
102
|
+
children: t
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ a("td", {
|
|
105
|
+
className: "py-1.5 text-right tabular-nums",
|
|
106
|
+
children: e.budgetTotal == null ? "—" : u(e.budgetTotal, e.currency)
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
}, e.id);
|
|
110
|
+
}) })]
|
|
111
|
+
})]
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { d as PortfolioHealthCard };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=PortfolioHealthCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortfolioHealthCard.js","names":[],"sources":["../../../../src/planmagnet/dashboards/cards/PortfolioHealthCard.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Briefcase } from 'lucide-react';\nimport { DashboardCard, cappedSubtitle } from '../DashboardUI';\n\n/**\n * Portfolio health (ANR-06): `planmagnetPortfolios` and, for each, its own `projects { status }` —\n * ONE request, no per-portfolio follow-up query. `Portfolio`/`PlanmagnetProject` carry no dedicated\n * \"health\" field (confirmed against `graphql/wspace.graphql`); health here is the same status-mix\n * read the server actually exposes, not a fabricated score.\n */\n// \"first: 8\" below is a literal, not a JS constant, on purpose: graphql-schema-drift's extractor only\n// resolves interpolations of same-file backtick STRING constants, not numbers, so the two \"8\"s here and\n// in cappedSubtitle's caller must be kept in sync by hand.\nconst GET_PORTFOLIO_HEALTH = gql`\n query DashboardPortfolioHealth($workspaceId: ID!) {\n planmagnetPortfolios(workspaceId: $workspaceId, pagination: { first: 8 }) {\n items {\n id\n name\n status\n budgetTotal\n currency\n projects {\n id\n status\n }\n }\n totalCount\n }\n }\n`;\n\ninterface PortfolioRow {\n id: string;\n name: string;\n status: string;\n budgetTotal: number | null;\n currency: string | null;\n projects: { id: string; status: string }[];\n}\n\ninterface PortfolioHealthData {\n planmagnetPortfolios: { items: PortfolioRow[]; totalCount: number };\n}\n\nconst AT_RISK_STATUSES = new Set(['ON_HOLD', 'CANCELLED']);\n\nfunction money(amount: number, currency: string | null): string {\n try {\n return new Intl.NumberFormat(undefined, {\n style: 'currency',\n currency: currency ?? 'USD',\n maximumFractionDigits: 0,\n }).format(amount);\n } catch {\n return `${Math.round(amount).toLocaleString()} ${currency ?? ''}`.trim();\n }\n}\n\nexport function PortfolioHealthCard({\n workspaceId,\n onDrillDown,\n}: {\n workspaceId?: string | null;\n onDrillDown: () => void;\n}) {\n const { t } = useI18n();\n const { data, loading, error } = useQuery<PortfolioHealthData>(GET_PORTFOLIO_HEALTH, {\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const portfolios = data?.planmagnetPortfolios.items ?? [];\n const totalCount = data?.planmagnetPortfolios.totalCount ?? portfolios.length;\n\n return (\n <DashboardCard\n icon={<Briefcase className=\"h-4 w-4\" />}\n title={t('planmagnet.dashboards.exec.portfolios.title', 'Portfolio health')}\n definition={t(\n 'planmagnet.dashboards.exec.portfolios.definition',\n 'Every portfolio and how its projects are distributed by status.'\n )}\n loading={loading && !data}\n error={error}\n empty={!loading && portfolios.length === 0}\n emptyMessage={t('planmagnet.dashboards.exec.portfolios.empty', 'No portfolios yet.')}\n drillDown={{\n label: t('planmagnet.dashboards.viewAll', 'View all portfolios'),\n onClick: onDrillDown,\n }}\n >\n <div className=\"space-y-3\">\n <p className=\"text-xs text-muted-foreground\">\n {cappedSubtitle(portfolios.length, totalCount, 'portfolio(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.exec.portfolios.name', 'Portfolio')}\n </th>\n <th className=\"py-1 pr-2 text-right font-normal\">\n {t('planmagnet.dashboards.exec.portfolios.projects', 'Projects')}\n </th>\n <th className=\"py-1 pr-2 text-right font-normal\">\n {t('planmagnet.dashboards.exec.portfolios.atRisk', 'At risk')}\n </th>\n <th className=\"py-1 text-right font-normal\">\n {t('planmagnet.dashboards.exec.portfolios.budget', 'Budget')}\n </th>\n </tr>\n </thead>\n <tbody>\n {portfolios.map((p) => {\n const atRisk = p.projects.filter((proj) => AT_RISK_STATUSES.has(proj.status)).length;\n return (\n <tr key={p.id} className=\"border-t align-middle\">\n <td className=\"py-1.5 pr-2\">\n <span className=\"font-medium\">{p.name}</span>\n <span className=\"ml-1.5 text-xs text-muted-foreground\">\n {p.status.toLowerCase()}\n </span>\n </td>\n <td className=\"py-1.5 pr-2 text-right tabular-nums\">{p.projects.length}</td>\n <td\n className={`py-1.5 pr-2 text-right tabular-nums ${atRisk > 0 ? 'text-status-warning-text' : ''}`}\n >\n {atRisk}\n </td>\n <td className=\"py-1.5 text-right tabular-nums\">\n {p.budgetTotal != null ? money(p.budgetTotal, p.currency) : '—'}\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n </DashboardCard>\n );\n}\n"],"mappings":";;;;;;;AAeA,IAAM,IAAuB,CAAG;;;;;;;;;;;;;;;;;GAgC1B,IAAmB,IAAI,IAAI,CAAC,WAAW,YAAY,CAAC;AAE1D,SAAS,EAAM,GAAgB,GAAiC;AAC9D,KAAI;AACF,SAAO,IAAI,KAAK,aAAa,KAAA,GAAW;GACtC,OAAO;GACP,UAAU,KAAY;GACtB,uBAAuB;GACxB,CAAC,CAAC,OAAO,EAAO;SACX;AACN,SAAO,GAAG,KAAK,MAAM,EAAO,CAAC,gBAAgB,CAAC,GAAG,KAAY,KAAK,MAAM;;;AAI5E,SAAgB,EAAoB,EAClC,gBACA,kBAIC;CACD,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,YAAS,aAAU,EAA8B,GAAsB;EACnF,WAAW,EAAE,gBAAa;EAC1B,MAAM,CAAC;EACR,CAAC,EACI,IAAa,GAAM,qBAAqB,SAAS,EAAE,EACnD,IAAa,GAAM,qBAAqB,cAAc,EAAW;AAEvE,QACE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAW,WAAU,WAAY,CAAA;EACvC,OAAO,EAAE,+CAA+C,mBAAmB;EAC3E,YAAY,EACV,oDACA,kEACD;EACD,SAAS,KAAW,CAAC;EACd;EACP,OAAO,CAAC,KAAW,EAAW,WAAW;EACzC,cAAc,EAAE,+CAA+C,qBAAqB;EACpF,WAAW;GACT,OAAO,EAAE,iCAAiC,sBAAsB;GAChE,SAAS;GACV;YAED,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cACV,EAAe,EAAW,QAAQ,GAAY,eAAe;IAC5D,CAAA,EACJ,kBAAC,SAAD;IAAO,WAAU;cAAjB,CACE,kBAAC,SAAD,EAAA,UACE,kBAAC,MAAD;KAAI,WAAU;eAAd;MACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,8CAA8C,YAAY;OAC1D,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,kDAAkD,WAAW;OAC7D,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,gDAAgD,UAAU;OAC1D,CAAA;MACL,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAE,gDAAgD,SAAS;OACzD,CAAA;MACF;QACC,CAAA,EACR,kBAAC,SAAD,EAAA,UACG,EAAW,KAAK,MAAM;KACrB,IAAM,IAAS,EAAE,SAAS,QAAQ,MAAS,EAAiB,IAAI,EAAK,OAAO,CAAC,CAAC;AAC9E,YACE,kBAAC,MAAD;MAAe,WAAU;gBAAzB;OACE,kBAAC,MAAD;QAAI,WAAU;kBAAd,CACE,kBAAC,QAAD;SAAM,WAAU;mBAAe,EAAE;SAAY,CAAA,EAC7C,kBAAC,QAAD;SAAM,WAAU;mBACb,EAAE,OAAO,aAAa;SAClB,CAAA,CACJ;;OACL,kBAAC,MAAD;QAAI,WAAU;kBAAuC,EAAE,SAAS;QAAY,CAAA;OAC5E,kBAAC,MAAD;QACE,WAAW,uCAAuC,IAAS,IAAI,6BAA6B;kBAE3F;QACE,CAAA;OACL,kBAAC,MAAD;QAAI,WAAU;kBACX,EAAE,eAAe,OAA0C,MAAnC,EAAM,EAAE,aAAa,EAAE,SAAS;QACtD,CAAA;OACF;QAhBI,EAAE,GAgBN;MAEP,EACI,CAAA,CACF;MACJ;;EACQ,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function QualityMetricsCard({ workspaceId, projectId, startDate, endDate, onDrillDown, }: {
|
|
2
|
+
workspaceId?: string | null;
|
|
3
|
+
projectId: string;
|
|
4
|
+
startDate: string;
|
|
5
|
+
endDate: string;
|
|
6
|
+
onDrillDown: () => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=QualityMetricsCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QualityMetricsCard.d.ts","sourceRoot":"","sources":["../../../../src/planmagnet/dashboards/cards/QualityMetricsCard.tsx"],"names":[],"mappings":"AA+CA,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,2CAkEA"}
|