@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,180 +1,207 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../api/client.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useConfirm as i } from "../../../lib/confirm.js";
|
|
2
|
+
import { jiraImportQuery as n, linearImportQuery as r, teamsQuery as i } from "../../../api/queries.js";
|
|
4
3
|
import { MigrationIcon as a } from "../../../components/icons.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { useCan as o } from "../../../lib/roles.js";
|
|
5
|
+
import { useConfirm as s } from "../../../lib/confirm.js";
|
|
7
6
|
import { AdminOnly as c, SettingsPage as l, useFormError as u } from "../../../components/settings.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { Route as d } from "./import.js";
|
|
8
|
+
import { Button as f, Checkbox as p, Disclosure as m, ErrorText as h, Field as g, Input as _, ProgressBar as v, SegmentedControl as y, Select as b, SettingsCard as x, StatusLabel as S, Tabs as C } from "@parallelworks/ui";
|
|
9
|
+
import { useState as w } from "react";
|
|
10
|
+
import { useFormatter as T, useTranslations as E } from "use-intl";
|
|
11
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
12
|
+
import { useMutation as A, useQueryClient as j, useSuspenseQuery as M } from "@tanstack/react-query";
|
|
13
13
|
// src/routes/$workspace/settings/import.tsx?tsr-split=component
|
|
14
|
-
function
|
|
15
|
-
let { workspace: e } =
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
title:
|
|
18
|
-
description:
|
|
19
|
-
children: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
14
|
+
function N() {
|
|
15
|
+
let { workspace: e } = d.useParams(), { data: t } = M(r(e)), { data: i } = M(n(e)), a = o(e, "manage_workspace"), s = E("settingsNav"), u = E("linearImport"), f = E("jiraImport"), [p, m] = w(() => i.import && !t.import ? "jira" : "linear"), h = p === "jira" ? i : t, g = h.import?.status === "running";
|
|
16
|
+
return /* @__PURE__ */ k(l, {
|
|
17
|
+
title: s("import"),
|
|
18
|
+
description: p === "jira" ? f("pageDescription") : u("pageDescription"),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ O(c, { workspace: e }),
|
|
21
|
+
/* @__PURE__ */ O(C, {
|
|
22
|
+
label: f("from"),
|
|
23
|
+
variant: "line",
|
|
24
|
+
size: "sm",
|
|
25
|
+
items: [{
|
|
26
|
+
value: "linear",
|
|
27
|
+
label: f("sources.linear")
|
|
28
|
+
}, {
|
|
29
|
+
value: "jira",
|
|
30
|
+
label: f("sources.jira")
|
|
31
|
+
}],
|
|
32
|
+
value: p,
|
|
33
|
+
onValueChange: m
|
|
34
|
+
}),
|
|
35
|
+
h.enabled ? /* @__PURE__ */ k("div", {
|
|
36
|
+
className: "space-y-6",
|
|
37
|
+
children: [
|
|
38
|
+
h.import && /* @__PURE__ */ O(F, {
|
|
39
|
+
workspace: e,
|
|
40
|
+
source: p,
|
|
41
|
+
im: h.import
|
|
42
|
+
}),
|
|
43
|
+
a && !g && O(p === "jira" ? R : L, {
|
|
44
|
+
workspace: e,
|
|
45
|
+
again: !!h.import
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ k("section", {
|
|
48
|
+
className: "space-y-2 text-sm",
|
|
49
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
50
|
+
className: "font-medium",
|
|
51
|
+
children: u("howTitle")
|
|
52
|
+
}), p === "jira" ? /* @__PURE__ */ k("ul", {
|
|
53
|
+
className: "list-disc space-y-1.5 pl-5 text-muted-foreground",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ O("li", { children: f("howIssues") }),
|
|
56
|
+
/* @__PURE__ */ O("li", { children: f("howWorkflow") }),
|
|
57
|
+
/* @__PURE__ */ O("li", { children: f("howProjects") }),
|
|
58
|
+
/* @__PURE__ */ O("li", { children: f("howPeople") }),
|
|
59
|
+
/* @__PURE__ */ O("li", { children: f("howLeftOut") })
|
|
60
|
+
]
|
|
61
|
+
}) : /* @__PURE__ */ k("ul", {
|
|
62
|
+
className: "list-disc space-y-1.5 pl-5 text-muted-foreground",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ O("li", { children: u("howIssues") }),
|
|
65
|
+
/* @__PURE__ */ O("li", { children: u("howWorkflow") }),
|
|
66
|
+
/* @__PURE__ */ O("li", { children: u("howProjects") }),
|
|
67
|
+
/* @__PURE__ */ O("li", { children: u("howPeople") })
|
|
68
|
+
]
|
|
69
|
+
})]
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}) : /* @__PURE__ */ O(x, { children: /* @__PURE__ */ O("p", {
|
|
73
|
+
className: "px-3 py-2 text-sm text-muted-foreground",
|
|
74
|
+
children: u("notConfigured")
|
|
75
|
+
}) })
|
|
76
|
+
]
|
|
50
77
|
});
|
|
51
78
|
}
|
|
52
|
-
var
|
|
79
|
+
var P = {
|
|
53
80
|
running: "info",
|
|
54
81
|
done: "success",
|
|
55
82
|
failed: "error",
|
|
56
83
|
canceled: "muted"
|
|
57
84
|
};
|
|
58
|
-
function
|
|
59
|
-
let
|
|
60
|
-
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/linear/import/cancel", { params: { path: { workspace:
|
|
61
|
-
onMutate:
|
|
62
|
-
onSuccess: () =>
|
|
63
|
-
onError:
|
|
64
|
-
}),
|
|
65
|
-
return /* @__PURE__ */
|
|
85
|
+
function F({ workspace: i, source: c, im: l }) {
|
|
86
|
+
let d = E("linearImport"), p = T(), g = o(i, "manage_workspace"), _ = j(), y = u(), { confirm: b, dialog: C } = s(), w = A({
|
|
87
|
+
mutationFn: async () => t(c === "jira" ? await e.POST("/api/v1/workspaces/{workspace}/jira/import/cancel", { params: { path: { workspace: i } } }) : await e.POST("/api/v1/workspaces/{workspace}/linear/import/cancel", { params: { path: { workspace: i } } })),
|
|
88
|
+
onMutate: y.clear,
|
|
89
|
+
onSuccess: () => _.invalidateQueries({ queryKey: (c === "jira" ? n : r)(i).queryKey }),
|
|
90
|
+
onError: y.set
|
|
91
|
+
}), D = l.status === "running";
|
|
92
|
+
return /* @__PURE__ */ k(x, { children: [C, /* @__PURE__ */ k("div", {
|
|
66
93
|
className: "space-y-3 px-3 py-3",
|
|
67
94
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ k("div", {
|
|
69
96
|
className: "flex flex-wrap items-center gap-3",
|
|
70
97
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ O(a, { className: "size-5 text-muted-foreground" }),
|
|
99
|
+
/* @__PURE__ */ k("div", {
|
|
73
100
|
className: "min-w-0 flex-1",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ O("p", {
|
|
75
102
|
className: "text-sm font-medium",
|
|
76
|
-
children:
|
|
77
|
-
}), /* @__PURE__ */
|
|
103
|
+
children: d("lastImport", { organization: l.organization })
|
|
104
|
+
}), /* @__PURE__ */ O("p", {
|
|
78
105
|
className: "text-xs text-muted-foreground",
|
|
79
|
-
children:
|
|
106
|
+
children: d("startedAt", { date: p.dateTime(new Date(l.startedAt), {
|
|
80
107
|
dateStyle: "medium",
|
|
81
108
|
timeStyle: "short"
|
|
82
109
|
}) })
|
|
83
110
|
})]
|
|
84
111
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
variant:
|
|
87
|
-
pulse:
|
|
88
|
-
children:
|
|
112
|
+
/* @__PURE__ */ O(S, {
|
|
113
|
+
variant: P[l.status],
|
|
114
|
+
pulse: D,
|
|
115
|
+
children: d(`status.${l.status}`)
|
|
89
116
|
}),
|
|
90
|
-
|
|
117
|
+
g && D && /* @__PURE__ */ O(f, {
|
|
91
118
|
type: "button",
|
|
92
119
|
size: "sm",
|
|
93
120
|
variant: "outline",
|
|
94
121
|
loading: w.isPending,
|
|
95
|
-
onClick: () =>
|
|
96
|
-
title:
|
|
97
|
-
description:
|
|
98
|
-
confirmLabel:
|
|
122
|
+
onClick: () => b({
|
|
123
|
+
title: d("cancelTitle"),
|
|
124
|
+
description: d("cancelDescription"),
|
|
125
|
+
confirmLabel: d("cancel"),
|
|
99
126
|
onConfirm: () => w.mutateAsync()
|
|
100
127
|
}),
|
|
101
|
-
children:
|
|
128
|
+
children: d("cancel")
|
|
102
129
|
})
|
|
103
130
|
]
|
|
104
131
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
value:
|
|
107
|
-
max:
|
|
108
|
-
label:
|
|
109
|
-
valueText: () =>
|
|
110
|
-
processed:
|
|
111
|
-
total:
|
|
132
|
+
/* @__PURE__ */ O(v, {
|
|
133
|
+
value: l.total > 0 ? Math.min(l.processed, l.total) : D ? null : 1,
|
|
134
|
+
max: l.total > 0 ? l.total : 1,
|
|
135
|
+
label: d("issuesLabel"),
|
|
136
|
+
valueText: () => d("progress", {
|
|
137
|
+
processed: l.processed,
|
|
138
|
+
total: l.total
|
|
112
139
|
})
|
|
113
140
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ O("ul", {
|
|
115
142
|
className: "space-y-1 text-sm",
|
|
116
|
-
children:
|
|
143
|
+
children: l.teams.map((e) => /* @__PURE__ */ O("li", {
|
|
117
144
|
className: "text-muted-foreground",
|
|
118
|
-
children:
|
|
145
|
+
children: d("teamRow", {
|
|
119
146
|
source: `${e.sourceName} (${e.sourceKey})`,
|
|
120
147
|
team: e.teamKey ?? ""
|
|
121
148
|
})
|
|
122
149
|
}, e.sourceKey))
|
|
123
150
|
}),
|
|
124
|
-
|
|
125
|
-
className: `text-sm ${
|
|
126
|
-
children:
|
|
151
|
+
l.error && /* @__PURE__ */ O("p", {
|
|
152
|
+
className: `text-sm ${D ? "text-muted-foreground" : "text-danger"}`,
|
|
153
|
+
children: d(D ? "retrying" : "stopped", { error: l.error })
|
|
127
154
|
}),
|
|
128
|
-
|
|
129
|
-
summary:
|
|
130
|
-
children: /* @__PURE__ */
|
|
155
|
+
l.skipped > 0 && /* @__PURE__ */ O(m, {
|
|
156
|
+
summary: d("skipped", { count: l.skipped }),
|
|
157
|
+
children: /* @__PURE__ */ O("ul", {
|
|
131
158
|
className: "space-y-1 pt-2 text-sm",
|
|
132
|
-
children:
|
|
133
|
-
/* @__PURE__ */
|
|
159
|
+
children: l.skips.map((e, t) => /* @__PURE__ */ k("li", { children: [
|
|
160
|
+
/* @__PURE__ */ O("span", {
|
|
134
161
|
className: "font-medium",
|
|
135
162
|
children: e.item
|
|
136
163
|
}),
|
|
137
164
|
" ",
|
|
138
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ O("span", {
|
|
139
166
|
className: "text-muted-foreground",
|
|
140
|
-
children:
|
|
167
|
+
children: d(`skipReason.${e.reason}`, { field: e.field ?? "" })
|
|
141
168
|
})
|
|
142
169
|
] }, t))
|
|
143
170
|
})
|
|
144
171
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ O(h, {
|
|
146
173
|
size: "md",
|
|
147
|
-
children:
|
|
174
|
+
children: y.error
|
|
148
175
|
})
|
|
149
176
|
]
|
|
150
177
|
})] });
|
|
151
178
|
}
|
|
152
|
-
var
|
|
153
|
-
function
|
|
154
|
-
let o =
|
|
179
|
+
var I = "__new__";
|
|
180
|
+
function L({ workspace: n, again: a }) {
|
|
181
|
+
let o = E("linearImport"), s = j(), { data: c } = M(i(n)), [l, d] = w(""), [m, v] = w(null), [y, S] = w({}), C = u(), T = c.filter((e) => !e.archivedAt), N = A({
|
|
155
182
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/linear/teams", {
|
|
156
|
-
params: { path: { workspace:
|
|
183
|
+
params: { path: { workspace: n } },
|
|
157
184
|
body: { apiKey: l }
|
|
158
185
|
})),
|
|
159
|
-
onMutate:
|
|
186
|
+
onMutate: C.clear,
|
|
160
187
|
onSuccess: (e) => {
|
|
161
|
-
|
|
162
|
-
let t =
|
|
188
|
+
v(e), S(Object.fromEntries(e.teams.map((e) => {
|
|
189
|
+
let t = T.find((t) => t.key === e.key);
|
|
163
190
|
return [e.id, {
|
|
164
191
|
on: !0,
|
|
165
|
-
target: t?.key ??
|
|
192
|
+
target: t?.key ?? I,
|
|
166
193
|
newKey: e.key,
|
|
167
194
|
newName: e.name
|
|
168
195
|
}];
|
|
169
196
|
})));
|
|
170
197
|
},
|
|
171
|
-
onError:
|
|
172
|
-
}),
|
|
198
|
+
onError: C.set
|
|
199
|
+
}), P = A({
|
|
173
200
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/linear/import", {
|
|
174
|
-
params: { path: { workspace:
|
|
201
|
+
params: { path: { workspace: n } },
|
|
175
202
|
body: {
|
|
176
203
|
apiKey: l,
|
|
177
|
-
teams: Object.entries(
|
|
204
|
+
teams: Object.entries(y).filter(([, e]) => e.on).map(([e, t]) => t.target === I ? {
|
|
178
205
|
sourceId: e,
|
|
179
206
|
newKey: t.newKey,
|
|
180
207
|
newName: t.newName
|
|
@@ -184,75 +211,75 @@ function P({ workspace: i, again: a }) {
|
|
|
184
211
|
})
|
|
185
212
|
}
|
|
186
213
|
})),
|
|
187
|
-
onMutate:
|
|
214
|
+
onMutate: C.clear,
|
|
188
215
|
onSuccess: () => {
|
|
189
|
-
|
|
216
|
+
d(""), v(null), s.invalidateQueries({ queryKey: r(n).queryKey }), s.invalidateQueries({ queryKey: i(n).queryKey });
|
|
190
217
|
},
|
|
191
|
-
onError:
|
|
192
|
-
}),
|
|
218
|
+
onError: C.set
|
|
219
|
+
}), F = Object.values(y).filter((e) => e.on).length, L = (e, t) => S((n) => ({
|
|
193
220
|
...n,
|
|
194
221
|
[e]: {
|
|
195
222
|
...n[e],
|
|
196
223
|
...t
|
|
197
224
|
}
|
|
198
225
|
}));
|
|
199
|
-
return /* @__PURE__ */
|
|
226
|
+
return /* @__PURE__ */ O(x, { children: /* @__PURE__ */ k("form", {
|
|
200
227
|
className: "space-y-4 px-3 py-3",
|
|
201
228
|
onSubmit: (e) => {
|
|
202
|
-
e.preventDefault(),
|
|
229
|
+
e.preventDefault(), m ? P.mutate() : N.mutate();
|
|
203
230
|
},
|
|
204
231
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
|
|
206
233
|
className: "text-sm font-medium",
|
|
207
234
|
children: o(a ? "again" : "startTitle")
|
|
208
|
-
}), a && /* @__PURE__ */
|
|
235
|
+
}), a && /* @__PURE__ */ O("p", {
|
|
209
236
|
className: "text-xs text-muted-foreground",
|
|
210
237
|
children: o("againHelp")
|
|
211
238
|
})] }),
|
|
212
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ O(g, {
|
|
213
240
|
label: o("keyLabel"),
|
|
214
241
|
description: o("keyHelp"),
|
|
215
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ O(_, {
|
|
216
243
|
type: "password",
|
|
217
244
|
autoComplete: "off",
|
|
218
245
|
required: !0,
|
|
219
246
|
value: l,
|
|
220
247
|
onChange: (e) => {
|
|
221
|
-
|
|
248
|
+
d(e.target.value), v(null);
|
|
222
249
|
},
|
|
223
250
|
placeholder: "lin_api_…"
|
|
224
251
|
})
|
|
225
252
|
}),
|
|
226
|
-
|
|
253
|
+
m && /* @__PURE__ */ k("fieldset", {
|
|
227
254
|
className: "space-y-2",
|
|
228
255
|
children: [
|
|
229
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ O("legend", {
|
|
230
257
|
className: "text-sm font-medium",
|
|
231
|
-
children: o("teamsFrom", { organization:
|
|
258
|
+
children: o("teamsFrom", { organization: m.organization })
|
|
232
259
|
}),
|
|
233
|
-
|
|
260
|
+
m.teams.length === 0 && /* @__PURE__ */ O("p", {
|
|
234
261
|
className: "text-sm text-muted-foreground",
|
|
235
262
|
children: o("noTeams")
|
|
236
263
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ O("ul", {
|
|
238
265
|
className: "divide-y divide-border rounded-md border border-border",
|
|
239
|
-
children:
|
|
240
|
-
let t =
|
|
241
|
-
return t ? /* @__PURE__ */
|
|
266
|
+
children: m.teams.map((e) => {
|
|
267
|
+
let t = y[e.id];
|
|
268
|
+
return t ? /* @__PURE__ */ k("li", {
|
|
242
269
|
className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ k("label", {
|
|
244
271
|
className: "flex min-w-0 flex-1 items-center gap-2 text-sm",
|
|
245
272
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ O(p, {
|
|
247
274
|
checked: t.on,
|
|
248
275
|
onCheckedChange: (t) => L(e.id, { on: t })
|
|
249
276
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ k("span", {
|
|
251
278
|
className: "truncate",
|
|
252
279
|
children: [
|
|
253
280
|
e.name,
|
|
254
281
|
" ",
|
|
255
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ k("span", {
|
|
256
283
|
className: "text-muted-foreground",
|
|
257
284
|
children: [
|
|
258
285
|
"(",
|
|
@@ -262,34 +289,34 @@ function P({ workspace: i, again: a }) {
|
|
|
262
289
|
})
|
|
263
290
|
]
|
|
264
291
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ O("span", {
|
|
266
293
|
className: "text-xs text-muted-foreground",
|
|
267
294
|
children: o("issues", { count: e.issueCount })
|
|
268
295
|
})
|
|
269
296
|
]
|
|
270
|
-
}), t.on && /* @__PURE__ */
|
|
297
|
+
}), t.on && /* @__PURE__ */ k("div", {
|
|
271
298
|
className: "flex basis-full flex-wrap items-center gap-2 pl-6 sm:basis-auto sm:pl-0",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ O(b, {
|
|
273
300
|
"aria-label": o("into", { team: e.name }),
|
|
274
301
|
value: t.target,
|
|
275
302
|
onValueChange: (t) => t && L(e.id, { target: t }),
|
|
276
303
|
items: [{
|
|
277
|
-
value:
|
|
304
|
+
value: I,
|
|
278
305
|
label: o("newTeam")
|
|
279
|
-
}, ...
|
|
306
|
+
}, ...T.map((e) => ({
|
|
280
307
|
value: e.key,
|
|
281
308
|
label: `${e.name} (${e.key})`
|
|
282
309
|
}))],
|
|
283
310
|
size: "sm",
|
|
284
311
|
width: "content"
|
|
285
|
-
}), t.target ===
|
|
312
|
+
}), t.target === I && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(_, {
|
|
286
313
|
"aria-label": o("newKey"),
|
|
287
314
|
value: t.newKey,
|
|
288
315
|
onChange: (t) => L(e.id, { newKey: t.target.value.toUpperCase() }),
|
|
289
316
|
className: "w-24",
|
|
290
317
|
maxLength: 10,
|
|
291
318
|
required: !0
|
|
292
|
-
}), /* @__PURE__ */
|
|
319
|
+
}), /* @__PURE__ */ O(_, {
|
|
293
320
|
"aria-label": o("newName"),
|
|
294
321
|
value: t.newName,
|
|
295
322
|
onChange: (t) => L(e.id, { newName: t.target.value }),
|
|
@@ -302,29 +329,253 @@ function P({ workspace: i, again: a }) {
|
|
|
302
329
|
})
|
|
303
330
|
]
|
|
304
331
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ k("div", {
|
|
306
333
|
className: "flex flex-wrap items-center gap-3",
|
|
307
|
-
children: [
|
|
334
|
+
children: [m ? /* @__PURE__ */ O(f, {
|
|
308
335
|
type: "submit",
|
|
309
336
|
variant: "primary",
|
|
310
|
-
loading:
|
|
311
|
-
disabled:
|
|
312
|
-
children: o("start", { count:
|
|
313
|
-
}) : /* @__PURE__ */
|
|
337
|
+
loading: P.isPending,
|
|
338
|
+
disabled: F === 0,
|
|
339
|
+
children: o("start", { count: F })
|
|
340
|
+
}) : /* @__PURE__ */ O(f, {
|
|
314
341
|
type: "submit",
|
|
315
342
|
variant: "primary",
|
|
316
|
-
loading:
|
|
343
|
+
loading: N.isPending,
|
|
317
344
|
children: o("findTeams")
|
|
318
|
-
}),
|
|
345
|
+
}), m && /* @__PURE__ */ O("span", {
|
|
346
|
+
className: "text-xs text-muted-foreground",
|
|
347
|
+
children: o("total", { count: m.teams.filter((e) => y[e.id]?.on).reduce((e, t) => e + t.issueCount, 0) })
|
|
348
|
+
})]
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ O(h, {
|
|
351
|
+
size: "md",
|
|
352
|
+
children: C.error
|
|
353
|
+
})
|
|
354
|
+
]
|
|
355
|
+
}) });
|
|
356
|
+
}
|
|
357
|
+
function R({ workspace: r, again: a }) {
|
|
358
|
+
let o = E("linearImport"), s = E("jiraImport"), c = j(), { data: l } = M(i(r)), [d, m] = w(!0), [v, S] = w(""), [C, T] = w(""), [N, P] = w(""), [F, L] = w(null), [R, z] = w({}), B = u(), V = l.filter((e) => !e.archivedAt), H = d ? {
|
|
359
|
+
url: v,
|
|
360
|
+
cloud: d,
|
|
361
|
+
email: C,
|
|
362
|
+
token: N
|
|
363
|
+
} : {
|
|
364
|
+
url: v,
|
|
365
|
+
cloud: d,
|
|
366
|
+
token: N
|
|
367
|
+
}, U = () => L(null), W = A({
|
|
368
|
+
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/jira/projects", {
|
|
369
|
+
params: { path: { workspace: r } },
|
|
370
|
+
body: H
|
|
371
|
+
})),
|
|
372
|
+
onMutate: B.clear,
|
|
373
|
+
onSuccess: (e) => {
|
|
374
|
+
L(e), z(Object.fromEntries(e.projects.map((e) => {
|
|
375
|
+
let t = V.find((t) => t.key === e.key);
|
|
376
|
+
return [e.id, {
|
|
377
|
+
on: !0,
|
|
378
|
+
target: t?.key ?? I,
|
|
379
|
+
newKey: e.key.slice(0, 10),
|
|
380
|
+
newName: e.name
|
|
381
|
+
}];
|
|
382
|
+
})));
|
|
383
|
+
},
|
|
384
|
+
onError: B.set
|
|
385
|
+
}), G = A({
|
|
386
|
+
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/jira/import", {
|
|
387
|
+
params: { path: { workspace: r } },
|
|
388
|
+
body: {
|
|
389
|
+
...H,
|
|
390
|
+
projects: Object.entries(R).filter(([, e]) => e.on).map(([e, t]) => t.target === I ? {
|
|
391
|
+
sourceId: e,
|
|
392
|
+
newKey: t.newKey,
|
|
393
|
+
newName: t.newName
|
|
394
|
+
} : {
|
|
395
|
+
sourceId: e,
|
|
396
|
+
teamKey: t.target
|
|
397
|
+
})
|
|
398
|
+
}
|
|
399
|
+
})),
|
|
400
|
+
onMutate: B.clear,
|
|
401
|
+
onSuccess: () => {
|
|
402
|
+
P(""), L(null), c.invalidateQueries({ queryKey: n(r).queryKey }), c.invalidateQueries({ queryKey: i(r).queryKey });
|
|
403
|
+
},
|
|
404
|
+
onError: B.set
|
|
405
|
+
}), K = Object.values(R).filter((e) => e.on).length, q = (e, t) => z((n) => ({
|
|
406
|
+
...n,
|
|
407
|
+
[e]: {
|
|
408
|
+
...n[e],
|
|
409
|
+
...t
|
|
410
|
+
}
|
|
411
|
+
}));
|
|
412
|
+
return /* @__PURE__ */ O(x, { children: /* @__PURE__ */ k("form", {
|
|
413
|
+
className: "space-y-4 px-3 py-3",
|
|
414
|
+
onSubmit: (e) => {
|
|
415
|
+
e.preventDefault(), F ? G.mutate() : W.mutate();
|
|
416
|
+
},
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
|
|
419
|
+
className: "text-sm font-medium",
|
|
420
|
+
children: a ? o("again") : s("startTitle")
|
|
421
|
+
}), a && /* @__PURE__ */ O("p", {
|
|
422
|
+
className: "text-xs text-muted-foreground",
|
|
423
|
+
children: o("againHelp")
|
|
424
|
+
})] }),
|
|
425
|
+
/* @__PURE__ */ O(y, {
|
|
426
|
+
label: s("deployment"),
|
|
427
|
+
size: "sm",
|
|
428
|
+
options: [{
|
|
429
|
+
value: "cloud",
|
|
430
|
+
label: s("cloud")
|
|
431
|
+
}, {
|
|
432
|
+
value: "dc",
|
|
433
|
+
label: s("dataCenter")
|
|
434
|
+
}],
|
|
435
|
+
value: d ? "cloud" : "dc",
|
|
436
|
+
onValueChange: (e) => {
|
|
437
|
+
m(e === "cloud"), U();
|
|
438
|
+
}
|
|
439
|
+
}),
|
|
440
|
+
/* @__PURE__ */ O(g, {
|
|
441
|
+
label: s("siteLabel"),
|
|
442
|
+
children: /* @__PURE__ */ O(_, {
|
|
443
|
+
type: "url",
|
|
444
|
+
required: !0,
|
|
445
|
+
value: v,
|
|
446
|
+
onChange: (e) => {
|
|
447
|
+
S(e.target.value), U();
|
|
448
|
+
},
|
|
449
|
+
placeholder: d ? "https://acme.atlassian.net" : "https://jira.acme.com"
|
|
450
|
+
})
|
|
451
|
+
}),
|
|
452
|
+
d && /* @__PURE__ */ O(g, {
|
|
453
|
+
label: s("emailLabel"),
|
|
454
|
+
children: /* @__PURE__ */ O(_, {
|
|
455
|
+
type: "email",
|
|
456
|
+
required: !0,
|
|
457
|
+
autoComplete: "off",
|
|
458
|
+
value: C,
|
|
459
|
+
onChange: (e) => {
|
|
460
|
+
T(e.target.value), U();
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ O(g, {
|
|
465
|
+
label: s(d ? "tokenLabelCloud" : "tokenLabelDataCenter"),
|
|
466
|
+
description: s(d ? "tokenHelpCloud" : "tokenHelpDataCenter"),
|
|
467
|
+
children: /* @__PURE__ */ O(_, {
|
|
468
|
+
type: "password",
|
|
469
|
+
autoComplete: "off",
|
|
470
|
+
required: !0,
|
|
471
|
+
value: N,
|
|
472
|
+
onChange: (e) => {
|
|
473
|
+
P(e.target.value), U();
|
|
474
|
+
}
|
|
475
|
+
})
|
|
476
|
+
}),
|
|
477
|
+
F && /* @__PURE__ */ k("fieldset", {
|
|
478
|
+
className: "space-y-2",
|
|
479
|
+
children: [
|
|
480
|
+
/* @__PURE__ */ O("legend", {
|
|
481
|
+
className: "text-sm font-medium",
|
|
482
|
+
children: s("projectsFrom", { organization: F.organization })
|
|
483
|
+
}),
|
|
484
|
+
F.projects.length === 0 && /* @__PURE__ */ O("p", {
|
|
485
|
+
className: "text-sm text-muted-foreground",
|
|
486
|
+
children: s("noProjects")
|
|
487
|
+
}),
|
|
488
|
+
/* @__PURE__ */ O("ul", {
|
|
489
|
+
className: "divide-y divide-border rounded-md border border-border",
|
|
490
|
+
children: F.projects.map((e) => {
|
|
491
|
+
let t = R[e.id];
|
|
492
|
+
return t ? /* @__PURE__ */ k("li", {
|
|
493
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",
|
|
494
|
+
children: [/* @__PURE__ */ k("label", {
|
|
495
|
+
className: "flex min-w-0 flex-1 items-center gap-2 text-sm",
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ O(p, {
|
|
498
|
+
checked: t.on,
|
|
499
|
+
onCheckedChange: (t) => q(e.id, { on: t })
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ k("span", {
|
|
502
|
+
className: "truncate",
|
|
503
|
+
children: [
|
|
504
|
+
e.name,
|
|
505
|
+
" ",
|
|
506
|
+
/* @__PURE__ */ k("span", {
|
|
507
|
+
className: "text-muted-foreground",
|
|
508
|
+
children: [
|
|
509
|
+
"(",
|
|
510
|
+
e.key,
|
|
511
|
+
")"
|
|
512
|
+
]
|
|
513
|
+
})
|
|
514
|
+
]
|
|
515
|
+
}),
|
|
516
|
+
/* @__PURE__ */ O("span", {
|
|
517
|
+
className: "text-xs text-muted-foreground",
|
|
518
|
+
children: o("issues", { count: e.issueCount })
|
|
519
|
+
})
|
|
520
|
+
]
|
|
521
|
+
}), t.on && /* @__PURE__ */ k("div", {
|
|
522
|
+
className: "flex basis-full flex-wrap items-center gap-2 pl-6 sm:basis-auto sm:pl-0",
|
|
523
|
+
children: [/* @__PURE__ */ O(b, {
|
|
524
|
+
"aria-label": o("into", { team: e.name }),
|
|
525
|
+
value: t.target,
|
|
526
|
+
onValueChange: (t) => t && q(e.id, { target: t }),
|
|
527
|
+
items: [{
|
|
528
|
+
value: I,
|
|
529
|
+
label: o("newTeam")
|
|
530
|
+
}, ...V.map((e) => ({
|
|
531
|
+
value: e.key,
|
|
532
|
+
label: `${e.name} (${e.key})`
|
|
533
|
+
}))],
|
|
534
|
+
size: "sm",
|
|
535
|
+
width: "content"
|
|
536
|
+
}), t.target === I && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(_, {
|
|
537
|
+
"aria-label": o("newKey"),
|
|
538
|
+
value: t.newKey,
|
|
539
|
+
onChange: (t) => q(e.id, { newKey: t.target.value.toUpperCase() }),
|
|
540
|
+
className: "w-24",
|
|
541
|
+
maxLength: 10,
|
|
542
|
+
required: !0
|
|
543
|
+
}), /* @__PURE__ */ O(_, {
|
|
544
|
+
"aria-label": o("newName"),
|
|
545
|
+
value: t.newName,
|
|
546
|
+
onChange: (t) => q(e.id, { newName: t.target.value }),
|
|
547
|
+
className: "w-44",
|
|
548
|
+
required: !0
|
|
549
|
+
})] })]
|
|
550
|
+
})]
|
|
551
|
+
}, e.id) : null;
|
|
552
|
+
})
|
|
553
|
+
})
|
|
554
|
+
]
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ k("div", {
|
|
557
|
+
className: "flex flex-wrap items-center gap-3",
|
|
558
|
+
children: [F ? /* @__PURE__ */ O(f, {
|
|
559
|
+
type: "submit",
|
|
560
|
+
variant: "primary",
|
|
561
|
+
loading: G.isPending,
|
|
562
|
+
disabled: K === 0,
|
|
563
|
+
children: s("start", { count: K })
|
|
564
|
+
}) : /* @__PURE__ */ O(f, {
|
|
565
|
+
type: "submit",
|
|
566
|
+
variant: "primary",
|
|
567
|
+
loading: W.isPending,
|
|
568
|
+
children: s("findProjects")
|
|
569
|
+
}), F && /* @__PURE__ */ O("span", {
|
|
319
570
|
className: "text-xs text-muted-foreground",
|
|
320
|
-
children: o("total", { count:
|
|
571
|
+
children: o("total", { count: F.projects.filter((e) => R[e.id]?.on).reduce((e, t) => e + t.issueCount, 0) })
|
|
321
572
|
})]
|
|
322
573
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ O(h, {
|
|
324
575
|
size: "md",
|
|
325
|
-
children:
|
|
576
|
+
children: B.error
|
|
326
577
|
})
|
|
327
578
|
]
|
|
328
579
|
}) });
|
|
329
580
|
}
|
|
330
|
-
export {
|
|
581
|
+
export { N as component };
|