@parallelworks/tandem-web 0.186.0 → 0.187.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 +14 -3
- package/_virtual/_virtual_i18n/es/common.js +14 -3
- package/_virtual/_virtual_i18n/ja/common.js +14 -3
- package/_virtual/_virtual_i18n/ko/common.js +14 -3
- package/_virtual/_virtual_i18n/zh/common.js +14 -3
- package/components/Graph.js +204 -134
- package/components/StatusRules.js +119 -85
- package/lib/projectList.js +16 -2
- package/lib/projects.js +2 -15
- package/package.json +1 -1
- package/pages/projects.js +130 -119
package/pages/projects.js
CHANGED
|
@@ -9,33 +9,33 @@ 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 {
|
|
13
|
-
import { healthStates as
|
|
14
|
-
import { projectLevel as
|
|
15
|
-
import { useCan as
|
|
16
|
-
import { Link as D, useNavigate as
|
|
17
|
-
import { teamPath as
|
|
12
|
+
import { storeExpanded as x, storeLayout as S, storedExpanded as C, storedLayout as ee } from "../lib/projectList.js";
|
|
13
|
+
import { healthStates as w, projectStatuses as te, shownStatus as ne } from "../lib/projectStates.js";
|
|
14
|
+
import { projectLevel as re, projectRef as T, projectsUnder as E } from "../lib/projects.js";
|
|
15
|
+
import { useCan as ie } from "../lib/roles.js";
|
|
16
|
+
import { Link as D, useNavigate as ae } from "../lib/router.js";
|
|
17
|
+
import { teamPath as oe } from "../lib/teamPaths.js";
|
|
18
18
|
import { useTime as O } from "../lib/time.js";
|
|
19
|
-
import { Avatar as k, Button as A, Combobox as
|
|
20
|
-
import { useParams as
|
|
21
|
-
import { useEffect as P, useId as
|
|
19
|
+
import { Avatar as k, Button as A, Combobox as se, EmptyState as ce, PageHeaderAddButton as j, Switch as le, Tabs as M, ToggleGroup as ue, Tooltip as N, menuDivider as de, useOpenMenu as fe } from "@parallelworks/ui";
|
|
20
|
+
import { useParams as pe, useSearch as me } from "@tanstack/react-router";
|
|
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";
|
|
23
23
|
import { jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
24
24
|
import { useSuspenseQuery as V } from "@tanstack/react-query";
|
|
25
25
|
import { MoreButton as H } from "@parallelworks/ui/list";
|
|
26
26
|
// src/pages/projects.tsx
|
|
27
27
|
function U() {
|
|
28
|
-
let { workspace: r, key: a } =
|
|
28
|
+
let { workspace: r, key: a } = pe({ strict: !1 }), s = me({ strict: !1 }), u = a ? {
|
|
29
29
|
...s,
|
|
30
30
|
team: a
|
|
31
|
-
} : s, f = R("planning"), p = R("common"), { data: m } = V(e(r)), { data: b } = V(t(r)),
|
|
32
|
-
y(
|
|
33
|
-
let
|
|
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
|
+
y(x ? f("teamProjects", { team: x.name }) : f("projects"));
|
|
33
|
+
let C = a ? "list" : "timeline", w = u.view ?? ee(!!a) ?? C, D = m.filter((e) => (!x || e.teamIds.includes(x.id)) && !!e.template == (w === "templates")), O = ie(r, "manage_projects"), [k, M] = I(null), N = he(), P = ae(), F = fe(), L = v(), H = u.parent ? m.find((e) => e.id === u.parent) : void 0, U = H && new Set(E(m, H.id).map((e) => e.id)), W = ne(u.status, w === "templates"), G = D.filter((e) => (!W || e.status === W) && (!u.health || h(e) === u.health) && (!U || U.has(e.id))), K = D.length > 0 && (!!W || !!u.health), q = (e) => {
|
|
34
34
|
let { team: t, ...n } = Object.fromEntries(Object.entries({
|
|
35
35
|
...u,
|
|
36
36
|
...e
|
|
37
37
|
}).filter(([, e]) => e !== void 0));
|
|
38
|
-
return
|
|
38
|
+
return P(a ? {
|
|
39
39
|
to: "/$workspace/teams/$key/projects",
|
|
40
40
|
params: {
|
|
41
41
|
workspace: r,
|
|
@@ -49,44 +49,44 @@ function U() {
|
|
|
49
49
|
search: n,
|
|
50
50
|
replace: !0
|
|
51
51
|
});
|
|
52
|
-
},
|
|
52
|
+
}, J = g(r), Y = R("favorites"), X = (e) => [
|
|
53
53
|
{
|
|
54
54
|
label: p("open"),
|
|
55
|
-
onClick: () =>
|
|
55
|
+
onClick: () => P({
|
|
56
56
|
to: "/$workspace/projects/$projectId",
|
|
57
57
|
params: {
|
|
58
58
|
workspace: r,
|
|
59
|
-
projectId:
|
|
59
|
+
projectId: T(e)
|
|
60
60
|
}
|
|
61
61
|
})
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
label: f("viewIssues"),
|
|
65
|
-
onClick: () =>
|
|
65
|
+
onClick: () => P({
|
|
66
66
|
to: "/$workspace/projects/$projectId",
|
|
67
67
|
params: {
|
|
68
68
|
workspace: r,
|
|
69
|
-
projectId:
|
|
69
|
+
projectId: T(e)
|
|
70
70
|
},
|
|
71
71
|
search: { tab: "issues" }
|
|
72
72
|
})
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
label:
|
|
76
|
-
onClick: () =>
|
|
75
|
+
label: J.find("project", e.id) ? Y("remove") : Y("add"),
|
|
76
|
+
onClick: () => J.toggle("project", e.id)
|
|
77
77
|
},
|
|
78
|
-
...
|
|
78
|
+
...O && !e.template && re(m, e.id) < 5 ? [{
|
|
79
79
|
label: f("newSubProject"),
|
|
80
80
|
onClick: () => M(e.id)
|
|
81
81
|
}] : [],
|
|
82
|
-
|
|
83
|
-
...
|
|
82
|
+
de,
|
|
83
|
+
...L(`/${r}/projects/${T(e)}`),
|
|
84
84
|
_(p("copyName"), e.name)
|
|
85
|
-
],
|
|
85
|
+
], Z = (e) => ({
|
|
86
86
|
workspace: r,
|
|
87
87
|
project: e,
|
|
88
|
-
onContextMenu: (t) =>
|
|
89
|
-
menu: () =>
|
|
88
|
+
onContextMenu: (t) => F(t, X(e)),
|
|
89
|
+
menu: () => X(e)
|
|
90
90
|
});
|
|
91
91
|
return /* @__PURE__ */ B("div", {
|
|
92
92
|
className: "flex h-full min-h-0 flex-col",
|
|
@@ -96,20 +96,20 @@ function U() {
|
|
|
96
96
|
children: [
|
|
97
97
|
/* @__PURE__ */ z("h1", {
|
|
98
98
|
className: "min-w-0 truncate text-sm font-semibold",
|
|
99
|
-
children:
|
|
99
|
+
children: x ? f("teamProjects", { team: x.name }) : f("projects")
|
|
100
100
|
}),
|
|
101
101
|
/* @__PURE__ */ z(i, {
|
|
102
102
|
workspace: r,
|
|
103
103
|
page: "projects",
|
|
104
|
-
team:
|
|
105
|
-
href:
|
|
106
|
-
label: f("teamProjects", { team:
|
|
104
|
+
team: x && {
|
|
105
|
+
href: oe(r, x.key, "projects"),
|
|
106
|
+
label: f("teamProjects", { team: x.name })
|
|
107
107
|
}
|
|
108
108
|
}),
|
|
109
109
|
/* @__PURE__ */ z("span", {
|
|
110
110
|
className: "ml-auto flex items-center gap-1",
|
|
111
111
|
children: /* @__PURE__ */ z(n, {
|
|
112
|
-
...
|
|
112
|
+
...w !== "templates" && {
|
|
113
113
|
layouts: [{
|
|
114
114
|
value: "list",
|
|
115
115
|
label: f("views.list"),
|
|
@@ -119,28 +119,28 @@ function U() {
|
|
|
119
119
|
label: f("views.timeline"),
|
|
120
120
|
icon: /* @__PURE__ */ z(l, {})
|
|
121
121
|
}],
|
|
122
|
-
layout:
|
|
122
|
+
layout: w,
|
|
123
123
|
onLayoutChange: (e) => {
|
|
124
|
-
|
|
124
|
+
S(!!a, e), q({ view: e });
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
changed:
|
|
127
|
+
changed: w !== C,
|
|
128
128
|
children: /* @__PURE__ */ B("div", {
|
|
129
129
|
className: "flex items-center justify-between gap-3",
|
|
130
130
|
children: [/* @__PURE__ */ z("span", {
|
|
131
|
-
id:
|
|
131
|
+
id: N,
|
|
132
132
|
className: "text-sm",
|
|
133
133
|
children: f("showTemplates")
|
|
134
134
|
}), /* @__PURE__ */ z(le, {
|
|
135
135
|
size: "sm",
|
|
136
|
-
checked:
|
|
137
|
-
onCheckedChange: (e) =>
|
|
138
|
-
"aria-labelledby":
|
|
136
|
+
checked: w === "templates",
|
|
137
|
+
onCheckedChange: (e) => q({ view: e ? "templates" : void 0 }),
|
|
138
|
+
"aria-labelledby": N
|
|
139
139
|
})]
|
|
140
140
|
})
|
|
141
141
|
})
|
|
142
142
|
}),
|
|
143
|
-
|
|
143
|
+
O && /* @__PURE__ */ z(j, {
|
|
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: D.length },
|
|
156
|
+
options: te.map((e) => ({
|
|
157
157
|
value: e,
|
|
158
158
|
label: f(`status.${e}`),
|
|
159
|
-
count:
|
|
159
|
+
count: D.filter((t) => t.status === e).length
|
|
160
160
|
})),
|
|
161
|
-
value:
|
|
162
|
-
onValueChange: ([e]) =>
|
|
161
|
+
value: W ? [W] : [],
|
|
162
|
+
onValueChange: ([e]) => q({ status: e ?? "all" })
|
|
163
163
|
}),
|
|
164
164
|
u.health && /* @__PURE__ */ z(A, {
|
|
165
165
|
variant: "outline",
|
|
166
166
|
size: "sm",
|
|
167
167
|
"aria-pressed": !0,
|
|
168
|
-
onClick: () =>
|
|
168
|
+
onClick: () => q({ health: void 0 }),
|
|
169
169
|
children: f("healthFilter", { health: f(`health.${u.health}`) })
|
|
170
170
|
}),
|
|
171
|
-
|
|
171
|
+
D.some((e) => e.parentId) && /* @__PURE__ */ z(se, {
|
|
172
172
|
items: [{
|
|
173
173
|
value: "",
|
|
174
174
|
label: f("anyParent")
|
|
@@ -177,14 +177,14 @@ function U() {
|
|
|
177
177
|
label: e.name
|
|
178
178
|
}))],
|
|
179
179
|
value: u.parent ?? "",
|
|
180
|
-
onValueChange: (e) =>
|
|
180
|
+
onValueChange: (e) => q({ parent: e || void 0 }),
|
|
181
181
|
placeholder: f("parentProject"),
|
|
182
182
|
"aria-label": f("parentProject"),
|
|
183
183
|
trigger: /* @__PURE__ */ z(A, {
|
|
184
184
|
variant: "outline",
|
|
185
185
|
size: "sm",
|
|
186
|
-
className:
|
|
187
|
-
children:
|
|
186
|
+
className: H ? "border-(--theme-link) text-(--theme-app)" : void 0,
|
|
187
|
+
children: H ? f("underProject", { name: H.name }) : f("parentProject")
|
|
188
188
|
})
|
|
189
189
|
})
|
|
190
190
|
]
|
|
@@ -193,79 +193,90 @@ function U() {
|
|
|
193
193
|
className: "flex min-h-0 flex-1",
|
|
194
194
|
children: [/* @__PURE__ */ z("div", {
|
|
195
195
|
className: "min-h-0 min-w-0 flex-1 overflow-auto",
|
|
196
|
-
children:
|
|
196
|
+
children: G.length === 0 ? /* @__PURE__ */ z("div", {
|
|
197
197
|
className: "p-6",
|
|
198
|
-
children: /* @__PURE__ */ z(
|
|
198
|
+
children: /* @__PURE__ */ z(ce, {
|
|
199
199
|
icon: /* @__PURE__ */ z(c, {}),
|
|
200
|
-
title: f(
|
|
201
|
-
...!
|
|
202
|
-
...
|
|
200
|
+
title: f(K ? "noProjectsWithStatus" : w === "templates" ? "noTemplates" : "noProjects"),
|
|
201
|
+
...!K && { description: f(w === "templates" ? "noTemplatesDescription" : "noProjectsDescription") },
|
|
202
|
+
...O && !K && w !== "templates" && { action: /* @__PURE__ */ z(A, {
|
|
203
203
|
type: "button",
|
|
204
204
|
variant: "primary",
|
|
205
205
|
onClick: () => M(""),
|
|
206
206
|
children: f("newProject")
|
|
207
207
|
}) }
|
|
208
208
|
})
|
|
209
|
-
}) :
|
|
209
|
+
}) : w === "timeline" ? /* @__PURE__ */ z(ye, {
|
|
210
210
|
workspace: r,
|
|
211
|
-
projects:
|
|
212
|
-
rowProps:
|
|
213
|
-
}) : /* @__PURE__ */ z(
|
|
214
|
-
projects:
|
|
215
|
-
|
|
211
|
+
projects: G,
|
|
212
|
+
rowProps: Z
|
|
213
|
+
}) : /* @__PURE__ */ z(ge, {
|
|
214
|
+
projects: G,
|
|
215
|
+
pool: m.filter((e) => !!e.template == (w === "templates")),
|
|
216
|
+
rowProps: Z
|
|
216
217
|
})
|
|
217
|
-
}), /* @__PURE__ */ z(
|
|
218
|
+
}), /* @__PURE__ */ z(xe, {
|
|
218
219
|
workspace: r,
|
|
219
|
-
projects:
|
|
220
|
+
projects: D,
|
|
220
221
|
health: u.health,
|
|
221
|
-
onHealth: (e) =>
|
|
222
|
+
onHealth: (e) => q({ health: e === u.health ? void 0 : e })
|
|
222
223
|
})]
|
|
223
224
|
}),
|
|
224
|
-
|
|
225
|
+
k !== null && /* @__PURE__ */ z(d, {
|
|
225
226
|
workspace: r,
|
|
226
|
-
teamId:
|
|
227
|
-
parentId:
|
|
227
|
+
teamId: x?.id,
|
|
228
|
+
parentId: k || void 0,
|
|
228
229
|
onClose: () => M(null)
|
|
229
230
|
})
|
|
230
231
|
]
|
|
231
232
|
});
|
|
232
233
|
}
|
|
233
234
|
var W = "@4xl:grid @4xl:grid-cols-[minmax(0,1fr)_10rem_2rem_2rem_6rem_8rem_2rem]";
|
|
234
|
-
function
|
|
235
|
-
let
|
|
235
|
+
function ge({ projects: e, pool: t, rowProps: n }) {
|
|
236
|
+
let r = R("planning"), [i, a] = I(C), o = (e) => a((t) => {
|
|
236
237
|
let n = new Set(t);
|
|
237
|
-
return n.delete(e) || n.add(e), n;
|
|
238
|
-
})
|
|
238
|
+
return n.delete(e) || n.add(e), x(n), n;
|
|
239
|
+
}), s = new Set(e.map((e) => e.id)), c = [], l = (e, n) => {
|
|
240
|
+
let r = t.filter((t) => t.parentId === e.id);
|
|
241
|
+
if (c.push({
|
|
242
|
+
project: e,
|
|
243
|
+
depth: n,
|
|
244
|
+
children: r.length,
|
|
245
|
+
muted: !s.has(e.id)
|
|
246
|
+
}), i.has(e.id) && n < 5) for (let e of r) l(e, n + 1);
|
|
247
|
+
};
|
|
248
|
+
for (let t of e) t.parentId && s.has(t.parentId) || l(t, 0);
|
|
239
249
|
return /* @__PURE__ */ B("div", {
|
|
240
250
|
className: "@container",
|
|
241
251
|
children: [/* @__PURE__ */ B("div", {
|
|
242
252
|
className: `hidden h-8 items-center gap-3 border-b border-border px-4 text-xs text-muted-foreground md:px-5 ${W}`,
|
|
243
253
|
children: [
|
|
244
|
-
/* @__PURE__ */ z("span", { children:
|
|
245
|
-
/* @__PURE__ */ z("span", { children:
|
|
246
|
-
/* @__PURE__ */ z(
|
|
247
|
-
content:
|
|
254
|
+
/* @__PURE__ */ z("span", { children: r("name") }),
|
|
255
|
+
/* @__PURE__ */ z("span", { children: r("healthLabel") }),
|
|
256
|
+
/* @__PURE__ */ z(N, {
|
|
257
|
+
content: r("priority"),
|
|
248
258
|
children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z("span", {
|
|
249
259
|
className: "sr-only",
|
|
250
|
-
children:
|
|
260
|
+
children: r("priority")
|
|
251
261
|
}) })
|
|
252
262
|
}),
|
|
253
|
-
/* @__PURE__ */ z(
|
|
254
|
-
content:
|
|
263
|
+
/* @__PURE__ */ z(N, {
|
|
264
|
+
content: r("lead"),
|
|
255
265
|
children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z("span", {
|
|
256
266
|
className: "sr-only",
|
|
257
|
-
children:
|
|
267
|
+
children: r("lead")
|
|
258
268
|
}) })
|
|
259
269
|
}),
|
|
260
|
-
/* @__PURE__ */ z("span", { children:
|
|
261
|
-
/* @__PURE__ */ z("span", { children:
|
|
270
|
+
/* @__PURE__ */ z("span", { children: r("targetDate") }),
|
|
271
|
+
/* @__PURE__ */ z("span", { children: r("progressTitle") }),
|
|
262
272
|
/* @__PURE__ */ z("span", {})
|
|
263
273
|
]
|
|
264
|
-
}), /* @__PURE__ */ z("ul", { children:
|
|
265
|
-
...
|
|
274
|
+
}), /* @__PURE__ */ z("ul", { children: c.map((e) => /* @__PURE__ */ z(K, {
|
|
275
|
+
...n(e.project),
|
|
266
276
|
depth: e.depth,
|
|
267
277
|
childCount: e.children,
|
|
268
|
-
folded:
|
|
278
|
+
folded: !i.has(e.project.id),
|
|
279
|
+
muted: e.muted,
|
|
269
280
|
onFold: () => o(e.project.id)
|
|
270
281
|
}, e.project.id)) })]
|
|
271
282
|
});
|
|
@@ -277,8 +288,8 @@ function G({ project: e }) {
|
|
|
277
288
|
name: e.name
|
|
278
289
|
}) : /* @__PURE__ */ z(c, { className: "size-4 text-muted-foreground" });
|
|
279
290
|
}
|
|
280
|
-
function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0, childCount: o = 0, folded: c = !1,
|
|
281
|
-
let
|
|
291
|
+
function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0, childCount: o = 0, folded: c = !1, muted: l = !1, onFold: d }) {
|
|
292
|
+
let g = R("planning"), _ = R("common"), v = O(), y = u(), { person: x } = b(e), S = t.lead ? x(t.lead) : void 0, C = h(t);
|
|
282
293
|
return /* @__PURE__ */ B("li", {
|
|
283
294
|
className: "group flex items-center border-b border-border pr-2 hover:bg-muted/60",
|
|
284
295
|
children: [
|
|
@@ -287,9 +298,9 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
|
|
|
287
298
|
style: { width: `${i * 1.25 + 2}rem` },
|
|
288
299
|
children: o > 0 && /* @__PURE__ */ z("button", {
|
|
289
300
|
type: "button",
|
|
290
|
-
onClick:
|
|
301
|
+
onClick: d,
|
|
291
302
|
"aria-expanded": !c,
|
|
292
|
-
"aria-label":
|
|
303
|
+
"aria-label": g(c ? "showSubProjects" : "hideSubProjects", { name: t.name }),
|
|
293
304
|
className: "rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
294
305
|
children: /* @__PURE__ */ z(a, { className: `size-3.5 transition-transform ${c ? "-rotate-90" : ""}` })
|
|
295
306
|
})
|
|
@@ -298,10 +309,10 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
|
|
|
298
309
|
to: "/$workspace/projects/$projectId",
|
|
299
310
|
params: {
|
|
300
311
|
workspace: e,
|
|
301
|
-
projectId:
|
|
312
|
+
projectId: T(t)
|
|
302
313
|
},
|
|
303
314
|
onContextMenu: n,
|
|
304
|
-
className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W}`,
|
|
315
|
+
className: `flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 py-2.5 pl-1 ${W} ${l ? "opacity-60" : ""}`,
|
|
305
316
|
children: [
|
|
306
317
|
/* @__PURE__ */ B("span", {
|
|
307
318
|
className: "flex min-w-0 basis-full items-center gap-2.5 @4xl:basis-auto",
|
|
@@ -318,41 +329,41 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
|
|
|
318
329
|
}),
|
|
319
330
|
/* @__PURE__ */ B("span", {
|
|
320
331
|
className: "flex items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground",
|
|
321
|
-
children: [/* @__PURE__ */ z(f, { state:
|
|
332
|
+
children: [/* @__PURE__ */ z(f, { state: C }), g(`health.${C}`)]
|
|
322
333
|
}),
|
|
323
|
-
/* @__PURE__ */ z(
|
|
324
|
-
content:
|
|
334
|
+
/* @__PURE__ */ z(N, {
|
|
335
|
+
content: y[t.priority],
|
|
325
336
|
children: /* @__PURE__ */ z("span", {
|
|
326
337
|
role: "img",
|
|
327
|
-
"aria-label":
|
|
338
|
+
"aria-label": y[t.priority],
|
|
328
339
|
className: "flex",
|
|
329
340
|
children: /* @__PURE__ */ z(s, { priority: t.priority })
|
|
330
341
|
})
|
|
331
342
|
}),
|
|
332
343
|
/* @__PURE__ */ z("span", {
|
|
333
344
|
className: "flex",
|
|
334
|
-
children:
|
|
335
|
-
content:
|
|
345
|
+
children: S && /* @__PURE__ */ z(N, {
|
|
346
|
+
content: g("leadIs", { name: S.name }),
|
|
336
347
|
children: /* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(k, {
|
|
337
|
-
name:
|
|
338
|
-
src:
|
|
348
|
+
name: S.name,
|
|
349
|
+
src: S.avatarUrl,
|
|
339
350
|
size: "sm"
|
|
340
351
|
}) })
|
|
341
352
|
})
|
|
342
353
|
}),
|
|
343
354
|
/* @__PURE__ */ z("span", {
|
|
344
355
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
345
|
-
children: t.targetDate ?
|
|
356
|
+
children: t.targetDate ? v.day(t.targetDate) : ""
|
|
346
357
|
}),
|
|
347
358
|
/* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(p, {
|
|
348
359
|
progress: o > 0 ? t.treeProgress : t.progress,
|
|
349
360
|
compact: !0
|
|
350
361
|
}) }),
|
|
351
|
-
/* @__PURE__ */ z(
|
|
352
|
-
content:
|
|
362
|
+
/* @__PURE__ */ z(N, {
|
|
363
|
+
content: g(`status.${t.status}`),
|
|
353
364
|
children: /* @__PURE__ */ z("span", {
|
|
354
365
|
role: "img",
|
|
355
|
-
"aria-label":
|
|
366
|
+
"aria-label": g(`status.${t.status}`),
|
|
356
367
|
className: "flex",
|
|
357
368
|
children: /* @__PURE__ */ z(m, { status: t.status })
|
|
358
369
|
})
|
|
@@ -361,7 +372,7 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
|
|
|
361
372
|
}),
|
|
362
373
|
/* @__PURE__ */ z(H, {
|
|
363
374
|
items: r,
|
|
364
|
-
label:
|
|
375
|
+
label: _("moreActionsFor", { name: t.name })
|
|
365
376
|
})
|
|
366
377
|
]
|
|
367
378
|
});
|
|
@@ -369,15 +380,15 @@ function K({ workspace: e, project: t, onContextMenu: n, menu: r, depth: i = 0,
|
|
|
369
380
|
var q = 864e5, J = 5, Y = 64, X = 256, Z = 56, Q = (e) => Date.parse(`${e}T00:00:00Z`), $ = (e) => {
|
|
370
381
|
let t = new Date(e);
|
|
371
382
|
return Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), 1);
|
|
372
|
-
},
|
|
383
|
+
}, _e = () => {
|
|
373
384
|
let e = /* @__PURE__ */ new Date();
|
|
374
385
|
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
375
|
-
},
|
|
376
|
-
function
|
|
386
|
+
}, ve = (e) => e - (new Date(e).getUTCDay() + 6) % 7 * q;
|
|
387
|
+
function ye({ workspace: e, projects: t, rowProps: n }) {
|
|
377
388
|
let r = R("planning"), i = L(), a = F(null), [o, s] = I({
|
|
378
389
|
left: 0,
|
|
379
390
|
width: 0
|
|
380
|
-
}), c =
|
|
391
|
+
}), c = _e(), l = t.map((e) => {
|
|
381
392
|
let t = e.targetDate ? Q(e.targetDate) : void 0;
|
|
382
393
|
return {
|
|
383
394
|
p: e,
|
|
@@ -387,7 +398,7 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
|
|
|
387
398
|
}), u = l.flatMap((e) => [e.start, e.end].filter((e) => e !== void 0)), d = $(Math.min(c - 90 * q, ...u)), f = $(Math.max(c + 300 * q, ...u) + 40 * q), p = (e) => (e - d) / q * J, m = p(f), h = [];
|
|
388
399
|
for (let e = d; e < f; e = $(e + 32 * q)) h.push(e);
|
|
389
400
|
let g = [];
|
|
390
|
-
for (let e =
|
|
401
|
+
for (let e = ve(d) + 7 * q; e < f; e += 7 * q) g.push(e);
|
|
391
402
|
let _ = (e, t) => i.dateTime(new Date(e), {
|
|
392
403
|
...t,
|
|
393
404
|
timeZone: "UTC"
|
|
@@ -497,16 +508,16 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
|
|
|
497
508
|
return /* @__PURE__ */ B("li", {
|
|
498
509
|
className: "group flex hover:bg-muted/40",
|
|
499
510
|
style: { height: Y },
|
|
500
|
-
children: [/* @__PURE__ */ z(
|
|
511
|
+
children: [/* @__PURE__ */ z(be, { ...n(t) }), /* @__PURE__ */ B("div", {
|
|
501
512
|
className: "relative",
|
|
502
513
|
style: { width: m },
|
|
503
|
-
children: [a && !u && !d && /* @__PURE__ */ z(
|
|
514
|
+
children: [a && !u && !d && /* @__PURE__ */ z(N, {
|
|
504
515
|
content: `${t.name}, ${v(r, i)}`,
|
|
505
516
|
children: /* @__PURE__ */ B(D, {
|
|
506
517
|
to: "/$workspace/projects/$projectId",
|
|
507
518
|
params: {
|
|
508
519
|
workspace: e,
|
|
509
|
-
projectId:
|
|
520
|
+
projectId: T(t)
|
|
510
521
|
},
|
|
511
522
|
className: "absolute top-2 bottom-2 flex flex-col justify-end gap-1",
|
|
512
523
|
style: {
|
|
@@ -535,7 +546,7 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
|
|
|
535
546
|
to: "/$workspace/projects/$projectId",
|
|
536
547
|
params: {
|
|
537
548
|
workspace: e,
|
|
538
|
-
projectId:
|
|
549
|
+
projectId: T(t)
|
|
539
550
|
},
|
|
540
551
|
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",
|
|
541
552
|
style: u ? { left: o.left + 12 } : {
|
|
@@ -562,13 +573,13 @@ function ve({ workspace: e, projects: t, rowProps: n }) {
|
|
|
562
573
|
})
|
|
563
574
|
});
|
|
564
575
|
}
|
|
565
|
-
function
|
|
576
|
+
function be({ workspace: e, project: t, onContextMenu: n }) {
|
|
566
577
|
let r = R("planning"), { person: i } = b(e), a = t.lead ? i(t.lead) : void 0, o = h(t);
|
|
567
578
|
return /* @__PURE__ */ B(D, {
|
|
568
579
|
to: "/$workspace/projects/$projectId",
|
|
569
580
|
params: {
|
|
570
581
|
workspace: e,
|
|
571
|
-
projectId:
|
|
582
|
+
projectId: T(t)
|
|
572
583
|
},
|
|
573
584
|
onContextMenu: n,
|
|
574
585
|
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",
|
|
@@ -579,7 +590,7 @@ function ye({ workspace: e, project: t, onContextMenu: n }) {
|
|
|
579
590
|
className: "min-w-0 flex-1 truncate text-sm",
|
|
580
591
|
children: t.name
|
|
581
592
|
}),
|
|
582
|
-
/* @__PURE__ */ z(
|
|
593
|
+
/* @__PURE__ */ z(N, {
|
|
583
594
|
content: r(`status.${t.status}`),
|
|
584
595
|
children: /* @__PURE__ */ z("span", {
|
|
585
596
|
role: "img",
|
|
@@ -588,7 +599,7 @@ function ye({ workspace: e, project: t, onContextMenu: n }) {
|
|
|
588
599
|
children: /* @__PURE__ */ z(m, { status: t.status })
|
|
589
600
|
})
|
|
590
601
|
}),
|
|
591
|
-
/* @__PURE__ */ z(
|
|
602
|
+
/* @__PURE__ */ z(N, {
|
|
592
603
|
content: r(`health.${o}`),
|
|
593
604
|
children: /* @__PURE__ */ z("span", {
|
|
594
605
|
role: "img",
|
|
@@ -605,12 +616,12 @@ function ye({ workspace: e, project: t, onContextMenu: n }) {
|
|
|
605
616
|
]
|
|
606
617
|
});
|
|
607
618
|
}
|
|
608
|
-
function
|
|
619
|
+
function xe({ workspace: e, projects: n, health: i, onHealth: a }) {
|
|
609
620
|
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 ?? ""))];
|
|
610
621
|
return /* @__PURE__ */ B("aside", {
|
|
611
622
|
"aria-label": o("breakdown"),
|
|
612
623
|
className: "hidden w-72 shrink-0 overflow-y-auto border-l border-border p-3 xl:block",
|
|
613
|
-
children: [/* @__PURE__ */ z(
|
|
624
|
+
children: [/* @__PURE__ */ z(M, {
|
|
614
625
|
variant: "segmented",
|
|
615
626
|
size: "sm",
|
|
616
627
|
label: o("breakdown"),
|
|
@@ -627,7 +638,7 @@ function be({ workspace: e, projects: n, health: i, onHealth: a }) {
|
|
|
627
638
|
}), /* @__PURE__ */ B("ul", {
|
|
628
639
|
className: "mt-2",
|
|
629
640
|
children: [
|
|
630
|
-
l === "health" &&
|
|
641
|
+
l === "health" && w.map((e) => ({
|
|
631
642
|
h: e,
|
|
632
643
|
n: d((t) => h(t) === e)
|
|
633
644
|
})).filter(({ n: e }) => e > 0).map(({ h: e, n: t }) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {
|