@burdenoff/microfe-planmagnet 2026.930.8 → 2026.930.9
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 +126 -120
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +83 -75
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/dependency/DependencyGraph.d.ts +43 -0
- package/dist/planmagnet/dependency/DependencyGraph.d.ts.map +1 -0
- package/dist/planmagnet/dependency/DependencyGraph.js +225 -0
- package/dist/planmagnet/dependency/DependencyGraph.js.map +1 -0
- package/dist/planmagnet/dependency/DependencyPanel.d.ts.map +1 -1
- package/dist/planmagnet/dependency/DependencyPanel.js +136 -90
- package/dist/planmagnet/dependency/DependencyPanel.js.map +1 -1
- package/dist/planmagnet/dependency/GanttChart.d.ts +40 -0
- package/dist/planmagnet/dependency/GanttChart.d.ts.map +1 -0
- package/dist/planmagnet/dependency/GanttChart.js +326 -0
- package/dist/planmagnet/dependency/GanttChart.js.map +1 -0
- package/dist/planmagnet/dependency/useProjectWorkItemsGraph.d.ts +40 -0
- package/dist/planmagnet/dependency/useProjectWorkItemsGraph.d.ts.map +1 -0
- package/dist/planmagnet/dependency/useProjectWorkItemsGraph.js +106 -0
- package/dist/planmagnet/dependency/useProjectWorkItemsGraph.js.map +1 -0
- package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +169 -100
- package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsGanttPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ProjectsGanttPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ProjectsGanttPagePage.js +143 -0
- package/dist/planmagnet/pages/ProjectsGanttPagePage.js.map +1 -0
- package/dist/planmagnet/utils/rowNavigation.d.ts +7 -2
- package/dist/planmagnet/utils/rowNavigation.d.ts.map +1 -1
- package/dist/planmagnet/utils/rowNavigation.js.map +1 -1
- package/dist/planmagnet/utils/statusColor.d.ts +26 -0
- package/dist/planmagnet/utils/statusColor.d.ts.map +1 -0
- package/dist/planmagnet/utils/statusColor.js +51 -0
- package/dist/planmagnet/utils/statusColor.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { ProjectSelect as n } from "../controls/Pickers.js";
|
|
3
|
+
import { useEntityId as r } from "../hooks/useEntityId.js";
|
|
4
|
+
import { criticalEdgeIdsFromPath as i, useProjectWorkItemsGraph as a } from "../dependency/useProjectWorkItemsGraph.js";
|
|
5
|
+
import { GanttChart as o } from "../dependency/GanttChart.js";
|
|
6
|
+
import { useState as s } from "react";
|
|
7
|
+
import { SquareGanttChart as c } from "lucide-react";
|
|
8
|
+
import { gql as l } from "@apollo/client";
|
|
9
|
+
import { useQuery as u } from "@apollo/client/react";
|
|
10
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
|
+
import { Card as p, CardContent as m } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
//#region src/planmagnet/pages/ProjectsGanttPagePage.tsx
|
|
13
|
+
var h = l`
|
|
14
|
+
query GetGanttProject($id: ID!) {
|
|
15
|
+
planmagnetProject(id: $id) {
|
|
16
|
+
id
|
|
17
|
+
name
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
`, g = l`
|
|
21
|
+
query GetGanttCriticalPath($workspaceId: ID!, $projectId: ID) {
|
|
22
|
+
planmagnetCriticalPath(workspaceId: $workspaceId, projectId: $projectId) {
|
|
23
|
+
path {
|
|
24
|
+
id
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
function _() {
|
|
30
|
+
let l = r(), { workspaceId: _ } = e(), v = t(), [y, b] = s(""), [x, S] = s("week"), { data: C } = u(h, {
|
|
31
|
+
variables: { id: l },
|
|
32
|
+
skip: !l
|
|
33
|
+
}), { data: w } = u(g, {
|
|
34
|
+
variables: {
|
|
35
|
+
workspaceId: _ ?? "",
|
|
36
|
+
projectId: l
|
|
37
|
+
},
|
|
38
|
+
skip: !_ || !l
|
|
39
|
+
}), { items: T, totalCount: E, loading: D, error: O, moreError: k, truncated: A } = a(l);
|
|
40
|
+
if (!l) return /* @__PURE__ */ f("div", {
|
|
41
|
+
className: "space-y-6 p-6",
|
|
42
|
+
"data-testid": "gantt-page",
|
|
43
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h1", {
|
|
44
|
+
className: "text-2xl font-semibold flex items-center gap-2",
|
|
45
|
+
children: [/* @__PURE__ */ d(c, { className: "h-5 w-5 text-primary" }), "Gantt"]
|
|
46
|
+
}), /* @__PURE__ */ d("p", {
|
|
47
|
+
className: "text-sm text-muted-foreground",
|
|
48
|
+
children: "Choose a project to see its timeline."
|
|
49
|
+
})] }), /* @__PURE__ */ d(p, { children: /* @__PURE__ */ f(m, {
|
|
50
|
+
className: "pt-6 space-y-3",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ d("label", {
|
|
53
|
+
htmlFor: "gantt-project",
|
|
54
|
+
className: "text-sm font-medium",
|
|
55
|
+
children: "Project"
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ d(n, {
|
|
58
|
+
id: "gantt-project",
|
|
59
|
+
value: y,
|
|
60
|
+
onChange: b,
|
|
61
|
+
noneLabel: "Choose a project…"
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ d("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
className: "text-sm text-primary hover:underline disabled:pointer-events-none disabled:opacity-50",
|
|
66
|
+
disabled: !y,
|
|
67
|
+
onClick: () => v(`/projects/gantt-page/${encodeURIComponent(y)}`),
|
|
68
|
+
children: "View timeline →"
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
}) })]
|
|
72
|
+
});
|
|
73
|
+
if (D && T.length === 0 && !O) return /* @__PURE__ */ d("div", {
|
|
74
|
+
className: "flex items-center justify-center p-12",
|
|
75
|
+
"data-testid": "gantt-page",
|
|
76
|
+
children: /* @__PURE__ */ d("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
|
|
77
|
+
});
|
|
78
|
+
if (O) return /* @__PURE__ */ f("div", {
|
|
79
|
+
className: "p-6 text-red-500",
|
|
80
|
+
"data-testid": "gantt-page",
|
|
81
|
+
children: ["Error loading the project's work items: ", O.message]
|
|
82
|
+
});
|
|
83
|
+
let j = C?.planmagnetProject?.name, M = new Set((w?.planmagnetCriticalPath.path ?? []).map((e) => e.id)), N = i(w?.planmagnetCriticalPath.path ?? [], T);
|
|
84
|
+
return /* @__PURE__ */ f("div", {
|
|
85
|
+
className: "space-y-6 p-6",
|
|
86
|
+
"data-testid": "gantt-page",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ f("div", {
|
|
89
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
90
|
+
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("h1", {
|
|
91
|
+
className: "text-2xl font-semibold flex items-center gap-2",
|
|
92
|
+
children: [/* @__PURE__ */ d(c, { className: "h-5 w-5 text-primary" }), "Gantt"]
|
|
93
|
+
}), /* @__PURE__ */ f("p", {
|
|
94
|
+
className: "text-sm text-muted-foreground",
|
|
95
|
+
children: [
|
|
96
|
+
j ?? "This project",
|
|
97
|
+
" — ",
|
|
98
|
+
E,
|
|
99
|
+
" work item",
|
|
100
|
+
E === 1 ? "" : "s",
|
|
101
|
+
". Bars are derived from each item's due date and estimate (there is no separate start date field yet); an item with only a due date shows as a milestone."
|
|
102
|
+
]
|
|
103
|
+
})] }), /* @__PURE__ */ d("div", {
|
|
104
|
+
className: "flex gap-1",
|
|
105
|
+
"data-testid": "gantt-zoom",
|
|
106
|
+
children: ["week", "month"].map((e) => /* @__PURE__ */ d("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
"aria-pressed": x === e,
|
|
109
|
+
className: `px-3 py-1.5 text-xs rounded-md capitalize ${x === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"}`,
|
|
110
|
+
onClick: () => S(e),
|
|
111
|
+
children: e
|
|
112
|
+
}, e))
|
|
113
|
+
})]
|
|
114
|
+
}),
|
|
115
|
+
k && /* @__PURE__ */ f("p", {
|
|
116
|
+
role: "alert",
|
|
117
|
+
className: "text-sm text-destructive",
|
|
118
|
+
children: ["Some work items could not be loaded, so this timeline may be incomplete: ", k]
|
|
119
|
+
}),
|
|
120
|
+
A && /* @__PURE__ */ f("p", {
|
|
121
|
+
className: "text-sm text-muted-foreground",
|
|
122
|
+
children: [
|
|
123
|
+
"This project has more than ",
|
|
124
|
+
T.length,
|
|
125
|
+
" work items — only the first ",
|
|
126
|
+
T.length,
|
|
127
|
+
" are shown."
|
|
128
|
+
]
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ d(o, {
|
|
131
|
+
items: T,
|
|
132
|
+
criticalIds: M,
|
|
133
|
+
criticalEdgeIds: N,
|
|
134
|
+
zoom: x,
|
|
135
|
+
onActivateRow: (e) => v(`/tasks/task-detail-page?taskId=${encodeURIComponent(e)}`)
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { _ as ProjectsGanttPagePage };
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=ProjectsGanttPagePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectsGanttPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/ProjectsGanttPagePage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Card, CardContent } from '@burdenoff/fe-libs/ui';\nimport { SquareGanttChart } from 'lucide-react';\nimport { useEntityId } from '../hooks/useEntityId';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { ProjectSelect } from '../controls/Pickers';\nimport { GanttChart } from '../dependency/GanttChart';\nimport {\n criticalEdgeIdsFromPath,\n useProjectWorkItemsGraph,\n} from '../dependency/useProjectWorkItemsGraph';\n\n/**\n * Gantt timeline for a project's work items (ANR-24). See dependency/GanttChart.tsx for the render (including\n * the note on why bar starts are DERIVED — WorkItem has no persisted start date today) and\n * dependency/useProjectWorkItemsGraph.ts for the full, paged item+dependency fetch this and the critical-path\n * page's \"Graph\" view (PDM-27) share.\n */\n\nconst GET_GANTT_PROJECT = gql`\n query GetGanttProject($id: ID!) {\n planmagnetProject(id: $id) {\n id\n name\n }\n }\n`;\n\nconst GET_GANTT_CRITICAL_PATH = gql`\n query GetGanttCriticalPath($workspaceId: ID!, $projectId: ID) {\n planmagnetCriticalPath(workspaceId: $workspaceId, projectId: $projectId) {\n path {\n id\n }\n }\n }\n`;\n\ntype Zoom = 'week' | 'month';\n\nexport function ProjectsGanttPagePage() {\n const projectId = useEntityId();\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [pickerProjectId, setPickerProjectId] = useState('');\n const [zoom, setZoom] = useState<Zoom>('week');\n\n const { data: projectData } = useQuery<{\n planmagnetProject: { id: string; name: string } | null;\n }>(GET_GANTT_PROJECT, { variables: { id: projectId }, skip: !projectId });\n\n const { data: cpData } = useQuery<{\n planmagnetCriticalPath: { path: { id: string }[] };\n }>(GET_GANTT_CRITICAL_PATH, {\n variables: { workspaceId: workspaceId ?? '', projectId },\n skip: !workspaceId || !projectId,\n });\n\n const { items, totalCount, loading, error, moreError, truncated } =\n useProjectWorkItemsGraph(projectId);\n\n if (!projectId) {\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"gantt-page\">\n <div>\n <h1 className=\"text-2xl font-semibold flex items-center gap-2\">\n <SquareGanttChart className=\"h-5 w-5 text-primary\" />\n Gantt\n </h1>\n <p className=\"text-sm text-muted-foreground\">Choose a project to see its timeline.</p>\n </div>\n <Card>\n <CardContent className=\"pt-6 space-y-3\">\n <label htmlFor=\"gantt-project\" className=\"text-sm font-medium\">\n Project\n </label>\n <ProjectSelect\n id=\"gantt-project\"\n value={pickerProjectId}\n onChange={setPickerProjectId}\n noneLabel=\"Choose a project…\"\n />\n <button\n type=\"button\"\n className=\"text-sm text-primary hover:underline disabled:pointer-events-none disabled:opacity-50\"\n disabled={!pickerProjectId}\n onClick={() =>\n navigate(`/projects/gantt-page/${encodeURIComponent(pickerProjectId)}`)\n }\n >\n View timeline →\n </button>\n </CardContent>\n </Card>\n </div>\n );\n }\n\n // Only before the first load: a refetch must not blank the page.\n if (loading && items.length === 0 && !error) {\n return (\n <div className=\"flex items-center justify-center p-12\" data-testid=\"gantt-page\">\n <div className=\"animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full\" />\n </div>\n );\n }\n if (error) {\n return (\n <div className=\"p-6 text-red-500\" data-testid=\"gantt-page\">\n Error loading the project's work items: {error.message}\n </div>\n );\n }\n\n const projectName = projectData?.planmagnetProject?.name;\n const criticalIds = new Set((cpData?.planmagnetCriticalPath.path ?? []).map((n) => n.id));\n const criticalEdgeIds = criticalEdgeIdsFromPath(cpData?.planmagnetCriticalPath.path ?? [], items);\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"gantt-page\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold flex items-center gap-2\">\n <SquareGanttChart className=\"h-5 w-5 text-primary\" />\n Gantt\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {projectName ?? 'This project'} — {totalCount} work item{totalCount === 1 ? '' : 's'}.\n Bars are derived from each item's due date and estimate (there is no separate start\n date field yet); an item with only a due date shows as a milestone.\n </p>\n </div>\n <div className=\"flex gap-1\" data-testid=\"gantt-zoom\">\n {(['week', 'month'] as const).map((z) => (\n <button\n key={z}\n type=\"button\"\n aria-pressed={zoom === z}\n className={`px-3 py-1.5 text-xs rounded-md capitalize ${zoom === z ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n onClick={() => setZoom(z)}\n >\n {z}\n </button>\n ))}\n </div>\n </div>\n\n {moreError && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Some work items could not be loaded, so this timeline may be incomplete: {moreError}\n </p>\n )}\n {truncated && (\n <p className=\"text-sm text-muted-foreground\">\n This project has more than {items.length} work items — only the first {items.length} are\n shown.\n </p>\n )}\n\n <GanttChart\n items={items}\n criticalIds={criticalIds}\n criticalEdgeIds={criticalEdgeIds}\n zoom={zoom}\n onActivateRow={(id) => navigate(`/tasks/task-detail-page?taskId=${encodeURIComponent(id)}`)}\n />\n </div>\n );\n}\n"],"mappings":"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"}
|
|
@@ -9,13 +9,18 @@ import { KeyboardEvent, MouseEvent } from 'react';
|
|
|
9
9
|
*/
|
|
10
10
|
/** The row-link look, for rows that also need their own layout classes. */
|
|
11
11
|
export declare const ROW_LINK_CLASS: string;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `T` defaults to `HTMLElement` for every existing (div/li/...) call site; the dependency graph spreads this
|
|
14
|
+
* onto an SVG `<g>` and passes `SVGGElement` explicitly — `KeyboardEvent<HTMLElement>` is not assignable there
|
|
15
|
+
* (SVGGElement and HTMLElement are unrelated siblings of Element, not one a subtype of the other).
|
|
16
|
+
*/
|
|
17
|
+
export declare function rowLinkProps<T extends Element = HTMLElement>(onActivate: () => void, label?: string): {
|
|
13
18
|
role: "button";
|
|
14
19
|
tabIndex: number;
|
|
15
20
|
'aria-label': string | undefined;
|
|
16
21
|
className: string;
|
|
17
22
|
onClick: () => void;
|
|
18
|
-
onKeyDown: (event: KeyboardEvent<
|
|
23
|
+
onKeyDown: (event: KeyboardEvent<T>) => void;
|
|
19
24
|
};
|
|
20
25
|
/**
|
|
21
26
|
* Stops a click on a nested control (a button, a menu) from also activating the row
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowNavigation.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,2EAA2E;AAC3E,eAAO,MAAM,cAAc,QAEiD,CAAC;AAE7E,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"rowNavigation.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;;GAMG;AACH,2EAA2E;AAC3E,eAAO,MAAM,cAAc,QAEiD,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW,EAC1D,UAAU,EAAE,MAAM,IAAI,EACtB,KAAK,CAAC,EAAE,MAAM;;;;;;uBAQO,aAAa,CAAC,CAAC,CAAC;EAOtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,QAE/D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAE/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rowNavigation.js","names":[],"sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * Props that turn a non-interactive container (a Card, a table row) into an\n * activatable one, so a list row can open its detail page by click OR keyboard.\n *\n * Kept as a props factory rather than a wrapper component so it can be spread onto\n * whatever element a given list already renders, without changing that list's layout.\n */\n/** The row-link look, for rows that also need their own layout classes. */\nexport const ROW_LINK_CLASS =\n 'cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none ' +\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';\n\nexport function rowLinkProps(onActivate: () => void
|
|
1
|
+
{"version":3,"file":"rowNavigation.js","names":[],"sources":["../../../src/planmagnet/utils/rowNavigation.ts"],"sourcesContent":["import type { KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * Props that turn a non-interactive container (a Card, a table row) into an\n * activatable one, so a list row can open its detail page by click OR keyboard.\n *\n * Kept as a props factory rather than a wrapper component so it can be spread onto\n * whatever element a given list already renders, without changing that list's layout.\n */\n/** The row-link look, for rows that also need their own layout classes. */\nexport const ROW_LINK_CLASS =\n 'cursor-pointer transition-shadow hover:shadow-md focus-visible:outline-none ' +\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';\n\n/**\n * `T` defaults to `HTMLElement` for every existing (div/li/...) call site; the dependency graph spreads this\n * onto an SVG `<g>` and passes `SVGGElement` explicitly — `KeyboardEvent<HTMLElement>` is not assignable there\n * (SVGGElement and HTMLElement are unrelated siblings of Element, not one a subtype of the other).\n */\nexport function rowLinkProps<T extends Element = HTMLElement>(\n onActivate: () => void,\n label?: string\n) {\n return {\n role: 'button' as const,\n tabIndex: 0,\n 'aria-label': label,\n className: ROW_LINK_CLASS,\n onClick: () => onActivate(),\n onKeyDown: (event: KeyboardEvent<T>) => {\n // Enter and Space are the two activation keys a role=\"button\" must honour.\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n onActivate();\n },\n };\n}\n\n/**\n * Stops a click on a nested control (a button, a menu) from also activating the row\n * it sits inside. Spread onto the nested control, not the row.\n */\nexport function stopRowActivation(event: MouseEvent<HTMLElement>) {\n event.stopPropagation();\n}\n\n/**\n * Builds the path to a detail page that reads its id from a \":id\" route segment.\n * Returns the bare path when no id is available, so a missing id degrades to the\n * list-style page rather than producing a path ending in \"undefined\".\n */\nexport function detailPath(route: string, id: string | null | undefined): string {\n return id ? `${route}/${encodeURIComponent(id)}` : route;\n}\n"],"mappings":";AAUA,IAAa,IACX;AAQF,SAAgB,EACd,GACA,GACA;AACA,QAAO;EACL,MAAM;EACN,UAAU;EACV,cAAc;EACd,WAAW;EACX,eAAe,GAAY;EAC3B,YAAY,MAA4B;AAElC,KAAM,QAAQ,WAAW,EAAM,QAAQ,QAC3C,EAAM,gBAAgB,EACtB,GAAY;;EAEf;;AAOH,SAAgB,EAAkB,GAAgC;AAChE,GAAM,iBAAiB;;AAQzB,SAAgB,EAAW,GAAe,GAAuC;AAC/E,QAAO,IAAK,GAAG,EAAM,GAAG,mBAAmB,EAAG,KAAK"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One fixed chart color per WorkItemStatus (PDM-27 dependency graph, ANR-24 Gantt): both visualizations color by
|
|
3
|
+
* status, so they share this single mapping rather than each re-deriving one. The order is FIXED and never
|
|
4
|
+
* re-assigned from whichever statuses happen to appear in a given project/graph — a categorical channel keeps the
|
|
5
|
+
* same color for the same identity everywhere it shows up.
|
|
6
|
+
*
|
|
7
|
+
* Values are complete literal Tailwind class names (never built with a template string): Tailwind's build scans
|
|
8
|
+
* source text for whole class-name tokens, so `` `fill-${status}` `` would never be picked up and would ship
|
|
9
|
+
* invisible/unstyled in production while every check here still passes.
|
|
10
|
+
*
|
|
11
|
+
* Colors come from fe-libs' chart token ramp (`chart-1`..`chart-12`), not the `status-*` tokens — those are
|
|
12
|
+
* reserved for good/warning/serious/critical severity (see `dev/skills` dataviz guidance) and workflow status is
|
|
13
|
+
* an identity dimension, not a severity one.
|
|
14
|
+
*/
|
|
15
|
+
export interface StatusVisual {
|
|
16
|
+
/** Fill class for the node/bar body. */
|
|
17
|
+
fill: string;
|
|
18
|
+
/** Stroke class matching `fill`, for outlines and edge/line marks of the same status. */
|
|
19
|
+
stroke: string;
|
|
20
|
+
/** Solid swatch class for a small legend dot. */
|
|
21
|
+
swatch: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function statusVisual(status: string): StatusVisual;
|
|
24
|
+
/** Every status with an assigned visual, in the fixed legend order. */
|
|
25
|
+
export declare const STATUS_LEGEND_ORDER: readonly string[];
|
|
26
|
+
//# sourceMappingURL=statusColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusColor.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/utils/statusColor.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAoBD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAEzD;AAED,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAuB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { WORK_ITEM_STATUSES as e } from "../controls/WorkItemControls.js";
|
|
2
|
+
//#region src/planmagnet/utils/statusColor.ts
|
|
3
|
+
var t = {
|
|
4
|
+
BACKLOG: {
|
|
5
|
+
fill: "fill-chart-6",
|
|
6
|
+
stroke: "stroke-chart-6",
|
|
7
|
+
swatch: "bg-chart-6"
|
|
8
|
+
},
|
|
9
|
+
TODO: {
|
|
10
|
+
fill: "fill-chart-1",
|
|
11
|
+
stroke: "stroke-chart-1",
|
|
12
|
+
swatch: "bg-chart-1"
|
|
13
|
+
},
|
|
14
|
+
IN_PROGRESS: {
|
|
15
|
+
fill: "fill-chart-4",
|
|
16
|
+
stroke: "stroke-chart-4",
|
|
17
|
+
swatch: "bg-chart-4"
|
|
18
|
+
},
|
|
19
|
+
IN_REVIEW: {
|
|
20
|
+
fill: "fill-chart-3",
|
|
21
|
+
stroke: "stroke-chart-3",
|
|
22
|
+
swatch: "bg-chart-3"
|
|
23
|
+
},
|
|
24
|
+
TESTING: {
|
|
25
|
+
fill: "fill-chart-9",
|
|
26
|
+
stroke: "stroke-chart-9",
|
|
27
|
+
swatch: "bg-chart-9"
|
|
28
|
+
},
|
|
29
|
+
DONE: {
|
|
30
|
+
fill: "fill-chart-2",
|
|
31
|
+
stroke: "stroke-chart-2",
|
|
32
|
+
swatch: "bg-chart-2"
|
|
33
|
+
},
|
|
34
|
+
CANCELLED: {
|
|
35
|
+
fill: "fill-chart-10",
|
|
36
|
+
stroke: "stroke-chart-10",
|
|
37
|
+
swatch: "bg-chart-10"
|
|
38
|
+
}
|
|
39
|
+
}, n = {
|
|
40
|
+
fill: "fill-chart-12",
|
|
41
|
+
stroke: "stroke-chart-12",
|
|
42
|
+
swatch: "bg-chart-12"
|
|
43
|
+
};
|
|
44
|
+
function r(e) {
|
|
45
|
+
return t[e] ?? n;
|
|
46
|
+
}
|
|
47
|
+
var i = e;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { i as STATUS_LEGEND_ORDER, r as statusVisual };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=statusColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statusColor.js","names":[],"sources":["../../../src/planmagnet/utils/statusColor.ts"],"sourcesContent":["import { WORK_ITEM_STATUSES } from '../controls/WorkItemControls';\n\n/**\n * One fixed chart color per WorkItemStatus (PDM-27 dependency graph, ANR-24 Gantt): both visualizations color by\n * status, so they share this single mapping rather than each re-deriving one. The order is FIXED and never\n * re-assigned from whichever statuses happen to appear in a given project/graph — a categorical channel keeps the\n * same color for the same identity everywhere it shows up.\n *\n * Values are complete literal Tailwind class names (never built with a template string): Tailwind's build scans\n * source text for whole class-name tokens, so `` `fill-${status}` `` would never be picked up and would ship\n * invisible/unstyled in production while every check here still passes.\n *\n * Colors come from fe-libs' chart token ramp (`chart-1`..`chart-12`), not the `status-*` tokens — those are\n * reserved for good/warning/serious/critical severity (see `dev/skills` dataviz guidance) and workflow status is\n * an identity dimension, not a severity one.\n */\nexport interface StatusVisual {\n /** Fill class for the node/bar body. */\n fill: string;\n /** Stroke class matching `fill`, for outlines and edge/line marks of the same status. */\n stroke: string;\n /** Solid swatch class for a small legend dot. */\n swatch: string;\n}\n\nconst STATUS_VISUALS: Record<(typeof WORK_ITEM_STATUSES)[number], StatusVisual> = {\n BACKLOG: { fill: 'fill-chart-6', stroke: 'stroke-chart-6', swatch: 'bg-chart-6' },\n TODO: { fill: 'fill-chart-1', stroke: 'stroke-chart-1', swatch: 'bg-chart-1' },\n IN_PROGRESS: { fill: 'fill-chart-4', stroke: 'stroke-chart-4', swatch: 'bg-chart-4' },\n IN_REVIEW: { fill: 'fill-chart-3', stroke: 'stroke-chart-3', swatch: 'bg-chart-3' },\n TESTING: { fill: 'fill-chart-9', stroke: 'stroke-chart-9', swatch: 'bg-chart-9' },\n DONE: { fill: 'fill-chart-2', stroke: 'stroke-chart-2', swatch: 'bg-chart-2' },\n CANCELLED: { fill: 'fill-chart-10', stroke: 'stroke-chart-10', swatch: 'bg-chart-10' },\n};\n\n/** A status the API returns that this map doesn't know yet (see WorkItemStatusCount's own doc comment on the\n * same risk) falls back to this rather than throwing or rendering unstyled. */\nconst FALLBACK_VISUAL: StatusVisual = {\n fill: 'fill-chart-12',\n stroke: 'stroke-chart-12',\n swatch: 'bg-chart-12',\n};\n\nexport function statusVisual(status: string): StatusVisual {\n return (STATUS_VISUALS as Record<string, StatusVisual>)[status] ?? FALLBACK_VISUAL;\n}\n\n/** Every status with an assigned visual, in the fixed legend order. */\nexport const STATUS_LEGEND_ORDER: readonly string[] = WORK_ITEM_STATUSES;\n"],"mappings":";;AAyBA,IAAM,IAA4E;CAChF,SAAS;EAAE,MAAM;EAAgB,QAAQ;EAAkB,QAAQ;EAAc;CACjF,MAAM;EAAE,MAAM;EAAgB,QAAQ;EAAkB,QAAQ;EAAc;CAC9E,aAAa;EAAE,MAAM;EAAgB,QAAQ;EAAkB,QAAQ;EAAc;CACrF,WAAW;EAAE,MAAM;EAAgB,QAAQ;EAAkB,QAAQ;EAAc;CACnF,SAAS;EAAE,MAAM;EAAgB,QAAQ;EAAkB,QAAQ;EAAc;CACjF,MAAM;EAAE,MAAM;EAAgB,QAAQ;EAAkB,QAAQ;EAAc;CAC9E,WAAW;EAAE,MAAM;EAAiB,QAAQ;EAAmB,QAAQ;EAAe;CACvF,EAIK,IAAgC;CACpC,MAAM;CACN,QAAQ;CACR,QAAQ;CACT;AAED,SAAgB,EAAa,GAA8B;AACzD,QAAQ,EAAgD,MAAW;;AAIrE,IAAa,IAAyC"}
|