@parallelworks/tandem-web 0.150.3 → 0.151.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 +32 -3
- package/_virtual/_virtual_i18n/es/common.js +32 -3
- package/_virtual/_virtual_i18n/ja/common.js +32 -3
- package/_virtual/_virtual_i18n/ko/common.js +32 -3
- package/_virtual/_virtual_i18n/zh/common.js +32 -3
- package/api/queries.js +88 -77
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +4 -4
- package/components/AgentWork.js +111 -111
- package/components/AreaLink.js +32 -0
- package/components/AreaTiles.js +10 -13
- package/components/AreaWork.js +25 -1
- package/components/BugRotation.js +3 -3
- package/components/CodeHostSettings.js +30 -30
- package/components/CommandPalette.js +53 -53
- package/components/CustomFields.js +116 -116
- package/components/DateChip.js +11 -11
- package/components/DocButton.js +6 -6
- package/components/DocHistory.js +4 -4
- package/components/DocLinkPicker.js +8 -8
- package/components/DocProperties.js +15 -15
- package/components/DocTable.js +15 -15
- package/components/DocsTree.js +80 -80
- package/components/Editor.js +35 -35
- package/components/FavoritesNav.js +53 -53
- package/components/GitHub.js +18 -18
- package/components/Graph.js +15 -15
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +38 -38
- package/components/IssueBoard.js +4 -4
- package/components/IssueCode.js +14 -14
- package/components/IssueEvent.js +3 -3
- package/components/IssueFilters.js +71 -71
- package/components/IssueListBlock.js +32 -32
- package/components/IssueRow.js +21 -21
- package/components/IssueTemplates.js +118 -118
- package/components/IssueTypes.js +40 -40
- package/components/NewIssueDialog.js +76 -76
- package/components/NewProjectDialog.js +145 -145
- package/components/PersonActivity.js +4 -4
- package/components/SharedViewer.js +5 -5
- package/components/SlashMenu.js +29 -29
- package/components/TeamRepositories.js +51 -51
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +20 -20
- package/components/Updates.js +3 -3
- package/components/Widgets.js +20 -20
- package/components/columns.js +17 -17
- package/components/editorPlugins.js +80 -80
- package/components/mathDiagrams.js +17 -17
- package/lib/boardMove.js +5 -5
- package/lib/issueList.js +58 -58
- package/lib/issueMenu.js +27 -27
- package/lib/knowledge.js +106 -106
- package/lib/views.js +9 -9
- package/package.json +1 -1
- package/pages/area.js +291 -0
- package/pages/areas.js +258 -287
- package/pages/decisions.js +21 -21
- package/pages/issues.js +52 -52
- package/pages/projects.js +125 -125
- package/pages/triage.js +12 -12
- package/routeTree.gen.js +186 -180
- package/routes/_workspace/agents/_slug2.js +11 -11
- package/routes/_workspace/agents/index2.js +10 -10
- package/routes/_workspace/areas/_area.js +7 -8
- package/routes/_workspace/areas/_area2.js +3 -290
- package/routes/_workspace/areas/_area3.js +7 -8
- package/routes/_workspace/docs/_doc2.js +230 -230
- package/routes/_workspace/docs/space2._space.js +27 -27
- package/routes/_workspace/issues/_identifier2.js +222 -224
- package/routes/_workspace/knowledge/_term2.js +43 -43
- package/routes/_workspace/knowledge/index.js +6 -6
- package/routes/_workspace/knowledge/index2.js +15 -15
- package/routes/_workspace/measures3.js +70 -72
- package/routes/_workspace/notifications2.js +150 -150
- package/routes/_workspace/people/_username2.js +10 -10
- package/routes/_workspace/projects/_projectId3.js +276 -276
- package/routes/_workspace/settings/audit-log3.js +136 -138
- package/routes/_workspace/settings/fields2.js +11 -11
- package/routes/_workspace/settings/github2.js +6 -6
- package/routes/_workspace/settings/groups2.js +26 -26
- package/routes/_workspace/settings/import2.js +398 -147
- package/routes/_workspace/settings/import3.js +7 -3
- package/routes/_workspace/settings/index2.js +6 -6
- package/routes/_workspace/settings/labels2.js +21 -21
- package/routes/_workspace/settings/members2.js +27 -27
- package/routes/_workspace/settings/notifications2.js +8 -8
- package/routes/_workspace/settings/parallelworks2.js +32 -32
- package/routes/_workspace/settings/roles2.js +24 -24
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +17 -17
- package/routes/_workspace/settings/slack2.js +7 -7
- package/routes/_workspace/settings/sso2.js +31 -31
- package/routes/_workspace/settings/teams2.js +25 -25
- package/routes/_workspace/settings/tokens2.js +12 -12
- package/routes/_workspace/settings/webhooks2.js +13 -13
- package/routes/_workspace/teams/_key/areas/_area.js +8 -0
- package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
- package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
- package/routes/_workspace/teams/_key/areas/index.js +6 -0
- package/routes/_workspace/teams/_key/areas/index2.js +4 -0
- package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
- package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
- package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
- package/routes/_workspace/teams/_key/settings2.js +29 -29
- package/routes/_workspace2.js +368 -368
- package/routes/_workspace/teams/_key/areas.js +0 -6
- package/routes/_workspace/teams/_key/areas2.js +0 -4
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { issueTemplatesQuery as n, labelsQuery as r, teamsQuery as i } from "../api/queries.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { AddIcon as a, PriorityIcon as o, usePriorityNames as s } from "./icons.js";
|
|
4
|
+
import { PropertyField as c } from "./DocProperties.js";
|
|
5
|
+
import { customFieldsQuery as l, fieldsFor as u } from "../lib/customFields.js";
|
|
6
|
+
import { useConfirm as d } from "../lib/confirm.js";
|
|
7
|
+
import { issueTypesQuery as f, typesFor as p } from "../lib/issueTypes.js";
|
|
8
|
+
import { TypeIcon as m } from "./IssueTypes.js";
|
|
9
9
|
import { Editor as h } from "./Editor.js";
|
|
10
10
|
import { Button as g, Combobox as _, DatePicker as v, Input as y, Modal as ee, Select as b, SettingsCard as x, menuDivider as S } from "@parallelworks/ui";
|
|
11
11
|
import { useId as C, useState as w } from "react";
|
|
12
|
-
import { useErrorMessage as
|
|
13
|
-
import { useFormatter as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { useMutation as
|
|
16
|
-
import { MoreButton as
|
|
12
|
+
import { useErrorMessage as te } from "@parallelworks/problem/react";
|
|
13
|
+
import { useFormatter as T, useTranslations as E } from "use-intl";
|
|
14
|
+
import { Fragment as ne, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
15
|
+
import { useMutation as k, useQuery as A, useQueryClient as j } from "@tanstack/react-query";
|
|
16
|
+
import { MoreButton as M } from "@parallelworks/ui/list";
|
|
17
17
|
// src/components/IssueTemplates.tsx
|
|
18
|
-
function
|
|
19
|
-
let s =
|
|
18
|
+
function N({ workspace: r, teamKey: i, isAdmin: o }) {
|
|
19
|
+
let s = E("issueTemplates"), c = T(), l = E("common"), u = j(), { data: f = [] } = A(n(r, i)), [p, m] = w(null), { confirm: h, dialog: _ } = d(), v = k({
|
|
20
20
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/teams/{key}/issue-templates/{templateId}", { params: { path: {
|
|
21
21
|
workspace: r,
|
|
22
22
|
key: i,
|
|
23
23
|
templateId: n
|
|
24
24
|
} } })),
|
|
25
|
-
onSettled: () =>
|
|
25
|
+
onSettled: () => u.invalidateQueries({ queryKey: n(r, i).queryKey })
|
|
26
26
|
});
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ O(x, {
|
|
28
28
|
title: s("title"),
|
|
29
29
|
description: s("description"),
|
|
30
|
-
action: o && /* @__PURE__ */
|
|
30
|
+
action: o && /* @__PURE__ */ D(g, {
|
|
31
31
|
variant: "outline",
|
|
32
32
|
size: "sm",
|
|
33
|
-
icon: /* @__PURE__ */
|
|
33
|
+
icon: /* @__PURE__ */ D(a, { className: "size-3.5" }),
|
|
34
34
|
onClick: () => m("new"),
|
|
35
35
|
children: s("new")
|
|
36
36
|
}),
|
|
37
37
|
children: [
|
|
38
|
-
f.length === 0 ? /* @__PURE__ */
|
|
38
|
+
f.length === 0 ? /* @__PURE__ */ D("p", {
|
|
39
39
|
className: "px-4 py-3 text-sm text-muted-foreground",
|
|
40
40
|
children: s("none")
|
|
41
|
-
}) : /* @__PURE__ */
|
|
41
|
+
}) : /* @__PURE__ */ D("ul", { children: f.map((e) => /* @__PURE__ */ O("li", {
|
|
42
42
|
className: "flex items-center gap-3 border-b border-border/60 px-4 py-2.5 last:border-b-0",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ O("span", {
|
|
44
44
|
className: "min-w-0 flex-1",
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ D("span", {
|
|
47
47
|
className: "block truncate text-sm font-medium",
|
|
48
48
|
children: e.name
|
|
49
49
|
}),
|
|
50
|
-
e.title && /* @__PURE__ */
|
|
50
|
+
e.title && /* @__PURE__ */ D("span", {
|
|
51
51
|
className: "block truncate text-xs text-muted-foreground",
|
|
52
52
|
children: e.title
|
|
53
53
|
}),
|
|
54
|
-
e.repeat && e.nextAt && /* @__PURE__ */
|
|
54
|
+
e.repeat && e.nextAt && /* @__PURE__ */ D("span", {
|
|
55
55
|
className: "block truncate text-xs text-muted-foreground",
|
|
56
56
|
children: s("schedule", {
|
|
57
57
|
repeat: s(`repeats.${e.repeat}`),
|
|
@@ -59,7 +59,7 @@ function P({ workspace: r, teamKey: i, isAdmin: o }) {
|
|
|
59
59
|
})
|
|
60
60
|
})
|
|
61
61
|
]
|
|
62
|
-
}), o && /* @__PURE__ */
|
|
62
|
+
}), o && /* @__PURE__ */ D(M, {
|
|
63
63
|
label: l("moreActionsFor", { name: e.name }),
|
|
64
64
|
items: () => [
|
|
65
65
|
{
|
|
@@ -80,7 +80,7 @@ function P({ workspace: r, teamKey: i, isAdmin: o }) {
|
|
|
80
80
|
]
|
|
81
81
|
})]
|
|
82
82
|
}, e.id)) }),
|
|
83
|
-
p && /* @__PURE__ */
|
|
83
|
+
p && /* @__PURE__ */ D(P, {
|
|
84
84
|
workspace: r,
|
|
85
85
|
teamKey: i,
|
|
86
86
|
template: p === "new" ? void 0 : p,
|
|
@@ -90,8 +90,8 @@ function P({ workspace: r, teamKey: i, isAdmin: o }) {
|
|
|
90
90
|
]
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
let
|
|
93
|
+
function P({ workspace: a, teamKey: d, template: x, onClose: S }) {
|
|
94
|
+
let M = E("issueTemplates"), N = T(), P = E("common"), R = te(), z = s(), B = j(), { data: V = [] } = A(r(a)), [H, U] = w({
|
|
95
95
|
name: x?.name ?? "",
|
|
96
96
|
title: x?.title ?? "",
|
|
97
97
|
body: x?.body ?? "",
|
|
@@ -104,154 +104,154 @@ function F({ workspace: a, teamKey: u, template: x, onClose: S }) {
|
|
|
104
104
|
nextAt: x.nextAt,
|
|
105
105
|
timeZone: x.timeZone
|
|
106
106
|
}
|
|
107
|
-
}), [
|
|
107
|
+
}), [W, re] = w(!1), G = C(), K = C(), q = (e) => U((t) => ({
|
|
108
108
|
...t,
|
|
109
109
|
...e
|
|
110
|
-
})), J =
|
|
110
|
+
})), J = k({
|
|
111
111
|
mutationFn: async () => t(x ? await e.PUT("/api/v1/workspaces/{workspace}/teams/{key}/issue-templates/{templateId}", {
|
|
112
112
|
params: { path: {
|
|
113
113
|
workspace: a,
|
|
114
|
-
key:
|
|
114
|
+
key: d,
|
|
115
115
|
templateId: x.id
|
|
116
116
|
} },
|
|
117
|
-
body:
|
|
117
|
+
body: H
|
|
118
118
|
}) : await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issue-templates", {
|
|
119
119
|
params: { path: {
|
|
120
120
|
workspace: a,
|
|
121
|
-
key:
|
|
121
|
+
key: d
|
|
122
122
|
} },
|
|
123
|
-
body:
|
|
123
|
+
body: H
|
|
124
124
|
})),
|
|
125
125
|
onSuccess: () => {
|
|
126
|
-
|
|
126
|
+
B.invalidateQueries({ queryKey: n(a, d).queryKey }), S();
|
|
127
127
|
}
|
|
128
|
-
}), Y =
|
|
129
|
-
return /* @__PURE__ */
|
|
128
|
+
}), Y = V.filter((e) => H.labelIds?.includes(e.id)), { data: X = [] } = A(i(a)), { data: ie } = A(l(a)), Z = u(ie, "issue", X.find((e) => e.key === d)?.id), ae = E("customFields"), Q = E("issueTypes"), { data: oe } = A(f(a)), $ = p(oe, X.find((e) => e.key === d)?.id);
|
|
129
|
+
return /* @__PURE__ */ D(ee, {
|
|
130
130
|
open: !0,
|
|
131
131
|
onClose: S,
|
|
132
132
|
size: "lg",
|
|
133
|
-
title:
|
|
134
|
-
footer: /* @__PURE__ */
|
|
133
|
+
title: M(x ? "editTitle" : "newTitle"),
|
|
134
|
+
footer: /* @__PURE__ */ O(ne, { children: [/* @__PURE__ */ D(g, {
|
|
135
135
|
variant: "secondary",
|
|
136
136
|
onClick: S,
|
|
137
|
-
children:
|
|
138
|
-
}), /* @__PURE__ */
|
|
137
|
+
children: P("cancel")
|
|
138
|
+
}), /* @__PURE__ */ D(g, {
|
|
139
139
|
variant: "primary",
|
|
140
140
|
loading: J.isPending,
|
|
141
|
-
disabled: !
|
|
141
|
+
disabled: !H.name.trim(),
|
|
142
142
|
onClick: () => J.mutate(),
|
|
143
|
-
children: x ?
|
|
143
|
+
children: x ? P("save") : M("create")
|
|
144
144
|
})] }),
|
|
145
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ O("form", {
|
|
146
146
|
className: "space-y-3",
|
|
147
147
|
onSubmit: (e) => {
|
|
148
148
|
e.preventDefault(), J.mutate();
|
|
149
149
|
},
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ D("label", {
|
|
152
152
|
htmlFor: G,
|
|
153
153
|
className: "block text-xs font-medium text-muted-foreground",
|
|
154
|
-
children:
|
|
154
|
+
children: M("name")
|
|
155
155
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ D(y, {
|
|
157
157
|
id: G,
|
|
158
|
-
value:
|
|
158
|
+
value: H.name,
|
|
159
159
|
onChange: (e) => q({ name: e.target.value }),
|
|
160
|
-
placeholder:
|
|
160
|
+
placeholder: M("namePlaceholder"),
|
|
161
161
|
maxLength: 80,
|
|
162
162
|
className: "-mt-2",
|
|
163
163
|
autoFocus: !0
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ D("label", {
|
|
166
166
|
htmlFor: K,
|
|
167
167
|
className: "block text-xs font-medium text-muted-foreground",
|
|
168
|
-
children:
|
|
168
|
+
children: M("issueTitle")
|
|
169
169
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ D(y, {
|
|
171
171
|
id: K,
|
|
172
|
-
value:
|
|
172
|
+
value: H.title ?? "",
|
|
173
173
|
onChange: (e) => q({ title: e.target.value }),
|
|
174
|
-
placeholder:
|
|
174
|
+
placeholder: M("issueTitlePlaceholder"),
|
|
175
175
|
maxLength: 200,
|
|
176
176
|
className: "-mt-2"
|
|
177
177
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ O("div", {
|
|
179
179
|
className: "text-xs font-medium text-muted-foreground",
|
|
180
|
-
children: [
|
|
180
|
+
children: [M("body"), /* @__PURE__ */ D("div", {
|
|
181
181
|
className: "mt-1 min-h-32 rounded-md border border-border px-3 py-2 text-sm font-normal text-foreground",
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
value:
|
|
182
|
+
children: /* @__PURE__ */ D(h, {
|
|
183
|
+
value: H.body ?? "",
|
|
184
184
|
onChange: (e) => q({ body: e }),
|
|
185
|
-
label:
|
|
185
|
+
label: M("body"),
|
|
186
186
|
className: "min-h-28"
|
|
187
187
|
})
|
|
188
188
|
})]
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ O("div", {
|
|
191
191
|
className: "flex flex-wrap items-end gap-3",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ O("div", {
|
|
193
193
|
className: "text-xs font-medium text-muted-foreground",
|
|
194
|
-
children: [
|
|
194
|
+
children: [M("priority"), /* @__PURE__ */ D("div", {
|
|
195
195
|
className: "mt-1",
|
|
196
|
-
children: /* @__PURE__ */
|
|
197
|
-
value: String(
|
|
198
|
-
items:
|
|
196
|
+
children: /* @__PURE__ */ D(b, {
|
|
197
|
+
value: String(H.priority ?? 0),
|
|
198
|
+
items: z.map((e, t) => ({
|
|
199
199
|
value: String(t),
|
|
200
200
|
label: e,
|
|
201
|
-
icon: /* @__PURE__ */
|
|
201
|
+
icon: /* @__PURE__ */ D(o, { priority: t })
|
|
202
202
|
})),
|
|
203
203
|
onValueChange: (e) => e !== null && q({ priority: Number(e) }),
|
|
204
|
-
"aria-label":
|
|
204
|
+
"aria-label": M("priority")
|
|
205
205
|
})
|
|
206
206
|
})]
|
|
207
|
-
}), /* @__PURE__ */
|
|
207
|
+
}), /* @__PURE__ */ O("div", {
|
|
208
208
|
className: "text-xs font-medium text-muted-foreground",
|
|
209
|
-
children: [
|
|
209
|
+
children: [M("labels"), /* @__PURE__ */ D("div", {
|
|
210
210
|
className: "mt-1",
|
|
211
|
-
children: /* @__PURE__ */
|
|
212
|
-
open:
|
|
211
|
+
children: /* @__PURE__ */ D(_, {
|
|
212
|
+
open: W,
|
|
213
213
|
onOpenChange: re,
|
|
214
214
|
multiple: !0,
|
|
215
|
-
items:
|
|
215
|
+
items: V.map((e) => ({
|
|
216
216
|
value: e.id,
|
|
217
217
|
label: e.name,
|
|
218
|
-
icon: /* @__PURE__ */
|
|
218
|
+
icon: /* @__PURE__ */ D("span", {
|
|
219
219
|
className: "size-2.5 rounded-full",
|
|
220
220
|
style: { background: e.color }
|
|
221
221
|
})
|
|
222
222
|
})),
|
|
223
|
-
value:
|
|
223
|
+
value: H.labelIds ?? [],
|
|
224
224
|
onValueChange: (e) => q({ labelIds: e }),
|
|
225
|
-
placeholder:
|
|
226
|
-
trigger: /* @__PURE__ */
|
|
225
|
+
placeholder: M("labels"),
|
|
226
|
+
trigger: /* @__PURE__ */ D(g, {
|
|
227
227
|
type: "button",
|
|
228
228
|
className: "font-normal",
|
|
229
|
-
children: Y.length ? Y.map((e) => e.name).join(", ") :
|
|
229
|
+
children: Y.length ? Y.map((e) => e.name).join(", ") : M("noLabels")
|
|
230
230
|
})
|
|
231
231
|
})
|
|
232
232
|
})]
|
|
233
233
|
})]
|
|
234
234
|
}),
|
|
235
|
-
$.length > 0 && /* @__PURE__ */
|
|
235
|
+
$.length > 0 && /* @__PURE__ */ O("div", {
|
|
236
236
|
className: "text-xs font-medium text-muted-foreground",
|
|
237
|
-
children: [Q("type"), /* @__PURE__ */
|
|
237
|
+
children: [Q("type"), /* @__PURE__ */ D("div", {
|
|
238
238
|
className: "mt-1 w-56",
|
|
239
|
-
children: /* @__PURE__ */
|
|
240
|
-
value:
|
|
239
|
+
children: /* @__PURE__ */ D(b, {
|
|
240
|
+
value: H.typeId ?? "",
|
|
241
241
|
items: [{
|
|
242
242
|
value: "",
|
|
243
243
|
label: Q("noType")
|
|
244
244
|
}, ...$.map((e) => ({
|
|
245
245
|
value: e.id,
|
|
246
246
|
label: e.name,
|
|
247
|
-
icon: /* @__PURE__ */
|
|
247
|
+
icon: /* @__PURE__ */ D(m, {
|
|
248
248
|
type: e,
|
|
249
249
|
className: "size-3.5"
|
|
250
250
|
})
|
|
251
251
|
}))],
|
|
252
252
|
onValueChange: (e) => {
|
|
253
|
-
let { typeId: t, ...n } =
|
|
254
|
-
|
|
253
|
+
let { typeId: t, ...n } = H;
|
|
254
|
+
U(e ? {
|
|
255
255
|
...n,
|
|
256
256
|
typeId: e
|
|
257
257
|
} : n);
|
|
@@ -261,39 +261,39 @@ function F({ workspace: a, teamKey: u, template: x, onClose: S }) {
|
|
|
261
261
|
})
|
|
262
262
|
})]
|
|
263
263
|
}),
|
|
264
|
-
Z.length > 0 && /* @__PURE__ */
|
|
264
|
+
Z.length > 0 && /* @__PURE__ */ O("fieldset", {
|
|
265
265
|
className: "space-y-0.5 text-sm",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ D("legend", {
|
|
267
267
|
className: "mb-1 text-xs font-medium text-muted-foreground",
|
|
268
268
|
children: ae("title")
|
|
269
|
-
}), Z.map((e) => /* @__PURE__ */
|
|
269
|
+
}), Z.map((e) => /* @__PURE__ */ O("div", {
|
|
270
270
|
className: "flex min-h-8 items-center gap-2",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ D("span", {
|
|
272
272
|
className: "w-36 shrink-0 truncate text-muted-foreground",
|
|
273
273
|
children: e.name
|
|
274
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ D("div", {
|
|
275
275
|
className: "min-w-0 flex-1",
|
|
276
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ D(c, {
|
|
277
277
|
workspace: a,
|
|
278
278
|
property: e,
|
|
279
|
-
value:
|
|
279
|
+
value: H.fields?.[e.id],
|
|
280
280
|
editable: !0,
|
|
281
281
|
onChange: (t) => q({ fields: {
|
|
282
|
-
...
|
|
282
|
+
...H.fields,
|
|
283
283
|
[e.id]: t
|
|
284
284
|
} })
|
|
285
285
|
})
|
|
286
286
|
})]
|
|
287
287
|
}, e.id))]
|
|
288
288
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ O("div", {
|
|
290
290
|
className: "flex flex-wrap items-end gap-3",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ O("div", {
|
|
292
292
|
className: "text-xs font-medium text-muted-foreground",
|
|
293
|
-
children: [
|
|
293
|
+
children: [M("repeat"), /* @__PURE__ */ D("div", {
|
|
294
294
|
className: "mt-1",
|
|
295
|
-
children: /* @__PURE__ */
|
|
296
|
-
value:
|
|
295
|
+
children: /* @__PURE__ */ D(b, {
|
|
296
|
+
value: H.repeat ?? "",
|
|
297
297
|
items: [
|
|
298
298
|
"",
|
|
299
299
|
"daily",
|
|
@@ -301,60 +301,60 @@ function F({ workspace: a, teamKey: u, template: x, onClose: S }) {
|
|
|
301
301
|
"monthly"
|
|
302
302
|
].map((e) => ({
|
|
303
303
|
value: e,
|
|
304
|
-
label:
|
|
304
|
+
label: M(`repeats.${e || "never"}`)
|
|
305
305
|
})),
|
|
306
306
|
onValueChange: (e) => {
|
|
307
|
-
if (!e) return
|
|
307
|
+
if (!e) return U(({ repeat: e, nextAt: t, timeZone: n, ...r }) => r);
|
|
308
308
|
q({
|
|
309
309
|
repeat: e,
|
|
310
|
-
nextAt:
|
|
311
|
-
timeZone:
|
|
310
|
+
nextAt: H.nextAt ?? L(new Date(Date.now() + 864e5)),
|
|
311
|
+
timeZone: H.timeZone ?? F()
|
|
312
312
|
});
|
|
313
313
|
},
|
|
314
|
-
"aria-label":
|
|
314
|
+
"aria-label": M("repeat")
|
|
315
315
|
})
|
|
316
316
|
})]
|
|
317
|
-
}),
|
|
317
|
+
}), H.repeat && /* @__PURE__ */ O("div", {
|
|
318
318
|
className: "text-xs font-medium text-muted-foreground",
|
|
319
|
-
children: [
|
|
319
|
+
children: [M("firstOn"), /* @__PURE__ */ D("div", {
|
|
320
320
|
className: "mt-1",
|
|
321
|
-
children: /* @__PURE__ */
|
|
322
|
-
value:
|
|
321
|
+
children: /* @__PURE__ */ D(v, {
|
|
322
|
+
value: H.nextAt ? I(H.nextAt) : "",
|
|
323
323
|
onValueChange: (e) => e && q({
|
|
324
|
-
nextAt:
|
|
325
|
-
timeZone:
|
|
324
|
+
nextAt: L(/* @__PURE__ */ new Date(`${e}T00:00`)),
|
|
325
|
+
timeZone: F()
|
|
326
326
|
}),
|
|
327
|
-
"aria-label":
|
|
328
|
-
trigger: /* @__PURE__ */
|
|
327
|
+
"aria-label": M("firstOn"),
|
|
328
|
+
trigger: /* @__PURE__ */ D(g, {
|
|
329
329
|
type: "button",
|
|
330
330
|
className: "font-normal",
|
|
331
|
-
children:
|
|
331
|
+
children: H.nextAt ? N.dateTime(new Date(H.nextAt), { dateStyle: "medium" }) : ""
|
|
332
332
|
})
|
|
333
333
|
})
|
|
334
334
|
})]
|
|
335
335
|
})]
|
|
336
336
|
}),
|
|
337
|
-
|
|
337
|
+
H.repeat && /* @__PURE__ */ D("p", {
|
|
338
338
|
className: "text-xs text-muted-foreground",
|
|
339
|
-
children:
|
|
339
|
+
children: M("repeatHelp")
|
|
340
340
|
}),
|
|
341
|
-
J.error && /* @__PURE__ */
|
|
341
|
+
J.error && /* @__PURE__ */ D("p", {
|
|
342
342
|
className: "text-sm text-danger",
|
|
343
|
-
children:
|
|
343
|
+
children: R(J.error)
|
|
344
344
|
})
|
|
345
345
|
]
|
|
346
346
|
})
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function F() {
|
|
350
350
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function I(e) {
|
|
353
353
|
let t = new Date(e), n = (e) => String(e).padStart(2, "0");
|
|
354
354
|
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())}`;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function L(e) {
|
|
357
357
|
let t = new Date(e);
|
|
358
358
|
return t.setHours(9, 0, 0, 0), t.toISOString();
|
|
359
359
|
}
|
|
360
|
-
export {
|
|
360
|
+
export { N as IssueTemplates };
|
package/components/IssueTypes.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { teamsQuery as e } from "../api/queries.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AddIcon as t } from "./icons.js";
|
|
3
3
|
import { customFieldsQuery as n } from "../lib/customFields.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useConfirm as r } from "../lib/confirm.js";
|
|
5
|
+
import { issueTypesQuery as i, useIssueTypeActions as a } from "../lib/issueTypes.js";
|
|
6
6
|
import { Button as o, ColorInput as s, ErrorText as c, IconButton as l, Input as u, Select as d, SettingsCard as f, Textarea as p, menuDivider as m, useOpenMenu as h } from "@parallelworks/ui";
|
|
7
7
|
import { useState as g } from "react";
|
|
8
8
|
import { useErrorMessage as _ } from "@parallelworks/problem/react";
|
|
@@ -23,44 +23,44 @@ function S({ type: e, className: t = "size-4" }) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function C({ workspace: e }) {
|
|
26
|
-
let
|
|
26
|
+
let n = v("issueTypes"), { data: r = [] } = x(i(e)), [a, s] = g(!1);
|
|
27
27
|
return /* @__PURE__ */ b(f, {
|
|
28
|
-
title:
|
|
29
|
-
description:
|
|
28
|
+
title: n("title"),
|
|
29
|
+
description: n("description"),
|
|
30
30
|
action: /* @__PURE__ */ y(o, {
|
|
31
31
|
size: "sm",
|
|
32
|
-
icon: /* @__PURE__ */ y(
|
|
32
|
+
icon: /* @__PURE__ */ y(t, {}),
|
|
33
33
|
onClick: () => s(!0),
|
|
34
|
-
children:
|
|
34
|
+
children: n("add")
|
|
35
35
|
}),
|
|
36
|
-
children: [
|
|
36
|
+
children: [a && /* @__PURE__ */ y("div", {
|
|
37
37
|
className: "p-2",
|
|
38
38
|
children: /* @__PURE__ */ y(T, {
|
|
39
39
|
workspace: e,
|
|
40
40
|
onDone: () => s(!1)
|
|
41
41
|
})
|
|
42
|
-
}),
|
|
42
|
+
}), r.length === 0 && !a ? /* @__PURE__ */ y("p", {
|
|
43
43
|
className: "px-3 py-3 text-sm text-muted-foreground",
|
|
44
|
-
children:
|
|
44
|
+
children: n("none")
|
|
45
45
|
}) : /* @__PURE__ */ y("ul", {
|
|
46
46
|
className: "divide-y divide-border",
|
|
47
|
-
children:
|
|
47
|
+
children: r.map((t, n) => /* @__PURE__ */ y(w, {
|
|
48
48
|
workspace: e,
|
|
49
49
|
type: t,
|
|
50
|
-
before: n
|
|
51
|
-
after: n
|
|
50
|
+
before: r[n - 1],
|
|
51
|
+
after: r[n + 1]
|
|
52
52
|
}, t.id))
|
|
53
53
|
})]
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
function w({ workspace:
|
|
57
|
-
let s = v("issueTypes"), c =
|
|
56
|
+
function w({ workspace: t, type: n, before: i, after: o }) {
|
|
57
|
+
let s = v("issueTypes"), c = a(t), u = h(), { confirm: d, dialog: f } = r(), [p, _] = g(!1), { data: C = [] } = x(e(t)), w = (e) => {
|
|
58
58
|
let t = {
|
|
59
|
-
...
|
|
59
|
+
...n,
|
|
60
60
|
...e
|
|
61
61
|
};
|
|
62
62
|
return {
|
|
63
|
-
id:
|
|
63
|
+
id: n.id,
|
|
64
64
|
name: t.name,
|
|
65
65
|
description: t.description ?? "",
|
|
66
66
|
icon: t.icon ?? "",
|
|
@@ -75,11 +75,11 @@ function w({ workspace: n, type: r, before: a, after: o }) {
|
|
|
75
75
|
label: s("edit"),
|
|
76
76
|
onClick: () => _(!0)
|
|
77
77
|
},
|
|
78
|
-
...
|
|
78
|
+
...i ? [{
|
|
79
79
|
label: s("moveUp"),
|
|
80
80
|
onClick: () => c.update.mutate({
|
|
81
81
|
...w({}),
|
|
82
|
-
position:
|
|
82
|
+
position: i.position - .5
|
|
83
83
|
})
|
|
84
84
|
}] : [],
|
|
85
85
|
...o ? [{
|
|
@@ -90,10 +90,10 @@ function w({ workspace: n, type: r, before: a, after: o }) {
|
|
|
90
90
|
})
|
|
91
91
|
}] : [],
|
|
92
92
|
{
|
|
93
|
-
label:
|
|
93
|
+
label: n.archivedAt ? s("restore") : s("archive"),
|
|
94
94
|
onClick: () => c.update.mutate({
|
|
95
95
|
...w({}),
|
|
96
|
-
archived: !
|
|
96
|
+
archived: !n.archivedAt
|
|
97
97
|
})
|
|
98
98
|
},
|
|
99
99
|
m,
|
|
@@ -101,38 +101,38 @@ function w({ workspace: n, type: r, before: a, after: o }) {
|
|
|
101
101
|
label: s("delete"),
|
|
102
102
|
destructive: !0,
|
|
103
103
|
onClick: () => d({
|
|
104
|
-
title: s("deleteTitle", { name:
|
|
105
|
-
description: s("deleteDescription", { count:
|
|
104
|
+
title: s("deleteTitle", { name: n.name }),
|
|
105
|
+
description: s("deleteDescription", { count: n.issues }),
|
|
106
106
|
confirmLabel: s("delete"),
|
|
107
|
-
onConfirm: () => c.remove.mutateAsync(
|
|
107
|
+
onConfirm: () => c.remove.mutateAsync(n.id)
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
110
|
];
|
|
111
111
|
if (p) return /* @__PURE__ */ y("li", {
|
|
112
112
|
className: "p-2",
|
|
113
113
|
children: /* @__PURE__ */ y(T, {
|
|
114
|
-
workspace:
|
|
115
|
-
type:
|
|
114
|
+
workspace: t,
|
|
115
|
+
type: n,
|
|
116
116
|
onDone: () => _(!1)
|
|
117
117
|
})
|
|
118
118
|
});
|
|
119
|
-
let D =
|
|
119
|
+
let D = n.teamIds.map((e) => C.find((t) => t.id === e)?.name).filter(Boolean).join(", ");
|
|
120
120
|
return /* @__PURE__ */ b("li", {
|
|
121
121
|
className: "flex min-h-10 items-center gap-3 px-3 py-1.5",
|
|
122
122
|
onContextMenu: (e) => u(e, E()),
|
|
123
123
|
children: [
|
|
124
|
-
/* @__PURE__ */ y(S, { type:
|
|
124
|
+
/* @__PURE__ */ y(S, { type: n }),
|
|
125
125
|
/* @__PURE__ */ b("div", {
|
|
126
126
|
className: "min-w-0 flex-1",
|
|
127
127
|
children: [/* @__PURE__ */ y("p", {
|
|
128
|
-
className: `truncate text-sm ${
|
|
129
|
-
children:
|
|
130
|
-
}),
|
|
128
|
+
className: `truncate text-sm ${n.archivedAt ? "text-muted-foreground" : ""}`,
|
|
129
|
+
children: n.name
|
|
130
|
+
}), n.description && /* @__PURE__ */ y("p", {
|
|
131
131
|
className: "truncate text-xs text-muted-foreground",
|
|
132
|
-
children:
|
|
132
|
+
children: n.description
|
|
133
133
|
})]
|
|
134
134
|
}),
|
|
135
|
-
|
|
135
|
+
n.archivedAt && /* @__PURE__ */ y("span", {
|
|
136
136
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
137
137
|
children: s("archived")
|
|
138
138
|
}),
|
|
@@ -142,12 +142,12 @@ function w({ workspace: n, type: r, before: a, after: o }) {
|
|
|
142
142
|
}),
|
|
143
143
|
/* @__PURE__ */ y("span", {
|
|
144
144
|
className: "w-20 shrink-0 text-right text-xs tabular-nums text-muted-foreground",
|
|
145
|
-
children: s("issues", { count:
|
|
145
|
+
children: s("issues", { count: n.issues })
|
|
146
146
|
}),
|
|
147
147
|
/* @__PURE__ */ y(l, {
|
|
148
148
|
variant: "ghost",
|
|
149
149
|
size: "sm",
|
|
150
|
-
label: s("actions", { name:
|
|
150
|
+
label: s("actions", { name: n.name }),
|
|
151
151
|
icon: /* @__PURE__ */ y("span", {
|
|
152
152
|
"aria-hidden": !0,
|
|
153
153
|
children: "⋯"
|
|
@@ -158,8 +158,8 @@ function w({ workspace: n, type: r, before: a, after: o }) {
|
|
|
158
158
|
]
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
function T({ workspace: t, type: r, onDone:
|
|
162
|
-
let l = v("issueTypes"), f = v("common"), m = _(), h =
|
|
161
|
+
function T({ workspace: t, type: r, onDone: i }) {
|
|
162
|
+
let l = v("issueTypes"), f = v("common"), m = _(), h = a(t), { data: S = [] } = x(e(t)), { data: C = [] } = x(n(t)), w = C.filter((e) => e.target === "issue" && !e.archivedAt), [T, E] = g(r?.name ?? ""), [D, O] = g(r?.description ?? ""), [k, A] = g(r?.icon ?? ""), [j, M] = g(r?.color || "#6e7781"), [N, P] = g(r?.teamIds ?? []), [F, I] = g(r?.fieldIds ?? []), [L, R] = g(r?.requiredFieldIds ?? []), [z, B] = g(r?.template ?? ""), V = r ? h.update : h.create, H = F.length > 0 ? w.filter((e) => F.includes(e.id)) : w, U = (e) => {
|
|
163
163
|
e.preventDefault();
|
|
164
164
|
let t = {
|
|
165
165
|
name: T,
|
|
@@ -174,7 +174,7 @@ function T({ workspace: t, type: r, onDone: a }) {
|
|
|
174
174
|
r ? h.update.mutate({
|
|
175
175
|
id: r.id,
|
|
176
176
|
...t
|
|
177
|
-
}, { onSuccess:
|
|
177
|
+
}, { onSuccess: i }) : h.create.mutate(t, { onSuccess: i });
|
|
178
178
|
}, W = "block text-xs font-medium text-muted-foreground";
|
|
179
179
|
return /* @__PURE__ */ b("form", {
|
|
180
180
|
onSubmit: U,
|
|
@@ -301,7 +301,7 @@ function T({ workspace: t, type: r, onDone: a }) {
|
|
|
301
301
|
children: [/* @__PURE__ */ y(o, {
|
|
302
302
|
size: "sm",
|
|
303
303
|
variant: "ghost",
|
|
304
|
-
onClick:
|
|
304
|
+
onClick: i,
|
|
305
305
|
children: f("cancel")
|
|
306
306
|
}), /* @__PURE__ */ y(o, {
|
|
307
307
|
type: "submit",
|