@burdenoff/microfe-planmagnet 2026.1001.7 → 2026.1001.8
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/hooks/useLiveRefresh.d.ts +33 -2
- package/dist/planmagnet/hooks/useLiveRefresh.d.ts.map +1 -1
- package/dist/planmagnet/hooks/useLiveRefresh.js +71 -42
- package/dist/planmagnet/hooks/useLiveRefresh.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js +153 -117
- package/dist/planmagnet/pages/ProductsRoadmapAnalyticsPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js +173 -138
- package/dist/planmagnet/pages/ProductsRoadmapDetailPagePage.js.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.d.ts.map +1 -1
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js +171 -153
- package/dist/planmagnet/roadmaps/RoadmapNowNextLater.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,15 +2,17 @@ import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
|
2
2
|
import { isForbidden as t, mutationErrorMessage as n } from "../utils/graphqlErrors.js";
|
|
3
3
|
import { throwOnError as r } from "../utils/mutationResult.js";
|
|
4
4
|
import { enumLabel as i } from "../controls/WorkItemControls.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { useLiveRefresh as a } from "../hooks/useLiveRefresh.js";
|
|
6
|
+
import { LiveStatus as o } from "../controls/LiveStatus.js";
|
|
7
|
+
import { RoadmapItemCommentsButton as s } from "../comments/RoadmapComments.js";
|
|
8
|
+
import { useEffect as c, useMemo as l, useState as u } from "react";
|
|
9
|
+
import { AlertTriangle as d, Calendar as f, Gauge as p, Inbox as m, Loader2 as h, ShieldAlert as g, ShieldCheck as _ } from "lucide-react";
|
|
10
|
+
import { gql as v } from "@apollo/client";
|
|
11
|
+
import { useMutation as y, useQuery as b } from "@apollo/client/react";
|
|
12
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
13
|
+
import { Tooltip as C, TooltipContent as w, TooltipProvider as T, TooltipTrigger as E } from "@burdenoff/fe-libs/ui";
|
|
12
14
|
//#region src/planmagnet/roadmaps/RoadmapNowNextLater.tsx
|
|
13
|
-
var
|
|
15
|
+
var D = ["RoadmapNowNextLaterItems"], O = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlane\n sortOrder\n confidence\n riskLevel\n riskNote\n featureRequestDemand {\n requests\n votes\n }\n", k = v`
|
|
14
16
|
query RoadmapNowNextLaterItems(
|
|
15
17
|
$workspaceId: ID!
|
|
16
18
|
$filter: PlanmagnetRoadmapItemFilter
|
|
@@ -18,7 +20,7 @@ var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlan
|
|
|
18
20
|
) {
|
|
19
21
|
planmagnetRoadmapItems(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
20
22
|
items {
|
|
21
|
-
${
|
|
23
|
+
${O}
|
|
22
24
|
}
|
|
23
25
|
pageInfo {
|
|
24
26
|
hasNextPage
|
|
@@ -27,13 +29,13 @@ var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlan
|
|
|
27
29
|
totalCount
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
|
-
`,
|
|
32
|
+
`, ee = v`
|
|
31
33
|
mutation RoadmapNowNextLaterMove($id: ID!, $input: PlanmagnetMoveRoadmapItemInput!) {
|
|
32
34
|
planmagnetMoveRoadmapItem(id: $id, input: $input) {
|
|
33
|
-
${
|
|
35
|
+
${O}
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
|
-
`,
|
|
38
|
+
`, A = [
|
|
37
39
|
{
|
|
38
40
|
key: "UNPLACED",
|
|
39
41
|
label: "Not placed",
|
|
@@ -54,20 +56,20 @@ var T = "\n id\n title\n status\n startDate\n endDate\n horizon\n swimlan
|
|
|
54
56
|
label: "Later",
|
|
55
57
|
horizon: "LATER"
|
|
56
58
|
}
|
|
57
|
-
],
|
|
58
|
-
function
|
|
59
|
-
let { data: n, loading: r, error: i, fetchMore: a } =
|
|
59
|
+
], j = (e) => e ?? "UNPLACED", M = 200, N = 2e3;
|
|
60
|
+
function P(e, t) {
|
|
61
|
+
let { data: n, loading: r, error: i, fetchMore: a } = b(k, {
|
|
60
62
|
variables: {
|
|
61
63
|
workspaceId: e ?? "",
|
|
62
64
|
filter: { roadmapId: t },
|
|
63
|
-
pagination: { first:
|
|
65
|
+
pagination: { first: M }
|
|
64
66
|
},
|
|
65
67
|
skip: !e || !t
|
|
66
|
-
}),
|
|
67
|
-
|
|
68
|
-
!
|
|
68
|
+
}), o = n?.planmagnetRoadmapItems.items ?? [], s = n?.planmagnetRoadmapItems.pageInfo.hasNextPage ?? !1, l = n?.planmagnetRoadmapItems.pageInfo.endCursor ?? null, d = n?.planmagnetRoadmapItems.totalCount ?? 0;
|
|
69
|
+
c(() => {
|
|
70
|
+
!s || !l || o.length >= N || a({
|
|
69
71
|
variables: { pagination: {
|
|
70
|
-
first:
|
|
72
|
+
first: M,
|
|
71
73
|
after: l
|
|
72
74
|
} },
|
|
73
75
|
updateQuery: (e, { fetchMoreResult: t }) => ({ planmagnetRoadmapItems: {
|
|
@@ -76,70 +78,77 @@ function M(e, t) {
|
|
|
76
78
|
} })
|
|
77
79
|
}).catch(() => {});
|
|
78
80
|
}, [
|
|
79
|
-
|
|
81
|
+
s,
|
|
80
82
|
l,
|
|
81
|
-
|
|
83
|
+
o.length,
|
|
82
84
|
a
|
|
83
|
-
])
|
|
84
|
-
|
|
85
|
+
]);
|
|
86
|
+
let f = !!n && (!s || o.length >= N), p = `${e ?? ""}:${t}`, [m, h] = u(null);
|
|
87
|
+
return m && m.key !== p ? h(null) : f && m?.items !== o && h({
|
|
88
|
+
key: p,
|
|
89
|
+
items: o,
|
|
90
|
+
totalCount: d,
|
|
91
|
+
truncated: s && o.length >= N
|
|
92
|
+
}), {
|
|
93
|
+
items: m && m.key === p ? m.items : o,
|
|
85
94
|
loading: r && !n,
|
|
86
95
|
error: i,
|
|
87
|
-
totalCount:
|
|
88
|
-
truncated:
|
|
96
|
+
totalCount: m && m.key === p ? m.totalCount : d,
|
|
97
|
+
truncated: m && m.key === p ? m.truncated : !1
|
|
89
98
|
};
|
|
90
99
|
}
|
|
91
|
-
var
|
|
92
|
-
function
|
|
100
|
+
var F = (e) => e.swimlane ?? "", I = (e) => e || "Uncategorized";
|
|
101
|
+
function L(e, t, n) {
|
|
93
102
|
let r = e.filter((e) => e.id !== t);
|
|
94
103
|
if (n === null) return r.length;
|
|
95
104
|
let i = r.findIndex((e) => e.id === n);
|
|
96
105
|
return i === -1 ? r.length : i;
|
|
97
106
|
}
|
|
98
|
-
var
|
|
107
|
+
var R = {
|
|
99
108
|
LOW: {
|
|
100
|
-
Icon:
|
|
109
|
+
Icon: _,
|
|
101
110
|
label: "Low risk",
|
|
102
111
|
className: "text-muted-foreground"
|
|
103
112
|
},
|
|
104
113
|
MEDIUM: {
|
|
105
|
-
Icon:
|
|
114
|
+
Icon: d,
|
|
106
115
|
label: "Medium risk",
|
|
107
116
|
className: "text-status-warning-text"
|
|
108
117
|
},
|
|
109
118
|
HIGH: {
|
|
110
|
-
Icon:
|
|
119
|
+
Icon: g,
|
|
111
120
|
label: "High risk",
|
|
112
121
|
className: "text-status-error-text"
|
|
113
122
|
}
|
|
114
123
|
};
|
|
115
|
-
function
|
|
124
|
+
function z({ level: e, note: t }) {
|
|
116
125
|
if (!e) return null;
|
|
117
|
-
let n =
|
|
126
|
+
let n = R[e], r = /* @__PURE__ */ S("span", {
|
|
118
127
|
"data-testid": "nnl-risk",
|
|
119
128
|
className: `inline-flex items-center gap-1 text-xs ${n.className}`,
|
|
120
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ x(n.Icon, {
|
|
121
130
|
className: "h-3.5 w-3.5",
|
|
122
131
|
"aria-hidden": "true"
|
|
123
132
|
}), n.label]
|
|
124
133
|
});
|
|
125
|
-
return t ? /* @__PURE__ */
|
|
134
|
+
return t ? /* @__PURE__ */ x(T, { children: /* @__PURE__ */ S(C, { children: [/* @__PURE__ */ x(E, {
|
|
126
135
|
asChild: !0,
|
|
127
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ x("button", {
|
|
128
137
|
type: "button",
|
|
129
138
|
className: "rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
130
139
|
children: r
|
|
131
140
|
})
|
|
132
|
-
}), /* @__PURE__ */
|
|
141
|
+
}), /* @__PURE__ */ x(w, {
|
|
133
142
|
className: "max-w-xs",
|
|
134
143
|
children: t
|
|
135
144
|
})] }) }) : r;
|
|
136
145
|
}
|
|
137
|
-
function
|
|
138
|
-
return e === null ? null : /* @__PURE__ */
|
|
146
|
+
function B({ confidence: e }) {
|
|
147
|
+
return e === null ? null : /* @__PURE__ */ S("span", {
|
|
139
148
|
"data-testid": "nnl-confidence",
|
|
140
149
|
className: "inline-flex items-center gap-1 text-xs text-muted-foreground",
|
|
141
150
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ x(p, {
|
|
143
152
|
className: "h-3.5 w-3.5",
|
|
144
153
|
"aria-hidden": "true"
|
|
145
154
|
}),
|
|
@@ -148,9 +157,9 @@ function R({ confidence: e }) {
|
|
|
148
157
|
]
|
|
149
158
|
});
|
|
150
159
|
}
|
|
151
|
-
function
|
|
160
|
+
function V({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onShift: a }) {
|
|
152
161
|
let o = n.findIndex((t) => t.id === e.id), s = o > 0, c = o !== -1 && o < n.length - 1;
|
|
153
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ S("select", {
|
|
154
163
|
id: `nnl-move-${e.id}`,
|
|
155
164
|
"aria-label": `Move ${e.title}`,
|
|
156
165
|
"data-testid": "nnl-card-move",
|
|
@@ -162,20 +171,20 @@ function z({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onSh
|
|
|
162
171
|
t === "up" ? a(-1) : t === "down" ? a(1) : t && i(t);
|
|
163
172
|
},
|
|
164
173
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ x("option", {
|
|
166
175
|
value: "",
|
|
167
176
|
children: "Move…"
|
|
168
177
|
}),
|
|
169
|
-
|
|
178
|
+
A.filter((e) => e.key !== t).map((e) => /* @__PURE__ */ S("option", {
|
|
170
179
|
value: e.key,
|
|
171
180
|
children: ["Move to ", e.label]
|
|
172
181
|
}, e.key)),
|
|
173
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ x("option", {
|
|
174
183
|
value: "up",
|
|
175
184
|
disabled: !s,
|
|
176
185
|
children: "Move up"
|
|
177
186
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ x("option", {
|
|
179
188
|
value: "down",
|
|
180
189
|
disabled: !c,
|
|
181
190
|
children: "Move down"
|
|
@@ -183,35 +192,35 @@ function z({ item: e, columnKey: t, laneItems: n, disabled: r, onMoveTo: i, onSh
|
|
|
183
192
|
]
|
|
184
193
|
});
|
|
185
194
|
}
|
|
186
|
-
function
|
|
195
|
+
function H({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: a, dragging: o, dropIndicator: c, moveDisabled: l, onDragStart: u, onDragEnd: d, onDragOverCard: p, onDropOnCard: m, onMoveTo: h, onShift: g }) {
|
|
187
196
|
let _ = t.featureRequestDemand;
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
draggable:
|
|
197
|
+
return /* @__PURE__ */ S("li", {
|
|
198
|
+
draggable: a,
|
|
190
199
|
onDragStart: (e) => {
|
|
191
|
-
e.dataTransfer.setData("text/plain", t.id), e.dataTransfer.effectAllowed = "move",
|
|
200
|
+
e.dataTransfer.setData("text/plain", t.id), e.dataTransfer.effectAllowed = "move", u(t.id);
|
|
192
201
|
},
|
|
193
|
-
onDragEnd:
|
|
202
|
+
onDragEnd: d,
|
|
194
203
|
onDragOver: p,
|
|
195
204
|
onDrop: m,
|
|
196
205
|
"data-testid": "nnl-card",
|
|
197
206
|
className: [
|
|
198
207
|
"space-y-1.5 rounded-md border bg-background p-2 text-sm",
|
|
199
|
-
|
|
200
|
-
|
|
208
|
+
a ? "cursor-grab" : "",
|
|
209
|
+
o ? "opacity-50" : "",
|
|
201
210
|
c === "before" ? "border-t-2 border-t-primary" : "",
|
|
202
211
|
c === "after" ? "border-b-2 border-b-primary" : ""
|
|
203
212
|
].filter(Boolean).join(" "),
|
|
204
213
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ x("p", {
|
|
206
215
|
className: "font-medium leading-tight",
|
|
207
216
|
children: t.title
|
|
208
217
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ S("div", {
|
|
210
219
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ x("span", { children: i(t.status) }), (t.startDate || t.endDate) && /* @__PURE__ */ S("span", {
|
|
212
221
|
className: "flex items-center gap-1",
|
|
213
222
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ x(f, {
|
|
215
224
|
className: "h-3 w-3",
|
|
216
225
|
"aria-hidden": "true"
|
|
217
226
|
}),
|
|
@@ -221,7 +230,7 @@ function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dr
|
|
|
221
230
|
]
|
|
222
231
|
})]
|
|
223
232
|
}),
|
|
224
|
-
_ && _.requests > 0 && /* @__PURE__ */
|
|
233
|
+
_ && _.requests > 0 && /* @__PURE__ */ S("p", {
|
|
225
234
|
className: "text-xs text-muted-foreground",
|
|
226
235
|
"data-testid": "roadmap-item-demand",
|
|
227
236
|
children: [
|
|
@@ -234,20 +243,20 @@ function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dr
|
|
|
234
243
|
_.votes === 1 ? "" : "s"
|
|
235
244
|
]
|
|
236
245
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ S("div", {
|
|
238
247
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ x(B, { confidence: t.confidence }), /* @__PURE__ */ x(z, {
|
|
240
249
|
level: t.riskLevel,
|
|
241
250
|
note: t.riskNote
|
|
242
251
|
})]
|
|
243
252
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ S("div", {
|
|
245
254
|
className: "flex items-center justify-between gap-1 pt-0.5",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ x(s, {
|
|
247
256
|
roadmapId: e,
|
|
248
257
|
itemId: t.id,
|
|
249
258
|
itemTitle: t.title
|
|
250
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ x(V, {
|
|
251
260
|
item: t,
|
|
252
261
|
columnKey: n,
|
|
253
262
|
laneItems: r,
|
|
@@ -259,8 +268,8 @@ function B({ roadmapId: e, item: t, columnKey: n, laneItems: r, draggable: o, dr
|
|
|
259
268
|
]
|
|
260
269
|
});
|
|
261
270
|
}
|
|
262
|
-
function
|
|
263
|
-
let { workspaceId:
|
|
271
|
+
function U({ roadmapId: i }) {
|
|
272
|
+
let { workspaceId: s } = e(), { items: d, loading: f, error: p, totalCount: g, truncated: _ } = P(s, i), [v, b] = y(ee, {
|
|
264
273
|
refetchQueries: [
|
|
265
274
|
"GetRoadmapDetailPage",
|
|
266
275
|
"GetRoadmapDetail",
|
|
@@ -268,156 +277,165 @@ function V({ roadmapId: i }) {
|
|
|
268
277
|
"RoadmapNowNextLaterItems"
|
|
269
278
|
],
|
|
270
279
|
awaitRefetchQueries: !0
|
|
271
|
-
}), [
|
|
280
|
+
}), [C, w] = u(null), [T, E] = u(!1), [O, k] = u(""), [M, R] = u(null), [z, B] = u(null), [V, U] = u(null), W = a({
|
|
281
|
+
kind: "roadmap",
|
|
282
|
+
roadmapId: i,
|
|
283
|
+
queries: D,
|
|
284
|
+
paused: M !== null
|
|
285
|
+
}), G = l(() => {
|
|
272
286
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
273
|
-
for (let n of
|
|
274
|
-
let r =
|
|
287
|
+
for (let n of d) {
|
|
288
|
+
let r = F(n);
|
|
275
289
|
e.has(r) || (e.add(r), t.push(r));
|
|
276
290
|
}
|
|
277
291
|
return t;
|
|
278
|
-
}, [
|
|
292
|
+
}, [d]), K = G.length > 1, q = l(() => {
|
|
279
293
|
let e = {
|
|
280
294
|
UNPLACED: [],
|
|
281
295
|
NOW: [],
|
|
282
296
|
NEXT: [],
|
|
283
297
|
LATER: []
|
|
284
298
|
};
|
|
285
|
-
for (let t of
|
|
299
|
+
for (let t of d) e[j(t.horizon)].push(t);
|
|
286
300
|
return e;
|
|
287
|
-
}, [
|
|
301
|
+
}, [d]), J = l(() => {
|
|
288
302
|
let e = {
|
|
289
303
|
UNPLACED: {},
|
|
290
304
|
NOW: {},
|
|
291
305
|
NEXT: {},
|
|
292
306
|
LATER: {}
|
|
293
307
|
};
|
|
294
|
-
for (let t of
|
|
295
|
-
for (let t of
|
|
296
|
-
let n =
|
|
308
|
+
for (let t of G) e.UNPLACED[t] = [], e.NOW[t] = [], e.NEXT[t] = [], e.LATER[t] = [];
|
|
309
|
+
for (let t of d) {
|
|
310
|
+
let n = j(t.horizon), r = F(t);
|
|
297
311
|
(e[n][r] ??= []).push(t);
|
|
298
312
|
}
|
|
299
313
|
return e;
|
|
300
|
-
}, [
|
|
301
|
-
|
|
302
|
-
if (!
|
|
303
|
-
let e =
|
|
304
|
-
document.getElementById(`nnl-move-${e}`)?.focus(),
|
|
314
|
+
}, [d, G]);
|
|
315
|
+
c(() => {
|
|
316
|
+
if (!V) return;
|
|
317
|
+
let e = V, t = requestAnimationFrame(() => {
|
|
318
|
+
document.getElementById(`nnl-move-${e}`)?.focus(), U(null);
|
|
305
319
|
});
|
|
306
320
|
return () => cancelAnimationFrame(t);
|
|
307
|
-
}, [
|
|
308
|
-
let
|
|
309
|
-
|
|
321
|
+
}, [d]);
|
|
322
|
+
let Y = b.loading, X = !T, Z = M ? d.find((e) => e.id === M) ?? null : null, Q = async (e, i, a, o, s) => {
|
|
323
|
+
w(null), s && U(e.id);
|
|
310
324
|
try {
|
|
311
|
-
await r(
|
|
325
|
+
await r(v({ variables: {
|
|
312
326
|
id: e.id,
|
|
313
327
|
input: {
|
|
314
328
|
horizon: i,
|
|
315
329
|
index: a
|
|
316
330
|
}
|
|
317
|
-
} })),
|
|
331
|
+
} })), k(`Moved "${e.title}" to ${o}.`);
|
|
318
332
|
} catch (e) {
|
|
319
|
-
if (t(e))
|
|
333
|
+
if (t(e)) E(!0), w("Your role cannot reorder this roadmap."), k("Move refused: your role cannot reorder this roadmap.");
|
|
320
334
|
else {
|
|
321
335
|
let t = n(e, "The item could not be moved.");
|
|
322
|
-
|
|
336
|
+
w(t), k(`Move failed: ${t}`);
|
|
323
337
|
}
|
|
324
338
|
}
|
|
325
|
-
},
|
|
326
|
-
if (!
|
|
327
|
-
let a =
|
|
328
|
-
if (!a ||
|
|
329
|
-
let o =
|
|
339
|
+
}, te = (e, t, n, r, i) => {
|
|
340
|
+
if (!X || Y) return;
|
|
341
|
+
let a = d.find((e) => e.id === r);
|
|
342
|
+
if (!a || F(a) !== t) return;
|
|
343
|
+
let o = A.find((t) => t.key === e);
|
|
330
344
|
if (!o) return;
|
|
331
|
-
let s =
|
|
332
|
-
|
|
333
|
-
},
|
|
334
|
-
if (!
|
|
345
|
+
let s = L(n, a.id, i);
|
|
346
|
+
j(a.horizon) === e && n.findIndex((e) => e.id === a.id) === s || Q(a, o.horizon, s, o.label, !1);
|
|
347
|
+
}, ne = (e, t, n) => (r, i, a) => {
|
|
348
|
+
if (!X || Y || !Z || F(Z) !== t) return;
|
|
335
349
|
r.preventDefault(), r.stopPropagation(), r.dataTransfer.dropEffect = "move";
|
|
336
350
|
let o = r.currentTarget.getBoundingClientRect();
|
|
337
|
-
|
|
351
|
+
B({
|
|
338
352
|
columnKey: e,
|
|
339
353
|
laneKey: t,
|
|
340
354
|
beforeId: r.clientY < o.top + o.height / 2 ? i.id : n[a + 1]?.id ?? null
|
|
341
355
|
});
|
|
342
|
-
},
|
|
356
|
+
}, $ = (e, t, n) => (r) => {
|
|
343
357
|
r.preventDefault(), r.stopPropagation();
|
|
344
|
-
let i = r.dataTransfer.getData("text/plain"), a =
|
|
345
|
-
|
|
358
|
+
let i = r.dataTransfer.getData("text/plain"), a = z?.columnKey === e && z.laneKey === t ? z.beforeId : null;
|
|
359
|
+
B(null), R(null), i && te(e, t, n, i, a);
|
|
346
360
|
};
|
|
347
|
-
return
|
|
361
|
+
return f ? /* @__PURE__ */ x("div", {
|
|
348
362
|
className: "flex items-center justify-center p-12",
|
|
349
363
|
"data-testid": "nnl-board",
|
|
350
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ x(h, {
|
|
351
365
|
className: "h-8 w-8 animate-spin text-muted-foreground",
|
|
352
366
|
"aria-hidden": "true"
|
|
353
367
|
})
|
|
354
|
-
}) :
|
|
368
|
+
}) : p ? /* @__PURE__ */ S("div", {
|
|
355
369
|
className: "p-6 text-destructive",
|
|
356
370
|
"data-testid": "nnl-board",
|
|
357
|
-
children: ["Failed to load roadmap items: ",
|
|
358
|
-
}) : /* @__PURE__ */
|
|
371
|
+
children: ["Failed to load roadmap items: ", p.message]
|
|
372
|
+
}) : /* @__PURE__ */ S("div", {
|
|
359
373
|
className: "space-y-3",
|
|
360
374
|
"data-testid": "nnl-board",
|
|
361
375
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ x("p", {
|
|
363
377
|
className: "sr-only",
|
|
364
378
|
role: "status",
|
|
365
379
|
"aria-live": "polite",
|
|
366
|
-
children:
|
|
380
|
+
children: O
|
|
367
381
|
}),
|
|
368
|
-
|
|
382
|
+
/* @__PURE__ */ x("div", {
|
|
383
|
+
className: "flex justify-end",
|
|
384
|
+
children: /* @__PURE__ */ x(o, { mode: W.mode })
|
|
385
|
+
}),
|
|
386
|
+
T && /* @__PURE__ */ x("p", {
|
|
369
387
|
role: "alert",
|
|
370
388
|
className: "rounded-md border border-destructive/40 p-2 text-sm text-destructive",
|
|
371
389
|
children: "Your role can view this roadmap but not reorder it. Moves are disabled below."
|
|
372
390
|
}),
|
|
373
|
-
!
|
|
391
|
+
!T && C && /* @__PURE__ */ x("p", {
|
|
374
392
|
role: "alert",
|
|
375
393
|
className: "rounded-md border border-destructive/40 p-2 text-sm text-destructive",
|
|
376
|
-
children:
|
|
394
|
+
children: C
|
|
377
395
|
}),
|
|
378
|
-
|
|
396
|
+
_ && /* @__PURE__ */ S("p", {
|
|
379
397
|
className: "text-xs text-muted-foreground",
|
|
380
398
|
children: [
|
|
381
399
|
"Showing the first ",
|
|
382
|
-
|
|
400
|
+
N,
|
|
383
401
|
" of ",
|
|
384
|
-
|
|
402
|
+
g,
|
|
385
403
|
" items."
|
|
386
404
|
]
|
|
387
405
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ x("div", {
|
|
389
407
|
className: "grid grid-cols-1 gap-3 md:grid-cols-4",
|
|
390
|
-
children:
|
|
391
|
-
let t =
|
|
408
|
+
children: A.map((e) => {
|
|
409
|
+
let t = q[e.key], n = G.map((t) => ({
|
|
392
410
|
lane: t,
|
|
393
|
-
laneItems:
|
|
394
|
-
})).filter(({ lane: e, laneItems: t }) => !
|
|
395
|
-
return /* @__PURE__ */
|
|
411
|
+
laneItems: J[e.key][t] ?? []
|
|
412
|
+
})).filter(({ lane: e, laneItems: t }) => !K || t.length > 0 || Z && F(Z) === e);
|
|
413
|
+
return /* @__PURE__ */ S("section", {
|
|
396
414
|
"aria-label": `${e.label} column`,
|
|
397
415
|
"data-testid": `nnl-column-${e.key}`,
|
|
398
416
|
className: "min-h-[120px] rounded-md border bg-muted/30 p-2",
|
|
399
417
|
onDragOver: (t) => {
|
|
400
|
-
!
|
|
418
|
+
!X || Y || !Z || (t.preventDefault(), t.dataTransfer.dropEffect = "move", B({
|
|
401
419
|
columnKey: e.key,
|
|
402
|
-
laneKey:
|
|
420
|
+
laneKey: F(Z),
|
|
403
421
|
beforeId: null
|
|
404
422
|
}));
|
|
405
423
|
},
|
|
406
424
|
onDrop: (t) => {
|
|
407
|
-
if (!
|
|
408
|
-
let n =
|
|
409
|
-
|
|
425
|
+
if (!Z) return;
|
|
426
|
+
let n = F(Z);
|
|
427
|
+
$(e.key, n, J[e.key][n] ?? [])(t);
|
|
410
428
|
},
|
|
411
429
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ S("h3", {
|
|
413
431
|
className: "mb-2 flex items-center gap-1.5 text-sm font-medium",
|
|
414
432
|
children: [
|
|
415
|
-
e.key === "UNPLACED" && /* @__PURE__ */
|
|
433
|
+
e.key === "UNPLACED" && /* @__PURE__ */ x(m, {
|
|
416
434
|
className: "h-3.5 w-3.5 text-muted-foreground",
|
|
417
435
|
"aria-hidden": "true"
|
|
418
436
|
}),
|
|
419
437
|
e.label,
|
|
420
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ S("span", {
|
|
421
439
|
className: "text-xs text-muted-foreground",
|
|
422
440
|
children: [
|
|
423
441
|
"(",
|
|
@@ -427,23 +445,23 @@ function V({ roadmapId: i }) {
|
|
|
427
445
|
})
|
|
428
446
|
]
|
|
429
447
|
}),
|
|
430
|
-
n.length === 0 && /* @__PURE__ */
|
|
448
|
+
n.length === 0 && /* @__PURE__ */ x("p", {
|
|
431
449
|
className: "py-4 text-center text-xs text-muted-foreground",
|
|
432
450
|
children: "No items"
|
|
433
451
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ x("div", {
|
|
435
453
|
className: "space-y-3",
|
|
436
454
|
children: n.map(({ lane: t, laneItems: n }) => {
|
|
437
|
-
let r =
|
|
438
|
-
return /* @__PURE__ */
|
|
455
|
+
let r = z?.columnKey === e.key && z.laneKey === t;
|
|
456
|
+
return /* @__PURE__ */ S("div", {
|
|
439
457
|
className: "space-y-1",
|
|
440
|
-
children: [
|
|
458
|
+
children: [K && /* @__PURE__ */ S("p", {
|
|
441
459
|
"data-testid": "nnl-lane-label",
|
|
442
460
|
className: "text-[11px] font-medium text-muted-foreground",
|
|
443
461
|
children: [
|
|
444
|
-
|
|
462
|
+
I(t),
|
|
445
463
|
" ",
|
|
446
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ S("span", {
|
|
447
465
|
className: "text-muted-foreground/70",
|
|
448
466
|
children: [
|
|
449
467
|
"(",
|
|
@@ -452,46 +470,46 @@ function V({ roadmapId: i }) {
|
|
|
452
470
|
]
|
|
453
471
|
})
|
|
454
472
|
]
|
|
455
|
-
}), /* @__PURE__ */
|
|
456
|
-
className: `min-h-[48px] space-y-2 rounded-sm p-1 ${r && !
|
|
473
|
+
}), /* @__PURE__ */ S("ul", {
|
|
474
|
+
className: `min-h-[48px] space-y-2 rounded-sm p-1 ${r && !z.beforeId ? "ring-2 ring-primary" : ""}`,
|
|
457
475
|
onDragOver: (n) => {
|
|
458
|
-
!
|
|
476
|
+
!X || Y || !Z || F(Z) !== t || (n.preventDefault(), n.dataTransfer.dropEffect = "move", B({
|
|
459
477
|
columnKey: e.key,
|
|
460
478
|
laneKey: t,
|
|
461
479
|
beforeId: null
|
|
462
480
|
}));
|
|
463
481
|
},
|
|
464
|
-
onDrop:
|
|
465
|
-
children: [n.length === 0 && /* @__PURE__ */
|
|
482
|
+
onDrop: $(e.key, t, n),
|
|
483
|
+
children: [n.length === 0 && /* @__PURE__ */ x("li", {
|
|
466
484
|
className: "py-2 text-center text-[11px] text-muted-foreground",
|
|
467
485
|
"aria-hidden": "true",
|
|
468
486
|
children: "Drop here"
|
|
469
487
|
}), n.map((a, o) => {
|
|
470
|
-
let s = r ?
|
|
471
|
-
return /* @__PURE__ */
|
|
488
|
+
let s = r ? z.beforeId === a.id ? "before" : z.beforeId === null && o === n.length - 1 ? "after" : null : null;
|
|
489
|
+
return /* @__PURE__ */ x(H, {
|
|
472
490
|
roadmapId: i,
|
|
473
491
|
item: a,
|
|
474
492
|
columnKey: e.key,
|
|
475
493
|
laneItems: n,
|
|
476
|
-
draggable:
|
|
477
|
-
dragging:
|
|
494
|
+
draggable: X && !Y,
|
|
495
|
+
dragging: M === a.id,
|
|
478
496
|
dropIndicator: s,
|
|
479
|
-
moveDisabled: !
|
|
480
|
-
onDragStart:
|
|
497
|
+
moveDisabled: !X || Y,
|
|
498
|
+
onDragStart: R,
|
|
481
499
|
onDragEnd: () => {
|
|
482
|
-
|
|
500
|
+
R(null), B(null);
|
|
483
501
|
},
|
|
484
|
-
onDragOverCard: (r) =>
|
|
485
|
-
onDropOnCard:
|
|
502
|
+
onDragOverCard: (r) => ne(e.key, t, n)(r, a, o),
|
|
503
|
+
onDropOnCard: $(e.key, t, n),
|
|
486
504
|
onMoveTo: (e) => {
|
|
487
|
-
let t =
|
|
505
|
+
let t = A.find((t) => t.key === e);
|
|
488
506
|
if (!t) return;
|
|
489
|
-
let n =
|
|
490
|
-
|
|
507
|
+
let n = L(J[e][F(a)] ?? [], a.id, null);
|
|
508
|
+
Q(a, t.horizon, n, t.label, !0);
|
|
491
509
|
},
|
|
492
510
|
onShift: (t) => {
|
|
493
511
|
let r = n.findIndex((e) => e.id === a.id), i = r + t;
|
|
494
|
-
r === -1 || i < 0 || i >= n.length ||
|
|
512
|
+
r === -1 || i < 0 || i >= n.length || Q(a, a.horizon, i, e.label, !0);
|
|
495
513
|
}
|
|
496
514
|
}, a.id);
|
|
497
515
|
})]
|
|
@@ -507,6 +525,6 @@ function V({ roadmapId: i }) {
|
|
|
507
525
|
});
|
|
508
526
|
}
|
|
509
527
|
//#endregion
|
|
510
|
-
export {
|
|
528
|
+
export { B as ConfidenceBadge, z as RiskIndicator, U as RoadmapNowNextLater };
|
|
511
529
|
|
|
512
530
|
//# sourceMappingURL=RoadmapNowNextLater.js.map
|