@burdenoff/microfe-planmagnet 2026.930.7 → 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/board/BoardViewBar.d.ts +27 -0
- package/dist/planmagnet/board/BoardViewBar.d.ts.map +1 -0
- package/dist/planmagnet/board/BoardViewBar.js +684 -0
- package/dist/planmagnet/board/BoardViewBar.js.map +1 -0
- package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +440 -345
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/board/boardViewConfig.d.ts +144 -0
- package/dist/planmagnet/board/boardViewConfig.d.ts.map +1 -0
- package/dist/planmagnet/board/boardViewConfig.js +265 -0
- package/dist/planmagnet/board/boardViewConfig.js.map +1 -0
- package/dist/planmagnet/controls/ConfirmButton.d.ts +3 -1
- package/dist/planmagnet/controls/ConfirmButton.d.ts.map +1 -1
- package/dist/planmagnet/controls/ConfirmButton.js +2 -1
- package/dist/planmagnet/controls/ConfirmButton.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/milestones/MilestoneControls.js +1 -1
- 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,265 @@
|
|
|
1
|
+
import "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { gql as e } from "@apollo/client";
|
|
3
|
+
import { useQuery as t } from "@apollo/client/react";
|
|
4
|
+
//#region src/planmagnet/board/boardViewConfig.ts
|
|
5
|
+
var n = [
|
|
6
|
+
"BUG",
|
|
7
|
+
"EPIC",
|
|
8
|
+
"STORY",
|
|
9
|
+
"SUB_TASK",
|
|
10
|
+
"TASK"
|
|
11
|
+
], r = [
|
|
12
|
+
{
|
|
13
|
+
value: "NONE",
|
|
14
|
+
label: "None"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "ASSIGNEE",
|
|
18
|
+
label: "Assignee"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: "PRIORITY",
|
|
22
|
+
label: "Priority"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "TYPE",
|
|
26
|
+
label: "Type"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "EPIC",
|
|
30
|
+
label: "Epic"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "SPRINT",
|
|
34
|
+
label: "Sprint"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "MILESTONE",
|
|
38
|
+
label: "Milestone"
|
|
39
|
+
}
|
|
40
|
+
], i = [
|
|
41
|
+
{
|
|
42
|
+
value: "RANK",
|
|
43
|
+
label: "Board order"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: "PRIORITY",
|
|
47
|
+
label: "Priority"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "DUE_DATE",
|
|
51
|
+
label: "Due date"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "STORY_POINTS",
|
|
55
|
+
label: "Story points"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "CREATED_AT",
|
|
59
|
+
label: "Created"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "UPDATED_AT",
|
|
63
|
+
label: "Updated"
|
|
64
|
+
}
|
|
65
|
+
], a = [
|
|
66
|
+
{
|
|
67
|
+
value: "KEY",
|
|
68
|
+
label: "Key"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: "TYPE",
|
|
72
|
+
label: "Type"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: "PRIORITY",
|
|
76
|
+
label: "Priority"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
value: "ASSIGNEE",
|
|
80
|
+
label: "Assignee"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "STORY_POINTS",
|
|
84
|
+
label: "Story points"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: "DUE_DATE",
|
|
88
|
+
label: "Due date"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: "LABELS",
|
|
92
|
+
label: "Labels"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "SPRINT",
|
|
96
|
+
label: "Sprint"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
value: "MILESTONE",
|
|
100
|
+
label: "Milestone"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: "EPIC",
|
|
104
|
+
label: "Epic"
|
|
105
|
+
}
|
|
106
|
+
], o = [
|
|
107
|
+
"KEY",
|
|
108
|
+
"ASSIGNEE",
|
|
109
|
+
"STORY_POINTS"
|
|
110
|
+
];
|
|
111
|
+
function s() {
|
|
112
|
+
return {
|
|
113
|
+
assigneeIds: [],
|
|
114
|
+
unassigned: !1,
|
|
115
|
+
types: [],
|
|
116
|
+
priorities: [],
|
|
117
|
+
labels: [],
|
|
118
|
+
search: "",
|
|
119
|
+
sprintId: "",
|
|
120
|
+
milestoneId: "",
|
|
121
|
+
dueFrom: "",
|
|
122
|
+
dueTo: ""
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function c() {
|
|
126
|
+
return {
|
|
127
|
+
field: "RANK",
|
|
128
|
+
direction: "ASC"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function l() {
|
|
132
|
+
return {
|
|
133
|
+
filter: s(),
|
|
134
|
+
sort: c(),
|
|
135
|
+
groupBy: "NONE",
|
|
136
|
+
visibleFields: []
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function u(e) {
|
|
140
|
+
let t = {};
|
|
141
|
+
return e.assigneeIds.length > 0 && (t.assigneeIds = e.assigneeIds), e.unassigned && (t.unassigned = !0), e.types.length > 0 && (t.types = e.types), e.priorities.length > 0 && (t.priorities = e.priorities), e.labels.length > 0 && (t.labels = e.labels), e.search.trim() && (t.search = e.search.trim()), e.sprintId && (t.sprintId = e.sprintId), e.milestoneId && (t.milestoneId = e.milestoneId), e.dueFrom && (t.dueFrom = `${e.dueFrom}T00:00:00.000Z`), e.dueTo && (t.dueTo = `${e.dueTo}T00:00:00.000Z`), Object.keys(t).length > 0 ? t : void 0;
|
|
142
|
+
}
|
|
143
|
+
function d(e) {
|
|
144
|
+
return u(e) !== void 0;
|
|
145
|
+
}
|
|
146
|
+
function f(e) {
|
|
147
|
+
return {
|
|
148
|
+
filter: u(e.filter) ?? null,
|
|
149
|
+
groupBy: e.groupBy,
|
|
150
|
+
sort: {
|
|
151
|
+
field: e.sort.field,
|
|
152
|
+
direction: e.sort.direction
|
|
153
|
+
},
|
|
154
|
+
visibleFields: e.visibleFields
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function p(e) {
|
|
158
|
+
return {
|
|
159
|
+
filter: {
|
|
160
|
+
assigneeIds: e.filter.assigneeIds,
|
|
161
|
+
unassigned: e.filter.unassigned,
|
|
162
|
+
types: e.filter.types,
|
|
163
|
+
priorities: e.filter.priorities,
|
|
164
|
+
labels: e.filter.labels,
|
|
165
|
+
search: e.filter.search ?? "",
|
|
166
|
+
sprintId: e.filter.sprintId ?? "",
|
|
167
|
+
milestoneId: e.filter.milestoneId ?? "",
|
|
168
|
+
dueFrom: e.filter.dueFrom ? e.filter.dueFrom.slice(0, 10) : "",
|
|
169
|
+
dueTo: e.filter.dueTo ? e.filter.dueTo.slice(0, 10) : ""
|
|
170
|
+
},
|
|
171
|
+
sort: {
|
|
172
|
+
field: e.sort.field,
|
|
173
|
+
direction: e.sort.direction
|
|
174
|
+
},
|
|
175
|
+
groupBy: e.groupBy,
|
|
176
|
+
visibleFields: e.visibleFields
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
var m = (e) => [...e].sort().join("\0");
|
|
180
|
+
function h(e, t) {
|
|
181
|
+
return m(e.filter.assigneeIds) === m(t.filter.assigneeIds) && e.filter.unassigned === t.filter.unassigned && m(e.filter.types) === m(t.filter.types) && m(e.filter.priorities) === m(t.filter.priorities) && m(e.filter.labels) === m(t.filter.labels) && e.filter.search.trim() === t.filter.search.trim() && e.filter.sprintId === t.filter.sprintId && e.filter.milestoneId === t.filter.milestoneId && e.filter.dueFrom === t.filter.dueFrom && e.filter.dueTo === t.filter.dueTo && e.sort.field === t.sort.field && e.sort.direction === t.sort.direction && e.groupBy === t.groupBy && m(e.visibleFields) === m(t.visibleFields);
|
|
182
|
+
}
|
|
183
|
+
function g() {
|
|
184
|
+
return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("view") || null;
|
|
185
|
+
}
|
|
186
|
+
function _(e) {
|
|
187
|
+
if (typeof window > "u") return;
|
|
188
|
+
let t = new URL(window.location.href);
|
|
189
|
+
e ? t.searchParams.set("view", e) : t.searchParams.delete("view"), window.history.replaceState(window.history.state, "", t);
|
|
190
|
+
}
|
|
191
|
+
var v = "\n id\n name\n description\n projectId\n boardId\n board {\n id\n name\n }\n ownerId\n visibility\n isMine\n filter {\n assigneeIds\n unassigned\n types\n priorities\n labels\n search\n sprintId\n milestoneId\n dueFrom\n dueTo\n }\n groupBy\n sort {\n field\n direction\n }\n visibleFields\n createdAt\n updatedAt\n", y = e`
|
|
192
|
+
query ProjectBoardViews($workspaceId: ID!, $filter: PlanmagnetBoardViewFilter, $pagination: PlanmagnetPaginationInput) {
|
|
193
|
+
planmagnetBoardViews(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
194
|
+
items {
|
|
195
|
+
${v}
|
|
196
|
+
}
|
|
197
|
+
totalCount
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`, b = e`
|
|
201
|
+
mutation ProjectBoardViewCreate($input: PlanmagnetCreateBoardViewInput!) {
|
|
202
|
+
planmagnetCreateBoardView(input: $input) {
|
|
203
|
+
${v}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`, x = e`
|
|
207
|
+
mutation ProjectBoardViewUpdate($id: ID!, $input: PlanmagnetUpdateBoardViewInput!) {
|
|
208
|
+
planmagnetUpdateBoardView(id: $id, input: $input) {
|
|
209
|
+
${v}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
`, S = e`
|
|
213
|
+
mutation ProjectBoardViewDelete($id: ID!) {
|
|
214
|
+
planmagnetDeleteBoardView(id: $id)
|
|
215
|
+
}
|
|
216
|
+
`, C = ["ProjectBoardViews"];
|
|
217
|
+
function w(e, n) {
|
|
218
|
+
let { data: r, loading: i, error: a, refetch: o } = t(y, {
|
|
219
|
+
variables: {
|
|
220
|
+
workspaceId: e ?? "",
|
|
221
|
+
filter: { projectId: n },
|
|
222
|
+
pagination: { first: 100 }
|
|
223
|
+
},
|
|
224
|
+
skip: !e
|
|
225
|
+
});
|
|
226
|
+
return {
|
|
227
|
+
views: r?.planmagnetBoardViews.items ?? [],
|
|
228
|
+
loading: i && !r,
|
|
229
|
+
error: a ? a.message : null,
|
|
230
|
+
refetch: o
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
var T = e`
|
|
234
|
+
query BoardViewProjectSprints($workspaceId: ID!, $projectId: String) {
|
|
235
|
+
planmagnetSprints(
|
|
236
|
+
workspaceId: $workspaceId
|
|
237
|
+
filter: { projectId: $projectId }
|
|
238
|
+
pagination: { first: 100 }
|
|
239
|
+
) {
|
|
240
|
+
items {
|
|
241
|
+
id
|
|
242
|
+
name
|
|
243
|
+
status
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
`;
|
|
248
|
+
function E(e, n) {
|
|
249
|
+
let { data: r, loading: i, error: a } = t(T, {
|
|
250
|
+
variables: {
|
|
251
|
+
workspaceId: e ?? "",
|
|
252
|
+
projectId: n
|
|
253
|
+
},
|
|
254
|
+
skip: !e || !n
|
|
255
|
+
});
|
|
256
|
+
return {
|
|
257
|
+
options: r?.planmagnetSprints?.items ?? [],
|
|
258
|
+
loading: i && !r,
|
|
259
|
+
error: a ? a.message : null
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
export { b as CREATE_BOARD_VIEW, o as DEFAULT_VISIBLE_FIELDS, S as DELETE_BOARD_VIEW, r as GROUP_BY_OPTIONS, i as SORT_FIELD_OPTIONS, x as UPDATE_BOARD_VIEW, C as VIEW_REFETCH, a as VISIBLE_FIELD_OPTIONS, n as WORK_ITEM_TYPES, p as configFromView, f as configToInput, h as configsEqual, l as defaultConfig, s as emptyFilter, u as filterToGraphQLInput, d as isFilterActive, g as readViewIdFromUrl, w as useBoardViews, E as useProjectSprintOptions, _ as writeViewIdToUrl };
|
|
264
|
+
|
|
265
|
+
//# sourceMappingURL=boardViewConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boardViewConfig.js","names":[],"sources":["../../../src/planmagnet/board/boardViewConfig.ts"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\n\n/**\n * Board views (PDM-N04): a saved, named presentation over a project's board — filter, group-by, sort, visible\n * fields, owner, sharing. A view holds no items and never creates a board (owner decision, 2026-09-29). Shapes,\n * conversions and the shared queries/mutations live here; `BoardViewBar.tsx` is the UI that uses them.\n */\n\nexport type BoardGroupBy =\n | 'NONE'\n | 'ASSIGNEE'\n | 'PRIORITY'\n | 'TYPE'\n | 'EPIC'\n | 'SPRINT'\n | 'MILESTONE';\nexport type BoardSortField =\n | 'RANK'\n | 'PRIORITY'\n | 'DUE_DATE'\n | 'STORY_POINTS'\n | 'CREATED_AT'\n | 'UPDATED_AT';\nexport type SortDirection = 'ASC' | 'DESC';\nexport type BoardCardField =\n | 'KEY'\n | 'TYPE'\n | 'PRIORITY'\n | 'ASSIGNEE'\n | 'STORY_POINTS'\n | 'DUE_DATE'\n | 'LABELS'\n | 'SPRINT'\n | 'MILESTONE'\n | 'EPIC';\nexport type BoardViewVisibility = 'PRIVATE' | 'SHARED';\n\n/** The project's work item types (WorkItemType), for the type filter. */\nexport const WORK_ITEM_TYPES = ['BUG', 'EPIC', 'STORY', 'SUB_TASK', 'TASK'] as const;\n\nexport const GROUP_BY_OPTIONS: ReadonlyArray<{ value: BoardGroupBy; label: string }> = [\n { value: 'NONE', label: 'None' },\n { value: 'ASSIGNEE', label: 'Assignee' },\n { value: 'PRIORITY', label: 'Priority' },\n { value: 'TYPE', label: 'Type' },\n { value: 'EPIC', label: 'Epic' },\n { value: 'SPRINT', label: 'Sprint' },\n { value: 'MILESTONE', label: 'Milestone' },\n];\n\nexport const SORT_FIELD_OPTIONS: ReadonlyArray<{ value: BoardSortField; label: string }> = [\n { value: 'RANK', label: 'Board order' },\n { value: 'PRIORITY', label: 'Priority' },\n { value: 'DUE_DATE', label: 'Due date' },\n { value: 'STORY_POINTS', label: 'Story points' },\n { value: 'CREATED_AT', label: 'Created' },\n { value: 'UPDATED_AT', label: 'Updated' },\n];\n\nexport const VISIBLE_FIELD_OPTIONS: ReadonlyArray<{ value: BoardCardField; label: string }> = [\n { value: 'KEY', label: 'Key' },\n { value: 'TYPE', label: 'Type' },\n { value: 'PRIORITY', label: 'Priority' },\n { value: 'ASSIGNEE', label: 'Assignee' },\n { value: 'STORY_POINTS', label: 'Story points' },\n { value: 'DUE_DATE', label: 'Due date' },\n { value: 'LABELS', label: 'Labels' },\n { value: 'SPRINT', label: 'Sprint' },\n { value: 'MILESTONE', label: 'Milestone' },\n { value: 'EPIC', label: 'Epic' },\n];\n\n/** The board's own card before any view narrows what shows — matches what the board rendered before PDM-N04. */\nexport const DEFAULT_VISIBLE_FIELDS: BoardCardField[] = ['KEY', 'ASSIGNEE', 'STORY_POINTS'];\n\n/** Fields shown on a card: the view's own choice, or the board's default card when it named none. */\nexport function effectiveVisibleFields(\n fields: readonly BoardCardField[]\n): readonly BoardCardField[] {\n return fields.length > 0 ? fields : DEFAULT_VISIBLE_FIELDS;\n}\n\nexport interface BoardFilterState {\n assigneeIds: string[];\n unassigned: boolean;\n types: string[];\n priorities: string[];\n labels: string[];\n search: string;\n sprintId: string;\n milestoneId: string;\n /** yyyy-mm-dd, or '' for no bound. */\n dueFrom: string;\n dueTo: string;\n}\n\nexport interface BoardSortState {\n field: BoardSortField;\n direction: SortDirection;\n}\n\nexport interface BoardViewConfigState {\n filter: BoardFilterState;\n sort: BoardSortState;\n groupBy: BoardGroupBy;\n visibleFields: BoardCardField[];\n}\n\nexport function emptyFilter(): BoardFilterState {\n return {\n assigneeIds: [],\n unassigned: false,\n types: [],\n priorities: [],\n labels: [],\n search: '',\n sprintId: '',\n milestoneId: '',\n dueFrom: '',\n dueTo: '',\n };\n}\n\nexport function defaultSort(): BoardSortState {\n return { field: 'RANK', direction: 'ASC' };\n}\n\n/** \"All cards\": no view applied. */\nexport function defaultConfig(): BoardViewConfigState {\n return { filter: emptyFilter(), sort: defaultSort(), groupBy: 'NONE', visibleFields: [] };\n}\n\n/** The server's `PlanmagnetBoardCardFilter` input — `undefined` (omit the variable) when nothing is set. */\nexport function filterToGraphQLInput(\n filter: BoardFilterState\n): Record<string, unknown> | undefined {\n const input: Record<string, unknown> = {};\n if (filter.assigneeIds.length > 0) input.assigneeIds = filter.assigneeIds;\n if (filter.unassigned) input.unassigned = true;\n if (filter.types.length > 0) input.types = filter.types;\n if (filter.priorities.length > 0) input.priorities = filter.priorities;\n if (filter.labels.length > 0) input.labels = filter.labels;\n if (filter.search.trim()) input.search = filter.search.trim();\n if (filter.sprintId) input.sprintId = filter.sprintId;\n if (filter.milestoneId) input.milestoneId = filter.milestoneId;\n if (filter.dueFrom) input.dueFrom = `${filter.dueFrom}T00:00:00.000Z`;\n if (filter.dueTo) input.dueTo = `${filter.dueTo}T00:00:00.000Z`;\n return Object.keys(input).length > 0 ? input : undefined;\n}\n\n/** Whether any filter is actually narrowing the board (for the \"showing N\" hint and the Clear button). */\nexport function isFilterActive(filter: BoardFilterState): boolean {\n return filterToGraphQLInput(filter) !== undefined;\n}\n\n/** The server's `PlanmagnetBoardViewConfigInput` — a full replacement of a view's stored configuration. */\nexport function configToInput(config: BoardViewConfigState): {\n filter: Record<string, unknown> | null;\n groupBy: BoardGroupBy;\n sort: { field: BoardSortField; direction: SortDirection };\n visibleFields: BoardCardField[];\n} {\n return {\n filter: filterToGraphQLInput(config.filter) ?? null,\n groupBy: config.groupBy,\n sort: { field: config.sort.field, direction: config.sort.direction },\n visibleFields: config.visibleFields,\n };\n}\n\nexport interface BoardViewFilterValue {\n assigneeIds: string[];\n unassigned: boolean;\n types: string[];\n priorities: string[];\n labels: string[];\n search: string | null;\n sprintId: string | null;\n milestoneId: string | null;\n dueFrom: string | null;\n dueTo: string | null;\n}\n\nexport interface BoardView {\n id: string;\n name: string;\n description: string | null;\n projectId: string;\n boardId: string | null;\n ownerId: string;\n visibility: BoardViewVisibility;\n isMine: boolean;\n filter: BoardViewFilterValue;\n groupBy: BoardGroupBy;\n sort: { field: BoardSortField; direction: SortDirection };\n visibleFields: BoardCardField[];\n createdAt: string;\n updatedAt: string;\n}\n\n/** A saved view's stored configuration, converted into the same shape the editable controls use. */\nexport function configFromView(view: BoardView): BoardViewConfigState {\n return {\n filter: {\n assigneeIds: view.filter.assigneeIds,\n unassigned: view.filter.unassigned,\n types: view.filter.types,\n priorities: view.filter.priorities,\n labels: view.filter.labels,\n search: view.filter.search ?? '',\n sprintId: view.filter.sprintId ?? '',\n milestoneId: view.filter.milestoneId ?? '',\n dueFrom: view.filter.dueFrom ? view.filter.dueFrom.slice(0, 10) : '',\n dueTo: view.filter.dueTo ? view.filter.dueTo.slice(0, 10) : '',\n },\n sort: { field: view.sort.field, direction: view.sort.direction },\n groupBy: view.groupBy,\n visibleFields: view.visibleFields,\n };\n}\n\nconst norm = (a: readonly string[]) => [...a].sort().join('\\u0000');\n\n/** Whether two configurations would save as the same thing — drives the \"unsaved changes\" hint. */\nexport function configsEqual(a: BoardViewConfigState, b: BoardViewConfigState): boolean {\n return (\n norm(a.filter.assigneeIds) === norm(b.filter.assigneeIds) &&\n a.filter.unassigned === b.filter.unassigned &&\n norm(a.filter.types) === norm(b.filter.types) &&\n norm(a.filter.priorities) === norm(b.filter.priorities) &&\n norm(a.filter.labels) === norm(b.filter.labels) &&\n a.filter.search.trim() === b.filter.search.trim() &&\n a.filter.sprintId === b.filter.sprintId &&\n a.filter.milestoneId === b.filter.milestoneId &&\n a.filter.dueFrom === b.filter.dueFrom &&\n a.filter.dueTo === b.filter.dueTo &&\n a.sort.field === b.sort.field &&\n a.sort.direction === b.sort.direction &&\n a.groupBy === b.groupBy &&\n norm(a.visibleFields) === norm(b.visibleFields)\n );\n}\n\n/** The `?view=` URL parameter that keeps an applied view linkable — read via `window.location.search`, the same\n * convention this codebase already uses for `?taskId=` and `?objectiveId=`. */\nexport function readViewIdFromUrl(): string | null {\n if (typeof window === 'undefined') return null;\n return new URLSearchParams(window.location.search).get('view') || null;\n}\n\n/** Keeps the applied view linkable without adding a history entry or touching the host shell's own router. */\nexport function writeViewIdToUrl(viewId: string | null): void {\n if (typeof window === 'undefined') return;\n const url = new URL(window.location.href);\n if (viewId) url.searchParams.set('view', viewId);\n else url.searchParams.delete('view');\n window.history.replaceState(window.history.state, '', url);\n}\n\n// ─── Queries & mutations ────────────────────────────────────────────────────\n\nconst BOARD_VIEW_FIELDS = `\n id\n name\n description\n projectId\n boardId\n board {\n id\n name\n }\n ownerId\n visibility\n isMine\n filter {\n assigneeIds\n unassigned\n types\n priorities\n labels\n search\n sprintId\n milestoneId\n dueFrom\n dueTo\n }\n groupBy\n sort {\n field\n direction\n }\n visibleFields\n createdAt\n updatedAt\n`;\n\n/** Own views plus every SHARED one of the project (server rule — `mine` is left unset on purpose). */\nexport const BOARD_VIEWS = gql`\n query ProjectBoardViews($workspaceId: ID!, $filter: PlanmagnetBoardViewFilter, $pagination: PlanmagnetPaginationInput) {\n planmagnetBoardViews(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n ${BOARD_VIEW_FIELDS}\n }\n totalCount\n }\n }\n`;\n\nexport const CREATE_BOARD_VIEW = gql`\n mutation ProjectBoardViewCreate($input: PlanmagnetCreateBoardViewInput!) {\n planmagnetCreateBoardView(input: $input) {\n ${BOARD_VIEW_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_BOARD_VIEW = gql`\n mutation ProjectBoardViewUpdate($id: ID!, $input: PlanmagnetUpdateBoardViewInput!) {\n planmagnetUpdateBoardView(id: $id, input: $input) {\n ${BOARD_VIEW_FIELDS}\n }\n }\n`;\n\nexport const DELETE_BOARD_VIEW = gql`\n mutation ProjectBoardViewDelete($id: ID!) {\n planmagnetDeleteBoardView(id: $id)\n }\n`;\n\n/** The only query a board-view write can move: the bar's own list. Board data reacts to `filter`/`sort`/`groupBy`\n * changing on ProjectBoard's own state, which re-runs its query on its own — no refetch entry needed for it. */\nexport const VIEW_REFETCH = ['ProjectBoardViews'];\n\nexport function useBoardViews(workspaceId: string | undefined, projectId: string) {\n const { data, loading, error, refetch } = useQuery<{\n planmagnetBoardViews: { items: BoardView[]; totalCount: number };\n }>(BOARD_VIEWS, {\n variables: {\n workspaceId: workspaceId ?? '',\n filter: { projectId },\n pagination: { first: 100 },\n },\n skip: !workspaceId,\n });\n return {\n views: data?.planmagnetBoardViews.items ?? [],\n loading: loading && !data,\n error: error ? error.message : null,\n refetch,\n };\n}\n\nexport interface SprintOption {\n id: string;\n name: string;\n status: string;\n}\n\nconst PROJECT_SPRINT_OPTIONS = gql`\n query BoardViewProjectSprints($workspaceId: ID!, $projectId: String) {\n planmagnetSprints(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n name\n status\n }\n }\n }\n`;\n\n/** A project's sprints, for the sprint filter and for naming SPRINT swimlanes. */\nexport function useProjectSprintOptions(\n workspaceId: string | undefined,\n projectId: string | null | undefined\n) {\n const { data, loading, error } = useQuery<{\n planmagnetSprints?: { items: SprintOption[] };\n }>(PROJECT_SPRINT_OPTIONS, {\n variables: { workspaceId: workspaceId ?? '', projectId },\n skip: !workspaceId || !projectId,\n });\n return {\n options: data?.planmagnetSprints?.items ?? [],\n loading: loading && !data,\n error: error ? error.message : null,\n };\n}\n\n/** Convenience re-export so `BoardViewBar` does not need a second import of the provider hook. */\nexport { usePlanMagnet };\n"],"mappings":";;;;AAwCA,IAAa,IAAkB;CAAC;CAAO;CAAQ;CAAS;CAAY;CAAO,EAE9D,IAA0E;CACrF;EAAE,OAAO;EAAQ,OAAO;EAAQ;CAChC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAQ,OAAO;EAAQ;CAChC;EAAE,OAAO;EAAQ,OAAO;EAAQ;CAChC;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAa,OAAO;EAAa;CAC3C,EAEY,IAA8E;CACzF;EAAE,OAAO;EAAQ,OAAO;EAAe;CACvC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAgB,OAAO;EAAgB;CAChD;EAAE,OAAO;EAAc,OAAO;EAAW;CACzC;EAAE,OAAO;EAAc,OAAO;EAAW;CAC1C,EAEY,IAAiF;CAC5F;EAAE,OAAO;EAAO,OAAO;EAAO;CAC9B;EAAE,OAAO;EAAQ,OAAO;EAAQ;CAChC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAgB,OAAO;EAAgB;CAChD;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAU,OAAO;EAAU;CACpC;EAAE,OAAO;EAAU,OAAO;EAAU;CAC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AmB,SAAS,EAAE;EAC7C,SAAS,KAAW,CAAC;EACrB,OAAO,IAAQ,EAAM,UAAU;EAChC"}
|
|
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
* A button that asks before it acts. Used for anything that cannot be undone from the UI (complete or cancel a
|
|
5
5
|
* sprint, delete a task, a project or a roadmap).
|
|
6
6
|
*/
|
|
7
|
-
export declare function ConfirmButton({ label, icon, title, description, confirmLabel, onConfirm, disabled, destructive, variant, cancelLabel, ariaLabel, }: {
|
|
7
|
+
export declare function ConfirmButton({ label, icon, title, description, confirmLabel, onConfirm, disabled, destructive, variant, cancelLabel, ariaLabel, testId, }: {
|
|
8
8
|
label: string;
|
|
9
9
|
icon: ReactNode;
|
|
10
10
|
title: string;
|
|
@@ -17,6 +17,8 @@ export declare function ConfirmButton({ label, icon, title, description, confirm
|
|
|
17
17
|
cancelLabel?: string;
|
|
18
18
|
/** Required when `label` is empty (an icon-only button): icons are aria-hidden. */
|
|
19
19
|
ariaLabel?: string;
|
|
20
|
+
/** `data-testid` on the trigger button, for callers that need one addressable from a test. */
|
|
21
|
+
testId?: string;
|
|
20
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
/** An inline refusal reason, announced to screen readers. */
|
|
22
24
|
export declare function ErrorLine({ message }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmButton.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAmB,EACnB,OAAmB,EACnB,WAAuB,EACvB,SAAS,
|
|
1
|
+
{"version":3,"file":"ConfirmButton.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAmB,EACnB,OAAmB,EACnB,WAAuB,EACvB,SAAS,EACT,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,2CAoCA;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAMzD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { AlertDialog as n, AlertDialogAction as r, AlertDialogCancel as i, AlertDialogContent as a, AlertDialogDescription as o, AlertDialogFooter as s, AlertDialogHeader as c, AlertDialogTitle as l, AlertDialogTrigger as u, Button as d } from "@burdenoff/fe-libs/ui";
|
|
3
3
|
//#region src/planmagnet/controls/ConfirmButton.tsx
|
|
4
|
-
function f({ label: f, icon: p, title: m, description: h, confirmLabel: g, onConfirm: _, disabled: v, destructive: y = !1, variant: b = "default", cancelLabel: x = "Keep it", ariaLabel: S }) {
|
|
4
|
+
function f({ label: f, icon: p, title: m, description: h, confirmLabel: g, onConfirm: _, disabled: v, destructive: y = !1, variant: b = "default", cancelLabel: x = "Keep it", ariaLabel: S, testId: C }) {
|
|
5
5
|
return /* @__PURE__ */ t(n, { children: [/* @__PURE__ */ e(u, {
|
|
6
6
|
asChild: !0,
|
|
7
7
|
children: /* @__PURE__ */ t(d, {
|
|
@@ -9,6 +9,7 @@ function f({ label: f, icon: p, title: m, description: h, confirmLabel: g, onCon
|
|
|
9
9
|
variant: b,
|
|
10
10
|
disabled: v,
|
|
11
11
|
"aria-label": S,
|
|
12
|
+
"data-testid": C,
|
|
12
13
|
children: [p, f]
|
|
13
14
|
})
|
|
14
15
|
}), /* @__PURE__ */ t(a, { children: [/* @__PURE__ */ t(c, { children: [/* @__PURE__ */ e(l, { children: m }), /* @__PURE__ */ e(o, { children: h })] }), /* @__PURE__ */ t(s, { children: [/* @__PURE__ */ e(i, { children: x }), /* @__PURE__ */ e(r, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmButton.js","names":[],"sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n} from '@burdenoff/fe-libs/ui';\n\n/**\n * A button that asks before it acts. Used for anything that cannot be undone from the UI (complete or cancel a\n * sprint, delete a task, a project or a roadmap).\n */\nexport function ConfirmButton({\n label,\n icon,\n title,\n description,\n confirmLabel,\n onConfirm,\n disabled,\n destructive = false,\n variant = 'default',\n cancelLabel = 'Keep it',\n ariaLabel,\n}: {\n label: string;\n icon: ReactNode;\n title: string;\n description: string;\n confirmLabel: string;\n onConfirm: () => void;\n disabled: boolean;\n destructive?: boolean;\n variant?: 'default' | 'outline';\n cancelLabel?: string;\n /** Required when `label` is empty (an icon-only button): icons are aria-hidden. */\n ariaLabel?: string;\n}) {\n return (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button
|
|
1
|
+
{"version":3,"file":"ConfirmButton.js","names":[],"sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n} from '@burdenoff/fe-libs/ui';\n\n/**\n * A button that asks before it acts. Used for anything that cannot be undone from the UI (complete or cancel a\n * sprint, delete a task, a project or a roadmap).\n */\nexport function ConfirmButton({\n label,\n icon,\n title,\n description,\n confirmLabel,\n onConfirm,\n disabled,\n destructive = false,\n variant = 'default',\n cancelLabel = 'Keep it',\n ariaLabel,\n testId,\n}: {\n label: string;\n icon: ReactNode;\n title: string;\n description: string;\n confirmLabel: string;\n onConfirm: () => void;\n disabled: boolean;\n destructive?: boolean;\n variant?: 'default' | 'outline';\n cancelLabel?: string;\n /** Required when `label` is empty (an icon-only button): icons are aria-hidden. */\n ariaLabel?: string;\n /** `data-testid` on the trigger button, for callers that need one addressable from a test. */\n testId?: string;\n}) {\n return (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n size=\"sm\"\n variant={variant}\n disabled={disabled}\n aria-label={ariaLabel}\n data-testid={testId}\n >\n {icon}\n {label}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{cancelLabel}</AlertDialogCancel>\n <AlertDialogAction\n onClick={onConfirm}\n className={\n destructive\n ? 'bg-destructive text-destructive-foreground hover:bg-destructive/90'\n : ''\n }\n >\n {confirmLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n\n/** An inline refusal reason, announced to screen readers. */\nexport function ErrorLine({ message }: { message: string }) {\n return (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {message}\n </p>\n );\n}\n"],"mappings":";;;AAkBA,SAAgB,EAAc,EAC5B,UACA,SACA,UACA,gBACA,iBACA,cACA,aACA,iBAAc,IACd,aAAU,WACV,iBAAc,WACd,cACA,aAgBC;AACD,QACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;EAAoB,SAAA;YAClB,kBAAC,GAAD;GACE,MAAK;GACI;GACC;GACV,cAAY;GACZ,eAAa;aALf,CAOG,GACA,EACM;;EACU,CAAA,EACrB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAmB,GAAyB,CAAA,EAC5C,kBAAC,GAAD,EAAA,UAAyB,GAAqC,CAAA,CAC5C,EAAA,CAAA,EACpB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAoB,GAAgC,CAAA,EACpD,kBAAC,GAAD;EACE,SAAS;EACT,WACE,IACI,uEACA;YAGL;EACiB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA,CACT,EAAA,CAAA;;AAKlB,SAAgB,EAAU,EAAE,cAAgC;AAC1D,QACE,kBAAC,KAAD;EAAG,MAAK;EAAQ,WAAU;YACvB;EACC,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable SVG dependency graph (PDM-27). Nodes are work items, edges are `WorkItemDependency` rows, laid out in
|
|
3
|
+
* layers left-to-right by longest-path topological order. Two mount points share this component:
|
|
4
|
+
* - the critical-path page's "Graph" view (the whole project — see useProjectWorkItemsGraph.ts)
|
|
5
|
+
* - the task dependency panel's one-hop neighbourhood graph (this item, its predecessors, its successors)
|
|
6
|
+
*
|
|
7
|
+
* The existing text list stays the accessible/no-JS-heavy fallback at every call site — this component is an
|
|
8
|
+
* additional view, never a replacement for it.
|
|
9
|
+
*/
|
|
10
|
+
export interface DependencyGraphNode {
|
|
11
|
+
id: string;
|
|
12
|
+
key: string | null;
|
|
13
|
+
title: string | null;
|
|
14
|
+
status: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DependencyGraphEdge {
|
|
17
|
+
/** The WorkItemDependency's own id — stable per edge, used as the React key. */
|
|
18
|
+
id: string;
|
|
19
|
+
predecessorId: string;
|
|
20
|
+
successorId: string;
|
|
21
|
+
/** A DependencyType value. */
|
|
22
|
+
type: string;
|
|
23
|
+
lagMinutes: number | null;
|
|
24
|
+
}
|
|
25
|
+
export interface DependencyGraphProps {
|
|
26
|
+
nodes: DependencyGraphNode[];
|
|
27
|
+
edges: DependencyGraphEdge[];
|
|
28
|
+
/** Node ids on the critical path (CPM chain) — emphasised with a thicker primary outline. */
|
|
29
|
+
criticalNodeIds?: ReadonlySet<string>;
|
|
30
|
+
/** Edge ids that connect two consecutive critical-path nodes — emphasised the same way. */
|
|
31
|
+
criticalEdgeIds?: ReadonlySet<string>;
|
|
32
|
+
onActivateNode: (nodeId: string) => void;
|
|
33
|
+
/** Shown instead of the graph when `nodes` is empty. */
|
|
34
|
+
emptyMessage: string;
|
|
35
|
+
/** Accessible name for the graph region — should say what project/item it scopes to. */
|
|
36
|
+
ariaLabel: string;
|
|
37
|
+
}
|
|
38
|
+
/** Shared with GanttChart.tsx, which draws the same dependency edges between bars instead of nodes. */
|
|
39
|
+
export declare function truncate(text: string, maxChars: number): string;
|
|
40
|
+
export declare function dependencyTypeLabel(type: string): string;
|
|
41
|
+
export declare function lagLabel(lagMinutes: number | null): string | null;
|
|
42
|
+
export declare function DependencyGraph({ nodes, edges, criticalNodeIds, criticalEdgeIds, onActivateNode, emptyMessage, ariaLabel, }: DependencyGraphProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=DependencyGraph.d.ts.map
|
|
@@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AK,EACL,KAAK,EACL,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACZ,SAAS,GACV,EAAE,oBAAoB,2CA0MtB"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { enumLabel as e } from "../controls/WorkItemControls.js";
|
|
2
|
+
import { rowLinkProps as t } from "../utils/rowNavigation.js";
|
|
3
|
+
import { STATUS_LEGEND_ORDER as n, statusVisual as r } from "../utils/statusColor.js";
|
|
4
|
+
import { useMemo as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/planmagnet/dependency/DependencyGraph.tsx
|
|
7
|
+
var s = 180, c = 56, l = 72, u = 16, d = 20, f = 4, p = 24, m = 16;
|
|
8
|
+
function h(e, t) {
|
|
9
|
+
return e.length <= t ? e : `${e.slice(0, Math.max(1, t - 1))}…`;
|
|
10
|
+
}
|
|
11
|
+
function g(t) {
|
|
12
|
+
switch (t) {
|
|
13
|
+
case "FINISH_TO_START": return "Finish to start";
|
|
14
|
+
case "START_TO_START": return "Start to start";
|
|
15
|
+
case "FINISH_TO_FINISH": return "Finish to finish";
|
|
16
|
+
case "START_TO_FINISH": return "Start to finish";
|
|
17
|
+
default: return e(t);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function _(e) {
|
|
21
|
+
if (!e) return null;
|
|
22
|
+
let t = e / 1440, n = e > 0 ? "lag" : "lead";
|
|
23
|
+
return Number.isInteger(t) ? `${Math.abs(t)}d ${n}` : `${Math.abs(Math.round(e / 60 * 10) / 10)}h ${n}`;
|
|
24
|
+
}
|
|
25
|
+
function v(e, t) {
|
|
26
|
+
let n = new Map(e.map((e) => [e, []]));
|
|
27
|
+
for (let e of t) {
|
|
28
|
+
let t = n.get(e.successorId);
|
|
29
|
+
t && n.has(e.predecessorId) && t.push(e.predecessorId);
|
|
30
|
+
}
|
|
31
|
+
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
32
|
+
function a(t, o) {
|
|
33
|
+
let s = r.get(t);
|
|
34
|
+
if (s !== void 0) return s;
|
|
35
|
+
if (i.has(t) || o > e.length) return -1;
|
|
36
|
+
i.add(t);
|
|
37
|
+
let c = n.get(t) ?? [], l = -1;
|
|
38
|
+
for (let e of c) l = Math.max(l, a(e, o + 1));
|
|
39
|
+
i.delete(t);
|
|
40
|
+
let u = l + 1;
|
|
41
|
+
return r.set(t, u), u;
|
|
42
|
+
}
|
|
43
|
+
for (let t of e) a(t, 0);
|
|
44
|
+
return r;
|
|
45
|
+
}
|
|
46
|
+
function y({ nodes: y, edges: b, criticalNodeIds: x, criticalEdgeIds: S, onActivateNode: C, emptyMessage: w, ariaLabel: T }) {
|
|
47
|
+
let E = i(() => {
|
|
48
|
+
let e = y.map((e) => e.id), t = new Set(e), n = b.filter((e) => t.has(e.predecessorId) && t.has(e.successorId)), r = v(e, n), i = /* @__PURE__ */ new Map();
|
|
49
|
+
for (let t of e) {
|
|
50
|
+
let e = r.get(t) ?? 0, n = i.get(e);
|
|
51
|
+
n ? n.push(t) : i.set(e, [t]);
|
|
52
|
+
}
|
|
53
|
+
let a = i.size === 0 ? 1 : Math.max(...i.keys()) + 1, o = Math.max(1, ...Array.from(i.values(), (e) => e.length)), f = /* @__PURE__ */ new Map();
|
|
54
|
+
for (let [e, t] of i) {
|
|
55
|
+
let n = d + e * (s + l), r = t.length * c + (t.length - 1) * u, i = o * c + (o - 1) * u, a = d + Math.max(0, (i - r) / 2);
|
|
56
|
+
t.forEach((e, t) => {
|
|
57
|
+
f.set(e, {
|
|
58
|
+
x: n,
|
|
59
|
+
y: a + t * (c + u)
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
position: f,
|
|
65
|
+
inScopeEdges: n,
|
|
66
|
+
width: d * 2 + a * s + Math.max(0, a - 1) * l,
|
|
67
|
+
height: d * 2 + o * c + Math.max(0, o - 1) * u
|
|
68
|
+
};
|
|
69
|
+
}, [y, b]), D = i(() => n.filter((e) => y.some((t) => t.status === e)), [y]);
|
|
70
|
+
if (y.length === 0) return /* @__PURE__ */ a("div", {
|
|
71
|
+
"data-testid": "dependency-graph",
|
|
72
|
+
className: "p-6 text-center text-sm text-muted-foreground",
|
|
73
|
+
children: w
|
|
74
|
+
});
|
|
75
|
+
let O = new Map(y.map((e) => [e.id, e]));
|
|
76
|
+
return /* @__PURE__ */ o("div", {
|
|
77
|
+
"data-testid": "dependency-graph",
|
|
78
|
+
className: "rounded-md border border-input bg-background",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ o("p", {
|
|
81
|
+
className: "sr-only",
|
|
82
|
+
children: [
|
|
83
|
+
"Dependency graph with ",
|
|
84
|
+
y.length,
|
|
85
|
+
" work item",
|
|
86
|
+
y.length === 1 ? "" : "s",
|
|
87
|
+
" and",
|
|
88
|
+
" ",
|
|
89
|
+
E.inScopeEdges.length,
|
|
90
|
+
" dependenc",
|
|
91
|
+
E.inScopeEdges.length === 1 ? "y" : "ies",
|
|
92
|
+
".",
|
|
93
|
+
x && x.size > 0 ? ` ${x.size} item${x.size === 1 ? " is" : "s are"} on the critical path.` : "",
|
|
94
|
+
" ",
|
|
95
|
+
"The list above/below gives the same information as text."
|
|
96
|
+
]
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ a("div", {
|
|
99
|
+
className: "overflow-x-auto p-3",
|
|
100
|
+
children: /* @__PURE__ */ o("svg", {
|
|
101
|
+
"aria-label": T,
|
|
102
|
+
width: E.width,
|
|
103
|
+
height: E.height,
|
|
104
|
+
viewBox: `0 0 ${E.width} ${E.height}`,
|
|
105
|
+
className: "block",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ o("defs", { children: [/* @__PURE__ */ a("marker", {
|
|
108
|
+
id: "dependency-graph-arrow",
|
|
109
|
+
viewBox: "0 0 10 10",
|
|
110
|
+
refX: "9",
|
|
111
|
+
refY: "5",
|
|
112
|
+
markerWidth: "6",
|
|
113
|
+
markerHeight: "6",
|
|
114
|
+
orient: "auto-start-reverse",
|
|
115
|
+
className: "text-border-strong",
|
|
116
|
+
children: /* @__PURE__ */ a("path", {
|
|
117
|
+
d: "M0,0 L10,5 L0,10 z",
|
|
118
|
+
fill: "currentColor"
|
|
119
|
+
})
|
|
120
|
+
}), /* @__PURE__ */ a("marker", {
|
|
121
|
+
id: "dependency-graph-arrow-critical",
|
|
122
|
+
viewBox: "0 0 10 10",
|
|
123
|
+
refX: "9",
|
|
124
|
+
refY: "5",
|
|
125
|
+
markerWidth: "6",
|
|
126
|
+
markerHeight: "6",
|
|
127
|
+
orient: "auto-start-reverse",
|
|
128
|
+
className: "text-primary",
|
|
129
|
+
children: /* @__PURE__ */ a("path", {
|
|
130
|
+
d: "M0,0 L10,5 L0,10 z",
|
|
131
|
+
fill: "currentColor"
|
|
132
|
+
})
|
|
133
|
+
})] }),
|
|
134
|
+
E.inScopeEdges.map((e) => {
|
|
135
|
+
let t = E.position.get(e.predecessorId), n = E.position.get(e.successorId);
|
|
136
|
+
if (!t || !n) return null;
|
|
137
|
+
let r = t.x + s, i = t.y + c / 2, l = n.x, u = n.y + c / 2, d = (r + l) / 2, f = S?.has(e.id) ?? !1, p = e.type === "FINISH_TO_START" ? null : g(e.type), m = _(e.lagMinutes), h = [p, m].filter((e) => !!e).join(" · "), v = O.get(e.predecessorId), y = O.get(e.successorId);
|
|
138
|
+
return /* @__PURE__ */ o("g", {
|
|
139
|
+
"data-testid": "dependency-graph-edge",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ o("title", { children: [
|
|
142
|
+
v?.key ?? e.predecessorId,
|
|
143
|
+
" ",
|
|
144
|
+
g(e.type),
|
|
145
|
+
" ",
|
|
146
|
+
y?.key ?? e.successorId,
|
|
147
|
+
m ? ` (${m})` : ""
|
|
148
|
+
] }),
|
|
149
|
+
/* @__PURE__ */ a("path", {
|
|
150
|
+
d: `M ${r},${i} C ${d},${i} ${d},${u} ${l},${u}`,
|
|
151
|
+
fill: "none",
|
|
152
|
+
strokeWidth: f ? 2.5 : 1.5,
|
|
153
|
+
className: f ? "text-primary" : "text-border-strong",
|
|
154
|
+
stroke: "currentColor",
|
|
155
|
+
markerEnd: `url(#${f ? "dependency-graph-arrow-critical" : "dependency-graph-arrow"})`
|
|
156
|
+
}),
|
|
157
|
+
h && /* @__PURE__ */ a("text", {
|
|
158
|
+
x: d,
|
|
159
|
+
y: (i + u) / 2 - 4,
|
|
160
|
+
textAnchor: "middle",
|
|
161
|
+
className: "fill-muted-foreground text-[9px]",
|
|
162
|
+
children: h
|
|
163
|
+
})
|
|
164
|
+
]
|
|
165
|
+
}, e.id);
|
|
166
|
+
}),
|
|
167
|
+
y.map((n) => {
|
|
168
|
+
let i = E.position.get(n.id);
|
|
169
|
+
if (!i) return null;
|
|
170
|
+
let l = x?.has(n.id) ?? !1, u = r(n.status), d = n.title ?? "Untitled work item", g = n.key ?? "", _ = `${g ? `${g} — ` : ""}${d} (${e(n.status)})${l ? ", on critical path" : ""}`;
|
|
171
|
+
return /* @__PURE__ */ o("g", {
|
|
172
|
+
"data-testid": "dependency-graph-node",
|
|
173
|
+
transform: `translate(${i.x}, ${i.y})`,
|
|
174
|
+
...t(() => C(n.id), _),
|
|
175
|
+
className: "cursor-pointer focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary focus-visible:outline-offset-2",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ a("title", { children: _ }),
|
|
178
|
+
/* @__PURE__ */ a("rect", {
|
|
179
|
+
width: s,
|
|
180
|
+
height: c,
|
|
181
|
+
rx: 8,
|
|
182
|
+
className: `fill-background ${l ? "stroke-primary" : "stroke-input"}`,
|
|
183
|
+
strokeWidth: l ? 2 : 1
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ a("circle", {
|
|
186
|
+
cx: 16,
|
|
187
|
+
cy: c / 2,
|
|
188
|
+
r: f,
|
|
189
|
+
className: u.fill
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ a("text", {
|
|
192
|
+
x: 28,
|
|
193
|
+
y: 22,
|
|
194
|
+
className: "fill-muted-foreground text-[10px] font-medium",
|
|
195
|
+
children: h(g, m)
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ a("text", {
|
|
198
|
+
x: 28,
|
|
199
|
+
y: 38,
|
|
200
|
+
className: "fill-foreground text-[11px] font-medium",
|
|
201
|
+
children: h(d, p)
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}, n.id);
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
})
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ o("div", {
|
|
210
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-1 border-t border-input px-3 py-2 text-[11px] text-muted-foreground",
|
|
211
|
+
children: [D.map((t) => /* @__PURE__ */ o("span", {
|
|
212
|
+
className: "inline-flex items-center gap-1.5",
|
|
213
|
+
children: [/* @__PURE__ */ a("span", { className: `h-2.5 w-2.5 rounded-full ${r(t).swatch}` }), e(t)]
|
|
214
|
+
}, t)), x && x.size > 0 && /* @__PURE__ */ o("span", {
|
|
215
|
+
className: "inline-flex items-center gap-1.5",
|
|
216
|
+
children: [/* @__PURE__ */ a("span", { className: "h-2.5 w-2.5 rounded-full border-2 border-primary bg-background" }), "Critical path"]
|
|
217
|
+
})]
|
|
218
|
+
})
|
|
219
|
+
]
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
export { y as DependencyGraph, g as dependencyTypeLabel, _ as lagLabel, h as truncate };
|
|
224
|
+
|
|
225
|
+
//# sourceMappingURL=DependencyGraph.js.map
|