@parallelworks/tandem-web 0.160.1 → 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 +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 +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,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,41 @@ 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, { category: e.category })
|
|
278
278
|
})),
|
|
279
|
-
value:
|
|
280
|
-
onValueChange: (e) => e !== null &&
|
|
281
|
-
placeholder:
|
|
279
|
+
value: X?.id ?? null,
|
|
280
|
+
onValueChange: (e) => e !== null && dt(e),
|
|
281
|
+
placeholder: A("changeStatus"),
|
|
282
282
|
trigger: /* @__PURE__ */ f("button", {
|
|
283
283
|
type: "button",
|
|
284
284
|
className: $,
|
|
285
|
-
children: [
|
|
285
|
+
children: [X && /* @__PURE__ */ d(ue, { category: X.category }), X?.name ?? j("status")]
|
|
286
286
|
})
|
|
287
287
|
}),
|
|
288
288
|
/* @__PURE__ */ d(s, {
|
|
@@ -296,115 +296,115 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
|
|
|
296
296
|
0
|
|
297
297
|
].map((e) => ({
|
|
298
298
|
value: String(e),
|
|
299
|
-
label:
|
|
300
|
-
icon: /* @__PURE__ */ d(
|
|
299
|
+
label: st[e] ?? "",
|
|
300
|
+
icon: /* @__PURE__ */ d(le, { priority: e })
|
|
301
301
|
})),
|
|
302
|
-
value: String(
|
|
303
|
-
onValueChange: (e) => e !== null &&
|
|
304
|
-
placeholder:
|
|
302
|
+
value: String(F),
|
|
303
|
+
onValueChange: (e) => e !== null && ft(Number(e)),
|
|
304
|
+
placeholder: A("setPriority"),
|
|
305
305
|
trigger: /* @__PURE__ */ f("button", {
|
|
306
306
|
type: "button",
|
|
307
307
|
className: $,
|
|
308
|
-
children: [/* @__PURE__ */ d(
|
|
308
|
+
children: [/* @__PURE__ */ d(le, { priority: F }), F ? st[F] : j("priority")]
|
|
309
309
|
})
|
|
310
310
|
}),
|
|
311
311
|
/* @__PURE__ */ d(s, {
|
|
312
312
|
multiple: !0,
|
|
313
313
|
open: J === "assignees",
|
|
314
314
|
onOpenChange: (e) => Y(e ? "assignees" : null),
|
|
315
|
-
items:
|
|
316
|
-
value:
|
|
315
|
+
items: ot,
|
|
316
|
+
value: V,
|
|
317
317
|
onValueChange: (e) => {
|
|
318
|
-
|
|
318
|
+
xt(e), Et();
|
|
319
319
|
},
|
|
320
|
-
placeholder:
|
|
320
|
+
placeholder: A("assignTo"),
|
|
321
321
|
trigger: /* @__PURE__ */ f("button", {
|
|
322
322
|
type: "button",
|
|
323
323
|
className: $,
|
|
324
|
-
children: [/* @__PURE__ */ d(
|
|
324
|
+
children: [/* @__PURE__ */ d(fe, { className: "size-3.5" }), V.length ? A("assignedCount", { count: V.length }) : j("assignee")]
|
|
325
325
|
})
|
|
326
326
|
}),
|
|
327
327
|
/* @__PURE__ */ d(s, {
|
|
328
328
|
multiple: !0,
|
|
329
329
|
open: J === "labels",
|
|
330
330
|
onOpenChange: (e) => Y(e ? "labels" : null),
|
|
331
|
-
items:
|
|
331
|
+
items: tt.map((e) => ({
|
|
332
332
|
value: e.id,
|
|
333
333
|
label: e.name,
|
|
334
334
|
icon: /* @__PURE__ */ f("span", {
|
|
335
335
|
className: "flex items-center gap-2",
|
|
336
|
-
children: [/* @__PURE__ */ d(
|
|
336
|
+
children: [/* @__PURE__ */ d(_e, {}), /* @__PURE__ */ d("span", {
|
|
337
337
|
className: "size-2.5 rounded-full",
|
|
338
338
|
style: { background: e.color }
|
|
339
339
|
})]
|
|
340
340
|
})
|
|
341
341
|
})),
|
|
342
|
-
value:
|
|
342
|
+
value: H,
|
|
343
343
|
onValueChange: (e) => {
|
|
344
|
-
|
|
344
|
+
St(e), Dt();
|
|
345
345
|
},
|
|
346
|
-
placeholder:
|
|
346
|
+
placeholder: A("addLabels"),
|
|
347
347
|
trigger: /* @__PURE__ */ f("button", {
|
|
348
348
|
type: "button",
|
|
349
349
|
className: $,
|
|
350
|
-
children: [/* @__PURE__ */ d(
|
|
350
|
+
children: [/* @__PURE__ */ d(de, { className: "size-3.5" }), H.length ? A("labelCount", { count: H.length }) : j("labels")]
|
|
351
351
|
})
|
|
352
352
|
}),
|
|
353
|
-
|
|
353
|
+
B !== "none" && /* @__PURE__ */ d(s, {
|
|
354
354
|
open: J === "estimate",
|
|
355
355
|
onOpenChange: (e) => Y(e ? "estimate" : null),
|
|
356
|
-
items: [0, ...
|
|
356
|
+
items: [0, ...he(B)].map((e) => ({
|
|
357
357
|
value: String(e),
|
|
358
|
-
label: e ?
|
|
358
|
+
label: e ? gt(e, B) : z("noEstimate")
|
|
359
359
|
})),
|
|
360
|
-
value: String(
|
|
361
|
-
onValueChange: (e) => e !== null &&
|
|
362
|
-
placeholder:
|
|
360
|
+
value: String(I),
|
|
361
|
+
onValueChange: (e) => e !== null && pt(Number(e)),
|
|
362
|
+
placeholder: z("setEstimate"),
|
|
363
363
|
trigger: /* @__PURE__ */ f("button", {
|
|
364
364
|
type: "button",
|
|
365
365
|
className: $,
|
|
366
|
-
children: [/* @__PURE__ */ d(
|
|
366
|
+
children: [/* @__PURE__ */ d(oe, { className: "size-3.5" }), I ? gt(I, B) : z("estimate")]
|
|
367
367
|
})
|
|
368
368
|
}),
|
|
369
|
-
|
|
369
|
+
Vt?.cyclesEnabled && /* @__PURE__ */ d(s, {
|
|
370
370
|
open: J === "cycle",
|
|
371
371
|
onOpenChange: (e) => Y(e ? "cycle" : null),
|
|
372
372
|
items: [{
|
|
373
373
|
value: "",
|
|
374
|
-
label:
|
|
375
|
-
}, ...
|
|
374
|
+
label: z("noCycle")
|
|
375
|
+
}, ...vt.filter((e) => e.state !== "past").map((e) => ({
|
|
376
376
|
value: e.id,
|
|
377
|
-
label:
|
|
378
|
-
description:
|
|
379
|
-
state:
|
|
380
|
-
dates:
|
|
377
|
+
label: bt(e),
|
|
378
|
+
description: z("stateAndDates", {
|
|
379
|
+
state: z(`states.${e.state}`),
|
|
380
|
+
dates: _t.dayRange(e.startsOn, e.endsOn)
|
|
381
381
|
})
|
|
382
382
|
}))],
|
|
383
|
-
value:
|
|
384
|
-
onValueChange: (e) => e !== null &&
|
|
385
|
-
placeholder:
|
|
383
|
+
value: R,
|
|
384
|
+
onValueChange: (e) => e !== null && ht(e),
|
|
385
|
+
placeholder: z("cycleLabel"),
|
|
386
386
|
trigger: /* @__PURE__ */ f("button", {
|
|
387
387
|
type: "button",
|
|
388
388
|
className: $,
|
|
389
|
-
children: [/* @__PURE__ */ d(
|
|
389
|
+
children: [/* @__PURE__ */ d(ae, { className: "size-3.5" }), yt ? bt(yt) : z("cycleLabel")]
|
|
390
390
|
})
|
|
391
391
|
}),
|
|
392
|
-
/* @__PURE__ */ d(
|
|
393
|
-
value:
|
|
394
|
-
onValueChange:
|
|
395
|
-
"aria-label":
|
|
392
|
+
/* @__PURE__ */ d(Re, {
|
|
393
|
+
value: L,
|
|
394
|
+
onValueChange: mt,
|
|
395
|
+
"aria-label": z("dueDate"),
|
|
396
396
|
trigger: /* @__PURE__ */ f("button", {
|
|
397
397
|
type: "button",
|
|
398
398
|
className: $,
|
|
399
|
-
children: [/* @__PURE__ */ d(
|
|
399
|
+
children: [/* @__PURE__ */ d(ie, { className: "size-3.5" }), L ? z("dueOn", { date: _t.day(L) }) : z("dueDate")]
|
|
400
400
|
})
|
|
401
401
|
}),
|
|
402
|
-
/* @__PURE__ */ d(
|
|
402
|
+
/* @__PURE__ */ d(je, { onFiles: (e) => void Rt(e) })
|
|
403
403
|
] })
|
|
404
|
-
}),
|
|
404
|
+
}), Nt] });
|
|
405
405
|
}
|
|
406
406
|
var h = (e) => `tandem:new-issue-draft:${e}`;
|
|
407
|
-
function
|
|
407
|
+
function qe(e) {
|
|
408
408
|
try {
|
|
409
409
|
let t = JSON.parse(localStorage.getItem(h(e)) ?? "null");
|
|
410
410
|
return t && typeof t.title == "string" && typeof t.body == "string" ? t : void 0;
|
|
@@ -412,7 +412,7 @@ function Ke(e) {
|
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Je(e, t) {
|
|
416
416
|
try {
|
|
417
417
|
t.title.trim() || t.body.trim() ? localStorage.setItem(h(e), JSON.stringify(t)) : localStorage.removeItem(h(e));
|
|
418
418
|
} catch {}
|