@parallelworks/tandem-web 0.192.1 → 0.193.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 +15 -7
- package/_virtual/_virtual_i18n/es/common.js +15 -7
- package/_virtual/_virtual_i18n/ja/common.js +15 -7
- package/_virtual/_virtual_i18n/ko/common.js +15 -7
- package/_virtual/_virtual_i18n/zh/common.js +15 -7
- package/components/DocIconPicker.js +17 -8
- package/components/DocLook.js +93 -68
- package/components/DocTable.js +67 -66
- package/components/DocsTree.js +182 -182
- package/components/IssueImport.js +95 -46
- package/components/IssueView.js +397 -397
- package/components/SubPages.js +60 -57
- package/components/SubpageViews.js +379 -365
- package/lib/docs.js +203 -133
- package/lib/menus.js +15 -1
- package/package.json +1 -1
- package/pages/issues.js +421 -455
- package/routes/_workspace/docs/_doc2.js +227 -227
- package/routes/_workspace/teams/_key/settings2.js +202 -196
- package/routes/_workspace2.js +334 -376
|
@@ -1,115 +1,164 @@
|
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { basePath as r } from "../lib/base.js";
|
|
4
|
+
import { Link as i } from "../lib/router.js";
|
|
5
|
+
import { DownloadIcon as a, UploadIcon as o } from "./icons.js";
|
|
6
|
+
import { Button as s, ErrorText as c, Modal as l, ModalTitle as u, SettingRow as d, SettingsCard as f } from "@parallelworks/ui";
|
|
7
|
+
import { useEffect as p, useRef as m, useState as h } from "react";
|
|
8
|
+
import { useErrorMessage as g } from "@parallelworks/problem/react";
|
|
9
|
+
import { useTranslations as _ } from "use-intl";
|
|
10
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
11
|
+
import { useMutation as x, useQueryClient as S } from "@tanstack/react-query";
|
|
10
12
|
// src/components/IssueImport.tsx
|
|
11
|
-
function
|
|
13
|
+
function C({ workspace: e, team: t, canImport: n }) {
|
|
14
|
+
let r = _("issueImport.settings"), [i, c] = h(null);
|
|
15
|
+
return /* @__PURE__ */ b(f, {
|
|
16
|
+
title: r("title"),
|
|
17
|
+
description: r("description"),
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ y(d, {
|
|
20
|
+
label: r("export"),
|
|
21
|
+
helpText: r("exportHelp"),
|
|
22
|
+
children: /* @__PURE__ */ y(s, {
|
|
23
|
+
size: "sm",
|
|
24
|
+
icon: /* @__PURE__ */ y(a, { className: "size-3.5" }),
|
|
25
|
+
onClick: () => w(e, { team: t }),
|
|
26
|
+
children: r("exportButton")
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
n && /* @__PURE__ */ y(d, {
|
|
30
|
+
label: r("import"),
|
|
31
|
+
helpText: r("importHelp"),
|
|
32
|
+
children: /* @__PURE__ */ y(s, {
|
|
33
|
+
size: "sm",
|
|
34
|
+
icon: /* @__PURE__ */ y(o, { className: "size-3.5" }),
|
|
35
|
+
onClick: () => T((e, t) => c({
|
|
36
|
+
name: e,
|
|
37
|
+
text: t
|
|
38
|
+
})),
|
|
39
|
+
children: r("importButton")
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
i && /* @__PURE__ */ y(E, {
|
|
43
|
+
workspace: e,
|
|
44
|
+
team: t,
|
|
45
|
+
file: i,
|
|
46
|
+
onClose: () => c(null)
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function w(e, t) {
|
|
52
|
+
let n = new URLSearchParams({
|
|
53
|
+
triage: "exclude",
|
|
54
|
+
archived: "exclude"
|
|
55
|
+
});
|
|
56
|
+
for (let [e, r] of Object.entries(t)) n.set(e, Array.isArray(r) ? r.join(",") : String(r));
|
|
57
|
+
let i = document.createElement("a");
|
|
58
|
+
i.href = `${r}/api/v1/workspaces/${encodeURIComponent(e)}/exports/issues.csv?${n}`, i.download = "", i.click();
|
|
59
|
+
}
|
|
60
|
+
function T(e) {
|
|
12
61
|
let t = document.createElement("input");
|
|
13
62
|
t.type = "file", t.accept = ".csv,text/csv", t.onchange = async () => {
|
|
14
63
|
let n = t.files?.[0];
|
|
15
64
|
n && e(n.name, await n.text());
|
|
16
65
|
}, t.click();
|
|
17
66
|
}
|
|
18
|
-
function
|
|
19
|
-
let
|
|
67
|
+
function E({ workspace: r, team: i, file: a, onClose: o }) {
|
|
68
|
+
let d = _("issueImport"), f = g(), C = S(), [w, T] = h(!1), E = x({
|
|
20
69
|
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issues/import", {
|
|
21
70
|
params: { path: {
|
|
22
71
|
workspace: r,
|
|
23
|
-
key:
|
|
72
|
+
key: i
|
|
24
73
|
} },
|
|
25
74
|
body: {
|
|
26
|
-
csv:
|
|
75
|
+
csv: a.text,
|
|
27
76
|
dryRun: n
|
|
28
77
|
}
|
|
29
78
|
})),
|
|
30
79
|
onSuccess: (e, t) => {
|
|
31
|
-
t || (
|
|
80
|
+
t || (T(!0), n(C, r));
|
|
32
81
|
}
|
|
33
|
-
}), O =
|
|
34
|
-
|
|
82
|
+
}), O = m(!1), k = m(E.mutate);
|
|
83
|
+
p(() => {
|
|
35
84
|
O.current || (O.current = !0, k.current(!0));
|
|
36
85
|
}, []);
|
|
37
|
-
let A =
|
|
38
|
-
return /* @__PURE__ */
|
|
86
|
+
let A = E.data;
|
|
87
|
+
return /* @__PURE__ */ b(l, {
|
|
39
88
|
open: !0,
|
|
40
|
-
onClose:
|
|
89
|
+
onClose: o,
|
|
41
90
|
className: "w-full max-w-2xl p-5",
|
|
42
91
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ y(u, {
|
|
44
93
|
className: "text-sm font-semibold",
|
|
45
|
-
children:
|
|
94
|
+
children: d("title", { file: a.name })
|
|
46
95
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ b("div", {
|
|
48
97
|
className: "mt-3 text-sm",
|
|
49
98
|
"aria-live": "polite",
|
|
50
99
|
children: [
|
|
51
|
-
|
|
100
|
+
E.isPending && /* @__PURE__ */ y("p", {
|
|
52
101
|
className: "text-muted-foreground",
|
|
53
|
-
children:
|
|
102
|
+
children: d(w ? "importing" : "reading")
|
|
54
103
|
}),
|
|
55
|
-
|
|
104
|
+
E.isError && /* @__PURE__ */ y(c, {
|
|
56
105
|
size: "md",
|
|
57
|
-
children:
|
|
106
|
+
children: f(E.error)
|
|
58
107
|
}),
|
|
59
|
-
A && /* @__PURE__ */
|
|
108
|
+
A && /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("p", { children: w ? d("imported", { count: A.imported }) : d("preview", {
|
|
60
109
|
count: A.imported,
|
|
61
110
|
skipped: A.rows.length - A.imported
|
|
62
|
-
}) }), /* @__PURE__ */
|
|
111
|
+
}) }), /* @__PURE__ */ y("ol", {
|
|
63
112
|
className: "mt-3 max-h-80 divide-y divide-border overflow-y-auto rounded-md border border-border",
|
|
64
|
-
children: A.rows.map((e) => /* @__PURE__ */
|
|
113
|
+
children: A.rows.map((e) => /* @__PURE__ */ y(D, {
|
|
65
114
|
workspace: r,
|
|
66
115
|
row: e
|
|
67
116
|
}, e.row))
|
|
68
117
|
})] })
|
|
69
118
|
]
|
|
70
119
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ b("div", {
|
|
72
121
|
className: "mt-5 flex justify-end gap-2",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
-
onClick:
|
|
75
|
-
children:
|
|
76
|
-
}), !
|
|
122
|
+
children: [/* @__PURE__ */ y(s, {
|
|
123
|
+
onClick: o,
|
|
124
|
+
children: d(w ? "close" : "cancel")
|
|
125
|
+
}), !w && A && A.imported > 0 && /* @__PURE__ */ y(s, {
|
|
77
126
|
variant: "primary",
|
|
78
|
-
loading:
|
|
79
|
-
onClick: () =>
|
|
80
|
-
children:
|
|
127
|
+
loading: E.isPending,
|
|
128
|
+
onClick: () => E.mutate(!1),
|
|
129
|
+
children: d("import", { count: A.imported })
|
|
81
130
|
})]
|
|
82
131
|
})
|
|
83
132
|
]
|
|
84
133
|
});
|
|
85
134
|
}
|
|
86
|
-
function
|
|
87
|
-
let n =
|
|
88
|
-
return /* @__PURE__ */
|
|
135
|
+
function D({ workspace: e, row: t }) {
|
|
136
|
+
let n = _("issueImport");
|
|
137
|
+
return /* @__PURE__ */ b("li", {
|
|
89
138
|
className: "flex gap-3 px-3 py-2 text-xs",
|
|
90
139
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ y("span", {
|
|
92
141
|
className: "w-8 shrink-0 text-right text-muted-foreground tabular-nums",
|
|
93
142
|
children: t.row
|
|
94
143
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ b("span", {
|
|
96
145
|
className: "min-w-0 flex-1",
|
|
97
146
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ y("span", {
|
|
99
148
|
className: t.skipped ? "text-muted-foreground line-through" : "",
|
|
100
149
|
children: t.title || n("untitled")
|
|
101
150
|
}),
|
|
102
|
-
t.skipped && /* @__PURE__ */
|
|
151
|
+
t.skipped && /* @__PURE__ */ y("span", {
|
|
103
152
|
className: "ml-2 text-danger",
|
|
104
153
|
children: n(`skipped.${t.skipped}`)
|
|
105
154
|
}),
|
|
106
|
-
t.warnings.length > 0 && /* @__PURE__ */
|
|
155
|
+
t.warnings.length > 0 && /* @__PURE__ */ y("span", {
|
|
107
156
|
className: "mt-0.5 block text-muted-foreground",
|
|
108
157
|
children: n("leftOut", { values: t.warnings.map((e) => `${e.field === "field" && e.name ? e.name : n(`field.${e.field}`)} “${e.value}”`).join(", ") })
|
|
109
158
|
})
|
|
110
159
|
]
|
|
111
160
|
}),
|
|
112
|
-
t.identifier && /* @__PURE__ */
|
|
161
|
+
t.identifier && /* @__PURE__ */ y(i, {
|
|
113
162
|
to: "/$workspace/issues/$identifier",
|
|
114
163
|
params: {
|
|
115
164
|
workspace: e,
|
|
@@ -121,4 +170,4 @@ function b({ workspace: e, row: t }) {
|
|
|
121
170
|
]
|
|
122
171
|
});
|
|
123
172
|
}
|
|
124
|
-
export {
|
|
173
|
+
export { E as IssueImport, C as TeamImportExport, T as pickCsv };
|