@parallelworks/tandem-web 0.150.3 → 0.152.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 +36 -4
  2. package/_virtual/_virtual_i18n/es/common.js +36 -4
  3. package/_virtual/_virtual_i18n/ja/common.js +36 -4
  4. package/_virtual/_virtual_i18n/ko/common.js +36 -4
  5. package/_virtual/_virtual_i18n/zh/common.js +36 -4
  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 +414 -151
  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,208 @@
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, T] = w(!0), N = u(), P = c.filter((e) => !e.archivedAt), F = 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: N.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 = P.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: N.set
199
+ }), L = 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
+ updateExistingOnly: C,
205
+ teams: Object.entries(y).filter(([, e]) => e.on).map(([e, t]) => t.target === I ? {
178
206
  sourceId: e,
179
207
  newKey: t.newKey,
180
208
  newName: t.newName
@@ -184,75 +212,75 @@ function P({ workspace: i, again: a }) {
184
212
  })
185
213
  }
186
214
  })),
187
- onMutate: j.clear,
215
+ onMutate: N.clear,
188
216
  onSuccess: () => {
189
- p(""), b(null), s.invalidateQueries({ queryKey: n(i).queryKey }), s.invalidateQueries({ queryKey: r(i).queryKey });
217
+ d(""), v(null), s.invalidateQueries({ queryKey: r(n).queryKey }), s.invalidateQueries({ queryKey: i(n).queryKey });
190
218
  },
191
- onError: j.set
192
- }), I = Object.values(S).filter((e) => e.on).length, L = (e, t) => A((n) => ({
219
+ onError: N.set
220
+ }), R = Object.values(y).filter((e) => e.on).length, z = (e, t) => S((n) => ({
193
221
  ...n,
194
222
  [e]: {
195
223
  ...n[e],
196
224
  ...t
197
225
  }
198
226
  }));
199
- return /* @__PURE__ */ T(y, { children: /* @__PURE__ */ E("form", {
227
+ return /* @__PURE__ */ O(x, { children: /* @__PURE__ */ k("form", {
200
228
  className: "space-y-4 px-3 py-3",
201
229
  onSubmit: (e) => {
202
- e.preventDefault(), _ ? F.mutate() : P.mutate();
230
+ e.preventDefault(), m ? L.mutate() : F.mutate();
203
231
  },
204
232
  children: [
205
- /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
233
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
206
234
  className: "text-sm font-medium",
207
235
  children: o(a ? "again" : "startTitle")
208
- }), a && /* @__PURE__ */ T("p", {
236
+ }), a && /* @__PURE__ */ O("p", {
209
237
  className: "text-xs text-muted-foreground",
210
238
  children: o("againHelp")
211
239
  })] }),
212
- /* @__PURE__ */ T(h, {
240
+ /* @__PURE__ */ O(g, {
213
241
  label: o("keyLabel"),
214
242
  description: o("keyHelp"),
215
- children: /* @__PURE__ */ T(g, {
243
+ children: /* @__PURE__ */ O(_, {
216
244
  type: "password",
217
245
  autoComplete: "off",
218
246
  required: !0,
219
247
  value: l,
220
248
  onChange: (e) => {
221
- p(e.target.value), b(null);
249
+ d(e.target.value), v(null);
222
250
  },
223
251
  placeholder: "lin_api_…"
224
252
  })
225
253
  }),
226
- _ && /* @__PURE__ */ E("fieldset", {
254
+ m && /* @__PURE__ */ k("fieldset", {
227
255
  className: "space-y-2",
228
256
  children: [
229
- /* @__PURE__ */ T("legend", {
257
+ /* @__PURE__ */ O("legend", {
230
258
  className: "text-sm font-medium",
231
- children: o("teamsFrom", { organization: _.organization })
259
+ children: o("teamsFrom", { organization: m.organization })
232
260
  }),
233
- _.teams.length === 0 && /* @__PURE__ */ T("p", {
261
+ m.teams.length === 0 && /* @__PURE__ */ O("p", {
234
262
  className: "text-sm text-muted-foreground",
235
263
  children: o("noTeams")
236
264
  }),
237
- /* @__PURE__ */ T("ul", {
265
+ /* @__PURE__ */ O("ul", {
238
266
  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", {
267
+ children: m.teams.map((e) => {
268
+ let t = y[e.id];
269
+ return t ? /* @__PURE__ */ k("li", {
242
270
  className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",
243
- children: [/* @__PURE__ */ E("label", {
271
+ children: [/* @__PURE__ */ k("label", {
244
272
  className: "flex min-w-0 flex-1 items-center gap-2 text-sm",
245
273
  children: [
246
- /* @__PURE__ */ T(f, {
274
+ /* @__PURE__ */ O(p, {
247
275
  checked: t.on,
248
- onCheckedChange: (t) => L(e.id, { on: t })
276
+ onCheckedChange: (t) => z(e.id, { on: t })
249
277
  }),
250
- /* @__PURE__ */ E("span", {
278
+ /* @__PURE__ */ k("span", {
251
279
  className: "truncate",
252
280
  children: [
253
281
  e.name,
254
282
  " ",
255
- /* @__PURE__ */ E("span", {
283
+ /* @__PURE__ */ k("span", {
256
284
  className: "text-muted-foreground",
257
285
  children: [
258
286
  "(",
@@ -262,37 +290,37 @@ function P({ workspace: i, again: a }) {
262
290
  })
263
291
  ]
264
292
  }),
265
- /* @__PURE__ */ T("span", {
293
+ /* @__PURE__ */ O("span", {
266
294
  className: "text-xs text-muted-foreground",
267
295
  children: o("issues", { count: e.issueCount })
268
296
  })
269
297
  ]
270
- }), t.on && /* @__PURE__ */ E("div", {
298
+ }), t.on && /* @__PURE__ */ k("div", {
271
299
  className: "flex basis-full flex-wrap items-center gap-2 pl-6 sm:basis-auto sm:pl-0",
272
- children: [/* @__PURE__ */ T(v, {
300
+ children: [/* @__PURE__ */ O(b, {
273
301
  "aria-label": o("into", { team: e.name }),
274
302
  value: t.target,
275
- onValueChange: (t) => t && L(e.id, { target: t }),
303
+ onValueChange: (t) => t && z(e.id, { target: t }),
276
304
  items: [{
277
- value: N,
305
+ value: I,
278
306
  label: o("newTeam")
279
- }, ...M.map((e) => ({
307
+ }, ...P.map((e) => ({
280
308
  value: e.key,
281
309
  label: `${e.name} (${e.key})`
282
310
  }))],
283
311
  size: "sm",
284
312
  width: "content"
285
- }), t.target === N && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(g, {
313
+ }), t.target === I && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(_, {
286
314
  "aria-label": o("newKey"),
287
315
  value: t.newKey,
288
- onChange: (t) => L(e.id, { newKey: t.target.value.toUpperCase() }),
316
+ onChange: (t) => z(e.id, { newKey: t.target.value.toUpperCase() }),
289
317
  className: "w-24",
290
318
  maxLength: 10,
291
319
  required: !0
292
- }), /* @__PURE__ */ T(g, {
320
+ }), /* @__PURE__ */ O(_, {
293
321
  "aria-label": o("newName"),
294
322
  value: t.newName,
295
- onChange: (t) => L(e.id, { newName: t.target.value }),
323
+ onChange: (t) => z(e.id, { newName: t.target.value }),
296
324
  className: "w-44",
297
325
  required: !0
298
326
  })] })]
@@ -302,29 +330,264 @@ function P({ workspace: i, again: a }) {
302
330
  })
303
331
  ]
304
332
  }),
305
- /* @__PURE__ */ E("div", {
333
+ m && /* @__PURE__ */ k("label", {
334
+ className: "flex items-start gap-2 text-sm",
335
+ children: [/* @__PURE__ */ O(p, {
336
+ className: "mt-0.5",
337
+ checked: C,
338
+ onCheckedChange: T
339
+ }), /* @__PURE__ */ k("span", { children: [o("updateOnly"), /* @__PURE__ */ O("span", {
340
+ className: "block text-xs text-muted-foreground",
341
+ children: o("updateOnlyHelp")
342
+ })] })]
343
+ }),
344
+ /* @__PURE__ */ k("div", {
306
345
  className: "flex flex-wrap items-center gap-3",
307
- children: [_ ? /* @__PURE__ */ T(d, {
346
+ children: [m ? /* @__PURE__ */ O(f, {
308
347
  type: "submit",
309
348
  variant: "primary",
310
- loading: F.isPending,
311
- disabled: I === 0,
312
- children: o("start", { count: I })
313
- }) : /* @__PURE__ */ T(d, {
349
+ loading: L.isPending,
350
+ disabled: R === 0,
351
+ children: o("start", { count: R })
352
+ }) : /* @__PURE__ */ O(f, {
314
353
  type: "submit",
315
354
  variant: "primary",
316
- loading: P.isPending,
355
+ loading: F.isPending,
317
356
  children: o("findTeams")
318
- }), _ && /* @__PURE__ */ T("span", {
357
+ }), m && /* @__PURE__ */ O("span", {
358
+ className: "text-xs text-muted-foreground",
359
+ children: o("total", { count: m.teams.filter((e) => y[e.id]?.on).reduce((e, t) => e + t.issueCount, 0) })
360
+ })]
361
+ }),
362
+ /* @__PURE__ */ O(h, {
363
+ size: "md",
364
+ children: N.error
365
+ })
366
+ ]
367
+ }) });
368
+ }
369
+ function R({ workspace: r, again: a }) {
370
+ 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 ? {
371
+ url: v,
372
+ cloud: d,
373
+ email: C,
374
+ token: N
375
+ } : {
376
+ url: v,
377
+ cloud: d,
378
+ token: N
379
+ }, U = () => L(null), W = A({
380
+ mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/jira/projects", {
381
+ params: { path: { workspace: r } },
382
+ body: H
383
+ })),
384
+ onMutate: B.clear,
385
+ onSuccess: (e) => {
386
+ L(e), z(Object.fromEntries(e.projects.map((e) => {
387
+ let t = V.find((t) => t.key === e.key);
388
+ return [e.id, {
389
+ on: !0,
390
+ target: t?.key ?? I,
391
+ newKey: e.key.slice(0, 10),
392
+ newName: e.name
393
+ }];
394
+ })));
395
+ },
396
+ onError: B.set
397
+ }), G = A({
398
+ mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/jira/import", {
399
+ params: { path: { workspace: r } },
400
+ body: {
401
+ ...H,
402
+ projects: Object.entries(R).filter(([, e]) => e.on).map(([e, t]) => t.target === I ? {
403
+ sourceId: e,
404
+ newKey: t.newKey,
405
+ newName: t.newName
406
+ } : {
407
+ sourceId: e,
408
+ teamKey: t.target
409
+ })
410
+ }
411
+ })),
412
+ onMutate: B.clear,
413
+ onSuccess: () => {
414
+ P(""), L(null), c.invalidateQueries({ queryKey: n(r).queryKey }), c.invalidateQueries({ queryKey: i(r).queryKey });
415
+ },
416
+ onError: B.set
417
+ }), K = Object.values(R).filter((e) => e.on).length, q = (e, t) => z((n) => ({
418
+ ...n,
419
+ [e]: {
420
+ ...n[e],
421
+ ...t
422
+ }
423
+ }));
424
+ return /* @__PURE__ */ O(x, { children: /* @__PURE__ */ k("form", {
425
+ className: "space-y-4 px-3 py-3",
426
+ onSubmit: (e) => {
427
+ e.preventDefault(), F ? G.mutate() : W.mutate();
428
+ },
429
+ children: [
430
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
431
+ className: "text-sm font-medium",
432
+ children: a ? o("again") : s("startTitle")
433
+ }), a && /* @__PURE__ */ O("p", {
434
+ className: "text-xs text-muted-foreground",
435
+ children: o("againHelp")
436
+ })] }),
437
+ /* @__PURE__ */ O(y, {
438
+ label: s("deployment"),
439
+ size: "sm",
440
+ options: [{
441
+ value: "cloud",
442
+ label: s("cloud")
443
+ }, {
444
+ value: "dc",
445
+ label: s("dataCenter")
446
+ }],
447
+ value: d ? "cloud" : "dc",
448
+ onValueChange: (e) => {
449
+ m(e === "cloud"), U();
450
+ }
451
+ }),
452
+ /* @__PURE__ */ O(g, {
453
+ label: s("siteLabel"),
454
+ children: /* @__PURE__ */ O(_, {
455
+ type: "url",
456
+ required: !0,
457
+ value: v,
458
+ onChange: (e) => {
459
+ S(e.target.value), U();
460
+ },
461
+ placeholder: d ? "https://acme.atlassian.net" : "https://jira.acme.com"
462
+ })
463
+ }),
464
+ d && /* @__PURE__ */ O(g, {
465
+ label: s("emailLabel"),
466
+ children: /* @__PURE__ */ O(_, {
467
+ type: "email",
468
+ required: !0,
469
+ autoComplete: "off",
470
+ value: C,
471
+ onChange: (e) => {
472
+ T(e.target.value), U();
473
+ }
474
+ })
475
+ }),
476
+ /* @__PURE__ */ O(g, {
477
+ label: s(d ? "tokenLabelCloud" : "tokenLabelDataCenter"),
478
+ description: s(d ? "tokenHelpCloud" : "tokenHelpDataCenter"),
479
+ children: /* @__PURE__ */ O(_, {
480
+ type: "password",
481
+ autoComplete: "off",
482
+ required: !0,
483
+ value: N,
484
+ onChange: (e) => {
485
+ P(e.target.value), U();
486
+ }
487
+ })
488
+ }),
489
+ F && /* @__PURE__ */ k("fieldset", {
490
+ className: "space-y-2",
491
+ children: [
492
+ /* @__PURE__ */ O("legend", {
493
+ className: "text-sm font-medium",
494
+ children: s("projectsFrom", { organization: F.organization })
495
+ }),
496
+ F.projects.length === 0 && /* @__PURE__ */ O("p", {
497
+ className: "text-sm text-muted-foreground",
498
+ children: s("noProjects")
499
+ }),
500
+ /* @__PURE__ */ O("ul", {
501
+ className: "divide-y divide-border rounded-md border border-border",
502
+ children: F.projects.map((e) => {
503
+ let t = R[e.id];
504
+ return t ? /* @__PURE__ */ k("li", {
505
+ className: "flex flex-wrap items-center gap-x-3 gap-y-2 px-3 py-2",
506
+ children: [/* @__PURE__ */ k("label", {
507
+ className: "flex min-w-0 flex-1 items-center gap-2 text-sm",
508
+ children: [
509
+ /* @__PURE__ */ O(p, {
510
+ checked: t.on,
511
+ onCheckedChange: (t) => q(e.id, { on: t })
512
+ }),
513
+ /* @__PURE__ */ k("span", {
514
+ className: "truncate",
515
+ children: [
516
+ e.name,
517
+ " ",
518
+ /* @__PURE__ */ k("span", {
519
+ className: "text-muted-foreground",
520
+ children: [
521
+ "(",
522
+ e.key,
523
+ ")"
524
+ ]
525
+ })
526
+ ]
527
+ }),
528
+ /* @__PURE__ */ O("span", {
529
+ className: "text-xs text-muted-foreground",
530
+ children: o("issues", { count: e.issueCount })
531
+ })
532
+ ]
533
+ }), t.on && /* @__PURE__ */ k("div", {
534
+ className: "flex basis-full flex-wrap items-center gap-2 pl-6 sm:basis-auto sm:pl-0",
535
+ children: [/* @__PURE__ */ O(b, {
536
+ "aria-label": o("into", { team: e.name }),
537
+ value: t.target,
538
+ onValueChange: (t) => t && q(e.id, { target: t }),
539
+ items: [{
540
+ value: I,
541
+ label: o("newTeam")
542
+ }, ...V.map((e) => ({
543
+ value: e.key,
544
+ label: `${e.name} (${e.key})`
545
+ }))],
546
+ size: "sm",
547
+ width: "content"
548
+ }), t.target === I && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(_, {
549
+ "aria-label": o("newKey"),
550
+ value: t.newKey,
551
+ onChange: (t) => q(e.id, { newKey: t.target.value.toUpperCase() }),
552
+ className: "w-24",
553
+ maxLength: 10,
554
+ required: !0
555
+ }), /* @__PURE__ */ O(_, {
556
+ "aria-label": o("newName"),
557
+ value: t.newName,
558
+ onChange: (t) => q(e.id, { newName: t.target.value }),
559
+ className: "w-44",
560
+ required: !0
561
+ })] })]
562
+ })]
563
+ }, e.id) : null;
564
+ })
565
+ })
566
+ ]
567
+ }),
568
+ /* @__PURE__ */ k("div", {
569
+ className: "flex flex-wrap items-center gap-3",
570
+ children: [F ? /* @__PURE__ */ O(f, {
571
+ type: "submit",
572
+ variant: "primary",
573
+ loading: G.isPending,
574
+ disabled: K === 0,
575
+ children: s("start", { count: K })
576
+ }) : /* @__PURE__ */ O(f, {
577
+ type: "submit",
578
+ variant: "primary",
579
+ loading: W.isPending,
580
+ children: s("findProjects")
581
+ }), F && /* @__PURE__ */ O("span", {
319
582
  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) })
583
+ children: o("total", { count: F.projects.filter((e) => R[e.id]?.on).reduce((e, t) => e + t.issueCount, 0) })
321
584
  })]
322
585
  }),
323
- /* @__PURE__ */ T(m, {
586
+ /* @__PURE__ */ O(h, {
324
587
  size: "md",
325
- children: j.error
588
+ children: B.error
326
589
  })
327
590
  ]
328
591
  }) });
329
592
  }
330
- export { A as component };
593
+ export { N as component };