@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.
Files changed (110) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +32 -3
  2. package/_virtual/_virtual_i18n/es/common.js +32 -3
  3. package/_virtual/_virtual_i18n/ja/common.js +32 -3
  4. package/_virtual/_virtual_i18n/ko/common.js +32 -3
  5. package/_virtual/_virtual_i18n/zh/common.js +32 -3
  6. package/api/queries.js +88 -77
  7. package/components/AccessGrants.js +6 -6
  8. package/components/ActivityTimeline.js +4 -4
  9. package/components/AgentWork.js +111 -111
  10. package/components/AreaLink.js +32 -0
  11. package/components/AreaTiles.js +10 -13
  12. package/components/AreaWork.js +25 -1
  13. package/components/BugRotation.js +3 -3
  14. package/components/CodeHostSettings.js +30 -30
  15. package/components/CommandPalette.js +53 -53
  16. package/components/CustomFields.js +116 -116
  17. package/components/DateChip.js +11 -11
  18. package/components/DocButton.js +6 -6
  19. package/components/DocHistory.js +4 -4
  20. package/components/DocLinkPicker.js +8 -8
  21. package/components/DocProperties.js +15 -15
  22. package/components/DocTable.js +15 -15
  23. package/components/DocsTree.js +80 -80
  24. package/components/Editor.js +35 -35
  25. package/components/FavoritesNav.js +53 -53
  26. package/components/GitHub.js +18 -18
  27. package/components/Graph.js +15 -15
  28. package/components/HostActions.js +21 -21
  29. package/components/HostPanel.js +6 -6
  30. package/components/HoverCards.js +38 -38
  31. package/components/IssueBoard.js +4 -4
  32. package/components/IssueCode.js +14 -14
  33. package/components/IssueEvent.js +3 -3
  34. package/components/IssueFilters.js +71 -71
  35. package/components/IssueListBlock.js +32 -32
  36. package/components/IssueRow.js +21 -21
  37. package/components/IssueTemplates.js +118 -118
  38. package/components/IssueTypes.js +40 -40
  39. package/components/NewIssueDialog.js +76 -76
  40. package/components/NewProjectDialog.js +145 -145
  41. package/components/PersonActivity.js +4 -4
  42. package/components/SharedViewer.js +5 -5
  43. package/components/SlashMenu.js +29 -29
  44. package/components/TeamRepositories.js +51 -51
  45. package/components/TeamWorkflow.js +6 -6
  46. package/components/UnlinkedMentions.js +20 -20
  47. package/components/Updates.js +3 -3
  48. package/components/Widgets.js +20 -20
  49. package/components/columns.js +17 -17
  50. package/components/editorPlugins.js +80 -80
  51. package/components/mathDiagrams.js +17 -17
  52. package/lib/boardMove.js +5 -5
  53. package/lib/issueList.js +58 -58
  54. package/lib/issueMenu.js +27 -27
  55. package/lib/knowledge.js +106 -106
  56. package/lib/views.js +9 -9
  57. package/package.json +1 -1
  58. package/pages/area.js +291 -0
  59. package/pages/areas.js +258 -287
  60. package/pages/decisions.js +21 -21
  61. package/pages/issues.js +52 -52
  62. package/pages/projects.js +125 -125
  63. package/pages/triage.js +12 -12
  64. package/routeTree.gen.js +186 -180
  65. package/routes/_workspace/agents/_slug2.js +11 -11
  66. package/routes/_workspace/agents/index2.js +10 -10
  67. package/routes/_workspace/areas/_area.js +7 -8
  68. package/routes/_workspace/areas/_area2.js +3 -290
  69. package/routes/_workspace/areas/_area3.js +7 -8
  70. package/routes/_workspace/docs/_doc2.js +230 -230
  71. package/routes/_workspace/docs/space2._space.js +27 -27
  72. package/routes/_workspace/issues/_identifier2.js +222 -224
  73. package/routes/_workspace/knowledge/_term2.js +43 -43
  74. package/routes/_workspace/knowledge/index.js +6 -6
  75. package/routes/_workspace/knowledge/index2.js +15 -15
  76. package/routes/_workspace/measures3.js +70 -72
  77. package/routes/_workspace/notifications2.js +150 -150
  78. package/routes/_workspace/people/_username2.js +10 -10
  79. package/routes/_workspace/projects/_projectId3.js +276 -276
  80. package/routes/_workspace/settings/audit-log3.js +136 -138
  81. package/routes/_workspace/settings/fields2.js +11 -11
  82. package/routes/_workspace/settings/github2.js +6 -6
  83. package/routes/_workspace/settings/groups2.js +26 -26
  84. package/routes/_workspace/settings/import2.js +398 -147
  85. package/routes/_workspace/settings/import3.js +7 -3
  86. package/routes/_workspace/settings/index2.js +6 -6
  87. package/routes/_workspace/settings/labels2.js +21 -21
  88. package/routes/_workspace/settings/members2.js +27 -27
  89. package/routes/_workspace/settings/notifications2.js +8 -8
  90. package/routes/_workspace/settings/parallelworks2.js +32 -32
  91. package/routes/_workspace/settings/roles2.js +24 -24
  92. package/routes/_workspace/settings/runners2.js +15 -15
  93. package/routes/_workspace/settings/sessions2.js +17 -17
  94. package/routes/_workspace/settings/slack2.js +7 -7
  95. package/routes/_workspace/settings/sso2.js +31 -31
  96. package/routes/_workspace/settings/teams2.js +25 -25
  97. package/routes/_workspace/settings/tokens2.js +12 -12
  98. package/routes/_workspace/settings/webhooks2.js +13 -13
  99. package/routes/_workspace/teams/_key/areas/_area.js +8 -0
  100. package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
  101. package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
  102. package/routes/_workspace/teams/_key/areas/index.js +6 -0
  103. package/routes/_workspace/teams/_key/areas/index2.js +4 -0
  104. package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
  105. package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
  106. package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
  107. package/routes/_workspace/teams/_key/settings2.js +29 -29
  108. package/routes/_workspace2.js +368 -368
  109. package/routes/_workspace/teams/_key/areas.js +0 -6
  110. 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 { linearImportQuery as n, teamsQuery as r } from "../../../api/queries.js";
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 { Route as o } from "./import.js";
6
- import { useCan as s } from "../../../lib/roles.js";
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 { 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";
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 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
- }) })]
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 j = {
79
+ var P = {
53
80
  running: "info",
54
81
  done: "success",
55
82
  failed: "error",
56
83
  canceled: "muted"
57
84
  };
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", {
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__ */ E("div", {
95
+ /* @__PURE__ */ k("div", {
69
96
  className: "flex flex-wrap items-center gap-3",
70
97
  children: [
71
- /* @__PURE__ */ T(a, { className: "size-5 text-muted-foreground" }),
72
- /* @__PURE__ */ E("div", {
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__ */ T("p", {
101
+ children: [/* @__PURE__ */ O("p", {
75
102
  className: "text-sm font-medium",
76
- children: c("lastImport", { organization: o.organization })
77
- }), /* @__PURE__ */ T("p", {
103
+ children: d("lastImport", { organization: l.organization })
104
+ }), /* @__PURE__ */ O("p", {
78
105
  className: "text-xs text-muted-foreground",
79
- children: c("startedAt", { date: l.dateTime(new Date(o.startedAt), {
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__ */ T(b, {
86
- variant: j[o.status],
87
- pulse: k,
88
- children: c(`status.${o.status}`)
112
+ /* @__PURE__ */ O(S, {
113
+ variant: P[l.status],
114
+ pulse: D,
115
+ children: d(`status.${l.status}`)
89
116
  }),
90
- f && k && /* @__PURE__ */ T(d, {
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: () => v({
96
- title: c("cancelTitle"),
97
- description: c("cancelDescription"),
98
- confirmLabel: c("cancel"),
122
+ onClick: () => b({
123
+ title: d("cancelTitle"),
124
+ description: d("cancelDescription"),
125
+ confirmLabel: d("cancel"),
99
126
  onConfirm: () => w.mutateAsync()
100
127
  }),
101
- children: c("cancel")
128
+ children: d("cancel")
102
129
  })
103
130
  ]
104
131
  }),
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
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__ */ T("ul", {
141
+ /* @__PURE__ */ O("ul", {
115
142
  className: "space-y-1 text-sm",
116
- children: o.teams.map((e) => /* @__PURE__ */ T("li", {
143
+ children: l.teams.map((e) => /* @__PURE__ */ O("li", {
117
144
  className: "text-muted-foreground",
118
- children: c("teamRow", {
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
- o.error && /* @__PURE__ */ T("p", {
125
- className: `text-sm ${k ? "text-muted-foreground" : "text-danger"}`,
126
- children: c(k ? "retrying" : "stopped", { error: o.error })
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
- o.skipped > 0 && /* @__PURE__ */ T(p, {
129
- summary: c("skipped", { count: o.skipped }),
130
- children: /* @__PURE__ */ T("ul", {
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: o.skips.map((e, t) => /* @__PURE__ */ E("li", { children: [
133
- /* @__PURE__ */ T("span", {
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__ */ T("span", {
165
+ /* @__PURE__ */ O("span", {
139
166
  className: "text-muted-foreground",
140
- children: c(`skipReason.${e.reason}`, { field: e.field ?? "" })
167
+ children: d(`skipReason.${e.reason}`, { field: e.field ?? "" })
141
168
  })
142
169
  ] }, t))
143
170
  })
144
171
  }),
145
- /* @__PURE__ */ T(m, {
172
+ /* @__PURE__ */ O(h, {
146
173
  size: "md",
147
- children: g.error
174
+ children: y.error
148
175
  })
149
176
  ]
150
177
  })] });
151
178
  }
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({
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: i } },
183
+ params: { path: { workspace: n } },
157
184
  body: { apiKey: l }
158
185
  })),
159
- onMutate: j.clear,
186
+ onMutate: C.clear,
160
187
  onSuccess: (e) => {
161
- b(e), A(Object.fromEntries(e.teams.map((e) => {
162
- let t = M.find((t) => t.key === e.key);
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 ?? N,
192
+ target: t?.key ?? I,
166
193
  newKey: e.key,
167
194
  newName: e.name
168
195
  }];
169
196
  })));
170
197
  },
171
- onError: j.set
172
- }), F = D({
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: i } },
201
+ params: { path: { workspace: n } },
175
202
  body: {
176
203
  apiKey: l,
177
- teams: Object.entries(S).filter(([, e]) => e.on).map(([e, t]) => t.target === N ? {
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: j.clear,
214
+ onMutate: C.clear,
188
215
  onSuccess: () => {
189
- p(""), b(null), s.invalidateQueries({ queryKey: n(i).queryKey }), s.invalidateQueries({ queryKey: r(i).queryKey });
216
+ d(""), v(null), s.invalidateQueries({ queryKey: r(n).queryKey }), s.invalidateQueries({ queryKey: i(n).queryKey });
190
217
  },
191
- onError: j.set
192
- }), I = Object.values(S).filter((e) => e.on).length, L = (e, t) => A((n) => ({
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__ */ T(y, { children: /* @__PURE__ */ E("form", {
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(), _ ? F.mutate() : P.mutate();
229
+ e.preventDefault(), m ? P.mutate() : N.mutate();
203
230
  },
204
231
  children: [
205
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
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__ */ T("p", {
235
+ }), a && /* @__PURE__ */ O("p", {
209
236
  className: "text-xs text-muted-foreground",
210
237
  children: o("againHelp")
211
238
  })] }),
212
- /* @__PURE__ */ T(h, {
239
+ /* @__PURE__ */ O(g, {
213
240
  label: o("keyLabel"),
214
241
  description: o("keyHelp"),
215
- children: /* @__PURE__ */ T(g, {
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
- p(e.target.value), b(null);
248
+ d(e.target.value), v(null);
222
249
  },
223
250
  placeholder: "lin_api_…"
224
251
  })
225
252
  }),
226
- _ && /* @__PURE__ */ E("fieldset", {
253
+ m && /* @__PURE__ */ k("fieldset", {
227
254
  className: "space-y-2",
228
255
  children: [
229
- /* @__PURE__ */ T("legend", {
256
+ /* @__PURE__ */ O("legend", {
230
257
  className: "text-sm font-medium",
231
- children: o("teamsFrom", { organization: _.organization })
258
+ children: o("teamsFrom", { organization: m.organization })
232
259
  }),
233
- _.teams.length === 0 && /* @__PURE__ */ T("p", {
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__ */ T("ul", {
264
+ /* @__PURE__ */ O("ul", {
238
265
  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", {
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__ */ E("label", {
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__ */ T(f, {
273
+ /* @__PURE__ */ O(p, {
247
274
  checked: t.on,
248
275
  onCheckedChange: (t) => L(e.id, { on: t })
249
276
  }),
250
- /* @__PURE__ */ E("span", {
277
+ /* @__PURE__ */ k("span", {
251
278
  className: "truncate",
252
279
  children: [
253
280
  e.name,
254
281
  " ",
255
- /* @__PURE__ */ E("span", {
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__ */ T("span", {
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__ */ E("div", {
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__ */ T(v, {
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: N,
304
+ value: I,
278
305
  label: o("newTeam")
279
- }, ...M.map((e) => ({
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 === N && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(g, {
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__ */ T(g, {
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__ */ E("div", {
332
+ /* @__PURE__ */ k("div", {
306
333
  className: "flex flex-wrap items-center gap-3",
307
- children: [_ ? /* @__PURE__ */ T(d, {
334
+ children: [m ? /* @__PURE__ */ O(f, {
308
335
  type: "submit",
309
336
  variant: "primary",
310
- loading: F.isPending,
311
- disabled: I === 0,
312
- children: o("start", { count: I })
313
- }) : /* @__PURE__ */ T(d, {
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: P.isPending,
343
+ loading: N.isPending,
317
344
  children: o("findTeams")
318
- }), _ && /* @__PURE__ */ T("span", {
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: _.teams.filter((e) => S[e.id]?.on).reduce((e, t) => e + t.issueCount, 0) })
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__ */ T(m, {
574
+ /* @__PURE__ */ O(h, {
324
575
  size: "md",
325
- children: j.error
576
+ children: B.error
326
577
  })
327
578
  ]
328
579
  }) });
329
580
  }
330
- export { A as component };
581
+ export { N as component };