@parallelworks/tandem-web 0.166.0 → 0.167.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 +1 -0
- package/_virtual/_virtual_i18n/es/common.js +1 -0
- package/_virtual/_virtual_i18n/ja/common.js +1 -0
- package/_virtual/_virtual_i18n/ko/common.js +1 -0
- package/_virtual/_virtual_i18n/zh/common.js +1 -0
- package/api/mutations.js +1 -0
- package/api/queries.js +165 -137
- package/components/ActivityTimeline.js +4 -1
- package/components/ActorAvatar.js +29 -0
- package/components/IssueEvent.js +1 -0
- package/components/IssueGroupList.js +51 -28
- package/lib/groupList.js +15 -5
- package/lib/pagedGroups.js +130 -0
- package/lib/projectList.js +1 -1
- package/lib/projectStates.js +4 -1
- package/lib/triage.js +20 -5
- package/package.json +1 -1
- package/pages/issues.js +431 -388
- package/pages/projects.js +198 -189
- package/pages/triage.js +234 -201
- package/routes/_workspace/notifications2.js +205 -226
- package/routes/_workspace/projects/_projectId3.js +198 -182
- package/routes/_workspace/teams/_key/triage3.js +4 -3
- package/routes/_workspace/triage3.js +4 -3
- package/routes/_workspace2.js +424 -418
package/pages/triage.js
CHANGED
|
@@ -1,75 +1,87 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
2
|
import { usePageTitle as n } from "../lib/pageTitle.js";
|
|
3
3
|
import { Link as r, useNavigate as i } from "../lib/router.js";
|
|
4
|
-
import { issueQuery as a, teamsQuery as o } from "../api/queries.js";
|
|
5
|
-
import { triageQuery as
|
|
6
|
-
import { PriorityIcon as
|
|
7
|
-
import { usePeople as
|
|
8
|
-
import { useTime as
|
|
9
|
-
import { EntityIcon as
|
|
10
|
-
import { useCanTriage as
|
|
11
|
-
import { actorAvatar as
|
|
12
|
-
import { Editor as
|
|
13
|
-
import { useShortcuts as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
4
|
+
import { issueQuery as a, teamsQuery as o, triageVisitsQuery as s } from "../api/queries.js";
|
|
5
|
+
import { triageQuery as c, useVisitTriage as l } from "../lib/triage.js";
|
|
6
|
+
import { AddIcon as u, PriorityIcon as d, StatusIcon as f, TriageIcon as p, usePriorityNames as m } from "../components/icons.js";
|
|
7
|
+
import { usePeople as h } from "../lib/people.js";
|
|
8
|
+
import { useTime as g } from "../lib/time.js";
|
|
9
|
+
import { EntityIcon as _ } from "../components/EntityIcon.js";
|
|
10
|
+
import { useCanTriage as v } from "../lib/roles.js";
|
|
11
|
+
import { actorAvatar as y } from "../lib/avatar.js";
|
|
12
|
+
import { Editor as b } from "../components/Editor.js";
|
|
13
|
+
import { useShortcuts as x } from "../lib/shortcuts.js";
|
|
14
|
+
import { ActorAvatar as S } from "../components/ActorAvatar.js";
|
|
15
|
+
import { Avatar as C, Button as w, EmptyState as T, RelativeTime as E, buttonClasses as D, toast as O } from "@parallelworks/ui";
|
|
16
|
+
import { useParams as k, useSearch as A } from "@tanstack/react-router";
|
|
17
|
+
import { useCallback as j, useEffect as M, useRef as N, useState as P } from "react";
|
|
18
|
+
import { useErrorMessage as F } from "@parallelworks/problem/react";
|
|
19
|
+
import { useTranslations as I } from "use-intl";
|
|
20
|
+
import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
21
|
+
import { useMutation as B, useQuery as V, useQueryClient as H, useSuspenseQuery as U } from "@tanstack/react-query";
|
|
21
22
|
// src/pages/triage.tsx
|
|
22
|
-
function
|
|
23
|
-
let r =
|
|
23
|
+
function W() {
|
|
24
|
+
let r = I("triage"), { workspace: a, key: o } = k({ strict: !1 }), { issue: u } = A({ strict: !1 }), { data: d } = U(c(a, o));
|
|
24
25
|
n(r("title"));
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
}, []), S =
|
|
26
|
+
let f = d.issues, m = F(), h = H(), [g, _] = P(/* @__PURE__ */ new Set()), [v, y] = P(/* @__PURE__ */ new Set()), b = j((e, t) => {
|
|
27
|
+
_((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : K(n, e));
|
|
28
|
+
}, []), S = f.filter((e) => g.has(e.id)), C = S.filter((e) => v.has(e.id)), E = i(), D = f.findIndex((e) => e.identifier === u?.toUpperCase()), L = N(null), V = f[D], { data: W } = U(s(a)), { mutate: q } = l(a), J = N(/* @__PURE__ */ new Set());
|
|
29
|
+
M(() => {
|
|
30
|
+
!V || W.includes(V.id) || J.current.has(V.id) || (J.current.add(V.id), q({
|
|
31
|
+
id: V.id,
|
|
32
|
+
identifier: V.identifier
|
|
33
|
+
}));
|
|
34
|
+
}, [
|
|
35
|
+
V,
|
|
36
|
+
W,
|
|
37
|
+
q
|
|
38
|
+
]);
|
|
39
|
+
let Y = (e) => E({
|
|
28
40
|
to: ".",
|
|
29
41
|
search: e ? { issue: e.identifier.toLowerCase() } : {},
|
|
30
42
|
replace: !0
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
},
|
|
43
|
+
}), X = (e) => {
|
|
44
|
+
g.has(e.id) && y((t) => t.has(e.id) ? K(t, e.id) : new Set(t).add(e.id));
|
|
45
|
+
}, Z = (e, t) => {
|
|
34
46
|
let [n, r] = e < t ? [e, t] : [t, e];
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
let n =
|
|
38
|
-
n && (e.metaKey || e.ctrlKey ? (e.preventDefault(),
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
41
|
-
let n =
|
|
42
|
-
t && ((
|
|
43
|
-
},
|
|
44
|
-
let t =
|
|
45
|
-
e.id ===
|
|
47
|
+
y(new Set(f.slice(n, r + 1).filter((e) => g.has(e.id)).map((e) => e.id)));
|
|
48
|
+
}, ne = (e, t) => {
|
|
49
|
+
let n = f[t];
|
|
50
|
+
n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), X(n), L.current = t) : e.shiftKey && (e.preventDefault(), Z(L.current ?? (D >= 0 ? D : t), t)));
|
|
51
|
+
}, Q = (e, t) => {
|
|
52
|
+
if (f.length === 0) return;
|
|
53
|
+
let n = D < 0 ? 0 : Math.min(Math.max(D + e, 0), f.length - 1);
|
|
54
|
+
t && ((L.current === null || v.size === 0) && (L.current = Math.max(D, 0)), Z(L.current, n)), Y(f[n]);
|
|
55
|
+
}, re = (e) => {
|
|
56
|
+
let t = f.findIndex((t) => t.id === e.id);
|
|
57
|
+
e.id === V?.id && Y(f[t + 1] ?? f[t - 1]);
|
|
46
58
|
};
|
|
47
|
-
|
|
48
|
-
j: () =>
|
|
49
|
-
k: () =>
|
|
50
|
-
J: () =>
|
|
51
|
-
K: () =>
|
|
52
|
-
ArrowDown: (e) =>
|
|
53
|
-
ArrowUp: (e) =>
|
|
59
|
+
x({
|
|
60
|
+
j: () => Q(1, !1),
|
|
61
|
+
k: () => Q(-1, !1),
|
|
62
|
+
J: () => Q(1, !0),
|
|
63
|
+
K: () => Q(-1, !0),
|
|
64
|
+
ArrowDown: (e) => Q(1, e.shiftKey),
|
|
65
|
+
ArrowUp: (e) => Q(-1, e.shiftKey),
|
|
54
66
|
x: () => {
|
|
55
|
-
|
|
67
|
+
V && (X(V), L.current = D);
|
|
56
68
|
},
|
|
57
|
-
Enter: () =>
|
|
69
|
+
Enter: () => V && E({
|
|
58
70
|
to: "/$workspace/issues/$identifier",
|
|
59
71
|
params: {
|
|
60
72
|
workspace: a,
|
|
61
|
-
identifier:
|
|
73
|
+
identifier: V.identifier
|
|
62
74
|
}
|
|
63
75
|
}),
|
|
64
|
-
"Mod+a": () =>
|
|
65
|
-
"Shift+Mod+a": () =>
|
|
66
|
-
Escape: () =>
|
|
67
|
-
}),
|
|
68
|
-
let e =
|
|
76
|
+
"Mod+a": () => y(new Set(f.map((e) => e.id))),
|
|
77
|
+
"Shift+Mod+a": () => y(/* @__PURE__ */ new Set()),
|
|
78
|
+
Escape: () => v.size > 0 ? y(/* @__PURE__ */ new Set()) : Y(void 0)
|
|
79
|
+
}), M(() => {
|
|
80
|
+
let e = V && document.getElementById(`triage-${V.id}`);
|
|
69
81
|
e && (e.scrollIntoView({ block: "nearest" }), e.parentElement?.contains(document.activeElement) && e.querySelector("a")?.focus({ preventScroll: !0 }));
|
|
70
|
-
}, [
|
|
71
|
-
let
|
|
72
|
-
mutationFn: async (n) => (await Promise.allSettled(
|
|
82
|
+
}, [V]);
|
|
83
|
+
let $ = B({
|
|
84
|
+
mutationFn: async (n) => (await Promise.allSettled(C.map(async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
73
85
|
params: { path: {
|
|
74
86
|
workspace: a,
|
|
75
87
|
identifier: r.identifier
|
|
@@ -77,106 +89,107 @@ function z() {
|
|
|
77
89
|
body: { decision: n }
|
|
78
90
|
}))))).filter((e) => e.status === "rejected"),
|
|
79
91
|
onSuccess: (e) => {
|
|
80
|
-
if (
|
|
81
|
-
let e = (e) => !
|
|
82
|
-
|
|
92
|
+
if (V && v.has(V.id)) {
|
|
93
|
+
let e = (e) => !v.has(e.id);
|
|
94
|
+
Y(f.slice(D + 1).find(e) ?? f.slice(0, D).findLast(e));
|
|
83
95
|
}
|
|
84
|
-
|
|
96
|
+
y(/* @__PURE__ */ new Set());
|
|
85
97
|
let t = e[0];
|
|
86
|
-
t &&
|
|
98
|
+
t && O.error(r("bulkFailed", {
|
|
87
99
|
count: e.length,
|
|
88
|
-
reason:
|
|
100
|
+
reason: m(t.reason)
|
|
89
101
|
}));
|
|
90
102
|
},
|
|
91
|
-
onSettled: () =>
|
|
103
|
+
onSettled: () => h.invalidateQueries({ queryKey: [
|
|
92
104
|
"workspace",
|
|
93
105
|
a,
|
|
94
106
|
"issues"
|
|
95
107
|
] })
|
|
96
108
|
});
|
|
97
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ z("div", {
|
|
98
110
|
className: "flex h-full flex-col",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ z("header", {
|
|
100
112
|
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
|
|
101
113
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ R("h1", {
|
|
103
115
|
className: "text-sm font-semibold",
|
|
104
116
|
children: r("title")
|
|
105
117
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ R("span", {
|
|
107
119
|
className: "text-xs text-muted-foreground tabular-nums",
|
|
108
|
-
children:
|
|
120
|
+
children: f.length
|
|
109
121
|
}),
|
|
110
|
-
|
|
122
|
+
C.length > 0 && /* @__PURE__ */ z("div", {
|
|
111
123
|
className: "ml-auto flex items-center gap-2",
|
|
112
124
|
children: [
|
|
113
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ R("span", {
|
|
114
126
|
className: "text-xs font-medium text-human",
|
|
115
|
-
children: r("selected", { count:
|
|
127
|
+
children: r("selected", { count: C.length })
|
|
116
128
|
}),
|
|
117
|
-
|
|
129
|
+
C.length < S.length && /* @__PURE__ */ R("button", {
|
|
118
130
|
type: "button",
|
|
119
|
-
onClick: () =>
|
|
131
|
+
onClick: () => y(new Set(S.map((e) => e.id))),
|
|
120
132
|
className: "text-xs hover:underline",
|
|
121
133
|
children: r("selectAll")
|
|
122
134
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ R("button", {
|
|
124
136
|
type: "button",
|
|
125
|
-
onClick: () =>
|
|
137
|
+
onClick: () => y(/* @__PURE__ */ new Set()),
|
|
126
138
|
className: "text-xs hover:underline",
|
|
127
139
|
children: r("clear")
|
|
128
140
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ R(w, {
|
|
130
142
|
variant: "outline",
|
|
131
143
|
size: "sm",
|
|
132
144
|
title: r("declineHelp"),
|
|
133
|
-
loading:
|
|
134
|
-
disabled:
|
|
135
|
-
onClick: () =>
|
|
136
|
-
children: r("declineCount", { count:
|
|
145
|
+
loading: $.isPending && $.variables === "decline",
|
|
146
|
+
disabled: $.isPending,
|
|
147
|
+
onClick: () => $.mutate("decline"),
|
|
148
|
+
children: r("declineCount", { count: C.length })
|
|
137
149
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ R(w, {
|
|
139
151
|
variant: "primary",
|
|
140
152
|
size: "sm",
|
|
141
153
|
title: r("acceptHelp"),
|
|
142
|
-
loading:
|
|
143
|
-
disabled:
|
|
144
|
-
onClick: () =>
|
|
145
|
-
children: r("acceptCount", { count:
|
|
154
|
+
loading: $.isPending && $.variables === "accept",
|
|
155
|
+
disabled: $.isPending,
|
|
156
|
+
onClick: () => $.mutate("accept"),
|
|
157
|
+
children: r("acceptCount", { count: C.length })
|
|
146
158
|
})
|
|
147
159
|
]
|
|
148
160
|
})
|
|
149
161
|
]
|
|
150
|
-
}),
|
|
162
|
+
}), f.length === 0 ? /* @__PURE__ */ R("div", {
|
|
151
163
|
className: "min-h-0 flex-1 overflow-y-auto p-6",
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
-
icon: /* @__PURE__ */
|
|
164
|
+
children: /* @__PURE__ */ R(T, {
|
|
165
|
+
icon: /* @__PURE__ */ R(p, {}),
|
|
154
166
|
title: r("empty"),
|
|
155
167
|
description: r("emptyDescription")
|
|
156
168
|
})
|
|
157
|
-
}) : /* @__PURE__ */
|
|
169
|
+
}) : /* @__PURE__ */ z("div", {
|
|
158
170
|
className: "flex min-h-0 flex-1",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ R("ul", {
|
|
160
172
|
"aria-label": r("title"),
|
|
161
|
-
className:
|
|
162
|
-
children:
|
|
173
|
+
className: G("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", V ? "hidden" : "flex"),
|
|
174
|
+
children: f.map((e, t) => /* @__PURE__ */ R(ee, {
|
|
163
175
|
workspace: a,
|
|
164
176
|
issue: e,
|
|
165
|
-
onEligible:
|
|
166
|
-
picked:
|
|
167
|
-
current: t ===
|
|
168
|
-
|
|
177
|
+
onEligible: b,
|
|
178
|
+
picked: v.has(e.id) && g.has(e.id),
|
|
179
|
+
current: t === D,
|
|
180
|
+
unread: !W.includes(e.id),
|
|
181
|
+
onClick: (e) => ne(e, t)
|
|
169
182
|
}, e.id))
|
|
170
|
-
}), /* @__PURE__ */
|
|
171
|
-
className:
|
|
172
|
-
children:
|
|
183
|
+
}), /* @__PURE__ */ R("div", {
|
|
184
|
+
className: G("min-w-0 flex-1 overflow-y-auto md:block", V ? "block" : "hidden"),
|
|
185
|
+
children: V ? /* @__PURE__ */ R(te, {
|
|
173
186
|
workspace: a,
|
|
174
|
-
issue:
|
|
175
|
-
onBack: () =>
|
|
176
|
-
onDecided:
|
|
177
|
-
},
|
|
187
|
+
issue: V,
|
|
188
|
+
onBack: () => Y(void 0),
|
|
189
|
+
onDecided: re
|
|
190
|
+
}, V.id) : /* @__PURE__ */ R("div", {
|
|
178
191
|
className: "px-6 py-24",
|
|
179
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ R(T, {
|
|
180
193
|
title: r("noneSelected"),
|
|
181
194
|
description: r("shortcuts")
|
|
182
195
|
})
|
|
@@ -185,67 +198,87 @@ function z() {
|
|
|
185
198
|
})]
|
|
186
199
|
});
|
|
187
200
|
}
|
|
188
|
-
var
|
|
189
|
-
function
|
|
201
|
+
var G = (...e) => e.filter(Boolean).join(" ");
|
|
202
|
+
function K(e, t) {
|
|
190
203
|
let n = new Set(e);
|
|
191
204
|
return n.delete(t), n;
|
|
192
205
|
}
|
|
193
|
-
function
|
|
194
|
-
let
|
|
195
|
-
|
|
206
|
+
function ee({ workspace: e, issue: t, onEligible: n, picked: i, current: a, unread: o, onClick: s }) {
|
|
207
|
+
let c = I("triage"), { actorName: l, avatarOf: d } = h(e), p = v(e, t.teamId);
|
|
208
|
+
M(() => n(t.id, p), [
|
|
196
209
|
n,
|
|
197
210
|
t.id,
|
|
198
|
-
|
|
211
|
+
p
|
|
199
212
|
]);
|
|
200
213
|
let m = t.creator;
|
|
201
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ R("li", {
|
|
202
215
|
id: `triage-${t.id}`,
|
|
203
216
|
"data-picked": i || void 0,
|
|
204
|
-
children: /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ z(r, {
|
|
205
218
|
to: ".",
|
|
206
219
|
search: { issue: t.identifier.toLowerCase() },
|
|
207
220
|
replace: !0,
|
|
208
|
-
onClick:
|
|
221
|
+
onClick: s,
|
|
209
222
|
"aria-current": a || void 0,
|
|
210
|
-
className:
|
|
211
|
-
children: [
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
children: t.identifier
|
|
219
|
-
})]
|
|
220
|
-
}), /* @__PURE__ */ P("span", {
|
|
221
|
-
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
222
|
-
children: [
|
|
223
|
-
/* @__PURE__ */ N("span", {
|
|
224
|
-
className: B("flex shrink-0 rounded-full", i && "ring-1 ring-human/40"),
|
|
225
|
-
children: /* @__PURE__ */ N(y, {
|
|
226
|
-
...g(m.kind),
|
|
227
|
-
name: l(m),
|
|
228
|
-
src: u(m.kind, m.handle),
|
|
229
|
-
size: "xs"
|
|
230
|
-
})
|
|
231
|
-
}),
|
|
232
|
-
/* @__PURE__ */ N("span", {
|
|
233
|
-
className: "min-w-0 flex-1 truncate",
|
|
234
|
-
children: s("from", { name: l(m) })
|
|
235
|
-
}),
|
|
236
|
-
/* @__PURE__ */ N("time", {
|
|
237
|
-
dateTime: t.createdAt,
|
|
238
|
-
title: c.full(t.createdAt),
|
|
239
|
-
className: "shrink-0 tabular-nums",
|
|
240
|
-
children: c.relative(t.createdAt)
|
|
223
|
+
className: G("flex gap-3 px-2 py-2.5 select-none", i ? "bg-human-soft" : G("rounded-md", a ? "bg-muted" : "hover:bg-muted")),
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ R("span", {
|
|
226
|
+
className: "flex w-2 shrink-0 justify-center pt-2.5",
|
|
227
|
+
children: o && /* @__PURE__ */ R("span", {
|
|
228
|
+
role: "img",
|
|
229
|
+
"aria-label": c("unseen"),
|
|
230
|
+
className: "size-2 rounded-full bg-primary"
|
|
241
231
|
})
|
|
242
|
-
|
|
243
|
-
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ R("span", {
|
|
234
|
+
className: G("h-fit shrink-0 rounded-full", i && "ring-1 ring-human/40"),
|
|
235
|
+
children: /* @__PURE__ */ R(S, {
|
|
236
|
+
actor: m,
|
|
237
|
+
name: l(m),
|
|
238
|
+
src: d(m.kind, m.handle),
|
|
239
|
+
badge: /* @__PURE__ */ R(u, {})
|
|
240
|
+
})
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ z("span", {
|
|
243
|
+
className: "min-w-0 flex-1",
|
|
244
|
+
children: [/* @__PURE__ */ z("span", {
|
|
245
|
+
className: "flex items-baseline gap-2 text-sm",
|
|
246
|
+
children: [/* @__PURE__ */ R("span", {
|
|
247
|
+
className: G("shrink-0 text-xs tabular-nums", o ? "font-medium text-foreground" : "text-muted-foreground"),
|
|
248
|
+
children: t.identifier
|
|
249
|
+
}), /* @__PURE__ */ R("span", {
|
|
250
|
+
className: G("min-w-0 flex-1 truncate", o ? "font-medium text-foreground" : "text-muted-foreground"),
|
|
251
|
+
children: t.title
|
|
252
|
+
})]
|
|
253
|
+
}), /* @__PURE__ */ R("span", {
|
|
254
|
+
className: "mt-0.5 block truncate text-xs text-muted-foreground",
|
|
255
|
+
children: c("from", { name: l(m) })
|
|
256
|
+
})]
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ z("span", {
|
|
259
|
+
className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
|
|
260
|
+
children: [/* @__PURE__ */ z("span", {
|
|
261
|
+
className: "flex h-4 items-center",
|
|
262
|
+
children: [/* @__PURE__ */ R(f, {
|
|
263
|
+
category: t.status.category,
|
|
264
|
+
step: t.status.step
|
|
265
|
+
}), /* @__PURE__ */ R("span", {
|
|
266
|
+
className: "sr-only",
|
|
267
|
+
children: t.status.name
|
|
268
|
+
})]
|
|
269
|
+
}), /* @__PURE__ */ R(E, {
|
|
270
|
+
value: t.createdAt,
|
|
271
|
+
format: "compact",
|
|
272
|
+
exact: "medium",
|
|
273
|
+
className: "text-xs text-muted-foreground"
|
|
274
|
+
})]
|
|
275
|
+
})
|
|
276
|
+
]
|
|
244
277
|
})
|
|
245
278
|
});
|
|
246
279
|
}
|
|
247
|
-
function
|
|
248
|
-
let
|
|
280
|
+
function te({ workspace: n, issue: i, onBack: s, onDecided: c }) {
|
|
281
|
+
let l = I("triage"), u = g(), p = F(), x = H(), S = m(), { data: T } = U(o(n)), { data: E } = V(a(n, i.identifier)), O = E ?? i, { actorName: k, avatarOf: A } = h(n), j = T.find((e) => e.id === O.teamId), M = v(n, O.teamId), N = B({
|
|
249
282
|
mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
250
283
|
params: { path: {
|
|
251
284
|
workspace: n,
|
|
@@ -254,62 +287,62 @@ function U({ workspace: n, issue: i, onBack: s, onDecided: u }) {
|
|
|
254
287
|
body: { decision: r }
|
|
255
288
|
})),
|
|
256
289
|
onSuccess: () => {
|
|
257
|
-
|
|
290
|
+
c(i), x.invalidateQueries({ queryKey: [
|
|
258
291
|
"workspace",
|
|
259
292
|
n,
|
|
260
293
|
"issues"
|
|
261
294
|
] });
|
|
262
295
|
}
|
|
263
|
-
}),
|
|
264
|
-
return /* @__PURE__ */
|
|
296
|
+
}), P = O.creator;
|
|
297
|
+
return /* @__PURE__ */ z("article", {
|
|
265
298
|
className: "mx-auto w-full max-w-3xl px-4 py-5 md:px-8",
|
|
266
299
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ R("button", {
|
|
268
301
|
type: "button",
|
|
269
302
|
onClick: s,
|
|
270
303
|
className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
|
|
271
|
-
children:
|
|
304
|
+
children: l("back")
|
|
272
305
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ z("p", {
|
|
274
307
|
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
275
308
|
children: [
|
|
276
|
-
|
|
277
|
-
icon:
|
|
278
|
-
name:
|
|
309
|
+
j && /* @__PURE__ */ R(_, {
|
|
310
|
+
icon: j.icon,
|
|
311
|
+
name: j.name,
|
|
279
312
|
className: "size-3.5"
|
|
280
313
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ R("span", {
|
|
282
315
|
className: "tabular-nums",
|
|
283
316
|
children: O.identifier
|
|
284
317
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ R("span", {
|
|
286
319
|
"aria-hidden": "true",
|
|
287
320
|
children: "·"
|
|
288
321
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
...
|
|
291
|
-
name: k(
|
|
292
|
-
src:
|
|
322
|
+
/* @__PURE__ */ R(C, {
|
|
323
|
+
...y(P.kind),
|
|
324
|
+
name: k(P),
|
|
325
|
+
src: A(P.kind, P.handle),
|
|
293
326
|
size: "xs"
|
|
294
327
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ R("span", {
|
|
296
329
|
className: "truncate",
|
|
297
|
-
children:
|
|
330
|
+
children: l("from", { name: k(P) })
|
|
298
331
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ R("span", {
|
|
300
333
|
"aria-hidden": "true",
|
|
301
334
|
children: "·"
|
|
302
335
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ R("time", {
|
|
304
337
|
dateTime: O.createdAt,
|
|
305
|
-
title:
|
|
306
|
-
children:
|
|
338
|
+
title: u.full(O.createdAt),
|
|
339
|
+
children: u.relative(O.createdAt)
|
|
307
340
|
})
|
|
308
341
|
]
|
|
309
342
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ R("h2", {
|
|
311
344
|
className: "mt-1 text-xl font-semibold text-balance",
|
|
312
|
-
children: /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ R(r, {
|
|
313
346
|
to: "/$workspace/issues/$identifier",
|
|
314
347
|
params: {
|
|
315
348
|
workspace: n,
|
|
@@ -319,79 +352,79 @@ function U({ workspace: n, issue: i, onBack: s, onDecided: u }) {
|
|
|
319
352
|
children: O.title
|
|
320
353
|
})
|
|
321
354
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ z("div", {
|
|
323
356
|
className: "mt-4 flex flex-wrap items-center gap-2",
|
|
324
|
-
children: [
|
|
357
|
+
children: [M && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(w, {
|
|
325
358
|
variant: "primary",
|
|
326
359
|
size: "sm",
|
|
327
|
-
title:
|
|
328
|
-
loading:
|
|
329
|
-
disabled:
|
|
330
|
-
onClick: () =>
|
|
331
|
-
children:
|
|
332
|
-
}), /* @__PURE__ */
|
|
360
|
+
title: l("acceptHelp"),
|
|
361
|
+
loading: N.isPending && N.variables === "accept",
|
|
362
|
+
disabled: N.isPending,
|
|
363
|
+
onClick: () => N.mutate("accept"),
|
|
364
|
+
children: l("accept")
|
|
365
|
+
}), /* @__PURE__ */ R(w, {
|
|
333
366
|
variant: "outline",
|
|
334
367
|
size: "sm",
|
|
335
|
-
title:
|
|
336
|
-
loading:
|
|
337
|
-
disabled:
|
|
338
|
-
onClick: () =>
|
|
339
|
-
children:
|
|
340
|
-
})] }), /* @__PURE__ */
|
|
368
|
+
title: l("declineHelp"),
|
|
369
|
+
loading: N.isPending && N.variables === "decline",
|
|
370
|
+
disabled: N.isPending,
|
|
371
|
+
onClick: () => N.mutate("decline"),
|
|
372
|
+
children: l("decline")
|
|
373
|
+
})] }), /* @__PURE__ */ R(r, {
|
|
341
374
|
to: "/$workspace/issues/$identifier",
|
|
342
375
|
params: {
|
|
343
376
|
workspace: n,
|
|
344
377
|
identifier: O.identifier
|
|
345
378
|
},
|
|
346
|
-
className:
|
|
379
|
+
className: D({
|
|
347
380
|
size: "sm",
|
|
348
381
|
variant: "ghost"
|
|
349
382
|
}),
|
|
350
|
-
children:
|
|
383
|
+
children: l("openIssue")
|
|
351
384
|
})]
|
|
352
385
|
}),
|
|
353
|
-
|
|
386
|
+
N.error && /* @__PURE__ */ R("p", {
|
|
354
387
|
className: "mt-2 text-xs text-danger",
|
|
355
|
-
children:
|
|
388
|
+
children: p(N.error)
|
|
356
389
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ R("p", {
|
|
358
391
|
className: "mt-3 text-xs text-muted-foreground",
|
|
359
|
-
children:
|
|
392
|
+
children: l("duplicateHint")
|
|
360
393
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ z("div", {
|
|
362
395
|
className: "mt-5 flex flex-wrap items-center gap-x-4 gap-y-1 border-y border-border py-2.5 text-xs text-muted-foreground",
|
|
363
396
|
children: [
|
|
364
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ z("span", {
|
|
365
398
|
className: "inline-flex items-center gap-1.5",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ R(f, {
|
|
367
400
|
category: O.status.category,
|
|
368
401
|
step: O.status.step
|
|
369
402
|
}), O.status.name]
|
|
370
403
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ z("span", {
|
|
372
405
|
className: "inline-flex items-center gap-1.5",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ R(d, { priority: O.priority }), S[O.priority]]
|
|
374
407
|
}),
|
|
375
|
-
O.labels.map((e) => /* @__PURE__ */
|
|
408
|
+
O.labels.map((e) => /* @__PURE__ */ z("span", {
|
|
376
409
|
className: "inline-flex items-center gap-1.5",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ R("span", {
|
|
378
411
|
className: "size-2 rounded-full",
|
|
379
412
|
style: { background: e.color }
|
|
380
413
|
}), e.name]
|
|
381
414
|
}, e.id))
|
|
382
415
|
]
|
|
383
416
|
}),
|
|
384
|
-
O.body.trim() ? /* @__PURE__ */
|
|
417
|
+
O.body.trim() ? /* @__PURE__ */ R("div", {
|
|
385
418
|
className: "mt-5 text-sm",
|
|
386
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ R(b, {
|
|
387
420
|
value: O.body,
|
|
388
421
|
editable: !1
|
|
389
422
|
})
|
|
390
|
-
}) : /* @__PURE__ */
|
|
423
|
+
}) : /* @__PURE__ */ R("p", {
|
|
391
424
|
className: "mt-5 text-sm text-muted-foreground",
|
|
392
|
-
children:
|
|
425
|
+
children: l("noDescription")
|
|
393
426
|
})
|
|
394
427
|
]
|
|
395
428
|
});
|
|
396
429
|
}
|
|
397
|
-
export {
|
|
430
|
+
export { W as TriagePage };
|