@parallelworks/tandem-web 0.142.0 → 0.144.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 +156 -6
- package/_virtual/_virtual_i18n/es/common.js +156 -6
- package/_virtual/_virtual_i18n/ja/common.js +156 -6
- package/_virtual/_virtual_i18n/ko/common.js +156 -6
- package/_virtual/_virtual_i18n/zh/common.js +156 -6
- package/api/queries.js +85 -74
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +2 -0
- package/components/CodeHostSettings.js +25 -25
- package/components/CustomFields.js +349 -0
- package/components/DocProperties.js +8 -2
- package/components/GitHub.js +22 -22
- package/components/IssueBoard.js +48 -43
- package/components/IssueEvent.js +2 -0
- package/components/IssueFilters.js +210 -122
- package/components/IssueImport.js +1 -1
- package/components/IssueRow.js +96 -79
- package/components/IssueTemplates.js +216 -156
- package/components/IssueTypes.js +318 -0
- package/components/NewIssueDialog.js +254 -216
- package/components/SettingsNav.js +45 -35
- package/components/TeamForm.js +49 -35
- package/components/TeamRepositories.js +51 -51
- package/components/TeamWorkflow.js +8 -8
- package/components/Updates.js +8 -8
- package/components/icons.js +8 -8
- package/lib/boardMove.js +69 -47
- package/lib/customFields.js +113 -0
- package/lib/issueDisplay.js +27 -12
- package/lib/issueList.js +166 -62
- package/lib/issueTypes.js +50 -0
- package/lib/teamTree.js +24 -0
- package/lib/views.js +13 -11
- package/package.json +1 -1
- package/pages/issues.js +331 -291
- package/routeTree.gen.js +186 -174
- package/routes/_workspace/agents/index2.js +9 -9
- package/routes/_workspace/issues/_identifier2.js +433 -370
- package/routes/_workspace/projects/_projectId3.js +213 -201
- package/routes/_workspace/settings/audit-log3.js +2 -0
- package/routes/_workspace/settings/fields.js +6 -0
- package/routes/_workspace/settings/fields2.js +30 -0
- package/routes/_workspace/settings/fields3.js +5 -0
- package/routes/_workspace/settings/groups2.js +74 -74
- package/routes/_workspace/settings/import.js +6 -0
- package/routes/_workspace/settings/import2.js +330 -0
- package/routes/_workspace/settings/import3.js +4 -0
- package/routes/_workspace/settings/labels2.js +33 -33
- package/routes/_workspace/settings/members2.js +35 -35
- package/routes/_workspace/settings/roles2.js +24 -24
- package/routes/_workspace/settings/runners2.js +18 -18
- package/routes/_workspace/settings/sessions2.js +9 -9
- package/routes/_workspace/settings/slack2.js +8 -8
- package/routes/_workspace/settings/sso2.js +50 -50
- package/routes/_workspace/settings/tokens2.js +15 -15
- package/routes/_workspace/settings/webhooks2.js +42 -42
- package/routes/_workspace/teams/_key/settings2.js +138 -76
- package/routes/_workspace2.js +320 -318
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
|
+
import { linearImportQuery as n, teamsQuery as r } from "../../../api/queries.js";
|
|
3
|
+
import { useConfirm as i } from "../../../lib/confirm.js";
|
|
4
|
+
import { MigrationIcon as a } from "../../../components/icons.js";
|
|
5
|
+
import { Route as o } from "./import.js";
|
|
6
|
+
import { useCan as s } from "../../../lib/roles.js";
|
|
7
|
+
import { AdminOnly as c, SettingsPage as l, useFormError as u } from "../../../components/settings.js";
|
|
8
|
+
import { Button as d, Checkbox as f, Disclosure as p, ErrorText as m, Field as h, Input as g, ProgressBar as _, Select as v, SettingsCard as y, StatusLabel as b } from "@parallelworks/ui";
|
|
9
|
+
import { useState as x } from "react";
|
|
10
|
+
import { useFormatter as S, useTranslations as C } from "use-intl";
|
|
11
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
import { useMutation as D, useQueryClient as O, useSuspenseQuery as k } from "@tanstack/react-query";
|
|
13
|
+
// src/routes/$workspace/settings/import.tsx?tsr-split=component
|
|
14
|
+
function A() {
|
|
15
|
+
let { workspace: e } = o.useParams(), { data: t } = k(n(e)), r = s(e, "manage_workspace"), i = C("settingsNav"), a = C("linearImport"), u = t.import?.status === "running";
|
|
16
|
+
return /* @__PURE__ */ E(l, {
|
|
17
|
+
title: i("import"),
|
|
18
|
+
description: a("pageDescription"),
|
|
19
|
+
children: [/* @__PURE__ */ T(c, { workspace: e }), t.enabled ? /* @__PURE__ */ E("div", {
|
|
20
|
+
className: "space-y-6",
|
|
21
|
+
children: [
|
|
22
|
+
t.import && /* @__PURE__ */ T(M, {
|
|
23
|
+
workspace: e,
|
|
24
|
+
im: t.import
|
|
25
|
+
}),
|
|
26
|
+
r && !u && /* @__PURE__ */ T(P, {
|
|
27
|
+
workspace: e,
|
|
28
|
+
again: !!t.import
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ E("section", {
|
|
31
|
+
className: "space-y-2 text-sm",
|
|
32
|
+
children: [/* @__PURE__ */ T("h2", {
|
|
33
|
+
className: "font-medium",
|
|
34
|
+
children: a("howTitle")
|
|
35
|
+
}), /* @__PURE__ */ E("ul", {
|
|
36
|
+
className: "list-disc space-y-1.5 pl-5 text-muted-foreground",
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ T("li", { children: a("howIssues") }),
|
|
39
|
+
/* @__PURE__ */ T("li", { children: a("howWorkflow") }),
|
|
40
|
+
/* @__PURE__ */ T("li", { children: a("howProjects") }),
|
|
41
|
+
/* @__PURE__ */ T("li", { children: a("howPeople") })
|
|
42
|
+
]
|
|
43
|
+
})]
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}) : /* @__PURE__ */ T(y, { children: /* @__PURE__ */ T("p", {
|
|
47
|
+
className: "px-3 py-2 text-sm text-muted-foreground",
|
|
48
|
+
children: a("notConfigured")
|
|
49
|
+
}) })]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
var j = {
|
|
53
|
+
running: "info",
|
|
54
|
+
done: "success",
|
|
55
|
+
failed: "error",
|
|
56
|
+
canceled: "muted"
|
|
57
|
+
};
|
|
58
|
+
function M({ workspace: r, im: o }) {
|
|
59
|
+
let c = C("linearImport"), l = S(), f = s(r, "manage_workspace"), h = O(), g = u(), { confirm: v, dialog: x } = i(), w = D({
|
|
60
|
+
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/linear/import/cancel", { params: { path: { workspace: r } } })),
|
|
61
|
+
onMutate: g.clear,
|
|
62
|
+
onSuccess: () => h.invalidateQueries({ queryKey: n(r).queryKey }),
|
|
63
|
+
onError: g.set
|
|
64
|
+
}), k = o.status === "running";
|
|
65
|
+
return /* @__PURE__ */ E(y, { children: [x, /* @__PURE__ */ E("div", {
|
|
66
|
+
className: "space-y-3 px-3 py-3",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ E("div", {
|
|
69
|
+
className: "flex flex-wrap items-center gap-3",
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ T(a, { className: "size-5 text-muted-foreground" }),
|
|
72
|
+
/* @__PURE__ */ E("div", {
|
|
73
|
+
className: "min-w-0 flex-1",
|
|
74
|
+
children: [/* @__PURE__ */ T("p", {
|
|
75
|
+
className: "text-sm font-medium",
|
|
76
|
+
children: c("lastImport", { organization: o.organization })
|
|
77
|
+
}), /* @__PURE__ */ T("p", {
|
|
78
|
+
className: "text-xs text-muted-foreground",
|
|
79
|
+
children: c("startedAt", { date: l.dateTime(new Date(o.startedAt), {
|
|
80
|
+
dateStyle: "medium",
|
|
81
|
+
timeStyle: "short"
|
|
82
|
+
}) })
|
|
83
|
+
})]
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ T(b, {
|
|
86
|
+
variant: j[o.status],
|
|
87
|
+
pulse: k,
|
|
88
|
+
children: c(`status.${o.status}`)
|
|
89
|
+
}),
|
|
90
|
+
f && k && /* @__PURE__ */ T(d, {
|
|
91
|
+
type: "button",
|
|
92
|
+
size: "sm",
|
|
93
|
+
variant: "outline",
|
|
94
|
+
loading: w.isPending,
|
|
95
|
+
onClick: () => v({
|
|
96
|
+
title: c("cancelTitle"),
|
|
97
|
+
description: c("cancelDescription"),
|
|
98
|
+
confirmLabel: c("cancel"),
|
|
99
|
+
onConfirm: () => w.mutateAsync()
|
|
100
|
+
}),
|
|
101
|
+
children: c("cancel")
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ T(_, {
|
|
106
|
+
value: o.total > 0 ? Math.min(o.processed, o.total) : k ? null : 1,
|
|
107
|
+
max: o.total > 0 ? o.total : 1,
|
|
108
|
+
label: c("issuesLabel"),
|
|
109
|
+
valueText: () => c("progress", {
|
|
110
|
+
processed: o.processed,
|
|
111
|
+
total: o.total
|
|
112
|
+
})
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ T("ul", {
|
|
115
|
+
className: "space-y-1 text-sm",
|
|
116
|
+
children: o.teams.map((e) => /* @__PURE__ */ T("li", {
|
|
117
|
+
className: "text-muted-foreground",
|
|
118
|
+
children: c("teamRow", {
|
|
119
|
+
source: `${e.sourceName} (${e.sourceKey})`,
|
|
120
|
+
team: e.teamKey ?? ""
|
|
121
|
+
})
|
|
122
|
+
}, e.sourceKey))
|
|
123
|
+
}),
|
|
124
|
+
o.error && /* @__PURE__ */ T("p", {
|
|
125
|
+
className: `text-sm ${k ? "text-muted-foreground" : "text-danger"}`,
|
|
126
|
+
children: c(k ? "retrying" : "stopped", { error: o.error })
|
|
127
|
+
}),
|
|
128
|
+
o.skipped > 0 && /* @__PURE__ */ T(p, {
|
|
129
|
+
summary: c("skipped", { count: o.skipped }),
|
|
130
|
+
children: /* @__PURE__ */ T("ul", {
|
|
131
|
+
className: "space-y-1 pt-2 text-sm",
|
|
132
|
+
children: o.skips.map((e, t) => /* @__PURE__ */ E("li", { children: [
|
|
133
|
+
/* @__PURE__ */ T("span", {
|
|
134
|
+
className: "font-medium",
|
|
135
|
+
children: e.item
|
|
136
|
+
}),
|
|
137
|
+
" ",
|
|
138
|
+
/* @__PURE__ */ T("span", {
|
|
139
|
+
className: "text-muted-foreground",
|
|
140
|
+
children: c(`skipReason.${e.reason}`, { field: e.field ?? "" })
|
|
141
|
+
})
|
|
142
|
+
] }, t))
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ T(m, {
|
|
146
|
+
size: "md",
|
|
147
|
+
children: g.error
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
})] });
|
|
151
|
+
}
|
|
152
|
+
var N = "__new__";
|
|
153
|
+
function P({ workspace: i, again: a }) {
|
|
154
|
+
let o = C("linearImport"), s = O(), { data: c } = k(r(i)), [l, p] = x(""), [_, b] = x(null), [S, A] = x({}), j = u(), M = c.filter((e) => !e.archivedAt), P = D({
|
|
155
|
+
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/linear/teams", {
|
|
156
|
+
params: { path: { workspace: i } },
|
|
157
|
+
body: { apiKey: l }
|
|
158
|
+
})),
|
|
159
|
+
onMutate: j.clear,
|
|
160
|
+
onSuccess: (e) => {
|
|
161
|
+
b(e), A(Object.fromEntries(e.teams.map((e) => {
|
|
162
|
+
let t = M.find((t) => t.key === e.key);
|
|
163
|
+
return [e.id, {
|
|
164
|
+
on: !0,
|
|
165
|
+
target: t?.key ?? N,
|
|
166
|
+
newKey: e.key,
|
|
167
|
+
newName: e.name
|
|
168
|
+
}];
|
|
169
|
+
})));
|
|
170
|
+
},
|
|
171
|
+
onError: j.set
|
|
172
|
+
}), F = D({
|
|
173
|
+
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/linear/import", {
|
|
174
|
+
params: { path: { workspace: i } },
|
|
175
|
+
body: {
|
|
176
|
+
apiKey: l,
|
|
177
|
+
teams: Object.entries(S).filter(([, e]) => e.on).map(([e, t]) => t.target === N ? {
|
|
178
|
+
sourceId: e,
|
|
179
|
+
newKey: t.newKey,
|
|
180
|
+
newName: t.newName
|
|
181
|
+
} : {
|
|
182
|
+
sourceId: e,
|
|
183
|
+
teamKey: t.target
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
})),
|
|
187
|
+
onMutate: j.clear,
|
|
188
|
+
onSuccess: () => {
|
|
189
|
+
p(""), b(null), s.invalidateQueries({ queryKey: n(i).queryKey }), s.invalidateQueries({ queryKey: r(i).queryKey });
|
|
190
|
+
},
|
|
191
|
+
onError: j.set
|
|
192
|
+
}), I = Object.values(S).filter((e) => e.on).length, L = (e, t) => A((n) => ({
|
|
193
|
+
...n,
|
|
194
|
+
[e]: {
|
|
195
|
+
...n[e],
|
|
196
|
+
...t
|
|
197
|
+
}
|
|
198
|
+
}));
|
|
199
|
+
return /* @__PURE__ */ T(y, { children: /* @__PURE__ */ E("form", {
|
|
200
|
+
className: "space-y-4 px-3 py-3",
|
|
201
|
+
onSubmit: (e) => {
|
|
202
|
+
e.preventDefault(), _ ? F.mutate() : P.mutate();
|
|
203
|
+
},
|
|
204
|
+
children: [
|
|
205
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
|
|
206
|
+
className: "text-sm font-medium",
|
|
207
|
+
children: o(a ? "again" : "startTitle")
|
|
208
|
+
}), a && /* @__PURE__ */ T("p", {
|
|
209
|
+
className: "text-xs text-muted-foreground",
|
|
210
|
+
children: o("againHelp")
|
|
211
|
+
})] }),
|
|
212
|
+
/* @__PURE__ */ T(h, {
|
|
213
|
+
label: o("keyLabel"),
|
|
214
|
+
description: o("keyHelp"),
|
|
215
|
+
children: /* @__PURE__ */ T(g, {
|
|
216
|
+
type: "password",
|
|
217
|
+
autoComplete: "off",
|
|
218
|
+
required: !0,
|
|
219
|
+
value: l,
|
|
220
|
+
onChange: (e) => {
|
|
221
|
+
p(e.target.value), b(null);
|
|
222
|
+
},
|
|
223
|
+
placeholder: "lin_api_…"
|
|
224
|
+
})
|
|
225
|
+
}),
|
|
226
|
+
_ && /* @__PURE__ */ E("fieldset", {
|
|
227
|
+
className: "space-y-2",
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ T("legend", {
|
|
230
|
+
className: "text-sm font-medium",
|
|
231
|
+
children: o("teamsFrom", { organization: _.organization })
|
|
232
|
+
}),
|
|
233
|
+
_.teams.length === 0 && /* @__PURE__ */ T("p", {
|
|
234
|
+
className: "text-sm text-muted-foreground",
|
|
235
|
+
children: o("noTeams")
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ T("ul", {
|
|
238
|
+
className: "divide-y divide-border rounded-md border border-border",
|
|
239
|
+
children: _.teams.map((e) => {
|
|
240
|
+
let t = S[e.id];
|
|
241
|
+
return t ? /* @__PURE__ */ E("li", {
|
|
242
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",
|
|
243
|
+
children: [/* @__PURE__ */ E("label", {
|
|
244
|
+
className: "flex min-w-0 flex-1 items-center gap-2 text-sm",
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ T(f, {
|
|
247
|
+
checked: t.on,
|
|
248
|
+
onCheckedChange: (t) => L(e.id, { on: t })
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ E("span", {
|
|
251
|
+
className: "truncate",
|
|
252
|
+
children: [
|
|
253
|
+
e.name,
|
|
254
|
+
" ",
|
|
255
|
+
/* @__PURE__ */ E("span", {
|
|
256
|
+
className: "text-muted-foreground",
|
|
257
|
+
children: [
|
|
258
|
+
"(",
|
|
259
|
+
e.key,
|
|
260
|
+
")"
|
|
261
|
+
]
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ T("span", {
|
|
266
|
+
className: "text-xs text-muted-foreground",
|
|
267
|
+
children: o("issues", { count: e.issueCount })
|
|
268
|
+
})
|
|
269
|
+
]
|
|
270
|
+
}), t.on && /* @__PURE__ */ E("div", {
|
|
271
|
+
className: "flex basis-full flex-wrap items-center gap-2 pl-6 sm:basis-auto sm:pl-0",
|
|
272
|
+
children: [/* @__PURE__ */ T(v, {
|
|
273
|
+
"aria-label": o("into", { team: e.name }),
|
|
274
|
+
value: t.target,
|
|
275
|
+
onValueChange: (t) => t && L(e.id, { target: t }),
|
|
276
|
+
items: [{
|
|
277
|
+
value: N,
|
|
278
|
+
label: o("newTeam")
|
|
279
|
+
}, ...M.map((e) => ({
|
|
280
|
+
value: e.key,
|
|
281
|
+
label: `${e.name} (${e.key})`
|
|
282
|
+
}))],
|
|
283
|
+
size: "sm",
|
|
284
|
+
width: "content"
|
|
285
|
+
}), t.target === N && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(g, {
|
|
286
|
+
"aria-label": o("newKey"),
|
|
287
|
+
value: t.newKey,
|
|
288
|
+
onChange: (t) => L(e.id, { newKey: t.target.value.toUpperCase() }),
|
|
289
|
+
className: "w-24",
|
|
290
|
+
maxLength: 10,
|
|
291
|
+
required: !0
|
|
292
|
+
}), /* @__PURE__ */ T(g, {
|
|
293
|
+
"aria-label": o("newName"),
|
|
294
|
+
value: t.newName,
|
|
295
|
+
onChange: (t) => L(e.id, { newName: t.target.value }),
|
|
296
|
+
className: "w-44",
|
|
297
|
+
required: !0
|
|
298
|
+
})] })]
|
|
299
|
+
})]
|
|
300
|
+
}, e.id) : null;
|
|
301
|
+
})
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ E("div", {
|
|
306
|
+
className: "flex flex-wrap items-center gap-3",
|
|
307
|
+
children: [_ ? /* @__PURE__ */ T(d, {
|
|
308
|
+
type: "submit",
|
|
309
|
+
variant: "primary",
|
|
310
|
+
loading: F.isPending,
|
|
311
|
+
disabled: I === 0,
|
|
312
|
+
children: o("start", { count: I })
|
|
313
|
+
}) : /* @__PURE__ */ T(d, {
|
|
314
|
+
type: "submit",
|
|
315
|
+
variant: "primary",
|
|
316
|
+
loading: P.isPending,
|
|
317
|
+
children: o("findTeams")
|
|
318
|
+
}), _ && /* @__PURE__ */ T("span", {
|
|
319
|
+
className: "text-xs text-muted-foreground",
|
|
320
|
+
children: o("total", { count: _.teams.filter((e) => S[e.id]?.on).reduce((e, t) => e + t.issueCount, 0) })
|
|
321
|
+
})]
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ T(m, {
|
|
324
|
+
size: "md",
|
|
325
|
+
children: j.error
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
}) });
|
|
329
|
+
}
|
|
330
|
+
export { A as component };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { linearImportQuery as e, teamsQuery as t } from "../../../api/queries.js";
|
|
2
|
+
// src/routes/$workspace/settings/import.tsx?tsr-split=loader
|
|
3
|
+
var n = ({ context: { queryClient: n }, params: { workspace: r } }) => Promise.all([n.ensureQueryData(e(r)), n.ensureQueryData(t(r))]);
|
|
4
|
+
export { n as loader };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
2
|
import { useNavigate as n } from "../../../lib/router.js";
|
|
3
3
|
import { labelsQuery as r } from "../../../api/queries.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { useConfirm as i } from "../../../lib/confirm.js";
|
|
5
|
+
import { TagIcon as a } from "../../../components/icons.js";
|
|
6
|
+
import { Route as o } from "./labels.js";
|
|
7
|
+
import { copyItem as s } from "../../../lib/menus.js";
|
|
8
|
+
import { useCan as c } from "../../../lib/roles.js";
|
|
9
|
+
import { AdminOnly as l, SettingsPage as u, useFormError as d } from "../../../components/settings.js";
|
|
10
10
|
import { Button as f, ColorInput as p, ErrorText as m, Input as h, Modal as g, ModalTitle as _, PageHeaderAddButton as v, Table as y, menuDivider as b, useOpenMenu as x } from "@parallelworks/ui";
|
|
11
11
|
import { useMemo as S, useState as C } from "react";
|
|
12
12
|
import { useTranslations as w } from "use-intl";
|
|
@@ -15,22 +15,22 @@ import { useMutation as D, useQueryClient as O, useSuspenseQuery as k } from "@t
|
|
|
15
15
|
import { ListCellText as A, ListColumns as j, ListPage as M, ListRow as N, ListToolbar as P, NameCell as F, listTableProps as I, useListNavigate as L, useListSearch as R, useListView as z } from "@parallelworks/ui/list";
|
|
16
16
|
// src/routes/$workspace/settings/labels.tsx?tsr-split=component
|
|
17
17
|
function B() {
|
|
18
|
-
let { workspace: e } =
|
|
18
|
+
let { workspace: e } = o.useParams();
|
|
19
19
|
return /* @__PURE__ */ T(V, {
|
|
20
20
|
workspace: e,
|
|
21
|
-
isAdmin:
|
|
21
|
+
isAdmin: c(e, "manage_labels")
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function V({ workspace:
|
|
25
|
-
let { data:
|
|
24
|
+
function V({ workspace: o, isAdmin: c }) {
|
|
25
|
+
let { data: d } = k(r(o)), f = n(), p = w("settings"), m = w("common"), h = R(), g = L(), _ = x(), [B, V] = C(null), U = O(), { confirm: W, dialog: G } = i(), K = D({
|
|
26
26
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/labels/{labelId}", { params: { path: {
|
|
27
|
-
workspace:
|
|
27
|
+
workspace: o,
|
|
28
28
|
labelId: n.id
|
|
29
29
|
} } })),
|
|
30
30
|
onSettled: () => {
|
|
31
|
-
U.invalidateQueries({ queryKey: r(
|
|
31
|
+
U.invalidateQueries({ queryKey: r(o).queryKey }), U.invalidateQueries({ queryKey: [
|
|
32
32
|
"workspace",
|
|
33
|
-
|
|
33
|
+
o,
|
|
34
34
|
"issues"
|
|
35
35
|
] });
|
|
36
36
|
}
|
|
@@ -54,23 +54,23 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
54
54
|
label: m("name"),
|
|
55
55
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
56
56
|
}], [m]), X = z({
|
|
57
|
-
storageKey: `tandem-labels-${
|
|
57
|
+
storageKey: `tandem-labels-${o}`,
|
|
58
58
|
defaultShowColumnHeaders: !1,
|
|
59
59
|
columns: J,
|
|
60
60
|
orderBys: Y,
|
|
61
61
|
defaultOrderBy: "name",
|
|
62
62
|
facets: []
|
|
63
|
-
}), Z = h.filter.trim().toLowerCase(), Q =
|
|
64
|
-
return /* @__PURE__ */ E(
|
|
63
|
+
}), Z = h.filter.trim().toLowerCase(), Q = d.filter((e) => !Z || e.name.toLowerCase().includes(Z)), $ = d.find((e) => e.id === B);
|
|
64
|
+
return /* @__PURE__ */ E(u, {
|
|
65
65
|
wide: !0,
|
|
66
66
|
title: m("labels"),
|
|
67
67
|
description: p("labelsDescription"),
|
|
68
|
-
actions:
|
|
68
|
+
actions: c && /* @__PURE__ */ T(v, {
|
|
69
69
|
label: p("newLabel"),
|
|
70
70
|
word: "create",
|
|
71
71
|
onClick: () => V("new")
|
|
72
72
|
}),
|
|
73
|
-
toolbar:
|
|
73
|
+
toolbar: d.length > 0 && /* @__PURE__ */ T(P, {
|
|
74
74
|
view: X,
|
|
75
75
|
search: h,
|
|
76
76
|
searchLabel: p("labelSearch"),
|
|
@@ -79,8 +79,8 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
79
79
|
children: [
|
|
80
80
|
/* @__PURE__ */ T("div", {
|
|
81
81
|
className: "px-4",
|
|
82
|
-
children: /* @__PURE__ */ T(
|
|
83
|
-
workspace:
|
|
82
|
+
children: /* @__PURE__ */ T(l, {
|
|
83
|
+
workspace: o,
|
|
84
84
|
permission: "manage_labels"
|
|
85
85
|
})
|
|
86
86
|
}),
|
|
@@ -88,7 +88,7 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
88
88
|
className: "border-t border-border",
|
|
89
89
|
children: /* @__PURE__ */ T(M, {
|
|
90
90
|
view: X,
|
|
91
|
-
total:
|
|
91
|
+
total: d.length,
|
|
92
92
|
matches: Q.length,
|
|
93
93
|
count: {
|
|
94
94
|
filterActive: h.filter.trim() !== "",
|
|
@@ -96,7 +96,7 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
96
96
|
nounPlural: p("labelNounPlural")
|
|
97
97
|
},
|
|
98
98
|
empty: {
|
|
99
|
-
icon: /* @__PURE__ */ T(
|
|
99
|
+
icon: /* @__PURE__ */ T(a, {}),
|
|
100
100
|
title: p("noLabels")
|
|
101
101
|
},
|
|
102
102
|
noMatches: p("labelNoMatches"),
|
|
@@ -104,7 +104,7 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
104
104
|
...I,
|
|
105
105
|
children: [/* @__PURE__ */ T(j, { view: X }), X.applyOrder(Q).map((e) => /* @__PURE__ */ E(N, {
|
|
106
106
|
href: null,
|
|
107
|
-
onActivate:
|
|
107
|
+
onActivate: c ? () => V(e.id) : void 0,
|
|
108
108
|
goTo: g,
|
|
109
109
|
openMenu: _,
|
|
110
110
|
items: [
|
|
@@ -112,13 +112,13 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
112
112
|
label: p("viewIssues"),
|
|
113
113
|
onClick: () => f({
|
|
114
114
|
to: "/$workspace/issues",
|
|
115
|
-
params: { workspace:
|
|
115
|
+
params: { workspace: o },
|
|
116
116
|
search: { label: e.name }
|
|
117
117
|
})
|
|
118
118
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
...
|
|
119
|
+
s(m("copyName"), e.name),
|
|
120
|
+
s(p("copyColor"), e.color),
|
|
121
|
+
...c ? [
|
|
122
122
|
b,
|
|
123
123
|
{
|
|
124
124
|
label: p("editLabel"),
|
|
@@ -151,7 +151,7 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
151
151
|
})
|
|
152
152
|
}),
|
|
153
153
|
(B === "new" || $) && /* @__PURE__ */ T(H, {
|
|
154
|
-
workspace:
|
|
154
|
+
workspace: o,
|
|
155
155
|
label: $,
|
|
156
156
|
onDone: () => V(null)
|
|
157
157
|
}),
|
|
@@ -160,20 +160,20 @@ function V({ workspace: a, isAdmin: s }) {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
function H({ workspace: n, label: i, onDone: a }) {
|
|
163
|
-
let o = w("settings"), s = w("common"), c = O(), l =
|
|
163
|
+
let o = w("settings"), s = w("common"), c = O(), l = d(), [u, v] = C(i?.name ?? ""), [y, b] = C(i?.color ?? "#d73a4a"), x = D({
|
|
164
164
|
mutationFn: async () => t(i ? await e.PATCH("/api/v1/workspaces/{workspace}/labels/{labelId}", {
|
|
165
165
|
params: { path: {
|
|
166
166
|
workspace: n,
|
|
167
167
|
labelId: i.id
|
|
168
168
|
} },
|
|
169
169
|
body: {
|
|
170
|
-
...
|
|
170
|
+
...u !== i.name && { name: u },
|
|
171
171
|
...y !== i.color && { color: y }
|
|
172
172
|
}
|
|
173
173
|
}) : await e.POST("/api/v1/workspaces/{workspace}/labels", {
|
|
174
174
|
params: { path: { workspace: n } },
|
|
175
175
|
body: {
|
|
176
|
-
name:
|
|
176
|
+
name: u,
|
|
177
177
|
color: y
|
|
178
178
|
}
|
|
179
179
|
})),
|
|
@@ -211,7 +211,7 @@ function H({ workspace: n, label: i, onDone: a }) {
|
|
|
211
211
|
required: !0,
|
|
212
212
|
autoFocus: !0,
|
|
213
213
|
placeholder: o("labelName"),
|
|
214
|
-
value:
|
|
214
|
+
value: u,
|
|
215
215
|
onChange: (e) => v(e.target.value),
|
|
216
216
|
"aria-label": o("labelName"),
|
|
217
217
|
className: "min-w-0 flex-1"
|
|
@@ -231,7 +231,7 @@ function H({ workspace: n, label: i, onDone: a }) {
|
|
|
231
231
|
}), /* @__PURE__ */ T(f, {
|
|
232
232
|
type: "submit",
|
|
233
233
|
variant: "primary",
|
|
234
|
-
disabled: !
|
|
234
|
+
disabled: !u.trim(),
|
|
235
235
|
loading: x.isPending,
|
|
236
236
|
children: i ? s("save") : o("createLabel")
|
|
237
237
|
})]
|