@parallelworks/tandem-web 0.160.1 → 0.161.1
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 +4 -0
- package/_virtual/_virtual_i18n/es/common.js +4 -0
- package/_virtual/_virtual_i18n/ja/common.js +4 -0
- package/_virtual/_virtual_i18n/ko/common.js +4 -0
- package/_virtual/_virtual_i18n/zh/common.js +4 -0
- package/api/mutations.js +16 -9
- package/api/queries.js +194 -140
- package/components/CommandPalette.js +5 -2
- package/components/CustomerRequests.js +81 -85
- package/components/DocLinkPicker.js +4 -1
- package/components/FavoritesNav.js +4 -1
- package/components/IssueFilters.js +90 -87
- package/components/IssueGroupList.js +72 -0
- package/components/IssueInsights.js +4 -1
- package/components/IssueRelations.js +8 -2
- package/components/IssueRow.js +73 -66
- package/components/IssueSection.js +30 -20
- package/components/NewIssueDialog.js +181 -175
- package/components/NewProjectDialog.js +64 -64
- package/components/Reports.js +4 -1
- package/components/TeamWorkflow.js +4 -1
- package/components/icons.js +61 -33
- package/lib/boardMove.js +13 -3
- package/lib/groupList.js +14 -0
- package/lib/issueMenu.js +8 -2
- package/lib/issuePicker.js +4 -1
- package/package.json +2 -1
- package/pages/issues.js +393 -340
- package/pages/triage.js +4 -1
- package/routes/_workspace/docs/_doc2.js +8 -2
- package/routes/_workspace/issues/_identifier2.js +8 -2
- package/routes/_workspace/issues/index.js +1 -1
- package/routes/_workspace/notifications2.js +4 -1
- package/routes/_workspace/teams/_key/settings2.js +180 -164
- package/routes/_workspace2.js +3 -3
- package/routes/_workspace3.js +11 -10
|
@@ -1,61 +1,61 @@
|
|
|
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 { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a,
|
|
4
|
-
import { invalidateIssueViews as
|
|
5
|
-
import { CalendarIcon as
|
|
6
|
-
import { useTime as
|
|
7
|
-
import { scalePoints as
|
|
8
|
-
import { PickManyBox as
|
|
9
|
-
import { parseAssigneeKey as
|
|
10
|
-
import { attachmentPrefix as
|
|
11
|
-
import { useCan as
|
|
3
|
+
import { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a, myTeamsQuery as ee, statusesQuery as te, teamsQuery as ne } from "../api/queries.js";
|
|
4
|
+
import { invalidateIssueViews as re } from "../api/mutations.js";
|
|
5
|
+
import { CalendarIcon as ie, CycleIcon as ae, EstimateIcon as oe, FileTextIcon as se, FolderIcon as ce, PriorityIcon as le, StatusIcon as ue, TagIcon as de, UserIcon as fe, usePriorityNames as pe } from "./icons.js";
|
|
6
|
+
import { useTime as me } from "../lib/time.js";
|
|
7
|
+
import { scalePoints as he, useEstimateLabel as ge } from "./Planning.js";
|
|
8
|
+
import { PickManyBox as _e, usePickMany as ve } from "../lib/pickMany.js";
|
|
9
|
+
import { parseAssigneeKey as ye, useAssigneeOptions as be } from "../lib/assignees.js";
|
|
10
|
+
import { attachmentPrefix as xe, insertPreviews as Se, readDataURL as Ce, uploadAttachment as we } from "../lib/attachments.js";
|
|
11
|
+
import { useCan as Te } from "../lib/roles.js";
|
|
12
12
|
import { hasValue as o } from "../lib/customFields.js";
|
|
13
|
-
import { useConfirm as
|
|
14
|
-
import { issueTypesQuery as
|
|
15
|
-
import { TypeIcon as
|
|
16
|
-
import { NewIssueFields as
|
|
17
|
-
import { AttachButton as
|
|
18
|
-
import { Editor as
|
|
19
|
-
import { withoutLink as
|
|
20
|
-
import { TeamForm as
|
|
21
|
-
import { Button as
|
|
22
|
-
import { useEffect as
|
|
23
|
-
import { useErrorMessage as
|
|
13
|
+
import { useConfirm as Ee } from "../lib/confirm.js";
|
|
14
|
+
import { issueTypesQuery as De, typesFor as Oe } from "../lib/issueTypes.js";
|
|
15
|
+
import { TypeIcon as ke } from "./IssueTypes.js";
|
|
16
|
+
import { NewIssueFields as Ae } from "./CustomFields.js";
|
|
17
|
+
import { AttachButton as je, useAttachmentsOn as Me } from "./Attachments.js";
|
|
18
|
+
import { Editor as Ne } from "./Editor.js";
|
|
19
|
+
import { withoutLink as Pe } from "../lib/markdownLinks.js";
|
|
20
|
+
import { TeamForm as Fe } from "./TeamForm.js";
|
|
21
|
+
import { Button as Ie, Combobox as s, CreateModal as Le, DatePicker as Re, Modal as ze, buttonClasses as Be, toast as Ve } from "@parallelworks/ui";
|
|
22
|
+
import { useEffect as He, useRef as c, useState as l } from "react";
|
|
23
|
+
import { useErrorMessage as Ue } from "@parallelworks/problem/react";
|
|
24
24
|
import { useTranslations as u } from "use-intl";
|
|
25
|
-
import { Fragment as
|
|
26
|
-
import { useQuery as p, useQueryClient as
|
|
25
|
+
import { Fragment as We, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
26
|
+
import { useQuery as p, useQueryClient as Ge, useSuspenseQuery as Ke } from "@tanstack/react-query";
|
|
27
27
|
// src/components/NewIssueDialog.tsx
|
|
28
|
-
function m({ workspace: m, defaultTeam: h, defaultTitle:
|
|
29
|
-
let { data:
|
|
30
|
-
...
|
|
28
|
+
function m({ workspace: m, defaultTeam: h, defaultTitle: Ye = "", defaultBody: g = "", defaultArea: _, origin: v, defaults: y = {}, onCreated: Xe, onClose: b }) {
|
|
29
|
+
let { data: Ze } = Ke(ee(m)), { data: Qe = [] } = p(ne(m)), $e = h && !Ze.some((e) => e.key === h) ? Qe.find((e) => e.key === h) : void 0, x = [...Ze, ...$e ? [$e] : []].filter((e) => !e.archivedAt), S = !Ye && !g && !_ && !v && Object.keys(y).length === 0, [C] = l(() => S ? qe(m) : void 0), [w, et] = l(h ?? x.find((e) => e.key === C?.team)?.key ?? x[0]?.key ?? ""), { data: T = [] } = p({
|
|
30
|
+
...te(m, w),
|
|
31
31
|
enabled: !!w
|
|
32
|
-
}), { data:
|
|
32
|
+
}), { data: tt = [] } = p(a(m)), { data: E = [] } = p({
|
|
33
33
|
...i(m, w),
|
|
34
34
|
enabled: !!w
|
|
35
|
-
}), [
|
|
35
|
+
}), [D, nt] = l(null), rt = E.find((e) => e.id === D), [O, it] = l(Ye || C?.title || ""), k = c(O), at = u("issueTemplates"), ot = be(m, !0), st = pe(), A = u("newIssue"), ct = Ue(), j = u("common"), M = Te(m, "manage_teams"), [N, P] = l(g || C?.body || ""), lt = c(N), [ut, dt] = l(y.statusId ?? null), [F, ft] = l(y.priority ?? 0), [I, pt] = l(0), [L, mt] = l(""), [R, ht] = l(y.cycleId ?? ""), z = u("planning"), gt = ge(), _t = me(), { data: vt = [] } = p({
|
|
36
36
|
...r(m, w),
|
|
37
37
|
enabled: !!x.find((e) => e.key === w)?.cyclesEnabled
|
|
38
|
-
}),
|
|
38
|
+
}), yt = vt.find((e) => e.id === R), bt = (e) => e.name ? z("cycleNamed", {
|
|
39
39
|
number: e.number,
|
|
40
40
|
name: e.name
|
|
41
|
-
}) :
|
|
42
|
-
|
|
41
|
+
}) : z("cycle", { number: e.number }), B = x.find((e) => e.key === w)?.estimateScale ?? "none", [V, xt] = l(y.assignees ?? []), [H, St] = l(y.labelIds ?? []), [U, W] = l({}), [G, Ct] = l(null), { data: wt } = p(De(m)), K = Oe(wt, x.find((e) => e.key === w)?.id), q = K.find((e) => e.id === G), Tt = u("issueTypes"), [J, Y] = l(null), Et = ve(J === "assignees", () => Y(null)), Dt = ve(J === "labels", () => Y(null)), [Ot, kt] = l(null), At = Ge(), jt = n(), { confirm: Mt, dialog: Nt } = Ee(), Pt = c(!1);
|
|
42
|
+
He(() => {
|
|
43
43
|
let e = () => {
|
|
44
|
-
S &&
|
|
44
|
+
S && Je(m, {
|
|
45
45
|
team: w,
|
|
46
|
-
title:
|
|
47
|
-
body:
|
|
46
|
+
title: k.current,
|
|
47
|
+
body: N
|
|
48
48
|
}), b();
|
|
49
49
|
}, t = (t) => {
|
|
50
|
-
if (!(t.key !== "Escape" || J !== null ||
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
title:
|
|
54
|
-
description:
|
|
55
|
-
confirmLabel:
|
|
50
|
+
if (!(t.key !== "Escape" || J !== null || Pt.current) && !document.querySelector("[role=\"menu\"], [role=\"listbox\"]")) {
|
|
51
|
+
if (k.current === O && N === lt.current) return e();
|
|
52
|
+
Pt.current = !0, Mt({
|
|
53
|
+
title: A("closeTitle"),
|
|
54
|
+
description: A(S ? "closeKeepsDraft" : "closeLoses"),
|
|
55
|
+
confirmLabel: j("close"),
|
|
56
56
|
onConfirm: async () => e()
|
|
57
57
|
}).finally(() => {
|
|
58
|
-
|
|
58
|
+
Pt.current = !1;
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
};
|
|
@@ -65,13 +65,13 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
65
65
|
S,
|
|
66
66
|
m,
|
|
67
67
|
w,
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
N,
|
|
69
|
+
O,
|
|
70
70
|
b,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]),
|
|
71
|
+
Mt,
|
|
72
|
+
A,
|
|
73
|
+
j
|
|
74
|
+
]), He(() => {
|
|
75
75
|
let e = (e) => {
|
|
76
76
|
if (e.metaKey || e.ctrlKey || e.altKey || e.key.length !== 1 || document.activeElement && document.activeElement !== document.body) return;
|
|
77
77
|
let t = document.querySelector("[role=\"dialog\"]");
|
|
@@ -81,32 +81,32 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
81
81
|
};
|
|
82
82
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
83
83
|
}, []);
|
|
84
|
-
let
|
|
85
|
-
S &&
|
|
84
|
+
let Ft = () => {
|
|
85
|
+
S && Je(m, {
|
|
86
86
|
team: w,
|
|
87
87
|
title: "",
|
|
88
88
|
body: ""
|
|
89
89
|
}), b();
|
|
90
|
-
},
|
|
91
|
-
if (!
|
|
92
|
-
|
|
90
|
+
}, X = T.find((e) => e.id === ut) ?? T.find((e) => e.category === "unstarted"), Z = c(null), Q = c(/* @__PURE__ */ new Map()), It = Me(), Lt = u("issue.attachments"), Rt = async (e, t) => {
|
|
91
|
+
if (!It) {
|
|
92
|
+
Ve.error(Lt("off", { name: e[0]?.name ?? "" }));
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
let n = await Promise.all(e.map(async (e) => ({
|
|
96
96
|
file: e,
|
|
97
|
-
src: await
|
|
97
|
+
src: await Ce(e)
|
|
98
98
|
})));
|
|
99
|
-
for (let { file: e, src: t } of n)
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
let n =
|
|
103
|
-
for (let [e, r] of
|
|
104
|
-
let i = await
|
|
105
|
-
n = n.replaceAll(`(${e})`, `(${
|
|
99
|
+
for (let { file: e, src: t } of n) Q.current.set(t, e);
|
|
100
|
+
Z.current && !Z.current.isDestroyed && Se(Z.current, n, t);
|
|
101
|
+
}, zt = async (t) => {
|
|
102
|
+
let n = N;
|
|
103
|
+
for (let [e, r] of Q.current) if (N.includes(e)) try {
|
|
104
|
+
let i = await we(m, t, r);
|
|
105
|
+
n = n.replaceAll(`(${e})`, `(${xe}${i.id})`);
|
|
106
106
|
} catch (t) {
|
|
107
|
-
n =
|
|
107
|
+
n = Pe(n, e), Ve.error(A("attachFailed", {
|
|
108
108
|
name: r.name,
|
|
109
|
-
reason:
|
|
109
|
+
reason: ct(t)
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
|
|
@@ -116,10 +116,10 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
116
116
|
} },
|
|
117
117
|
body: { body: n }
|
|
118
118
|
});
|
|
119
|
-
},
|
|
119
|
+
}, Bt = async (n, r) => {
|
|
120
120
|
if (!w) return !1;
|
|
121
|
-
|
|
122
|
-
let i = [...
|
|
121
|
+
kt(null);
|
|
122
|
+
let i = [...Q.current.keys()].filter((e) => N.includes(e));
|
|
123
123
|
try {
|
|
124
124
|
let a = t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issues", {
|
|
125
125
|
params: { path: {
|
|
@@ -128,22 +128,22 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
128
128
|
} },
|
|
129
129
|
body: {
|
|
130
130
|
title: n,
|
|
131
|
-
body: i.reduce(
|
|
132
|
-
priority:
|
|
133
|
-
...
|
|
134
|
-
assignees:
|
|
135
|
-
labelIds:
|
|
131
|
+
body: i.reduce(Pe, N),
|
|
132
|
+
priority: F,
|
|
133
|
+
...X && { statusId: X.id },
|
|
134
|
+
assignees: V.map(ye),
|
|
135
|
+
labelIds: H,
|
|
136
136
|
...q && { typeId: q.id },
|
|
137
|
-
...Object.values(
|
|
138
|
-
...
|
|
139
|
-
...
|
|
140
|
-
...
|
|
137
|
+
...Object.values(U).some(o) && { fields: Object.fromEntries(Object.entries(U).filter(([, e]) => o(e))) },
|
|
138
|
+
...I && he(B).includes(I) && { estimate: I },
|
|
139
|
+
...L && { dueDate: L },
|
|
140
|
+
...R && { cycleId: R },
|
|
141
141
|
...(!h || w === h) && _ && { area: _ },
|
|
142
142
|
...(!h || w === h) && v && { origin: v },
|
|
143
143
|
...(!h || w === h) && y.projectId && { projectId: y.projectId }
|
|
144
144
|
}
|
|
145
145
|
}));
|
|
146
|
-
return i.length > 0 && await
|
|
146
|
+
return i.length > 0 && await zt(a.identifier), re(At, m, a.identifier), Xe?.(a), r && jt({
|
|
147
147
|
to: "/$workspace/issues/$identifier",
|
|
148
148
|
params: {
|
|
149
149
|
workspace: m,
|
|
@@ -151,95 +151,95 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
151
151
|
}
|
|
152
152
|
}), !0;
|
|
153
153
|
} catch (e) {
|
|
154
|
-
return
|
|
154
|
+
return kt(ct(e)), !1;
|
|
155
155
|
}
|
|
156
|
-
}, $ =
|
|
157
|
-
if (x.length === 0) return /* @__PURE__ */ d(
|
|
156
|
+
}, $ = Be({ size: "sm" });
|
|
157
|
+
if (x.length === 0) return /* @__PURE__ */ d(ze, {
|
|
158
158
|
open: !0,
|
|
159
159
|
onClose: b,
|
|
160
160
|
size: "lg",
|
|
161
|
-
title:
|
|
162
|
-
description:
|
|
163
|
-
...!
|
|
161
|
+
title: A("noTeamTitle"),
|
|
162
|
+
description: A(M ? "noTeamDescription" : "noTeamAskAdmin"),
|
|
163
|
+
...!M && { footer: /* @__PURE__ */ d(Ie, {
|
|
164
164
|
type: "button",
|
|
165
165
|
onClick: b,
|
|
166
|
-
children:
|
|
166
|
+
children: j("close")
|
|
167
167
|
}) },
|
|
168
|
-
children:
|
|
168
|
+
children: M && /* @__PURE__ */ d(Fe, {
|
|
169
169
|
workspace: m,
|
|
170
170
|
autoFocus: !0,
|
|
171
|
-
onCreated: (e) =>
|
|
171
|
+
onCreated: (e) => et(e.key)
|
|
172
172
|
})
|
|
173
173
|
});
|
|
174
|
-
let
|
|
175
|
-
return /* @__PURE__ */ f(
|
|
174
|
+
let Vt = x.find((e) => e.key === w);
|
|
175
|
+
return /* @__PURE__ */ f(We, { children: [/* @__PURE__ */ d(Le, {
|
|
176
176
|
open: !0,
|
|
177
|
-
onClose:
|
|
177
|
+
onClose: Ft,
|
|
178
178
|
size: "xl",
|
|
179
|
-
typeIcon: /* @__PURE__ */ d(
|
|
180
|
-
typeLabel:
|
|
179
|
+
typeIcon: /* @__PURE__ */ d(ce, { className: "size-3.5" }),
|
|
180
|
+
typeLabel: Vt?.name ?? "",
|
|
181
181
|
typeMenu: x.map((e) => ({
|
|
182
182
|
label: e.name,
|
|
183
183
|
hint: e.key,
|
|
184
184
|
checked: e.key === w,
|
|
185
185
|
onClick: () => {
|
|
186
|
-
|
|
186
|
+
et(e.key), dt(null), nt(null), W({}), Ct(null), ht("");
|
|
187
187
|
}
|
|
188
188
|
})),
|
|
189
189
|
typeMenuSearch: {
|
|
190
|
-
placeholder:
|
|
191
|
-
empty:
|
|
190
|
+
placeholder: A("moveToTeam"),
|
|
191
|
+
empty: A("noTeamMatches")
|
|
192
192
|
},
|
|
193
|
-
namePlaceholder:
|
|
194
|
-
initialName:
|
|
193
|
+
namePlaceholder: A("issueTitle"),
|
|
194
|
+
initialName: O,
|
|
195
195
|
onNameChange: (e) => {
|
|
196
|
-
|
|
196
|
+
k.current = e;
|
|
197
197
|
},
|
|
198
|
-
submitLabel:
|
|
198
|
+
submitLabel: A("create"),
|
|
199
199
|
descriptionField: /* @__PURE__ */ f("div", {
|
|
200
200
|
className: "min-h-24 pb-2",
|
|
201
|
-
children: [/* @__PURE__ */ d(
|
|
202
|
-
value:
|
|
203
|
-
onChange:
|
|
204
|
-
onFiles: (e, t) => void
|
|
201
|
+
children: [/* @__PURE__ */ d(Ne, {
|
|
202
|
+
value: N,
|
|
203
|
+
onChange: P,
|
|
204
|
+
onFiles: (e, t) => void Rt(e, t),
|
|
205
205
|
onEditor: (e) => {
|
|
206
|
-
|
|
206
|
+
Z.current = e;
|
|
207
207
|
},
|
|
208
208
|
onSubmit: () => {},
|
|
209
|
-
placeholder:
|
|
210
|
-
label:
|
|
209
|
+
placeholder: A("descriptionPlaceholder"),
|
|
210
|
+
label: j("description"),
|
|
211
211
|
className: "min-h-24"
|
|
212
|
-
}), /* @__PURE__ */ d(
|
|
212
|
+
}), /* @__PURE__ */ d(Ae, {
|
|
213
213
|
workspace: m,
|
|
214
214
|
teamId: x.find((e) => e.key === w)?.id,
|
|
215
|
-
typeId:
|
|
216
|
-
values:
|
|
217
|
-
onChange:
|
|
215
|
+
typeId: G,
|
|
216
|
+
values: U,
|
|
217
|
+
onChange: W
|
|
218
218
|
})]
|
|
219
219
|
}),
|
|
220
|
-
dirty:
|
|
221
|
-
footerHint:
|
|
222
|
-
error:
|
|
223
|
-
onSubmit: (e, t, n, { modifier: r }) =>
|
|
224
|
-
properties: /* @__PURE__ */ f(
|
|
225
|
-
|
|
220
|
+
dirty: N !== g || D !== null || ut !== null || F !== 0 || I !== 0 || L !== "" || R !== "" || V.length > 0 || H.length > 0 || G !== null || Object.values(U).some(o),
|
|
221
|
+
footerHint: A("hint"),
|
|
222
|
+
error: Ot,
|
|
223
|
+
onSubmit: (e, t, n, { modifier: r }) => Bt(e, r),
|
|
224
|
+
properties: /* @__PURE__ */ f(We, { children: [
|
|
225
|
+
E.length > 0 && /* @__PURE__ */ d(s, {
|
|
226
226
|
open: J === "template",
|
|
227
227
|
onOpenChange: (e) => Y(e ? "template" : null),
|
|
228
|
-
items:
|
|
228
|
+
items: E.map((e) => ({
|
|
229
229
|
value: e.id,
|
|
230
230
|
label: e.name,
|
|
231
|
-
icon: /* @__PURE__ */ d(
|
|
231
|
+
icon: /* @__PURE__ */ d(se, { className: "size-3.5 text-muted-foreground" })
|
|
232
232
|
})),
|
|
233
|
-
value:
|
|
233
|
+
value: D,
|
|
234
234
|
onValueChange: (e) => {
|
|
235
|
-
let t =
|
|
236
|
-
t && (
|
|
235
|
+
let t = E.find((t) => t.id === e);
|
|
236
|
+
t && (nt(t.id), t.title && (it(t.title), k.current = t.title), P(t.body), ft(t.priority), St(t.labelIds), W(t.fields), Ct(t.typeId ?? null));
|
|
237
237
|
},
|
|
238
|
-
placeholder:
|
|
238
|
+
placeholder: at("choose"),
|
|
239
239
|
trigger: /* @__PURE__ */ f("button", {
|
|
240
240
|
type: "button",
|
|
241
241
|
className: $,
|
|
242
|
-
children: [/* @__PURE__ */ d(
|
|
242
|
+
children: [/* @__PURE__ */ d(se, { className: "size-3.5" }), rt?.name ?? at("choose")]
|
|
243
243
|
})
|
|
244
244
|
}),
|
|
245
245
|
K.length > 0 && /* @__PURE__ */ d(s, {
|
|
@@ -248,41 +248,47 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
248
248
|
items: K.map((e) => ({
|
|
249
249
|
value: e.id,
|
|
250
250
|
label: e.name,
|
|
251
|
-
icon: /* @__PURE__ */ d(
|
|
251
|
+
icon: /* @__PURE__ */ d(ke, {
|
|
252
252
|
type: e,
|
|
253
253
|
className: "size-3.5"
|
|
254
254
|
})
|
|
255
255
|
})),
|
|
256
|
-
value:
|
|
256
|
+
value: G,
|
|
257
257
|
onValueChange: (e) => {
|
|
258
258
|
let t = K.find((t) => t.id === e);
|
|
259
|
-
|
|
259
|
+
Ct(t?.id ?? null), t?.template && !N.trim() && P(t.template);
|
|
260
260
|
},
|
|
261
|
-
placeholder:
|
|
261
|
+
placeholder: Tt("type"),
|
|
262
262
|
trigger: /* @__PURE__ */ f("button", {
|
|
263
263
|
type: "button",
|
|
264
264
|
className: $,
|
|
265
|
-
children: [q && /* @__PURE__ */ d(
|
|
265
|
+
children: [q && /* @__PURE__ */ d(ke, {
|
|
266
266
|
type: q,
|
|
267
267
|
className: "size-3.5"
|
|
268
|
-
}), q?.name ??
|
|
268
|
+
}), q?.name ?? Tt("type")]
|
|
269
269
|
})
|
|
270
270
|
}),
|
|
271
271
|
/* @__PURE__ */ d(s, {
|
|
272
272
|
open: J === "status",
|
|
273
273
|
onOpenChange: (e) => Y(e ? "status" : null),
|
|
274
|
-
items:
|
|
274
|
+
items: T.map((e) => ({
|
|
275
275
|
value: e.id,
|
|
276
276
|
label: e.name,
|
|
277
|
-
icon: /* @__PURE__ */ d(
|
|
277
|
+
icon: /* @__PURE__ */ d(ue, {
|
|
278
|
+
category: e.category,
|
|
279
|
+
step: e.step
|
|
280
|
+
})
|
|
278
281
|
})),
|
|
279
|
-
value:
|
|
280
|
-
onValueChange: (e) => e !== null &&
|
|
281
|
-
placeholder:
|
|
282
|
+
value: X?.id ?? null,
|
|
283
|
+
onValueChange: (e) => e !== null && dt(e),
|
|
284
|
+
placeholder: A("changeStatus"),
|
|
282
285
|
trigger: /* @__PURE__ */ f("button", {
|
|
283
286
|
type: "button",
|
|
284
287
|
className: $,
|
|
285
|
-
children: [
|
|
288
|
+
children: [X && /* @__PURE__ */ d(ue, {
|
|
289
|
+
category: X.category,
|
|
290
|
+
step: X.step
|
|
291
|
+
}), X?.name ?? j("status")]
|
|
286
292
|
})
|
|
287
293
|
}),
|
|
288
294
|
/* @__PURE__ */ d(s, {
|
|
@@ -296,115 +302,115 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
296
302
|
0
|
|
297
303
|
].map((e) => ({
|
|
298
304
|
value: String(e),
|
|
299
|
-
label:
|
|
300
|
-
icon: /* @__PURE__ */ d(
|
|
305
|
+
label: st[e] ?? "",
|
|
306
|
+
icon: /* @__PURE__ */ d(le, { priority: e })
|
|
301
307
|
})),
|
|
302
|
-
value: String(
|
|
303
|
-
onValueChange: (e) => e !== null &&
|
|
304
|
-
placeholder:
|
|
308
|
+
value: String(F),
|
|
309
|
+
onValueChange: (e) => e !== null && ft(Number(e)),
|
|
310
|
+
placeholder: A("setPriority"),
|
|
305
311
|
trigger: /* @__PURE__ */ f("button", {
|
|
306
312
|
type: "button",
|
|
307
313
|
className: $,
|
|
308
|
-
children: [/* @__PURE__ */ d(
|
|
314
|
+
children: [/* @__PURE__ */ d(le, { priority: F }), F ? st[F] : j("priority")]
|
|
309
315
|
})
|
|
310
316
|
}),
|
|
311
317
|
/* @__PURE__ */ d(s, {
|
|
312
318
|
multiple: !0,
|
|
313
319
|
open: J === "assignees",
|
|
314
320
|
onOpenChange: (e) => Y(e ? "assignees" : null),
|
|
315
|
-
items:
|
|
316
|
-
value:
|
|
321
|
+
items: ot,
|
|
322
|
+
value: V,
|
|
317
323
|
onValueChange: (e) => {
|
|
318
|
-
|
|
324
|
+
xt(e), Et();
|
|
319
325
|
},
|
|
320
|
-
placeholder:
|
|
326
|
+
placeholder: A("assignTo"),
|
|
321
327
|
trigger: /* @__PURE__ */ f("button", {
|
|
322
328
|
type: "button",
|
|
323
329
|
className: $,
|
|
324
|
-
children: [/* @__PURE__ */ d(
|
|
330
|
+
children: [/* @__PURE__ */ d(fe, { className: "size-3.5" }), V.length ? A("assignedCount", { count: V.length }) : j("assignee")]
|
|
325
331
|
})
|
|
326
332
|
}),
|
|
327
333
|
/* @__PURE__ */ d(s, {
|
|
328
334
|
multiple: !0,
|
|
329
335
|
open: J === "labels",
|
|
330
336
|
onOpenChange: (e) => Y(e ? "labels" : null),
|
|
331
|
-
items:
|
|
337
|
+
items: tt.map((e) => ({
|
|
332
338
|
value: e.id,
|
|
333
339
|
label: e.name,
|
|
334
340
|
icon: /* @__PURE__ */ f("span", {
|
|
335
341
|
className: "flex items-center gap-2",
|
|
336
|
-
children: [/* @__PURE__ */ d(
|
|
342
|
+
children: [/* @__PURE__ */ d(_e, {}), /* @__PURE__ */ d("span", {
|
|
337
343
|
className: "size-2.5 rounded-full",
|
|
338
344
|
style: { background: e.color }
|
|
339
345
|
})]
|
|
340
346
|
})
|
|
341
347
|
})),
|
|
342
|
-
value:
|
|
348
|
+
value: H,
|
|
343
349
|
onValueChange: (e) => {
|
|
344
|
-
|
|
350
|
+
St(e), Dt();
|
|
345
351
|
},
|
|
346
|
-
placeholder:
|
|
352
|
+
placeholder: A("addLabels"),
|
|
347
353
|
trigger: /* @__PURE__ */ f("button", {
|
|
348
354
|
type: "button",
|
|
349
355
|
className: $,
|
|
350
|
-
children: [/* @__PURE__ */ d(
|
|
356
|
+
children: [/* @__PURE__ */ d(de, { className: "size-3.5" }), H.length ? A("labelCount", { count: H.length }) : j("labels")]
|
|
351
357
|
})
|
|
352
358
|
}),
|
|
353
|
-
|
|
359
|
+
B !== "none" && /* @__PURE__ */ d(s, {
|
|
354
360
|
open: J === "estimate",
|
|
355
361
|
onOpenChange: (e) => Y(e ? "estimate" : null),
|
|
356
|
-
items: [0, ...
|
|
362
|
+
items: [0, ...he(B)].map((e) => ({
|
|
357
363
|
value: String(e),
|
|
358
|
-
label: e ?
|
|
364
|
+
label: e ? gt(e, B) : z("noEstimate")
|
|
359
365
|
})),
|
|
360
|
-
value: String(
|
|
361
|
-
onValueChange: (e) => e !== null &&
|
|
362
|
-
placeholder:
|
|
366
|
+
value: String(I),
|
|
367
|
+
onValueChange: (e) => e !== null && pt(Number(e)),
|
|
368
|
+
placeholder: z("setEstimate"),
|
|
363
369
|
trigger: /* @__PURE__ */ f("button", {
|
|
364
370
|
type: "button",
|
|
365
371
|
className: $,
|
|
366
|
-
children: [/* @__PURE__ */ d(
|
|
372
|
+
children: [/* @__PURE__ */ d(oe, { className: "size-3.5" }), I ? gt(I, B) : z("estimate")]
|
|
367
373
|
})
|
|
368
374
|
}),
|
|
369
|
-
|
|
375
|
+
Vt?.cyclesEnabled && /* @__PURE__ */ d(s, {
|
|
370
376
|
open: J === "cycle",
|
|
371
377
|
onOpenChange: (e) => Y(e ? "cycle" : null),
|
|
372
378
|
items: [{
|
|
373
379
|
value: "",
|
|
374
|
-
label:
|
|
375
|
-
}, ...
|
|
380
|
+
label: z("noCycle")
|
|
381
|
+
}, ...vt.filter((e) => e.state !== "past").map((e) => ({
|
|
376
382
|
value: e.id,
|
|
377
|
-
label:
|
|
378
|
-
description:
|
|
379
|
-
state:
|
|
380
|
-
dates:
|
|
383
|
+
label: bt(e),
|
|
384
|
+
description: z("stateAndDates", {
|
|
385
|
+
state: z(`states.${e.state}`),
|
|
386
|
+
dates: _t.dayRange(e.startsOn, e.endsOn)
|
|
381
387
|
})
|
|
382
388
|
}))],
|
|
383
|
-
value:
|
|
384
|
-
onValueChange: (e) => e !== null &&
|
|
385
|
-
placeholder:
|
|
389
|
+
value: R,
|
|
390
|
+
onValueChange: (e) => e !== null && ht(e),
|
|
391
|
+
placeholder: z("cycleLabel"),
|
|
386
392
|
trigger: /* @__PURE__ */ f("button", {
|
|
387
393
|
type: "button",
|
|
388
394
|
className: $,
|
|
389
|
-
children: [/* @__PURE__ */ d(
|
|
395
|
+
children: [/* @__PURE__ */ d(ae, { className: "size-3.5" }), yt ? bt(yt) : z("cycleLabel")]
|
|
390
396
|
})
|
|
391
397
|
}),
|
|
392
|
-
/* @__PURE__ */ d(
|
|
393
|
-
value:
|
|
394
|
-
onValueChange:
|
|
395
|
-
"aria-label":
|
|
398
|
+
/* @__PURE__ */ d(Re, {
|
|
399
|
+
value: L,
|
|
400
|
+
onValueChange: mt,
|
|
401
|
+
"aria-label": z("dueDate"),
|
|
396
402
|
trigger: /* @__PURE__ */ f("button", {
|
|
397
403
|
type: "button",
|
|
398
404
|
className: $,
|
|
399
|
-
children: [/* @__PURE__ */ d(
|
|
405
|
+
children: [/* @__PURE__ */ d(ie, { className: "size-3.5" }), L ? z("dueOn", { date: _t.day(L) }) : z("dueDate")]
|
|
400
406
|
})
|
|
401
407
|
}),
|
|
402
|
-
/* @__PURE__ */ d(
|
|
408
|
+
/* @__PURE__ */ d(je, { onFiles: (e) => void Rt(e) })
|
|
403
409
|
] })
|
|
404
|
-
}),
|
|
410
|
+
}), Nt] });
|
|
405
411
|
}
|
|
406
412
|
var h = (e) => `tandem:new-issue-draft:${e}`;
|
|
407
|
-
function
|
|
413
|
+
function qe(e) {
|
|
408
414
|
try {
|
|
409
415
|
let t = JSON.parse(localStorage.getItem(h(e)) ?? "null");
|
|
410
416
|
return t && typeof t.title == "string" && typeof t.body == "string" ? t : void 0;
|
|
@@ -412,7 +418,7 @@ function Ke(e) {
|
|
|
412
418
|
return;
|
|
413
419
|
}
|
|
414
420
|
}
|
|
415
|
-
function
|
|
421
|
+
function Je(e, t) {
|
|
416
422
|
try {
|
|
417
423
|
t.title.trim() || t.body.trim() ? localStorage.setItem(h(e), JSON.stringify(t)) : localStorage.removeItem(h(e));
|
|
418
424
|
} catch {}
|