@parallelworks/tandem-web 0.160.0 → 0.161.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 +5 -0
- package/_virtual/_virtual_i18n/es/common.js +5 -0
- package/_virtual/_virtual_i18n/ja/common.js +5 -0
- package/_virtual/_virtual_i18n/ko/common.js +5 -0
- package/_virtual/_virtual_i18n/zh/common.js +5 -0
- package/api/mutations.js +16 -9
- package/api/queries.js +194 -140
- package/components/CommandPalette.js +1 -1
- package/components/CustomerRequests.js +81 -85
- package/components/IssueFilters.js +87 -87
- package/components/IssueGroupList.js +72 -0
- package/components/IssueRow.js +70 -66
- package/components/IssueSection.js +30 -20
- package/components/NewIssueDialog.js +175 -175
- package/components/NewProjectDialog.js +64 -64
- package/lib/boardMove.js +13 -3
- package/lib/groupList.js +14 -0
- package/package.json +2 -1
- package/pages/issues.js +393 -340
- package/routes/_workspace/issues/index.js +1 -1
- package/routes/_workspace/teams/_key/settings2.js +180 -164
- package/routes/_workspace2.js +3 -3
- package/routes/_workspace3.js +11 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { useNavigate as n } from "../lib/router.js";
|
|
3
|
-
import {
|
|
4
|
-
import { AddIcon as
|
|
3
|
+
import { myTeamsQuery as r, projectsQuery as i, workspaceQuery as ee } from "../api/queries.js";
|
|
4
|
+
import { AddIcon as te, CalendarIcon as ne, ChevronRightIcon as re, CloseIcon as a, PriorityIcon as o, ProjectIcon as ie, UserIcon as ae, UsersIcon as s, usePriorityNames as oe } from "./icons.js";
|
|
5
5
|
import { usePeople as se } from "../lib/people.js";
|
|
6
6
|
import { useTime as ce } from "../lib/time.js";
|
|
7
7
|
import { ProjectStatusIcon as c } from "./Planning.js";
|
|
@@ -19,37 +19,37 @@ import { useQuery as x, useQueryClient as ye } from "@tanstack/react-query";
|
|
|
19
19
|
// src/components/NewProjectDialog.tsx
|
|
20
20
|
var S = h({ size: "sm" });
|
|
21
21
|
function C({ workspace: h, teamId: C, onClose: w }) {
|
|
22
|
-
let T = _("planning"), E = _("common"), be = ve(), xe = ce(), D = oe(), Se = ye(),
|
|
22
|
+
let T = _("planning"), E = _("common"), be = ve(), xe = ce(), D = oe(), Se = ye(), Ce = n(), { members: O, person: we } = se(h), { data: k } = x(ee(h)), { data: Te = [] } = x(r(h)), { data: Ee = [] } = x(i(h)), A = Ee.filter((e) => e.template), [j, De] = g(""), [M, Oe] = g(""), [N, ke] = g(""), [P, Ae] = g(""), [F, je] = g(""), [I, Me] = g("planned"), [L, Ne] = g(0), [R, Pe] = g(""), [z, Fe] = g([]), [B, Ie] = g(C ? [C] : []), [V, Le] = g(""), [H, U] = g(""), [W, G] = g([]), [K, q] = g(null), [J, Y] = g(!1), [Re, X] = g(null), Z = Te.filter((e) => !e.archivedAt), Q = (e, t, n) => /* @__PURE__ */ y(me, {
|
|
23
23
|
value: t,
|
|
24
24
|
onValueChange: n,
|
|
25
25
|
"aria-label": e,
|
|
26
26
|
trigger: /* @__PURE__ */ b("button", {
|
|
27
27
|
type: "button",
|
|
28
28
|
className: S,
|
|
29
|
-
children: [/* @__PURE__ */ y(
|
|
29
|
+
children: [/* @__PURE__ */ y(ne, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
|
|
30
30
|
className: t ? "" : "text-muted-foreground",
|
|
31
31
|
children: t ? xe.day(t) : e
|
|
32
32
|
})]
|
|
33
33
|
})
|
|
34
34
|
}), ze = async (n) => {
|
|
35
|
-
if (n.preventDefault(),
|
|
35
|
+
if (n.preventDefault(), N.trim()) {
|
|
36
36
|
Y(!0), X(null);
|
|
37
37
|
try {
|
|
38
38
|
let n = t(await e.POST("/api/v1/workspaces/{workspace}/projects", {
|
|
39
39
|
params: { path: { workspace: h } },
|
|
40
40
|
body: {
|
|
41
|
-
name:
|
|
42
|
-
status:
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
...
|
|
50
|
-
...
|
|
51
|
-
...
|
|
52
|
-
...
|
|
41
|
+
name: N.trim(),
|
|
42
|
+
status: I,
|
|
43
|
+
...j && { from: j },
|
|
44
|
+
...P.trim() && { summary: P.trim() },
|
|
45
|
+
...F && { description: F },
|
|
46
|
+
...L && { priority: L },
|
|
47
|
+
...M && { icon: M },
|
|
48
|
+
...R && { lead: R },
|
|
49
|
+
...z.length > 0 && { members: z },
|
|
50
|
+
...B.length > 0 && { teamIds: B },
|
|
51
|
+
...V && { startDate: V },
|
|
52
|
+
...H && { targetDate: H }
|
|
53
53
|
}
|
|
54
54
|
}));
|
|
55
55
|
for (let r of W.filter((e) => e.name.trim())) t(await e.POST("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones", {
|
|
@@ -62,7 +62,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
62
62
|
...r.targetDate && { targetDate: r.targetDate }
|
|
63
63
|
}
|
|
64
64
|
}));
|
|
65
|
-
Se.invalidateQueries({ queryKey:
|
|
65
|
+
Se.invalidateQueries({ queryKey: i(h).queryKey }), w(), Ce({
|
|
66
66
|
to: "/$workspace/projects/$projectId",
|
|
67
67
|
params: {
|
|
68
68
|
workspace: h,
|
|
@@ -75,7 +75,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
75
75
|
Y(!1);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
}, $ =
|
|
78
|
+
}, $ = R ? we(R) : void 0;
|
|
79
79
|
return /* @__PURE__ */ y(ge, {
|
|
80
80
|
open: !0,
|
|
81
81
|
onClose: w,
|
|
@@ -87,15 +87,15 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
87
87
|
/* @__PURE__ */ b("div", {
|
|
88
88
|
className: "flex items-center gap-2 px-5 pt-4 text-sm",
|
|
89
89
|
children: [
|
|
90
|
-
|
|
90
|
+
k && /* @__PURE__ */ b("span", {
|
|
91
91
|
className: "flex items-center gap-1.5 rounded-md border border-border px-2 py-0.5",
|
|
92
92
|
children: [/* @__PURE__ */ y(l, {
|
|
93
|
-
icon:
|
|
94
|
-
color:
|
|
95
|
-
name:
|
|
96
|
-
}),
|
|
93
|
+
icon: k.icon,
|
|
94
|
+
color: k.color,
|
|
95
|
+
name: k.name
|
|
96
|
+
}), k.name]
|
|
97
97
|
}),
|
|
98
|
-
/* @__PURE__ */ y(
|
|
98
|
+
/* @__PURE__ */ y(re, { className: "size-3.5 text-muted-foreground" }),
|
|
99
99
|
/* @__PURE__ */ y(_e, {
|
|
100
100
|
className: "text-sm",
|
|
101
101
|
children: T("newProject")
|
|
@@ -103,7 +103,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
103
103
|
/* @__PURE__ */ y(p, {
|
|
104
104
|
variant: "ghost",
|
|
105
105
|
size: "sm",
|
|
106
|
-
icon: /* @__PURE__ */ y(
|
|
106
|
+
icon: /* @__PURE__ */ y(a, {}),
|
|
107
107
|
label: E("close"),
|
|
108
108
|
onClick: w,
|
|
109
109
|
className: "ml-auto"
|
|
@@ -115,14 +115,14 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ y(fe, {
|
|
117
117
|
workspace: h,
|
|
118
|
-
icon:
|
|
119
|
-
name:
|
|
120
|
-
onChange:
|
|
118
|
+
icon: M,
|
|
119
|
+
name: N || T("project"),
|
|
120
|
+
onChange: Oe,
|
|
121
121
|
size: 40
|
|
122
122
|
}),
|
|
123
123
|
/* @__PURE__ */ y("input", {
|
|
124
|
-
value:
|
|
125
|
-
onChange: (e) =>
|
|
124
|
+
value: N,
|
|
125
|
+
onChange: (e) => ke(e.target.value),
|
|
126
126
|
autoFocus: !0,
|
|
127
127
|
required: !0,
|
|
128
128
|
maxLength: 200,
|
|
@@ -131,8 +131,8 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
131
131
|
className: "mt-3 w-full bg-transparent text-2xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60"
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ y("input", {
|
|
134
|
-
value:
|
|
135
|
-
onChange: (e) =>
|
|
134
|
+
value: P,
|
|
135
|
+
onChange: (e) => Ae(e.target.value),
|
|
136
136
|
maxLength: 200,
|
|
137
137
|
"aria-label": T("summary"),
|
|
138
138
|
placeholder: T("summaryPlaceholder"),
|
|
@@ -142,7 +142,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
142
142
|
className: "mt-4",
|
|
143
143
|
children: /* @__PURE__ */ y(ue, {
|
|
144
144
|
value: "",
|
|
145
|
-
onChange:
|
|
145
|
+
onChange: je,
|
|
146
146
|
placeholder: T("projectBrief"),
|
|
147
147
|
label: E("description"),
|
|
148
148
|
className: "min-h-32"
|
|
@@ -159,7 +159,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
159
159
|
className: "text-sm font-medium",
|
|
160
160
|
children: T("milestones")
|
|
161
161
|
}), /* @__PURE__ */ y(p, {
|
|
162
|
-
icon: /* @__PURE__ */ y(
|
|
162
|
+
icon: /* @__PURE__ */ y(te, { className: "size-3.5" }),
|
|
163
163
|
label: T("addMilestone"),
|
|
164
164
|
size: "xs",
|
|
165
165
|
onClick: () => G((e) => [...e, {
|
|
@@ -190,7 +190,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
190
190
|
/* @__PURE__ */ y(p, {
|
|
191
191
|
variant: "ghost",
|
|
192
192
|
size: "sm",
|
|
193
|
-
icon: /* @__PURE__ */ y(
|
|
193
|
+
icon: /* @__PURE__ */ y(a, {}),
|
|
194
194
|
label: T("removeMilestone"),
|
|
195
195
|
onClick: () => G((t) => t.filter((t) => t.key !== e.key))
|
|
196
196
|
})
|
|
@@ -202,27 +202,27 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
202
202
|
/* @__PURE__ */ b("div", {
|
|
203
203
|
className: "flex flex-wrap items-center gap-1.5 border-t border-border px-5 pt-3",
|
|
204
204
|
children: [
|
|
205
|
-
|
|
205
|
+
A.length > 0 && /* @__PURE__ */ y(m, {
|
|
206
206
|
"aria-label": T("startFrom"),
|
|
207
|
-
value:
|
|
208
|
-
onValueChange: (e) =>
|
|
207
|
+
value: j,
|
|
208
|
+
onValueChange: (e) => De(e ?? ""),
|
|
209
209
|
items: [{
|
|
210
210
|
value: "",
|
|
211
211
|
label: T("blankProject")
|
|
212
|
-
}, ...
|
|
212
|
+
}, ...A.map((e) => ({
|
|
213
213
|
value: e.id,
|
|
214
214
|
label: e.name
|
|
215
215
|
}))],
|
|
216
216
|
trigger: /* @__PURE__ */ b("button", {
|
|
217
217
|
type: "button",
|
|
218
218
|
className: S,
|
|
219
|
-
children: [/* @__PURE__ */ y(
|
|
219
|
+
children: [/* @__PURE__ */ y(ie, { className: "size-3.5 text-muted-foreground" }), j ? T("fromTemplate", { name: A.find((e) => e.id === j)?.name ?? "" }) : T("blankProject")]
|
|
220
220
|
})
|
|
221
221
|
}),
|
|
222
222
|
/* @__PURE__ */ y(m, {
|
|
223
223
|
"aria-label": T("statusLabel"),
|
|
224
|
-
value:
|
|
225
|
-
onValueChange: (e) => e &&
|
|
224
|
+
value: I,
|
|
225
|
+
onValueChange: (e) => e && Me(e),
|
|
226
226
|
items: de.map((e) => ({
|
|
227
227
|
value: e,
|
|
228
228
|
label: T(`status.${e}`),
|
|
@@ -231,32 +231,32 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
231
231
|
trigger: /* @__PURE__ */ b("button", {
|
|
232
232
|
type: "button",
|
|
233
233
|
className: S,
|
|
234
|
-
children: [/* @__PURE__ */ y(c, { status:
|
|
234
|
+
children: [/* @__PURE__ */ y(c, { status: I }), T(`status.${I}`)]
|
|
235
235
|
})
|
|
236
236
|
}),
|
|
237
237
|
/* @__PURE__ */ y(m, {
|
|
238
238
|
"aria-label": T("priority"),
|
|
239
|
-
value: String(
|
|
240
|
-
onValueChange: (e) => e &&
|
|
239
|
+
value: String(L),
|
|
240
|
+
onValueChange: (e) => e && Ne(Number(e)),
|
|
241
241
|
items: D.map((e, t) => ({
|
|
242
242
|
value: String(t),
|
|
243
243
|
label: e,
|
|
244
|
-
icon: /* @__PURE__ */ y(
|
|
244
|
+
icon: /* @__PURE__ */ y(o, { priority: t })
|
|
245
245
|
})),
|
|
246
246
|
trigger: /* @__PURE__ */ b("button", {
|
|
247
247
|
type: "button",
|
|
248
248
|
className: S,
|
|
249
|
-
children: [/* @__PURE__ */ y(
|
|
249
|
+
children: [/* @__PURE__ */ y(o, { priority: L }), L ? D[L] : T("noPriority")]
|
|
250
250
|
})
|
|
251
251
|
}),
|
|
252
252
|
/* @__PURE__ */ y(f, {
|
|
253
253
|
"aria-label": T("lead"),
|
|
254
|
-
value:
|
|
255
|
-
onValueChange: (e) =>
|
|
254
|
+
value: R,
|
|
255
|
+
onValueChange: (e) => Pe(e ?? ""),
|
|
256
256
|
items: [{
|
|
257
257
|
value: "",
|
|
258
258
|
label: T("noLead")
|
|
259
|
-
}, ...
|
|
259
|
+
}, ...O.map((e) => ({
|
|
260
260
|
value: e.user.username,
|
|
261
261
|
label: e.user.name,
|
|
262
262
|
icon: /* @__PURE__ */ y(u, {
|
|
@@ -274,7 +274,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
274
274
|
src: $.avatarUrl,
|
|
275
275
|
size: "xs",
|
|
276
276
|
decorative: !0
|
|
277
|
-
}), $.name] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(
|
|
277
|
+
}), $.name] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(ae, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
|
|
278
278
|
className: "text-muted-foreground",
|
|
279
279
|
children: T("lead")
|
|
280
280
|
})] })
|
|
@@ -284,7 +284,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
284
284
|
open: K === "members",
|
|
285
285
|
onOpenChange: (e) => q(e ? "members" : null),
|
|
286
286
|
multiple: !0,
|
|
287
|
-
items:
|
|
287
|
+
items: O.map((e) => ({
|
|
288
288
|
value: e.user.username,
|
|
289
289
|
label: e.user.name,
|
|
290
290
|
icon: /* @__PURE__ */ y(u, {
|
|
@@ -294,20 +294,20 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
294
294
|
decorative: !0
|
|
295
295
|
})
|
|
296
296
|
})),
|
|
297
|
-
value:
|
|
298
|
-
onValueChange:
|
|
297
|
+
value: z,
|
|
298
|
+
onValueChange: Fe,
|
|
299
299
|
placeholder: T("members"),
|
|
300
300
|
trigger: /* @__PURE__ */ b("button", {
|
|
301
301
|
type: "button",
|
|
302
302
|
className: S,
|
|
303
303
|
children: [/* @__PURE__ */ y(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
|
|
304
|
-
className:
|
|
305
|
-
children:
|
|
304
|
+
className: z.length ? "" : "text-muted-foreground",
|
|
305
|
+
children: z.length ? T("memberCount", { count: z.length }) : T("members")
|
|
306
306
|
})]
|
|
307
307
|
})
|
|
308
308
|
}),
|
|
309
|
-
Q(T("startDate"),
|
|
310
|
-
Q(T("targetDate"),
|
|
309
|
+
Q(T("startDate"), V, Le),
|
|
310
|
+
Q(T("targetDate"), H, U),
|
|
311
311
|
/* @__PURE__ */ y(f, {
|
|
312
312
|
open: K === "teams",
|
|
313
313
|
onOpenChange: (e) => q(e ? "teams" : null),
|
|
@@ -322,15 +322,15 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
322
322
|
name: e.name
|
|
323
323
|
})
|
|
324
324
|
})),
|
|
325
|
-
value:
|
|
326
|
-
onValueChange:
|
|
325
|
+
value: B,
|
|
326
|
+
onValueChange: Ie,
|
|
327
327
|
placeholder: T("teams"),
|
|
328
328
|
trigger: /* @__PURE__ */ b("button", {
|
|
329
329
|
type: "button",
|
|
330
330
|
className: S,
|
|
331
331
|
children: [/* @__PURE__ */ y(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ y("span", {
|
|
332
|
-
className:
|
|
333
|
-
children:
|
|
332
|
+
className: B.length ? "" : "text-muted-foreground",
|
|
333
|
+
children: B.length ? Z.filter((e) => B.includes(e.id)).map((e) => e.key).join(", ") : T("teams")
|
|
334
334
|
})]
|
|
335
335
|
})
|
|
336
336
|
})
|
|
@@ -353,7 +353,7 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
353
353
|
/* @__PURE__ */ y(d, {
|
|
354
354
|
type: "submit",
|
|
355
355
|
variant: "primary",
|
|
356
|
-
disabled: J || !
|
|
356
|
+
disabled: J || !N.trim(),
|
|
357
357
|
children: T(J ? "creating" : "createProject")
|
|
358
358
|
})
|
|
359
359
|
]
|
package/lib/boardMove.js
CHANGED
|
@@ -87,15 +87,25 @@ function d(d, f) {
|
|
|
87
87
|
labels: []
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
let b =
|
|
90
|
+
let b = (e) => ({
|
|
91
|
+
...e,
|
|
92
|
+
issues: e.issues.map((e) => e.id === r.id ? y : e)
|
|
93
|
+
}), x = { queryKey: [
|
|
91
94
|
"workspace",
|
|
92
95
|
d,
|
|
93
96
|
"issues",
|
|
94
97
|
"list"
|
|
95
98
|
] };
|
|
96
|
-
p.setQueriesData(
|
|
99
|
+
p.setQueriesData(x, (e) => e && b(e));
|
|
100
|
+
let S = { queryKey: [
|
|
101
|
+
"workspace",
|
|
102
|
+
d,
|
|
103
|
+
"issues",
|
|
104
|
+
"pages"
|
|
105
|
+
] };
|
|
106
|
+
p.setQueriesData(S, (e) => e && {
|
|
97
107
|
...e,
|
|
98
|
-
|
|
108
|
+
pages: e.pages.map(b)
|
|
99
109
|
});
|
|
100
110
|
try {
|
|
101
111
|
let i = v ? await a(d, r.identifier, v) : t(await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
|
package/lib/groupList.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/lib/groupList.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
return e.flatMap((e) => [{
|
|
4
|
+
kind: "group",
|
|
5
|
+
group: e
|
|
6
|
+
}, ...t.has(e.key) ? [] : e.issues.map((e) => ({
|
|
7
|
+
kind: "row",
|
|
8
|
+
issue: e
|
|
9
|
+
}))]);
|
|
10
|
+
}
|
|
11
|
+
function t(e, t) {
|
|
12
|
+
return e.findLast((e) => e <= t) ?? 0;
|
|
13
|
+
}
|
|
14
|
+
export { e as groupItems, t as headingOf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallelworks/tandem-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.161.0",
|
|
4
4
|
"description": "Tandem's pages, for a host app to render in its own",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@parallelworks/i18n": "^0.3.0",
|
|
22
22
|
"@parallelworks/problem": "^0.6.0",
|
|
23
23
|
"@tanstack/react-query": "^5.104.5",
|
|
24
|
+
"@tanstack/react-virtual": "3.14.24",
|
|
24
25
|
"@tiptap/extension-blockquote": "3.32.0",
|
|
25
26
|
"@tiptap/extension-code-block-lowlight": "3.32.0",
|
|
26
27
|
"@tiptap/extension-collaboration": "^3.32.0",
|