@parallelworks/tandem-web 0.190.2 → 0.191.0
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/_virtual/_virtual_i18n/en/common.js +37 -1
- package/_virtual/_virtual_i18n/es/common.js +37 -1
- package/_virtual/_virtual_i18n/ja/common.js +37 -1
- package/_virtual/_virtual_i18n/ko/common.js +37 -1
- package/_virtual/_virtual_i18n/zh/common.js +37 -1
- package/api/queries.js +38 -23
- package/components/ActivityTimeline.js +1 -0
- package/components/Gantt.js +634 -0
- package/components/IssueBreakdown.js +113 -94
- package/components/IssueEvent.js +1 -0
- package/components/IssueView.js +442 -414
- package/package.json +1 -1
- package/pages/projects.js +143 -106
- package/routes/_workspace/projects/_projectId.js +1 -0
- package/routes/_workspace/projects/_projectId3.js +305 -260
- package/routes/_workspace/settings/audit-log3.js +1 -0
package/package.json
CHANGED
package/pages/projects.js
CHANGED
|
@@ -9,14 +9,14 @@ import { useFavorites as g } from "../lib/favorites.js";
|
|
|
9
9
|
import { copyItem as _, useLinkItems as v } from "../lib/menus.js";
|
|
10
10
|
import { usePageTitle as y } from "../lib/pageTitle.js";
|
|
11
11
|
import { usePeople as b } from "../lib/people.js";
|
|
12
|
-
import { storeExpanded as x, storeLayout as
|
|
13
|
-
import { healthStates as w, projectStatuses as
|
|
14
|
-
import { projectLevel as
|
|
15
|
-
import { useCan as
|
|
16
|
-
import { Link as
|
|
17
|
-
import { teamPath as
|
|
18
|
-
import { useTime as
|
|
19
|
-
import { Avatar as
|
|
12
|
+
import { storeExpanded as x, storeLayout as ee, storedExpanded as S, storedLayout as C } from "../lib/projectList.js";
|
|
13
|
+
import { healthStates as w, projectStatuses as T, shownStatus as E } from "../lib/projectStates.js";
|
|
14
|
+
import { projectLevel as te, projectRef as D, projectsUnder as ne } from "../lib/projects.js";
|
|
15
|
+
import { useCan as re } from "../lib/roles.js";
|
|
16
|
+
import { Link as O, useNavigate as ie } from "../lib/router.js";
|
|
17
|
+
import { teamPath as ae } from "../lib/teamPaths.js";
|
|
18
|
+
import { useTime as k } from "../lib/time.js";
|
|
19
|
+
import { Avatar as A, Button as j, Combobox as oe, EmptyState as se, PageHeaderAddButton as ce, Switch as le, Tabs as M, ToggleGroup as ue, Tooltip as N, menuDivider as de, useOpenMenu as fe } from "@parallelworks/ui";
|
|
20
20
|
import { useParams as pe, useSearch as me } from "@tanstack/react-router";
|
|
21
21
|
import { useEffect as P, useId as he, useRef as F, useState as I } from "react";
|
|
22
22
|
import { useFormatter as L, useTranslations as R } from "use-intl";
|
|
@@ -30,7 +30,7 @@ function U() {
|
|
|
30
30
|
team: a
|
|
31
31
|
} : s, f = R("planning"), p = R("common"), { data: m } = V(e(r)), { data: b } = V(t(r)), x = b.find((e) => e.key === u.team);
|
|
32
32
|
y(x ? f("teamProjects", { team: x.name }) : f("projects"));
|
|
33
|
-
let
|
|
33
|
+
let S = a ? "list" : "timeline", w = u.view ?? C(!!a) ?? S, O = m.filter((e) => (!x || e.teamIds.includes(x.id)) && !!e.template == (w === "templates")), k = re(r, "manage_projects"), [A, M] = I(null), N = he(), P = ie(), F = fe(), L = v(), H = u.parent ? m.find((e) => e.id === u.parent) : void 0, U = H && new Set(ne(m, H.id).map((e) => e.id)), W = E(u.status, w === "templates"), G = O.filter((e) => (!W || e.status === W) && (!u.health || h(e) === u.health) && (!U || U.has(e.id))), K = O.length > 0 && (!!W || !!u.health), q = (e) => {
|
|
34
34
|
let { team: t, ...n } = Object.fromEntries(Object.entries({
|
|
35
35
|
...u,
|
|
36
36
|
...e
|
|
@@ -56,7 +56,7 @@ function U() {
|
|
|
56
56
|
to: "/$workspace/projects/$projectId",
|
|
57
57
|
params: {
|
|
58
58
|
workspace: r,
|
|
59
|
-
projectId:
|
|
59
|
+
projectId: D(e)
|
|
60
60
|
}
|
|
61
61
|
})
|
|
62
62
|
},
|
|
@@ -66,7 +66,7 @@ function U() {
|
|
|
66
66
|
to: "/$workspace/projects/$projectId",
|
|
67
67
|
params: {
|
|
68
68
|
workspace: r,
|
|
69
|
-
projectId:
|
|
69
|
+
projectId: D(e)
|
|
70
70
|
},
|
|
71
71
|
search: { tab: "issues" }
|
|
72
72
|
})
|
|
@@ -75,12 +75,12 @@ function U() {
|
|
|
75
75
|
label: J.find("project", e.id) ? Y("remove") : Y("add"),
|
|
76
76
|
onClick: () => J.toggle("project", e.id)
|
|
77
77
|
},
|
|
78
|
-
...
|
|
78
|
+
...k && !e.template && te(m, e.id) < 5 ? [{
|
|
79
79
|
label: f("newSubProject"),
|
|
80
80
|
onClick: () => M(e.id)
|
|
81
81
|
}] : [],
|
|
82
82
|
de,
|
|
83
|
-
...L(`/${r}/projects/${
|
|
83
|
+
...L(`/${r}/projects/${D(e)}`),
|
|
84
84
|
_(p("copyName"), e.name)
|
|
85
85
|
], Z = (e) => ({
|
|
86
86
|
workspace: r,
|
|
@@ -102,7 +102,7 @@ function U() {
|
|
|
102
102
|
workspace: r,
|
|
103
103
|
page: "projects",
|
|
104
104
|
team: x && {
|
|
105
|
-
href:
|
|
105
|
+
href: ae(r, x.key, "projects"),
|
|
106
106
|
label: f("teamProjects", { team: x.name })
|
|
107
107
|
}
|
|
108
108
|
}),
|
|
@@ -121,10 +121,10 @@ function U() {
|
|
|
121
121
|
}],
|
|
122
122
|
layout: w,
|
|
123
123
|
onLayoutChange: (e) => {
|
|
124
|
-
|
|
124
|
+
ee(!!a, e), q({ view: e });
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
changed: w !==
|
|
127
|
+
changed: w !== S,
|
|
128
128
|
children: /* @__PURE__ */ B("div", {
|
|
129
129
|
className: "flex items-center justify-between gap-3",
|
|
130
130
|
children: [/* @__PURE__ */ z("span", {
|
|
@@ -140,7 +140,7 @@ function U() {
|
|
|
140
140
|
})
|
|
141
141
|
})
|
|
142
142
|
}),
|
|
143
|
-
|
|
143
|
+
k && /* @__PURE__ */ z(ce, {
|
|
144
144
|
label: f("newProject"),
|
|
145
145
|
onClick: () => M("")
|
|
146
146
|
})
|
|
@@ -152,23 +152,23 @@ function U() {
|
|
|
152
152
|
/* @__PURE__ */ z(ue, {
|
|
153
153
|
label: f("filterStatus"),
|
|
154
154
|
multiple: !1,
|
|
155
|
-
all: { count:
|
|
156
|
-
options:
|
|
155
|
+
all: { count: O.length },
|
|
156
|
+
options: T.map((e) => ({
|
|
157
157
|
value: e,
|
|
158
158
|
label: f(`status.${e}`),
|
|
159
|
-
count:
|
|
159
|
+
count: O.filter((t) => t.status === e).length
|
|
160
160
|
})),
|
|
161
161
|
value: W ? [W] : [],
|
|
162
162
|
onValueChange: ([e]) => q({ status: e ?? "all" })
|
|
163
163
|
}),
|
|
164
|
-
u.health && /* @__PURE__ */ z(
|
|
164
|
+
u.health && /* @__PURE__ */ z(j, {
|
|
165
165
|
variant: "outline",
|
|
166
166
|
size: "sm",
|
|
167
167
|
"aria-pressed": !0,
|
|
168
168
|
onClick: () => q({ health: void 0 }),
|
|
169
169
|
children: f("healthFilter", { health: f(`health.${u.health}`) })
|
|
170
170
|
}),
|
|
171
|
-
|
|
171
|
+
O.some((e) => e.parentId) && /* @__PURE__ */ z(oe, {
|
|
172
172
|
items: [{
|
|
173
173
|
value: "",
|
|
174
174
|
label: f("anyParent")
|
|
@@ -180,7 +180,7 @@ function U() {
|
|
|
180
180
|
onValueChange: (e) => q({ parent: e || void 0 }),
|
|
181
181
|
placeholder: f("parentProject"),
|
|
182
182
|
"aria-label": f("parentProject"),
|
|
183
|
-
trigger: /* @__PURE__ */ z(
|
|
183
|
+
trigger: /* @__PURE__ */ z(j, {
|
|
184
184
|
variant: "outline",
|
|
185
185
|
size: "sm",
|
|
186
186
|
className: H ? "border-(--theme-link) text-(--theme-app)" : void 0,
|
|
@@ -195,18 +195,18 @@ function U() {
|
|
|
195
195
|
className: "min-h-0 min-w-0 flex-1 overflow-auto",
|
|
196
196
|
children: G.length === 0 ? /* @__PURE__ */ z("div", {
|
|
197
197
|
className: "p-6",
|
|
198
|
-
children: /* @__PURE__ */ z(
|
|
198
|
+
children: /* @__PURE__ */ z(se, {
|
|
199
199
|
icon: /* @__PURE__ */ z(c, {}),
|
|
200
200
|
title: f(K ? "noProjectsWithStatus" : w === "templates" ? "noTemplates" : "noProjects"),
|
|
201
201
|
...!K && { description: f(w === "templates" ? "noTemplatesDescription" : "noProjectsDescription") },
|
|
202
|
-
...
|
|
202
|
+
...k && !K && w !== "templates" && { action: /* @__PURE__ */ z(j, {
|
|
203
203
|
type: "button",
|
|
204
204
|
variant: "primary",
|
|
205
205
|
onClick: () => M(""),
|
|
206
206
|
children: f("newProject")
|
|
207
207
|
}) }
|
|
208
208
|
})
|
|
209
|
-
}) : w === "timeline" ? /* @__PURE__ */ z(
|
|
209
|
+
}) : w === "timeline" ? /* @__PURE__ */ z(be, {
|
|
210
210
|
workspace: r,
|
|
211
211
|
projects: G,
|
|
212
212
|
rowProps: Z
|
|
@@ -215,25 +215,25 @@ function U() {
|
|
|
215
215
|
pool: m.filter((e) => !!e.template == (w === "templates")),
|
|
216
216
|
rowProps: Z
|
|
217
217
|
})
|
|
218
|
-
}), /* @__PURE__ */ z(
|
|
218
|
+
}), /* @__PURE__ */ z(Se, {
|
|
219
219
|
workspace: r,
|
|
220
|
-
projects:
|
|
220
|
+
projects: O,
|
|
221
221
|
health: u.health,
|
|
222
222
|
onHealth: (e) => q({ health: e === u.health ? void 0 : e })
|
|
223
223
|
})]
|
|
224
224
|
}),
|
|
225
|
-
|
|
225
|
+
A !== null && /* @__PURE__ */ z(d, {
|
|
226
226
|
workspace: r,
|
|
227
227
|
teamId: x?.id,
|
|
228
|
-
parentId:
|
|
228
|
+
parentId: A || void 0,
|
|
229
229
|
onClose: () => M(null)
|
|
230
230
|
})
|
|
231
231
|
]
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
-
var W = "@4xl:grid @4xl:grid-cols-[minmax(0,1fr)
|
|
234
|
+
var W = "@4xl:grid @4xl:grid-cols-[minmax(0,1fr)_8rem_2rem_2rem_9.5rem_8.5rem_2rem] @7xl:grid-cols-[minmax(0,1fr)_8rem_2rem_2rem_7rem_9.5rem_6rem_8.5rem_5rem_2rem]", G = "hidden @7xl:block";
|
|
235
235
|
function ge({ projects: e, pool: t, rowProps: n }) {
|
|
236
|
-
let r = R("planning"), [i, a] = I(
|
|
236
|
+
let r = R("planning"), [i, a] = I(S), o = (e) => a((t) => {
|
|
237
237
|
let n = new Set(t);
|
|
238
238
|
return n.delete(e) || n.add(e), x(n), n;
|
|
239
239
|
}), s = new Set(e.map((e) => e.id)), c = [], l = (e, n) => {
|
|
@@ -267,11 +267,23 @@ function ge({ projects: e, pool: t, rowProps: n }) {
|
|
|
267
267
|
children: r("lead")
|
|
268
268
|
}) })
|
|
269
269
|
}),
|
|
270
|
-
/* @__PURE__ */ z("span", {
|
|
270
|
+
/* @__PURE__ */ z("span", {
|
|
271
|
+
className: G,
|
|
272
|
+
children: r("teams")
|
|
273
|
+
}),
|
|
274
|
+
/* @__PURE__ */ z("span", { children: r("dates") }),
|
|
275
|
+
/* @__PURE__ */ z("span", {
|
|
276
|
+
className: G,
|
|
277
|
+
children: r("milestones")
|
|
278
|
+
}),
|
|
271
279
|
/* @__PURE__ */ z("span", { children: r("progressTitle") }),
|
|
280
|
+
/* @__PURE__ */ z("span", {
|
|
281
|
+
className: G,
|
|
282
|
+
children: r("updated")
|
|
283
|
+
}),
|
|
272
284
|
/* @__PURE__ */ z("span", {})
|
|
273
285
|
]
|
|
274
|
-
}), /* @__PURE__ */ z("ul", { children: c.map((e) => /* @__PURE__ */ z(
|
|
286
|
+
}), /* @__PURE__ */ z("ul", { children: c.map((e) => /* @__PURE__ */ z(q, {
|
|
275
287
|
...n(e.project),
|
|
276
288
|
depth: e.depth,
|
|
277
289
|
childCount: e.children,
|
|
@@ -281,70 +293,70 @@ function ge({ projects: e, pool: t, rowProps: n }) {
|
|
|
281
293
|
}, e.project.id)) })]
|
|
282
294
|
});
|
|
283
295
|
}
|
|
284
|
-
function
|
|
296
|
+
function K({ project: e }) {
|
|
285
297
|
return e.icon || e.color ? /* @__PURE__ */ z(r, {
|
|
286
298
|
icon: e.icon ?? "",
|
|
287
299
|
color: e.color ?? "",
|
|
288
300
|
name: e.name
|
|
289
301
|
}) : /* @__PURE__ */ z(c, { className: "size-4 text-muted-foreground" });
|
|
290
302
|
}
|
|
291
|
-
function
|
|
292
|
-
let
|
|
303
|
+
function q({ workspace: e, project: n, onContextMenu: r, menu: i, depth: o = 0, childCount: c = 0, folded: l = !1, muted: d = !1, onFold: g }) {
|
|
304
|
+
let _ = R("planning"), v = R("common"), y = k(), x = u(), { person: ee } = b(e), S = n.lead ? ee(n.lead) : void 0, C = h(n), { data: w } = V(t(e)), T = w.filter((e) => n.teamIds.includes(e.id)).map((e) => e.name), E = c > 0 ? n.treeProgress : n.progress;
|
|
293
305
|
return /* @__PURE__ */ B("li", {
|
|
294
306
|
className: "group flex items-center border-b border-border pr-2 hover:bg-muted/60",
|
|
295
307
|
children: [
|
|
296
308
|
/* @__PURE__ */ z("span", {
|
|
297
309
|
className: "flex shrink-0 justify-end pl-2 md:pl-3",
|
|
298
|
-
style: { width: `${
|
|
299
|
-
children:
|
|
310
|
+
style: { width: `${o * 1.25 + 2}rem` },
|
|
311
|
+
children: c > 0 && /* @__PURE__ */ z("button", {
|
|
300
312
|
type: "button",
|
|
301
|
-
onClick:
|
|
302
|
-
"aria-expanded": !
|
|
303
|
-
"aria-label":
|
|
313
|
+
onClick: g,
|
|
314
|
+
"aria-expanded": !l,
|
|
315
|
+
"aria-label": _(l ? "showSubProjects" : "hideSubProjects", { name: n.name }),
|
|
304
316
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
305
|
-
children: /* @__PURE__ */ z(a, { className: `size-3.5 transition-transform ${
|
|
317
|
+
children: /* @__PURE__ */ z(a, { className: `size-3.5 transition-transform ${l ? "-rotate-90" : ""}` })
|
|
306
318
|
})
|
|
307
319
|
}),
|
|
308
|
-
/* @__PURE__ */ B(
|
|
320
|
+
/* @__PURE__ */ B(O, {
|
|
309
321
|
to: "/$workspace/projects/$projectId",
|
|
310
322
|
params: {
|
|
311
323
|
workspace: e,
|
|
312
|
-
projectId:
|
|
324
|
+
projectId: D(n)
|
|
313
325
|
},
|
|
314
|
-
onContextMenu:
|
|
315
|
-
className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W} ${
|
|
326
|
+
onContextMenu: r,
|
|
327
|
+
className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W} ${d ? "opacity-60" : ""}`,
|
|
316
328
|
children: [
|
|
317
329
|
/* @__PURE__ */ B("span", {
|
|
318
330
|
className: "flex min-w-0 basis-full items-center gap-2.5 @4xl:basis-auto",
|
|
319
|
-
children: [/* @__PURE__ */ z(
|
|
331
|
+
children: [/* @__PURE__ */ z(K, { project: n }), /* @__PURE__ */ B("span", {
|
|
320
332
|
className: "min-w-0",
|
|
321
333
|
children: [/* @__PURE__ */ z("span", {
|
|
322
334
|
className: "block truncate text-sm font-medium",
|
|
323
|
-
children:
|
|
324
|
-
}),
|
|
335
|
+
children: n.name
|
|
336
|
+
}), n.summary && /* @__PURE__ */ z("span", {
|
|
325
337
|
className: "block truncate text-xs text-muted-foreground",
|
|
326
|
-
children:
|
|
338
|
+
children: n.summary
|
|
327
339
|
})]
|
|
328
340
|
})]
|
|
329
341
|
}),
|
|
330
342
|
/* @__PURE__ */ B("span", {
|
|
331
343
|
className: "flex items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground",
|
|
332
|
-
children: [/* @__PURE__ */ z(f, { state: C }),
|
|
344
|
+
children: [/* @__PURE__ */ z(f, { state: C }), _(`health.${C}`)]
|
|
333
345
|
}),
|
|
334
346
|
/* @__PURE__ */ z(N, {
|
|
335
|
-
content:
|
|
347
|
+
content: x[n.priority],
|
|
336
348
|
children: /* @__PURE__ */ z("span", {
|
|
337
349
|
role: "img",
|
|
338
|
-
"aria-label":
|
|
350
|
+
"aria-label": x[n.priority],
|
|
339
351
|
className: "flex",
|
|
340
|
-
children: /* @__PURE__ */ z(s, { priority:
|
|
352
|
+
children: /* @__PURE__ */ z(s, { priority: n.priority })
|
|
341
353
|
})
|
|
342
354
|
}),
|
|
343
355
|
/* @__PURE__ */ z("span", {
|
|
344
356
|
className: "flex",
|
|
345
357
|
children: S && /* @__PURE__ */ z(N, {
|
|
346
|
-
content:
|
|
347
|
-
children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(
|
|
358
|
+
content: _("leadIs", { name: S.name }),
|
|
359
|
+
children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(A, {
|
|
348
360
|
name: S.name,
|
|
349
361
|
src: S.avatarUrl,
|
|
350
362
|
size: "sm"
|
|
@@ -352,53 +364,78 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
|
|
|
352
364
|
})
|
|
353
365
|
}),
|
|
354
366
|
/* @__PURE__ */ z("span", {
|
|
355
|
-
className:
|
|
356
|
-
|
|
367
|
+
className: `${G} truncate text-xs text-muted-foreground`,
|
|
368
|
+
title: T.join(", "),
|
|
369
|
+
children: T.join(", ")
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ z("span", {
|
|
372
|
+
className: "text-xs whitespace-nowrap text-muted-foreground tabular-nums",
|
|
373
|
+
children: (n.startDate || n.targetDate) && _("dateRange", {
|
|
374
|
+
start: n.startDate ? y.day(n.startDate) : "…",
|
|
375
|
+
end: n.targetDate ? y.day(n.targetDate) : "…"
|
|
376
|
+
})
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ z("span", {
|
|
379
|
+
className: `${G} text-xs whitespace-nowrap text-muted-foreground tabular-nums`,
|
|
380
|
+
children: n.milestones.length > 0 && _("milestoneCount", { count: n.milestones.length })
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ B("span", {
|
|
383
|
+
className: "flex items-center gap-2",
|
|
384
|
+
children: [/* @__PURE__ */ z(p, {
|
|
385
|
+
progress: E,
|
|
386
|
+
compact: !0
|
|
387
|
+
}), /* @__PURE__ */ z("span", {
|
|
388
|
+
className: "text-xs whitespace-nowrap text-muted-foreground tabular-nums",
|
|
389
|
+
children: _("doneOfTotal", {
|
|
390
|
+
done: E.completed,
|
|
391
|
+
total: E.total
|
|
392
|
+
})
|
|
393
|
+
})]
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ z("span", {
|
|
396
|
+
className: `${G} text-xs whitespace-nowrap text-muted-foreground`,
|
|
397
|
+
children: y.relative(n.updatedAt)
|
|
357
398
|
}),
|
|
358
|
-
/* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(p, {
|
|
359
|
-
progress: o > 0 ? t.treeProgress : t.progress,
|
|
360
|
-
compact: !0
|
|
361
|
-
}) }),
|
|
362
399
|
/* @__PURE__ */ z(N, {
|
|
363
|
-
content:
|
|
400
|
+
content: _(`status.${n.status}`),
|
|
364
401
|
children: /* @__PURE__ */ z("span", {
|
|
365
402
|
role: "img",
|
|
366
|
-
"aria-label":
|
|
403
|
+
"aria-label": _(`status.${n.status}`),
|
|
367
404
|
className: "flex",
|
|
368
|
-
children: /* @__PURE__ */ z(m, { status:
|
|
405
|
+
children: /* @__PURE__ */ z(m, { status: n.status })
|
|
369
406
|
})
|
|
370
407
|
})
|
|
371
408
|
]
|
|
372
409
|
}),
|
|
373
410
|
/* @__PURE__ */ z(H, {
|
|
374
|
-
items:
|
|
375
|
-
label:
|
|
411
|
+
items: i,
|
|
412
|
+
label: v("moreActionsFor", { name: n.name })
|
|
376
413
|
})
|
|
377
414
|
]
|
|
378
415
|
});
|
|
379
416
|
}
|
|
380
|
-
var
|
|
417
|
+
var J = 864e5, Y = 5, X = 64, Z = 256, Q = 56, _e = (e) => Date.parse(`${e}T00:00:00Z`), $ = (e) => {
|
|
381
418
|
let t = new Date(e);
|
|
382
419
|
return Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), 1);
|
|
383
|
-
},
|
|
420
|
+
}, ve = () => {
|
|
384
421
|
let e = /* @__PURE__ */ new Date();
|
|
385
422
|
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
386
|
-
},
|
|
387
|
-
function
|
|
423
|
+
}, ye = (e) => e - (new Date(e).getUTCDay() + 6) % 7 * J;
|
|
424
|
+
function be({ workspace: e, projects: t, rowProps: n }) {
|
|
388
425
|
let r = R("planning"), i = L(), a = F(null), [o, s] = I({
|
|
389
426
|
left: 0,
|
|
390
427
|
width: 0
|
|
391
|
-
}), c =
|
|
392
|
-
let t = e.targetDate ?
|
|
428
|
+
}), c = ve(), l = t.map((e) => {
|
|
429
|
+
let t = e.targetDate ? _e(e.targetDate) : void 0;
|
|
393
430
|
return {
|
|
394
431
|
p: e,
|
|
395
|
-
start: e.startDate ?
|
|
432
|
+
start: e.startDate ? _e(e.startDate) : t === void 0 ? void 0 : Math.min(Date.parse(e.createdAt), t),
|
|
396
433
|
end: t
|
|
397
434
|
};
|
|
398
|
-
}), u = l.flatMap((e) => [e.start, e.end].filter((e) => e !== void 0)), d = $(Math.min(c - 90 *
|
|
399
|
-
for (let e = d; e < f; e = $(e + 32 *
|
|
435
|
+
}), u = l.flatMap((e) => [e.start, e.end].filter((e) => e !== void 0)), d = $(Math.min(c - 90 * J, ...u)), f = $(Math.max(c + 300 * J, ...u) + 40 * J), p = (e) => (e - d) / J * Y, m = p(f), h = [];
|
|
436
|
+
for (let e = d; e < f; e = $(e + 32 * J)) h.push(e);
|
|
400
437
|
let g = [];
|
|
401
|
-
for (let e =
|
|
438
|
+
for (let e = ye(d) + 7 * J; e < f; e += 7 * J) g.push(e);
|
|
402
439
|
let _ = (e, t) => i.dateTime(new Date(e), {
|
|
403
440
|
...t,
|
|
404
441
|
timeZone: "UTC"
|
|
@@ -412,12 +449,12 @@ function ye({ workspace: e, projects: t, rowProps: n }) {
|
|
|
412
449
|
let e = a.current;
|
|
413
450
|
e && s({
|
|
414
451
|
left: e.scrollLeft,
|
|
415
|
-
width: e.clientWidth -
|
|
452
|
+
width: e.clientWidth - Z
|
|
416
453
|
});
|
|
417
454
|
}, b = (e = "smooth") => {
|
|
418
455
|
let t = a.current;
|
|
419
456
|
t && t.scrollTo({
|
|
420
|
-
left: p(c) - (t.clientWidth -
|
|
457
|
+
left: p(c) - (t.clientWidth - Z) / 2,
|
|
421
458
|
behavior: e
|
|
422
459
|
});
|
|
423
460
|
};
|
|
@@ -428,22 +465,22 @@ function ye({ workspace: e, projects: t, rowProps: n }) {
|
|
|
428
465
|
children: /* @__PURE__ */ B("div", {
|
|
429
466
|
className: "relative",
|
|
430
467
|
style: {
|
|
431
|
-
width: m +
|
|
468
|
+
width: m + Z,
|
|
432
469
|
minHeight: "100%"
|
|
433
470
|
},
|
|
434
471
|
children: [
|
|
435
472
|
/* @__PURE__ */ z("div", {
|
|
436
473
|
"aria-hidden": "true",
|
|
437
474
|
className: "pointer-events-none sticky left-0 z-[2] float-left -mb-[100vh] h-full min-h-[100vh] border-r border-border bg-background",
|
|
438
|
-
style: { width:
|
|
475
|
+
style: { width: Z }
|
|
439
476
|
}),
|
|
440
477
|
/* @__PURE__ */ B("div", {
|
|
441
478
|
className: "sticky top-0 z-[3] flex border-b border-border bg-background",
|
|
442
|
-
style: { height:
|
|
479
|
+
style: { height: Q },
|
|
443
480
|
children: [/* @__PURE__ */ z("div", {
|
|
444
481
|
className: "sticky left-0 z-[3] flex shrink-0 items-end border-r border-border bg-background px-4 pb-2",
|
|
445
|
-
style: { width:
|
|
446
|
-
children: /* @__PURE__ */ z(
|
|
482
|
+
style: { width: Z },
|
|
483
|
+
children: /* @__PURE__ */ z(j, {
|
|
447
484
|
type: "button",
|
|
448
485
|
size: "xs",
|
|
449
486
|
onClick: () => b(),
|
|
@@ -481,43 +518,43 @@ function ye({ workspace: e, projects: t, rowProps: n }) {
|
|
|
481
518
|
"aria-hidden": "true",
|
|
482
519
|
className: "pointer-events-none absolute bottom-0 border-l border-dashed border-border/40",
|
|
483
520
|
style: {
|
|
484
|
-
left:
|
|
485
|
-
top:
|
|
521
|
+
left: Z + p(e),
|
|
522
|
+
top: Q
|
|
486
523
|
}
|
|
487
524
|
}, e)),
|
|
488
525
|
h.map((e) => /* @__PURE__ */ z("div", {
|
|
489
526
|
"aria-hidden": "true",
|
|
490
527
|
className: "pointer-events-none absolute bottom-0 w-px bg-border/70",
|
|
491
528
|
style: {
|
|
492
|
-
left:
|
|
493
|
-
top:
|
|
529
|
+
left: Z + p(e),
|
|
530
|
+
top: Q
|
|
494
531
|
}
|
|
495
532
|
}, e)),
|
|
496
533
|
/* @__PURE__ */ z("div", {
|
|
497
534
|
"aria-hidden": "true",
|
|
498
535
|
className: "pointer-events-none absolute bottom-0 z-[1] w-px bg-primary",
|
|
499
536
|
style: {
|
|
500
|
-
left:
|
|
501
|
-
top:
|
|
537
|
+
left: Z + p(c),
|
|
538
|
+
top: Q
|
|
502
539
|
}
|
|
503
540
|
}),
|
|
504
541
|
/* @__PURE__ */ z("ul", {
|
|
505
542
|
className: "relative",
|
|
506
543
|
children: l.map(({ p: t, start: r, end: i }) => {
|
|
507
|
-
let a = r !== void 0 && i !== void 0, s = a ? p(r) : 0, l = a ? Math.max(p(i +
|
|
544
|
+
let a = r !== void 0 && i !== void 0, s = a ? p(r) : 0, l = a ? Math.max(p(i + J), s + 24) : 0, u = a && l < o.left, d = a && s > o.left + o.width, f = a ? Math.min(Math.max(p(c) - s, 0), l - s) : 0, h = Math.min(Math.max(o.left + 8 - s, 0), Math.max(l - s - 80, 0));
|
|
508
545
|
return /* @__PURE__ */ B("li", {
|
|
509
546
|
className: "group flex hover:bg-muted/40",
|
|
510
|
-
style: { height:
|
|
511
|
-
children: [/* @__PURE__ */ z(
|
|
547
|
+
style: { height: X },
|
|
548
|
+
children: [/* @__PURE__ */ z(xe, { ...n(t) }), /* @__PURE__ */ B("div", {
|
|
512
549
|
className: "relative",
|
|
513
550
|
style: { width: m },
|
|
514
551
|
children: [a && !u && !d && /* @__PURE__ */ z(N, {
|
|
515
552
|
content: `${t.name}, ${v(r, i)}`,
|
|
516
|
-
children: /* @__PURE__ */ B(
|
|
553
|
+
children: /* @__PURE__ */ B(O, {
|
|
517
554
|
to: "/$workspace/projects/$projectId",
|
|
518
555
|
params: {
|
|
519
556
|
workspace: e,
|
|
520
|
-
projectId:
|
|
557
|
+
projectId: D(t)
|
|
521
558
|
},
|
|
522
559
|
className: "absolute top-2 bottom-2 flex flex-col justify-end gap-1",
|
|
523
560
|
style: {
|
|
@@ -542,11 +579,11 @@ function ye({ workspace: e, projects: t, rowProps: n }) {
|
|
|
542
579
|
})]
|
|
543
580
|
})]
|
|
544
581
|
})
|
|
545
|
-
}), (u || d) && /* @__PURE__ */ B(
|
|
582
|
+
}), (u || d) && /* @__PURE__ */ B(O, {
|
|
546
583
|
to: "/$workspace/projects/$projectId",
|
|
547
584
|
params: {
|
|
548
585
|
workspace: e,
|
|
549
|
-
projectId:
|
|
586
|
+
projectId: D(t)
|
|
550
587
|
},
|
|
551
588
|
className: "absolute top-1/2 flex -translate-y-1/2 items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground hover:text-foreground",
|
|
552
589
|
style: u ? { left: o.left + 12 } : {
|
|
@@ -573,19 +610,19 @@ function ye({ workspace: e, projects: t, rowProps: n }) {
|
|
|
573
610
|
})
|
|
574
611
|
});
|
|
575
612
|
}
|
|
576
|
-
function
|
|
613
|
+
function xe({ workspace: e, project: t, onContextMenu: n }) {
|
|
577
614
|
let r = R("planning"), { person: i } = b(e), a = t.lead ? i(t.lead) : void 0, o = h(t);
|
|
578
|
-
return /* @__PURE__ */ B(
|
|
615
|
+
return /* @__PURE__ */ B(O, {
|
|
579
616
|
to: "/$workspace/projects/$projectId",
|
|
580
617
|
params: {
|
|
581
618
|
workspace: e,
|
|
582
|
-
projectId:
|
|
619
|
+
projectId: D(t)
|
|
583
620
|
},
|
|
584
621
|
onContextMenu: n,
|
|
585
622
|
className: "sticky left-0 z-[2] flex shrink-0 items-center gap-2 border-r border-border bg-background px-4 group-hover:bg-muted",
|
|
586
|
-
style: { width:
|
|
623
|
+
style: { width: Z },
|
|
587
624
|
children: [
|
|
588
|
-
/* @__PURE__ */ z(
|
|
625
|
+
/* @__PURE__ */ z(K, { project: t }),
|
|
589
626
|
/* @__PURE__ */ z("span", {
|
|
590
627
|
className: "min-w-0 flex-1 truncate text-sm",
|
|
591
628
|
children: t.name
|
|
@@ -607,7 +644,7 @@ function be({ workspace: e, project: t, onContextMenu: n }) {
|
|
|
607
644
|
children: /* @__PURE__ */ z(f, { state: o })
|
|
608
645
|
})
|
|
609
646
|
}),
|
|
610
|
-
a && /* @__PURE__ */ z(
|
|
647
|
+
a && /* @__PURE__ */ z(A, {
|
|
611
648
|
name: a.name,
|
|
612
649
|
src: a.avatarUrl,
|
|
613
650
|
size: "xs",
|
|
@@ -616,7 +653,7 @@ function be({ workspace: e, project: t, onContextMenu: n }) {
|
|
|
616
653
|
]
|
|
617
654
|
});
|
|
618
655
|
}
|
|
619
|
-
function
|
|
656
|
+
function Se({ workspace: e, projects: n, health: i, onHealth: a }) {
|
|
620
657
|
let o = R("planning"), { data: s } = V(t(e)), { person: c } = b(e), [l, u] = I("health"), d = (e) => n.filter(e).length, p = "flex h-9 w-full items-center gap-2.5 rounded-md px-2 text-sm", m = [...new Set(n.map((e) => e.lead ?? ""))];
|
|
621
658
|
return /* @__PURE__ */ B("aside", {
|
|
622
659
|
"aria-label": o("breakdown"),
|
|
@@ -684,7 +721,7 @@ function xe({ workspace: e, projects: n, health: i, onHealth: a }) {
|
|
|
684
721
|
return /* @__PURE__ */ B("li", {
|
|
685
722
|
className: p,
|
|
686
723
|
children: [
|
|
687
|
-
t ? /* @__PURE__ */ z(
|
|
724
|
+
t ? /* @__PURE__ */ z(A, {
|
|
688
725
|
name: t.name,
|
|
689
726
|
src: t.avatarUrl,
|
|
690
727
|
size: "xs",
|