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