@parallelworks/tandem-web 0.189.8 → 0.189.10
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 +11 -3
- package/_virtual/_virtual_i18n/es/common.js +11 -3
- package/_virtual/_virtual_i18n/ja/common.js +11 -3
- package/_virtual/_virtual_i18n/ko/common.js +11 -3
- package/_virtual/_virtual_i18n/zh/common.js +11 -3
- package/components/IssueBreakdown.js +162 -76
- package/components/IssueView.js +98 -101
- package/components/TriageBanner.js +137 -192
- package/lib/glossary.js +35 -22
- package/lib/issueList.js +2 -1
- package/package.json +1 -1
- package/pages/issues.js +365 -367
- package/pages/triage.js +229 -160
- package/routes/_workspace/teams/_key/cycles/_number2.js +68 -71
|
@@ -1,207 +1,152 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useIssuePicker as
|
|
4
|
-
import { useCanTriage as
|
|
2
|
+
import { statusesQuery as n, teamsQuery as r } from "../api/queries.js";
|
|
3
|
+
import { useIssuePicker as i } from "../lib/issuePicker.js";
|
|
4
|
+
import { useCanTriage as a } from "../lib/roles.js";
|
|
5
|
+
import { useShortcuts as o } from "../lib/shortcuts.js";
|
|
5
6
|
import { TriageIcon as s } from "./icons.js";
|
|
6
|
-
import { Button as c, Checkbox as l, Combobox as u,
|
|
7
|
-
import { useId as
|
|
8
|
-
import { useErrorMessage as
|
|
9
|
-
import { useTranslations as
|
|
10
|
-
import {
|
|
11
|
-
import { useMutation as
|
|
12
|
-
import { CheckIcon as
|
|
7
|
+
import { Button as c, Checkbox as l, Combobox as u, Select as d, Textarea as f } from "@parallelworks/ui";
|
|
8
|
+
import { useId as p, useState as m } from "react";
|
|
9
|
+
import { useErrorMessage as h } from "@parallelworks/problem/react";
|
|
10
|
+
import { useTranslations as g } from "use-intl";
|
|
11
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
import { useMutation as y, useQuery as b, useQueryClient as x } from "@tanstack/react-query";
|
|
13
|
+
import { CheckIcon as S, CloseIcon as C, DuplicateIcon as w } from "@parallelworks/ui/icons";
|
|
13
14
|
// src/components/TriageBanner.tsx
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
className: "mb-5 flex flex-
|
|
18
|
-
children: [
|
|
19
|
-
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
issue: t
|
|
27
|
-
})
|
|
28
|
-
]
|
|
15
|
+
function T({ workspace: e, issue: t, shortcuts: n = !1 }) {
|
|
16
|
+
let r = g("triage");
|
|
17
|
+
return /* @__PURE__ */ v("div", {
|
|
18
|
+
className: "mb-5 flex flex-col gap-3 rounded-xl border border-border bg-muted/40 px-4 py-3",
|
|
19
|
+
children: [/* @__PURE__ */ v("p", {
|
|
20
|
+
className: "flex items-center gap-2 text-sm",
|
|
21
|
+
children: [/* @__PURE__ */ _(s, { className: "size-4 shrink-0 text-muted-foreground" }), r("waiting")]
|
|
22
|
+
}), /* @__PURE__ */ _(D, {
|
|
23
|
+
workspace: e,
|
|
24
|
+
issue: t,
|
|
25
|
+
shortcuts: n
|
|
26
|
+
})]
|
|
29
27
|
});
|
|
30
28
|
}
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
body: { body: G.trim() }
|
|
68
|
-
})), t(await R("decline"));
|
|
69
|
-
},
|
|
70
|
-
onSuccess: z
|
|
71
|
-
}), J = x({
|
|
72
|
-
mutationFn: async (n) => {
|
|
73
|
-
t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/relations", {
|
|
74
|
-
...L,
|
|
75
|
-
body: {
|
|
76
|
-
type: "duplicate",
|
|
77
|
-
issue: n
|
|
78
|
-
}
|
|
79
|
-
})), t(await R("decline"));
|
|
80
|
-
},
|
|
81
|
-
onSuccess: z
|
|
82
|
-
}), Y = a(s, (e) => e.identifier !== D.identifier), X = m(), Z = W.error ?? q.error ?? J.error, Q = W.isPending || q.isPending || J.isPending, $ = F.filter((e) => e.category !== "triage" && e.category !== "canceled");
|
|
83
|
-
return M ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("span", {
|
|
84
|
-
className: O ? "flex items-center gap-0.5" : "flex flex-wrap gap-2",
|
|
29
|
+
function E(e) {
|
|
30
|
+
let t = e.filter((e) => e.category !== "triage" && e.category !== "completed" && e.category !== "canceled");
|
|
31
|
+
return t.find((e) => e.category === "unstarted") ?? t[0];
|
|
32
|
+
}
|
|
33
|
+
function D({ workspace: s, issue: T, shortcuts: D = !1 }) {
|
|
34
|
+
let O = g("triage"), k = h(), A = x(), j = a(s, T.teamId), { data: M = [] } = b(r(s)), N = M.find((e) => e.id === T.teamId)?.key ?? "", { data: P = [] } = b({
|
|
35
|
+
...n(s, N),
|
|
36
|
+
enabled: !!N
|
|
37
|
+
}), F = y({
|
|
38
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
|
|
39
|
+
params: { path: {
|
|
40
|
+
workspace: s,
|
|
41
|
+
identifier: T.identifier
|
|
42
|
+
} },
|
|
43
|
+
body: n
|
|
44
|
+
})),
|
|
45
|
+
onSuccess: () => A.invalidateQueries({ queryKey: [
|
|
46
|
+
"workspace",
|
|
47
|
+
s,
|
|
48
|
+
"issues"
|
|
49
|
+
] })
|
|
50
|
+
}), I = P.filter((e) => e.category !== "triage" && e.category !== "completed" && e.category !== "canceled"), [L, R] = m(null), z = L ?? E(P)?.id ?? "", [B, V] = m(T.assignees.length === 0), [H, U] = m(!1), [W, G] = m(""), K = i(s, (e) => e.identifier !== T.identifier), q = p(), J = () => F.mutate({
|
|
51
|
+
decision: "accept",
|
|
52
|
+
...z && { statusId: z },
|
|
53
|
+
assignToMe: B
|
|
54
|
+
}), Y = () => F.mutate({
|
|
55
|
+
decision: "decline",
|
|
56
|
+
reason: W.trim()
|
|
57
|
+
});
|
|
58
|
+
if (o({
|
|
59
|
+
1: J,
|
|
60
|
+
2: Y
|
|
61
|
+
}, D && j && !F.isPending), !j) return null;
|
|
62
|
+
let X = F.isPending;
|
|
63
|
+
return /* @__PURE__ */ v("div", {
|
|
64
|
+
className: "flex flex-col gap-2",
|
|
85
65
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
title: k("decline"),
|
|
112
|
-
disabled: Q,
|
|
113
|
-
children: /* @__PURE__ */ y(T, {})
|
|
114
|
-
}) : /* @__PURE__ */ y(c, {
|
|
115
|
-
variant: "outline",
|
|
116
|
-
size: "sm",
|
|
117
|
-
disabled: Q,
|
|
118
|
-
children: k("decline")
|
|
119
|
-
}),
|
|
120
|
-
align: "end",
|
|
121
|
-
className: "w-80",
|
|
122
|
-
"aria-label": k("decline"),
|
|
123
|
-
children: /* @__PURE__ */ b("form", {
|
|
124
|
-
className: "flex flex-col gap-2",
|
|
125
|
-
onSubmit: (e) => {
|
|
126
|
-
e.preventDefault(), q.mutate();
|
|
127
|
-
},
|
|
128
|
-
children: [/* @__PURE__ */ y(p, {
|
|
129
|
-
value: G,
|
|
130
|
-
onChange: (e) => K(e.target.value),
|
|
131
|
-
placeholder: k("declineReason"),
|
|
132
|
-
"aria-label": k("declineReason"),
|
|
133
|
-
rows: 3
|
|
134
|
-
}), /* @__PURE__ */ y(c, {
|
|
135
|
-
type: "submit",
|
|
66
|
+
/* @__PURE__ */ v("div", {
|
|
67
|
+
className: "flex flex-wrap items-center gap-2",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ _(d, {
|
|
70
|
+
"aria-label": O("acceptInto"),
|
|
71
|
+
value: z,
|
|
72
|
+
items: I.map((e) => ({
|
|
73
|
+
value: e.id,
|
|
74
|
+
label: e.name
|
|
75
|
+
})),
|
|
76
|
+
onValueChange: (e) => e && R(e),
|
|
77
|
+
className: "w-36"
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ v("span", {
|
|
80
|
+
className: "flex items-center gap-1.5 text-sm",
|
|
81
|
+
children: [/* @__PURE__ */ _(l, {
|
|
82
|
+
id: q,
|
|
83
|
+
checked: B,
|
|
84
|
+
onCheckedChange: (e) => V(e === !0)
|
|
85
|
+
}), /* @__PURE__ */ _("label", {
|
|
86
|
+
htmlFor: q,
|
|
87
|
+
children: O("assignToMe")
|
|
88
|
+
})]
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ v(c, {
|
|
136
91
|
variant: "primary",
|
|
137
92
|
size: "sm",
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
93
|
+
onClick: J,
|
|
94
|
+
disabled: X,
|
|
95
|
+
title: O("acceptKey"),
|
|
96
|
+
children: [/* @__PURE__ */ _(S, {}), O("accept")]
|
|
97
|
+
})
|
|
98
|
+
]
|
|
143
99
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
items: [{
|
|
171
|
-
value: "",
|
|
172
|
-
label: k("acceptWhereItIs")
|
|
173
|
-
}, ...$.map((e) => ({
|
|
174
|
-
value: e.id,
|
|
175
|
-
label: e.name
|
|
176
|
-
}))],
|
|
177
|
-
onValueChange: (e) => V(e ?? "")
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ b("span", {
|
|
180
|
-
className: "flex items-center gap-2 text-sm",
|
|
181
|
-
children: [/* @__PURE__ */ y(l, {
|
|
182
|
-
id: X,
|
|
183
|
-
checked: H,
|
|
184
|
-
onCheckedChange: (e) => U(e === !0)
|
|
185
|
-
}), /* @__PURE__ */ y("label", {
|
|
186
|
-
htmlFor: X,
|
|
187
|
-
children: k("assignToMe")
|
|
188
|
-
})]
|
|
100
|
+
/* @__PURE__ */ v("div", {
|
|
101
|
+
className: "flex flex-wrap items-center gap-2",
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ v(c, {
|
|
104
|
+
variant: "outline",
|
|
105
|
+
size: "sm",
|
|
106
|
+
onClick: Y,
|
|
107
|
+
disabled: X,
|
|
108
|
+
title: O("declineKey"),
|
|
109
|
+
children: [/* @__PURE__ */ _(C, {}), O("decline")]
|
|
110
|
+
}),
|
|
111
|
+
!H && /* @__PURE__ */ _(c, {
|
|
112
|
+
variant: "ghost",
|
|
113
|
+
size: "sm",
|
|
114
|
+
onClick: () => U(!0),
|
|
115
|
+
disabled: X,
|
|
116
|
+
children: O("addReason")
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ _(u, {
|
|
119
|
+
"aria-label": O("markDuplicate"),
|
|
120
|
+
...K,
|
|
121
|
+
value: null,
|
|
122
|
+
onValueChange: (e) => e && F.mutate({
|
|
123
|
+
decision: "duplicate",
|
|
124
|
+
duplicateOf: e,
|
|
125
|
+
reason: W.trim()
|
|
189
126
|
}),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
variant: "
|
|
127
|
+
placeholder: O("findIssue"),
|
|
128
|
+
trigger: /* @__PURE__ */ v(c, {
|
|
129
|
+
variant: "ghost",
|
|
193
130
|
size: "sm",
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
children: k("accept")
|
|
131
|
+
disabled: X,
|
|
132
|
+
children: [/* @__PURE__ */ _(w, {}), O("markDuplicate")]
|
|
197
133
|
})
|
|
198
|
-
|
|
199
|
-
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
}),
|
|
137
|
+
H && /* @__PURE__ */ _(f, {
|
|
138
|
+
value: W,
|
|
139
|
+
onChange: (e) => G(e.target.value),
|
|
140
|
+
placeholder: O("declineReason"),
|
|
141
|
+
"aria-label": O("declineReason"),
|
|
142
|
+
rows: 2,
|
|
143
|
+
autoFocus: !0
|
|
144
|
+
}),
|
|
145
|
+
F.error && /* @__PURE__ */ _("p", {
|
|
146
|
+
className: "text-xs text-danger",
|
|
147
|
+
children: k(F.error)
|
|
200
148
|
})
|
|
201
149
|
]
|
|
202
|
-
})
|
|
203
|
-
className: "basis-full text-xs text-danger",
|
|
204
|
-
children: A(Z)
|
|
205
|
-
})] }) : null;
|
|
150
|
+
});
|
|
206
151
|
}
|
|
207
|
-
export {
|
|
152
|
+
export { D as TriageActions, T as TriageBanner, E as acceptStatus };
|
package/lib/glossary.js
CHANGED
|
@@ -31,37 +31,50 @@ function c(e) {
|
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
var l = /\s/;
|
|
35
|
+
function u(e, t, n) {
|
|
36
|
+
let r = t, i = n;
|
|
37
|
+
for (; r > 0 && !l.test(e[r - 1] ?? "");) r--;
|
|
38
|
+
for (; i < e.length && !l.test(e[i] ?? "");) i++;
|
|
39
|
+
let a = (e.slice(r, t) + e.slice(n, i)).replace(/[.,;:!?)\]}"'’”]+$/u, "");
|
|
40
|
+
return /[/<>=?]/.test(a);
|
|
41
|
+
}
|
|
42
|
+
function d(e, n, r = !1) {
|
|
43
|
+
let a = [], s = /* @__PURE__ */ new Set(), l = c(n), d = 0;
|
|
44
|
+
for (; d < e.length;) {
|
|
45
|
+
if (d > 0 && t(e[d - 1]) || !t(e[d])) {
|
|
46
|
+
d++;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
let n = o(e, d), c = l.get(n.toLowerCase());
|
|
50
|
+
if (!c) {
|
|
51
|
+
d += n.length;
|
|
39
52
|
continue;
|
|
40
53
|
}
|
|
41
|
-
let
|
|
42
|
-
for (let t of
|
|
43
|
-
let n = i(e,
|
|
44
|
-
if (n
|
|
54
|
+
let f = 0;
|
|
55
|
+
for (let t of c) {
|
|
56
|
+
let n = i(e, d, t.text);
|
|
57
|
+
if (!(n === 0 || u(e, d, d + n))) {
|
|
45
58
|
(r || !s.has(t.id)) && (s.add(t.id), a.push({
|
|
46
|
-
from:
|
|
47
|
-
to:
|
|
59
|
+
from: d,
|
|
60
|
+
to: d + n,
|
|
48
61
|
id: t.id
|
|
49
|
-
})),
|
|
62
|
+
})), f = n;
|
|
50
63
|
break;
|
|
51
64
|
}
|
|
52
65
|
}
|
|
53
|
-
|
|
66
|
+
d += f > 0 ? f : n.length;
|
|
54
67
|
}
|
|
55
68
|
return a;
|
|
56
69
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
59
|
-
return e.filter((e) => e.key !== t && !e.template && e.title.trim().length >=
|
|
70
|
+
var f = 4;
|
|
71
|
+
function p(e, t) {
|
|
72
|
+
return e.filter((e) => e.key !== t && !e.template && e.title.trim().length >= f).map((e) => ({
|
|
60
73
|
text: e.title.trim(),
|
|
61
74
|
id: `doc:${e.key}`
|
|
62
75
|
})).sort((e, t) => t.text.length - e.text.length);
|
|
63
76
|
}
|
|
64
|
-
var
|
|
77
|
+
var m = (() => {
|
|
65
78
|
let e = [], t = /* @__PURE__ */ new Set();
|
|
66
79
|
return {
|
|
67
80
|
forms: () => e,
|
|
@@ -76,18 +89,18 @@ var f = (() => {
|
|
|
76
89
|
}
|
|
77
90
|
};
|
|
78
91
|
})();
|
|
79
|
-
function
|
|
92
|
+
function h(e) {
|
|
80
93
|
return e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu, "").replace(/\s+/g, "-");
|
|
81
94
|
}
|
|
82
|
-
function
|
|
95
|
+
function g(e) {
|
|
83
96
|
return e.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/(\*\*|__|~~|`)(.+?)\1/g, "$2").replace(/(^|[^\w*])[*_]([^*_]+)[*_](?=[^\w*]|$)/g, "$1$2").trim();
|
|
84
97
|
}
|
|
85
|
-
function
|
|
98
|
+
function _(e) {
|
|
86
99
|
let t = [], n = "";
|
|
87
100
|
for (let r of e.split("\n")) {
|
|
88
101
|
let e = /^(`{3,}|~{3,})/.exec(r)?.[1];
|
|
89
102
|
e && (!n || e.startsWith(n)) && (n = n ? "" : e);
|
|
90
|
-
let i = n ? null : /^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(r), a = i?.[2] ?
|
|
103
|
+
let i = n ? null : /^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(r), a = i?.[2] ? g(i[2]) : "";
|
|
91
104
|
i?.[1] && a && t.push({
|
|
92
105
|
level: i[1].length,
|
|
93
106
|
text: a
|
|
@@ -95,4 +108,4 @@ function h(e) {
|
|
|
95
108
|
}
|
|
96
109
|
return t;
|
|
97
110
|
}
|
|
98
|
-
export {
|
|
111
|
+
export { p as docForms, a as formsOf, m as glossary, h as headingAnchor, _ as headings, d as mentions, g as plainHeading };
|
package/lib/issueList.js
CHANGED