@burdenoff/microfe-planmagnet 2026.930.13 → 2026.930.15
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 +166 -126
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +245 -225
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/activity/activityDescribe.d.ts +38 -0
- package/dist/planmagnet/activity/activityDescribe.d.ts.map +1 -0
- package/dist/planmagnet/activity/activityDescribe.js +123 -0
- package/dist/planmagnet/activity/activityDescribe.js.map +1 -0
- package/dist/planmagnet/activity/relativeTime.d.ts +8 -0
- package/dist/planmagnet/activity/relativeTime.d.ts.map +1 -0
- package/dist/planmagnet/activity/relativeTime.js +38 -0
- package/dist/planmagnet/activity/relativeTime.js.map +1 -0
- package/dist/planmagnet/comments/WorkItemActivity.d.ts.map +1 -1
- package/dist/planmagnet/comments/WorkItemActivity.js +35 -38
- package/dist/planmagnet/comments/WorkItemActivity.js.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.js +25 -25
- package/dist/planmagnet/controls/ProjectControls.d.ts.map +1 -1
- package/dist/planmagnet/controls/ProjectControls.js +53 -46
- package/dist/planmagnet/controls/ProjectControls.js.map +1 -1
- 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/ActivityActivityPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ActivityActivityPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ActivityActivityPagePage.js +291 -0
- package/dist/planmagnet/pages/ActivityActivityPagePage.js.map +1 -0
- package/dist/planmagnet/pages/AutomationAutomationRulesPagePage.js +15 -15
- package/dist/planmagnet/pages/AutomationCreateAutomationRulePagePage.js +9 -9
- 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/ProductsEditProductPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsEditRoadmapPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +118 -109
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProgramsEditProgramPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsMilestoneDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsPlanningDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +13 -13
- package/dist/planmagnet/pages/RisksRiskDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/TeamCreateTeamPagePage.js +4 -4
- package/dist/planmagnet/pages/TeamTeamDetailPagePage.js +6 -6
- package/dist/planmagnet/pages/TeamTeamEditPagePage.js +6 -6
- 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/RoadmapControls.js +21 -21
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts +29 -0
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapPresentation.d.ts +37 -0
- package/dist/planmagnet/roadmaps/RoadmapPresentation.d.ts.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapPresentation.js +210 -0
- package/dist/planmagnet/roadmaps/RoadmapPresentation.js.map +1 -0
- package/dist/planmagnet/team/TeamControls.d.ts.map +1 -1
- package/dist/planmagnet/team/TeamControls.js +134 -124
- package/dist/planmagnet/team/TeamControls.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkItemActivity.js","names":[],"sources":["../../../src/planmagnet/comments/WorkItemActivity.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { PersonName } from '../people/People';\n\n/**\n * A work item's recorded history (P1.4). This card used to synthesise three\n * entries client-side, including \"Status changed to X\" attributed to whoever\n * was assigned, at the item's updatedAt. That was fabricated history. It now\n * shows only what the server has recorded: creation, status changes and\n * comments
|
|
1
|
+
{"version":3,"file":"WorkItemActivity.js","names":[],"sources":["../../../src/planmagnet/comments/WorkItemActivity.tsx"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent, CardHeader, CardTitle } from '@burdenoff/fe-libs/ui';\nimport { PersonName } from '../people/People';\nimport { ActivityEventSentence } from '../activity/activityDescribe';\nimport { isForbidden } from '../utils/graphqlErrors';\n\n/**\n * A work item's recorded history (P1.4). This card used to synthesise three\n * entries client-side, including \"Status changed to X\" attributed to whoever\n * was assigned, at the item's updatedAt. That was fabricated history. It now\n * shows only what the server has recorded: creation, status changes and\n * comments.\n *\n * CWF-09 added a fourth kind, FIELD_CHANGED (assignment and the other tracked fields —\n * `field`/`fromValue`/`toValue`), rendered through the same sentence builder the workspace Activity page uses\n * (`activity/activityDescribe.tsx`) so the two surfaces never disagree on wording.\n */\n\nconst ACTIVITY = gql`\n query WorkItemActivity($workItemId: ID!) {\n planmagnetWorkItemActivity(workItemId: $workItemId, first: 50) {\n totalCount\n truncated\n items {\n id\n kind\n actorId\n at\n fromStatus\n toStatus\n excerpt\n field\n fromValue\n toValue\n }\n }\n }\n`;\n\ninterface ActivityEvent {\n id: string;\n kind: string;\n actorId: string | null;\n at: string;\n fromStatus: string | null;\n toStatus: string | null;\n excerpt: string | null;\n field: string | null;\n fromValue: string | null;\n toValue: string | null;\n}\n\nexport function WorkItemActivity({ workItemId }: { workItemId: string }) {\n const { data, loading, error } = useQuery<{\n planmagnetWorkItemActivity: { totalCount: number; truncated: boolean; items: ActivityEvent[] };\n }>(ACTIVITY, { variables: { workItemId }, skip: !workItemId });\n const activity = data?.planmagnetWorkItemActivity;\n const events = activity?.items ?? [];\n\n return (\n <Card data-testid=\"work-item-activity\">\n <CardHeader>\n <CardTitle>Activity</CardTitle>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {loading && !data && <p className=\"text-sm text-muted-foreground\">Loading activity…</p>}\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {isForbidden(error)\n ? 'You do not have access to this item’s activity.'\n : `Activity could not be loaded: ${error.message}`}\n </p>\n )}\n <ol className=\"space-y-3\">\n {events.map((event, i) => (\n <li key={event.id} className=\"flex gap-3\" data-testid=\"activity-event\">\n <div className=\"flex flex-col items-center\">\n <div className=\"h-2.5 w-2.5 rounded-full bg-primary mt-1.5\" />\n {i < events.length - 1 && <div className=\"w-px flex-1 bg-border\" />}\n </div>\n <div className=\"pb-1 min-w-0\">\n <p className=\"text-sm break-words\">\n <ActivityEventSentence event={event} />\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {event.actorId ? <PersonName id={event.actorId} /> : 'Unknown'} ·{' '}\n {new Date(event.at).toLocaleString()}\n </p>\n </div>\n </li>\n ))}\n </ol>\n {activity?.truncated && (\n <p className=\"text-xs text-muted-foreground\">\n Showing the latest {events.length} of {activity.totalCount} events.\n </p>\n )}\n <p className=\"text-xs text-muted-foreground\">\n Creation, status changes, field edits and comments are recorded.\n </p>\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;AAmBA,IAAM,IAAW,CAAG;;;;;;;;;;;;;;;;;;;;AAkCpB,SAAgB,EAAiB,EAAE,iBAAsC;CACvE,IAAM,EAAE,SAAM,YAAS,aAAU,EAE9B,GAAU;EAAE,WAAW,EAAE,eAAY;EAAE,MAAM,CAAC;EAAY,CAAC,EACxD,IAAW,GAAM,4BACjB,IAAS,GAAU,SAAS,EAAE;AAEpC,QACE,kBAAC,GAAD;EAAM,eAAY;YAAlB,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UAAW,YAAoB,CAAA,EACpB,CAAA,EACb,kBAAC,GAAD;GAAa,WAAU;aAAvB;IACG,KAAW,CAAC,KAAQ,kBAAC,KAAD;KAAG,WAAU;eAAgC;KAAqB,CAAA;IACtF,KACC,kBAAC,KAAD;KAAG,MAAK;KAAQ,WAAU;eACvB,EAAY,EAAM,GACf,oDACA,iCAAiC,EAAM;KACzC,CAAA;IAEN,kBAAC,MAAD;KAAI,WAAU;eACX,EAAO,KAAK,GAAO,MAClB,kBAAC,MAAD;MAAmB,WAAU;MAAa,eAAY;gBAAtD,CACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,OAAD,EAAK,WAAU,8CAA+C,CAAA,EAC7D,IAAI,EAAO,SAAS,KAAK,kBAAC,OAAD,EAAK,WAAU,yBAA0B,CAAA,CAC/D;UACN,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,KAAD;QAAG,WAAU;kBACX,kBAAC,GAAD,EAA8B,UAAS,CAAA;QACrC,CAAA,EACJ,kBAAC,KAAD;QAAG,WAAU;kBAAb;SACG,EAAM,UAAU,kBAAC,GAAD,EAAY,IAAI,EAAM,SAAW,CAAA,GAAG;SAAU;SAAG;SACjE,IAAI,KAAK,EAAM,GAAG,CAAC,gBAAgB;SAClC;UACA;SACH;QAdI,EAAM,GAcV,CACL;KACC,CAAA;IACJ,GAAU,aACT,kBAAC,KAAD;KAAG,WAAU;eAAb;MAA6C;MACvB,EAAO;MAAO;MAAK,EAAS;MAAW;MACzD;;IAEN,kBAAC,KAAD;KAAG,WAAU;eAAgC;KAEzC,CAAA;IACQ;KACT"}
|
|
@@ -3,8 +3,8 @@ import { LEAVES_PAGE_CONTEXT as t, throwOnError as n } from "../utils/mutationRe
|
|
|
3
3
|
import { ConfirmButton as r, ErrorLine as i } from "./ConfirmButton.js";
|
|
4
4
|
import { enumLabel as a } from "./WorkItemControls.js";
|
|
5
5
|
import { ProjectSelect as o, WorkItemSearchSelect as s } from "./Pickers.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { detailPath as c } from "../utils/rowNavigation.js";
|
|
7
|
+
import { parseIntField as l } from "../utils/formValidation.js";
|
|
8
8
|
import { useState as u } from "react";
|
|
9
9
|
import { BarChart3 as d, Pencil as f, ThumbsUp as p, Trash2 as m } from "lucide-react";
|
|
10
10
|
import { gql as h } from "@apollo/client";
|
|
@@ -82,13 +82,13 @@ function F({ featureId: e, voted: t }) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function I({ feature: o }) {
|
|
85
|
-
let s = e(), [
|
|
85
|
+
let s = e(), [l, f] = g(M, P), [p, h] = g(N, {
|
|
86
86
|
refetchQueries: k.filter((e) => e !== "GetFeatureRequest"),
|
|
87
87
|
context: t
|
|
88
88
|
}), [b, x] = u(null), S = f.loading || h.loading, C = O.includes(o.status) ? O : [o.status, ...O], w = async (e) => {
|
|
89
89
|
x(null);
|
|
90
90
|
try {
|
|
91
|
-
await n(
|
|
91
|
+
await n(l({ variables: {
|
|
92
92
|
id: o.id,
|
|
93
93
|
input: { status: e }
|
|
94
94
|
} }));
|
|
@@ -127,7 +127,7 @@ function I({ feature: o }) {
|
|
|
127
127
|
size: "sm",
|
|
128
128
|
variant: "outline",
|
|
129
129
|
"data-testid": "feature-analytics",
|
|
130
|
-
onClick: () => s(
|
|
130
|
+
onClick: () => s(c("/products/feature-analytics-page", o.id)),
|
|
131
131
|
children: [/* @__PURE__ */ _(d, { className: "mr-1 h-4 w-4" }), "Analytics"]
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ _(r, {
|
|
@@ -153,18 +153,18 @@ function L({ feature: e }) {
|
|
|
153
153
|
effortEstimate: e.effortEstimate ?? "",
|
|
154
154
|
projectId: e.projectId ?? "",
|
|
155
155
|
workItemId: e.workItemId ?? ""
|
|
156
|
-
}, [r, a] = u(!1), [
|
|
156
|
+
}, [r, a] = u(!1), [c, d] = u(t), [p, m] = u(null), [h, O] = g(M, P), k = l(c.businessValue, {
|
|
157
157
|
min: 0,
|
|
158
158
|
max: 100
|
|
159
|
-
}), A =
|
|
159
|
+
}), A = c.title.trim() !== "" && !k.invalid && !O.loading, j = async () => {
|
|
160
160
|
m(null);
|
|
161
161
|
let r = (e) => e.trim() ? e.trim() : null, i = {
|
|
162
|
-
title:
|
|
163
|
-
description: r(
|
|
162
|
+
title: c.title.trim(),
|
|
163
|
+
description: r(c.description),
|
|
164
164
|
businessValue: k.value ?? null,
|
|
165
|
-
effortEstimate: r(
|
|
166
|
-
projectId:
|
|
167
|
-
workItemId:
|
|
165
|
+
effortEstimate: r(c.effortEstimate),
|
|
166
|
+
projectId: c.projectId || null,
|
|
167
|
+
workItemId: c.workItemId || null
|
|
168
168
|
}, o = {
|
|
169
169
|
title: t.title,
|
|
170
170
|
description: r(t.description),
|
|
@@ -213,9 +213,9 @@ function L({ feature: e }) {
|
|
|
213
213
|
}), /* @__PURE__ */ _(b, {
|
|
214
214
|
id: "feature-edit-title",
|
|
215
215
|
className: "mt-1",
|
|
216
|
-
value:
|
|
216
|
+
value: c.title,
|
|
217
217
|
onChange: (e) => d({
|
|
218
|
-
...
|
|
218
|
+
...c,
|
|
219
219
|
title: e.target.value
|
|
220
220
|
})
|
|
221
221
|
})] }),
|
|
@@ -226,9 +226,9 @@ function L({ feature: e }) {
|
|
|
226
226
|
}), /* @__PURE__ */ _("textarea", {
|
|
227
227
|
id: "feature-edit-description",
|
|
228
228
|
className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[72px]",
|
|
229
|
-
value:
|
|
229
|
+
value: c.description,
|
|
230
230
|
onChange: (e) => d({
|
|
231
|
-
...
|
|
231
|
+
...c,
|
|
232
232
|
description: e.target.value
|
|
233
233
|
})
|
|
234
234
|
})] }),
|
|
@@ -244,10 +244,10 @@ function L({ feature: e }) {
|
|
|
244
244
|
min: 0,
|
|
245
245
|
max: 100,
|
|
246
246
|
className: "mt-1",
|
|
247
|
-
value:
|
|
247
|
+
value: c.businessValue,
|
|
248
248
|
"aria-invalid": k.invalid,
|
|
249
249
|
onChange: (e) => d({
|
|
250
|
-
...
|
|
250
|
+
...c,
|
|
251
251
|
businessValue: e.target.value
|
|
252
252
|
})
|
|
253
253
|
})] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
@@ -258,9 +258,9 @@ function L({ feature: e }) {
|
|
|
258
258
|
id: "feature-edit-effort",
|
|
259
259
|
className: "mt-1",
|
|
260
260
|
placeholder: "e.g. M",
|
|
261
|
-
value:
|
|
261
|
+
value: c.effortEstimate,
|
|
262
262
|
onChange: (e) => d({
|
|
263
|
-
...
|
|
263
|
+
...c,
|
|
264
264
|
effortEstimate: e.target.value
|
|
265
265
|
})
|
|
266
266
|
})] })]
|
|
@@ -274,10 +274,10 @@ function L({ feature: e }) {
|
|
|
274
274
|
className: "mt-1",
|
|
275
275
|
children: /* @__PURE__ */ _(o, {
|
|
276
276
|
id: "feature-edit-project",
|
|
277
|
-
value:
|
|
277
|
+
value: c.projectId,
|
|
278
278
|
noneLabel: "No project",
|
|
279
279
|
onChange: (e) => d({
|
|
280
|
-
...
|
|
280
|
+
...c,
|
|
281
281
|
projectId: e,
|
|
282
282
|
workItemId: ""
|
|
283
283
|
})
|
|
@@ -291,10 +291,10 @@ function L({ feature: e }) {
|
|
|
291
291
|
className: "mt-1",
|
|
292
292
|
children: /* @__PURE__ */ _(s, {
|
|
293
293
|
id: "feature-edit-workitem",
|
|
294
|
-
projectId:
|
|
295
|
-
value:
|
|
294
|
+
projectId: c.projectId || void 0,
|
|
295
|
+
value: c.workItemId,
|
|
296
296
|
onChange: (e) => d({
|
|
297
|
-
...
|
|
297
|
+
...c,
|
|
298
298
|
workItemId: e
|
|
299
299
|
})
|
|
300
300
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectControls.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/ProjectControls.tsx"],"names":[],"mappings":"AAWA;;;;;GAKG;AAEH,eAAO,MAAM,gBAAgB,kFAOnB,CAAC;AAyBX,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,IAAI,EACJ,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,
|
|
1
|
+
{"version":3,"file":"ProjectControls.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/ProjectControls.tsx"],"names":[],"mappings":"AAWA;;;;;GAKG;AAEH,eAAO,MAAM,gBAAgB,kFAOnB,CAAC;AAyBX,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,IAAI,EACJ,MAAM,GACP,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,2CA6GA"}
|
|
@@ -4,118 +4,125 @@ import { ConfirmButton as r, ErrorLine as i } from "./ConfirmButton.js";
|
|
|
4
4
|
import { enumLabel as a } from "./WorkItemControls.js";
|
|
5
5
|
import { detailPath as o } from "../utils/rowNavigation.js";
|
|
6
6
|
import { useState as s } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import { gql as
|
|
9
|
-
import { useMutation as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { Button as
|
|
7
|
+
import { History as c, ListPlus as l, Pencil as u, Trash2 as d, Workflow as f } from "lucide-react";
|
|
8
|
+
import { gql as p } from "@apollo/client";
|
|
9
|
+
import { useMutation as m } from "@apollo/client/react";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
+
import { Button as _ } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/planmagnet/controls/ProjectControls.tsx
|
|
13
|
-
var
|
|
13
|
+
var v = [
|
|
14
14
|
"PLANNING",
|
|
15
15
|
"ACTIVE",
|
|
16
16
|
"ON_HOLD",
|
|
17
17
|
"COMPLETED",
|
|
18
18
|
"CANCELLED",
|
|
19
19
|
"ARCHIVED"
|
|
20
|
-
],
|
|
20
|
+
], y = p`
|
|
21
21
|
mutation ProjectControlsStatus($id: ID!, $input: PlanmagnetUpdateProjectInput!) {
|
|
22
22
|
planmagnetUpdateProject(id: $id, input: $input) {
|
|
23
23
|
id
|
|
24
24
|
status
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
`,
|
|
27
|
+
`, b = p`
|
|
28
28
|
mutation ProjectControlsDelete($id: ID!) {
|
|
29
29
|
planmagnetDeleteProject(id: $id)
|
|
30
30
|
}
|
|
31
|
-
`,
|
|
31
|
+
`, x = [
|
|
32
32
|
"GetProjects",
|
|
33
33
|
"GetActiveProjects",
|
|
34
34
|
"GetBoardProjects",
|
|
35
35
|
"GetDashboardData",
|
|
36
36
|
"AdminPlanmagnetProjects"
|
|
37
37
|
];
|
|
38
|
-
function
|
|
39
|
-
let
|
|
40
|
-
refetchQueries: ["GetProjectDetail", ...
|
|
38
|
+
function S({ projectId: p, name: S, status: C }) {
|
|
39
|
+
let w = e(), [T, E] = m(y, {
|
|
40
|
+
refetchQueries: ["GetProjectDetail", ...x],
|
|
41
41
|
awaitRefetchQueries: !0
|
|
42
|
-
}), [
|
|
43
|
-
refetchQueries:
|
|
42
|
+
}), [D, O] = m(b, {
|
|
43
|
+
refetchQueries: x,
|
|
44
44
|
context: t
|
|
45
|
-
}), [
|
|
46
|
-
|
|
45
|
+
}), [k, A] = s(null), j = E.loading || O.loading, M = v.includes(C) ? v : [C, ...v], N = async (e) => {
|
|
46
|
+
A(null);
|
|
47
47
|
try {
|
|
48
|
-
await n(
|
|
49
|
-
id:
|
|
48
|
+
await n(T({ variables: {
|
|
49
|
+
id: p,
|
|
50
50
|
input: { status: e }
|
|
51
51
|
} }));
|
|
52
52
|
} catch (e) {
|
|
53
|
-
|
|
53
|
+
A(e instanceof Error ? e.message : "The status could not be changed.");
|
|
54
54
|
}
|
|
55
|
-
},
|
|
56
|
-
|
|
55
|
+
}, P = async () => {
|
|
56
|
+
A(null);
|
|
57
57
|
try {
|
|
58
|
-
await n(
|
|
58
|
+
await n(D({ variables: { id: p } })), w("/projects/projects-page");
|
|
59
59
|
} catch (e) {
|
|
60
|
-
|
|
60
|
+
A(e instanceof Error ? e.message : "The project could not be deleted.");
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ g("div", {
|
|
64
64
|
className: "flex flex-col items-end gap-2",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ g("div", {
|
|
66
66
|
className: "flex flex-wrap items-center justify-end gap-2",
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ h("select", {
|
|
69
69
|
"aria-label": "Project status",
|
|
70
70
|
"data-testid": "project-status",
|
|
71
71
|
className: "rounded-md border border-input bg-background px-2 py-1 text-sm disabled:opacity-60",
|
|
72
|
-
value:
|
|
73
|
-
disabled:
|
|
72
|
+
value: C,
|
|
73
|
+
disabled: j,
|
|
74
74
|
onChange: (e) => {
|
|
75
|
-
e.target.value !==
|
|
75
|
+
e.target.value !== C && N(e.target.value);
|
|
76
76
|
},
|
|
77
|
-
children:
|
|
77
|
+
children: M.map((e) => /* @__PURE__ */ h("option", {
|
|
78
78
|
value: e,
|
|
79
79
|
children: a(e)
|
|
80
80
|
}, e))
|
|
81
81
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ g(_, {
|
|
83
83
|
size: "sm",
|
|
84
84
|
variant: "outline",
|
|
85
85
|
"data-testid": "project-edit",
|
|
86
|
-
onClick: () =>
|
|
87
|
-
children: [/* @__PURE__ */
|
|
86
|
+
onClick: () => w(o("/projects/edit-project-page", p)),
|
|
87
|
+
children: [/* @__PURE__ */ h(u, { className: "mr-1 h-4 w-4" }), "Edit"]
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ g(_, {
|
|
90
90
|
size: "sm",
|
|
91
91
|
variant: "outline",
|
|
92
92
|
"data-testid": "project-workflow",
|
|
93
|
-
onClick: () =>
|
|
94
|
-
children: [/* @__PURE__ */
|
|
93
|
+
onClick: () => w(o("/projects/project-workflow-page", p)),
|
|
94
|
+
children: [/* @__PURE__ */ h(f, { className: "mr-1 h-4 w-4" }), "Workflow"]
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ g(_, {
|
|
97
97
|
size: "sm",
|
|
98
98
|
variant: "outline",
|
|
99
99
|
"data-testid": "project-custom-fields",
|
|
100
|
-
onClick: () =>
|
|
101
|
-
children: [/* @__PURE__ */
|
|
100
|
+
onClick: () => w(o("/projects/project-custom-fields-page", p)),
|
|
101
|
+
children: [/* @__PURE__ */ h(l, { className: "mr-1 h-4 w-4" }), "Custom Fields"]
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ g(_, {
|
|
104
|
+
size: "sm",
|
|
105
|
+
variant: "outline",
|
|
106
|
+
"data-testid": "project-activity-link",
|
|
107
|
+
onClick: () => w(`/activity/activity-page?projectId=${encodeURIComponent(p)}`),
|
|
108
|
+
children: [/* @__PURE__ */ h(c, { className: "mr-1 h-4 w-4" }), "Activity"]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ h(r, {
|
|
104
111
|
label: "Delete",
|
|
105
112
|
variant: "outline",
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
-
title: `Delete ${
|
|
113
|
+
icon: /* @__PURE__ */ h(d, { className: "mr-1 h-4 w-4" }),
|
|
114
|
+
title: `Delete ${S}?`,
|
|
108
115
|
description: "The project is deleted. Its tasks, sprints, boards, milestones and budgets disappear from every list, and so do releases that belong to no other project. This cannot be undone here.",
|
|
109
116
|
confirmLabel: "Delete project",
|
|
110
117
|
destructive: !0,
|
|
111
|
-
disabled:
|
|
112
|
-
onConfirm: () => void
|
|
118
|
+
disabled: j,
|
|
119
|
+
onConfirm: () => void P()
|
|
113
120
|
})
|
|
114
121
|
]
|
|
115
|
-
}),
|
|
122
|
+
}), k && /* @__PURE__ */ h(i, { message: k })]
|
|
116
123
|
});
|
|
117
124
|
}
|
|
118
125
|
//#endregion
|
|
119
|
-
export {
|
|
126
|
+
export { v as PROJECT_STATUSES, S as ProjectHeaderActions };
|
|
120
127
|
|
|
121
128
|
//# sourceMappingURL=ProjectControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectControls.js","names":[],"sources":["../../../src/planmagnet/controls/ProjectControls.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { ListPlus, Pencil, Trash2, Workflow } from 'lucide-react';\nimport { usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { detailPath } from '../utils/rowNavigation';\nimport { throwOnError, LEAVES_PAGE_CONTEXT } from '../utils/mutationResult';\nimport { ConfirmButton, ErrorLine } from './ConfirmButton';\nimport { enumLabel } from './WorkItemControls';\n\n/**\n * Project controls (BOFF-7940). A new project starts in PLANNING and, until 2026-09-27, nothing in the UI could\n * move it: no status control, and the Edit Project page (which had no Status field) was linked from nowhere. So\n * Projects > Active, the Dashboard's project status card and the admin Bulk Archive never showed a project created\n * in the UI.\n */\n\nexport const PROJECT_STATUSES = [\n 'PLANNING',\n 'ACTIVE',\n 'ON_HOLD',\n 'COMPLETED',\n 'CANCELLED',\n 'ARCHIVED',\n] as const;\n\nconst UPDATE_PROJECT_STATUS = gql`\n mutation ProjectControlsStatus($id: ID!, $input: PlanmagnetUpdateProjectInput!) {\n planmagnetUpdateProject(id: $id, input: $input) {\n id\n status\n }\n }\n`;\nconst DELETE_PROJECT = gql`\n mutation ProjectControlsDelete($id: ID!) {\n planmagnetDeleteProject(id: $id)\n }\n`;\n\n/** Every query that lists projects or shows a project's status. */\nconst PROJECT_LIST_QUERIES = [\n 'GetProjects',\n 'GetActiveProjects',\n 'GetBoardProjects',\n 'GetDashboardData',\n 'AdminPlanmagnetProjects',\n];\n\nexport function ProjectHeaderActions({\n projectId,\n name,\n status,\n}: {\n projectId: string;\n name: string;\n status: string;\n}) {\n const navigate = usePlanMagnetNavigate();\n const [updateStatus, statusState] = useMutation(UPDATE_PROJECT_STATUS, {\n refetchQueries: ['GetProjectDetail', ...PROJECT_LIST_QUERIES],\n awaitRefetchQueries: true,\n });\n const [remove, removeState] = useMutation(DELETE_PROJECT, {\n refetchQueries: PROJECT_LIST_QUERIES,\n context: LEAVES_PAGE_CONTEXT,\n });\n const [error, setError] = useState<string | null>(null);\n const busy = statusState.loading || removeState.loading;\n const statuses = (PROJECT_STATUSES as readonly string[]).includes(status)\n ? PROJECT_STATUSES\n : [status, ...PROJECT_STATUSES];\n\n const onStatus = async (next: string) => {\n setError(null);\n try {\n await throwOnError(updateStatus({ variables: { id: projectId, input: { status: next } } }));\n } catch (e) {\n setError(e instanceof Error ? e.message : 'The status could not be changed.');\n }\n };\n const onDelete = async () => {\n setError(null);\n try {\n await throwOnError(remove({ variables: { id: projectId } }));\n navigate('/projects/projects-page');\n } catch (e) {\n setError(e instanceof Error ? e.message : 'The project could not be deleted.');\n }\n };\n\n return (\n <div className=\"flex flex-col items-end gap-2\">\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n <select\n aria-label=\"Project status\"\n data-testid=\"project-status\"\n className=\"rounded-md border border-input bg-background px-2 py-1 text-sm disabled:opacity-60\"\n value={status}\n disabled={busy}\n onChange={(e) => {\n if (e.target.value !== status) void onStatus(e.target.value);\n }}\n >\n {statuses.map((s) => (\n <option key={s} value={s}>\n {enumLabel(s)}\n </option>\n ))}\n </select>\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-edit\"\n onClick={() => navigate(detailPath('/projects/edit-project-page', projectId))}\n >\n <Pencil className=\"mr-1 h-4 w-4\" />\n Edit\n </Button>\n {/* BOFF-8043: status names, hidden statuses and allowed moves for this project. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-workflow\"\n onClick={() => navigate(detailPath('/projects/project-workflow-page', projectId))}\n >\n <Workflow className=\"mr-1 h-4 w-4\" />\n Workflow\n </Button>\n {/* BOFF-8047: per-project custom field definitions — create/edit/delete, and the types work items can carry. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-custom-fields\"\n onClick={() => navigate(detailPath('/projects/project-custom-fields-page', projectId))}\n >\n <ListPlus className=\"mr-1 h-4 w-4\" />\n Custom Fields\n </Button>\n <ConfirmButton\n label=\"Delete\"\n variant=\"outline\"\n icon={<Trash2 className=\"mr-1 h-4 w-4\" />}\n title={`Delete ${name}?`}\n description=\"The project is deleted. Its tasks, sprints, boards, milestones and budgets disappear from every list, and so do releases that belong to no other project. This cannot be undone here.\"\n confirmLabel=\"Delete project\"\n destructive\n disabled={busy}\n onConfirm={() => void onDelete()}\n />\n </div>\n {error && <ErrorLine message={error} />}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAa,IAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAwB,CAAG;;;;;;;GAQ3B,IAAiB,CAAG;;;;GAOpB,IAAuB;CAC3B;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,EAAqB,EACnC,cACA,SACA,aAKC;CACD,IAAM,IAAW,GAAuB,EAClC,CAAC,GAAc,KAAe,EAAY,GAAuB;EACrE,gBAAgB,CAAC,oBAAoB,GAAG,EAAqB;EAC7D,qBAAqB;EACtB,CAAC,EACI,CAAC,GAAQ,KAAe,EAAY,GAAgB;EACxD,gBAAgB;EAChB,SAAS;EACV,CAAC,EACI,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,IAAO,EAAY,WAAW,EAAY,SAC1C,IAAY,EAAuC,SAAS,EAAO,GACrE,IACA,CAAC,GAAQ,GAAG,EAAiB,EAE3B,IAAW,OAAO,MAAiB;AACvC,IAAS,KAAK;AACd,MAAI;AACF,SAAM,EAAa,EAAa,EAAE,WAAW;IAAE,IAAI;IAAW,OAAO,EAAE,QAAQ,GAAM;I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tB,aAAY;KACZ,cAAa;KACb,aAAA;KACA,UAAU;KACV,iBAAiB,KAAK,GAAU;KAChC,CAAA;IACE;MACL,KAAS,kBAAC,GAAD,EAAW,SAAS,GAAS,CAAA,CACnC"}
|
|
1
|
+
{"version":3,"file":"ProjectControls.js","names":[],"sources":["../../../src/planmagnet/controls/ProjectControls.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { History, ListPlus, Pencil, Trash2, Workflow } from 'lucide-react';\nimport { usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { detailPath } from '../utils/rowNavigation';\nimport { throwOnError, LEAVES_PAGE_CONTEXT } from '../utils/mutationResult';\nimport { ConfirmButton, ErrorLine } from './ConfirmButton';\nimport { enumLabel } from './WorkItemControls';\n\n/**\n * Project controls (BOFF-7940). A new project starts in PLANNING and, until 2026-09-27, nothing in the UI could\n * move it: no status control, and the Edit Project page (which had no Status field) was linked from nowhere. So\n * Projects > Active, the Dashboard's project status card and the admin Bulk Archive never showed a project created\n * in the UI.\n */\n\nexport const PROJECT_STATUSES = [\n 'PLANNING',\n 'ACTIVE',\n 'ON_HOLD',\n 'COMPLETED',\n 'CANCELLED',\n 'ARCHIVED',\n] as const;\n\nconst UPDATE_PROJECT_STATUS = gql`\n mutation ProjectControlsStatus($id: ID!, $input: PlanmagnetUpdateProjectInput!) {\n planmagnetUpdateProject(id: $id, input: $input) {\n id\n status\n }\n }\n`;\nconst DELETE_PROJECT = gql`\n mutation ProjectControlsDelete($id: ID!) {\n planmagnetDeleteProject(id: $id)\n }\n`;\n\n/** Every query that lists projects or shows a project's status. */\nconst PROJECT_LIST_QUERIES = [\n 'GetProjects',\n 'GetActiveProjects',\n 'GetBoardProjects',\n 'GetDashboardData',\n 'AdminPlanmagnetProjects',\n];\n\nexport function ProjectHeaderActions({\n projectId,\n name,\n status,\n}: {\n projectId: string;\n name: string;\n status: string;\n}) {\n const navigate = usePlanMagnetNavigate();\n const [updateStatus, statusState] = useMutation(UPDATE_PROJECT_STATUS, {\n refetchQueries: ['GetProjectDetail', ...PROJECT_LIST_QUERIES],\n awaitRefetchQueries: true,\n });\n const [remove, removeState] = useMutation(DELETE_PROJECT, {\n refetchQueries: PROJECT_LIST_QUERIES,\n context: LEAVES_PAGE_CONTEXT,\n });\n const [error, setError] = useState<string | null>(null);\n const busy = statusState.loading || removeState.loading;\n const statuses = (PROJECT_STATUSES as readonly string[]).includes(status)\n ? PROJECT_STATUSES\n : [status, ...PROJECT_STATUSES];\n\n const onStatus = async (next: string) => {\n setError(null);\n try {\n await throwOnError(updateStatus({ variables: { id: projectId, input: { status: next } } }));\n } catch (e) {\n setError(e instanceof Error ? e.message : 'The status could not be changed.');\n }\n };\n const onDelete = async () => {\n setError(null);\n try {\n await throwOnError(remove({ variables: { id: projectId } }));\n navigate('/projects/projects-page');\n } catch (e) {\n setError(e instanceof Error ? e.message : 'The project could not be deleted.');\n }\n };\n\n return (\n <div className=\"flex flex-col items-end gap-2\">\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n <select\n aria-label=\"Project status\"\n data-testid=\"project-status\"\n className=\"rounded-md border border-input bg-background px-2 py-1 text-sm disabled:opacity-60\"\n value={status}\n disabled={busy}\n onChange={(e) => {\n if (e.target.value !== status) void onStatus(e.target.value);\n }}\n >\n {statuses.map((s) => (\n <option key={s} value={s}>\n {enumLabel(s)}\n </option>\n ))}\n </select>\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-edit\"\n onClick={() => navigate(detailPath('/projects/edit-project-page', projectId))}\n >\n <Pencil className=\"mr-1 h-4 w-4\" />\n Edit\n </Button>\n {/* BOFF-8043: status names, hidden statuses and allowed moves for this project. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-workflow\"\n onClick={() => navigate(detailPath('/projects/project-workflow-page', projectId))}\n >\n <Workflow className=\"mr-1 h-4 w-4\" />\n Workflow\n </Button>\n {/* BOFF-8047: per-project custom field definitions — create/edit/delete, and the types work items can carry. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-custom-fields\"\n onClick={() => navigate(detailPath('/projects/project-custom-fields-page', projectId))}\n >\n <ListPlus className=\"mr-1 h-4 w-4\" />\n Custom Fields\n </Button>\n {/* CWF-09: the workspace Activity page, filtered to this project. */}\n <Button\n size=\"sm\"\n variant=\"outline\"\n data-testid=\"project-activity-link\"\n onClick={() =>\n navigate(`/activity/activity-page?projectId=${encodeURIComponent(projectId)}`)\n }\n >\n <History className=\"mr-1 h-4 w-4\" />\n Activity\n </Button>\n <ConfirmButton\n label=\"Delete\"\n variant=\"outline\"\n icon={<Trash2 className=\"mr-1 h-4 w-4\" />}\n title={`Delete ${name}?`}\n description=\"The project is deleted. Its tasks, sprints, boards, milestones and budgets disappear from every list, and so do releases that belong to no other project. This cannot be undone here.\"\n confirmLabel=\"Delete project\"\n destructive\n disabled={busy}\n onConfirm={() => void onDelete()}\n />\n </div>\n {error && <ErrorLine message={error} />}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAa,IAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACD,EAEK,IAAwB,CAAG;;;;;;;GAQ3B,IAAiB,CAAG;;;;GAOpB,IAAuB;CAC3B;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,EAAqB,EACnC,cACA,SACA,aAKC;CACD,IAAM,IAAW,GAAuB,EAClC,CAAC,GAAc,KAAe,EAAY,GAAuB;EACrE,gBAAgB,CAAC,oBAAoB,GAAG,EAAqB;EAC7D,qBAAqB;EACtB,CAAC,EACI,CAAC,GAAQ,KAAe,EAAY,GAAgB;EACxD,gBAAgB;EAChB,SAAS;EACV,CAAC,EACI,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,IAAO,EAAY,WAAW,EAAY,SAC1C,IAAY,EAAuC,SAAS,EAAO,GACrE,IACA,CAAC,GAAQ,GAAG,E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CAAA,EAAA,gBAE9B;;IAET,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,eAAY;KACZ,eACE,EAAS,qCAAqC,mBAAmB,EAAU,GAAG;eALlF,CAQE,kBAAC,GAAD,EAAS,WAAU,gBAAiB,CAAA,EAAA,WAE7B;;IACT,kBAAC,GAAD;KACE,OAAM;KACN,SAAQ;KACR,MAAM,kBAAC,GAAD,EAAQ,WAAU,gBAAiB,CAAA;KACzC,OAAO,UAAU,EAAK;KACtB,aAAY;KACZ,cAAa;KACb,aAAA;KACA,UAAU;KACV,iBAAiB,KAAK,GAAU;KAChC,CAAA;IACE;MACL,KAAS,kBAAC,GAAD,EAAW,SAAS,GAAS,CAAA,CACnC"}
|
|
@@ -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,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AAI,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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,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"}
|