@parallelworks/tandem-web 0.153.1 → 0.155.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.
@@ -1,148 +1,162 @@
1
1
  import { usePathname as e } from "../lib/router.js";
2
- import { githubAccountQuery as t, meQuery as n } from "../api/queries.js";
3
- import { ChevronDownIcon as r, CloudIcon as i, CommentIcon as a, FolderIcon as o, HistoryIcon as s, KeyIcon as c, LinkIcon as l, ListViewIcon as u, MigrationIcon as d, NotificationIcon as f, RepositoryIcon as p, SettingsIcon as m, ShieldIcon as h, TagIcon as g, UserIcon as _, UsersIcon as v, WebhookIcon as y, WorkerIcon as b } from "./icons.js";
4
- import { useTranslations as x } from "use-intl";
5
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
6
- import { useQuery as T, useSuspenseQuery as E } from "@tanstack/react-query";
7
- import { AppFrameNavGroup as D, AppFrameNavItem as O } from "@parallelworks/ui/app-frame";
2
+ import { githubAccountQuery as t, gitlabQuery as n, meQuery as r } from "../api/queries.js";
3
+ import { ChevronDownIcon as i, CloudIcon as a, CommentIcon as o, FolderIcon as s, HistoryIcon as c, InboxIcon as l, KeyIcon as u, LinkIcon as d, ListViewIcon as f, MigrationIcon as p, NotificationIcon as m, RepositoryIcon as h, SettingsIcon as g, ShieldIcon as _, TagIcon as v, UserIcon as y, UsersIcon as b, WebhookIcon as x, WorkerIcon as S } from "./icons.js";
4
+ import { useParams as C } from "@tanstack/react-router";
5
+ import { useTranslations as w } from "use-intl";
6
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
7
+ import { useQuery as O, useSuspenseQuery as k } from "@tanstack/react-query";
8
+ import { AppFrameNavGroup as A, AppFrameNavItem as j } from "@parallelworks/ui/app-frame";
8
9
  // src/components/SettingsNav.tsx
9
- function k() {
10
- let { data: e } = E(n), r = x("settingsNav"), S = e?.mode === "platform", { data: C } = T(t);
10
+ function M() {
11
+ let { data: e } = k(r), i = w("settingsNav"), T = e?.mode === "platform", { data: E } = O(t), { workspace: D } = C({ strict: !1 }), { data: A } = O({
12
+ ...n(D ?? ""),
13
+ enabled: !!D
14
+ });
11
15
  return [
12
16
  {
13
- label: r("account"),
17
+ label: i("account"),
14
18
  items: [
15
19
  {
16
20
  to: "/$workspace/settings/account",
17
- label: r("profile"),
18
- Icon: _
21
+ label: i("profile"),
22
+ Icon: y
19
23
  },
20
24
  {
21
25
  to: "/$workspace/settings/notifications",
22
- label: r("notifications"),
23
- Icon: f
26
+ label: i("notifications"),
27
+ Icon: m
24
28
  },
25
29
  {
26
30
  to: "/$workspace/settings/runners",
27
- label: r("runners"),
28
- Icon: b
31
+ label: i("runners"),
32
+ Icon: S
29
33
  },
30
- ...C?.enabled ? [{
34
+ ...E?.enabled ? [{
31
35
  to: "/$workspace/settings/connections",
32
- label: r("connections"),
33
- Icon: l
36
+ label: i("connections"),
37
+ Icon: d
34
38
  }] : [],
35
- ...S ? [] : [{
39
+ ...T ? [] : [{
36
40
  to: "/$workspace/settings/tokens",
37
- label: r("tokens"),
38
- Icon: c
41
+ label: i("tokens"),
42
+ Icon: u
39
43
  }, {
40
44
  to: "/$workspace/settings/sessions",
41
- label: r("sessions"),
42
- Icon: h
45
+ label: i("sessions"),
46
+ Icon: _
43
47
  }]
44
48
  ]
45
49
  },
46
50
  {
47
- label: r("workspace"),
51
+ label: i("workspace"),
48
52
  items: [
49
53
  {
50
54
  to: "/$workspace/settings",
51
- label: r("general"),
52
- Icon: m
55
+ label: i("general"),
56
+ Icon: g
53
57
  },
54
58
  {
55
59
  to: "/$workspace/settings/members",
56
- label: r(S ? "access" : "members"),
57
- Icon: v
60
+ label: i(T ? "access" : "members"),
61
+ Icon: b
58
62
  },
59
63
  {
60
64
  to: "/$workspace/settings/roles",
61
- label: r("roles"),
62
- Icon: h
65
+ label: i("roles"),
66
+ Icon: _
63
67
  },
64
68
  {
65
69
  to: "/$workspace/settings/groups",
66
- label: r("groups"),
67
- Icon: h
70
+ label: i("groups"),
71
+ Icon: _
68
72
  },
69
73
  {
70
74
  to: "/$workspace/settings/teams",
71
- label: r("teams"),
72
- Icon: o
75
+ label: i("teams"),
76
+ Icon: s
73
77
  },
74
78
  {
75
79
  to: "/$workspace/settings/labels",
76
- label: r("labels"),
77
- Icon: g
80
+ label: i("labels"),
81
+ Icon: v
78
82
  },
79
83
  {
80
84
  to: "/$workspace/settings/fields",
81
- label: r("fields"),
82
- Icon: u
85
+ label: i("fields"),
86
+ Icon: f
83
87
  },
84
88
  {
85
89
  to: "/$workspace/settings/audit-log",
86
- label: r("auditLog"),
87
- Icon: s
90
+ label: i("auditLog"),
91
+ Icon: c
88
92
  },
89
- ...S ? [] : [{
93
+ ...T ? [] : [{
90
94
  to: "/$workspace/settings/sso",
91
- label: r("sso"),
92
- Icon: c
95
+ label: i("sso"),
96
+ Icon: u
93
97
  }]
94
98
  ]
95
99
  },
96
100
  {
97
- label: r("integrations"),
101
+ label: i("integrations"),
98
102
  items: [
99
103
  {
100
104
  to: "/$workspace/settings/github",
101
- label: r("github"),
102
- Icon: p
105
+ label: i("github"),
106
+ Icon: h
103
107
  },
108
+ ...A?.enabled ? [{
109
+ to: "/$workspace/settings/gitlab",
110
+ label: i("gitlab"),
111
+ Icon: h
112
+ }] : [],
104
113
  {
105
114
  to: "/$workspace/settings/slack",
106
- label: r("slack"),
107
- Icon: a
115
+ label: i("slack"),
116
+ Icon: o
117
+ },
118
+ {
119
+ to: "/$workspace/settings/zendesk",
120
+ label: i("zendesk"),
121
+ Icon: l
108
122
  },
109
123
  {
110
124
  to: "/$workspace/settings/webhooks",
111
- label: r("webhooks"),
112
- Icon: y
125
+ label: i("webhooks"),
126
+ Icon: x
113
127
  },
114
128
  {
115
129
  to: "/$workspace/settings/parallelworks",
116
- label: r("parallelWorks"),
117
- Icon: i
130
+ label: i("parallelWorks"),
131
+ Icon: a
118
132
  },
119
133
  {
120
134
  to: "/$workspace/settings/import",
121
- label: r("import"),
122
- Icon: d
135
+ label: i("import"),
136
+ Icon: p
123
137
  }
124
138
  ]
125
139
  }
126
140
  ];
127
141
  }
128
- function A({ workspace: t }) {
129
- let n = x("settingsNav"), i = k(), a = e();
130
- return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(O, {
142
+ function N({ workspace: t }) {
143
+ let n = w("settingsNav"), r = M(), a = e();
144
+ return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(j, {
131
145
  label: n("label"),
132
- icon: /* @__PURE__ */ C(r, { className: "size-4 rotate-90" }),
146
+ icon: /* @__PURE__ */ E(i, { className: "size-4 rotate-90" }),
133
147
  href: `/${t}/issues`,
134
148
  className: "font-semibold"
135
- }), /* @__PURE__ */ C("nav", {
149
+ }), /* @__PURE__ */ E("nav", {
136
150
  "aria-label": n("label"),
137
151
  className: "-mx-3 mt-2 min-h-0 flex-1 overflow-y-auto px-3",
138
- children: i.map((e) => /* @__PURE__ */ C(D, {
152
+ children: r.map((e) => /* @__PURE__ */ E(A, {
139
153
  label: e.label,
140
154
  collapsible: !1,
141
155
  children: e.items.map(({ to: e, label: n, Icon: r }) => {
142
156
  let i = e.replace("$workspace", t);
143
- return /* @__PURE__ */ C(O, {
157
+ return /* @__PURE__ */ E(j, {
144
158
  label: n,
145
- icon: /* @__PURE__ */ C(r, { className: "size-4" }),
159
+ icon: /* @__PURE__ */ E(r, { className: "size-4" }),
146
160
  href: i,
147
161
  selected: a === i
148
162
  }, e);
@@ -150,4 +164,4 @@ function A({ workspace: t }) {
150
164
  }, e.label))
151
165
  })] });
152
166
  }
153
- export { A as SettingsNav, k as useSettingsPages };
167
+ export { N as SettingsNav, M as useSettingsPages };
@@ -1,27 +1,27 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { Link as n } from "../lib/router.js";
3
- import { availableRepositoriesQuery as r, codeHostQuery as ee, githubSettingsQuery as i, repositoriesQuery as a, teamsQuery as o } from "../api/queries.js";
4
- import { copyItem as s } from "../lib/menus.js";
5
- import { externalUrl as c } from "../lib/externalUrl.js";
6
- import { AddIcon as l, RepositoryIcon as u } from "./icons.js";
7
- import { useConfirm as te } from "../lib/confirm.js";
8
- import { useFormError as d } from "./settings.js";
9
- import { RepositoryIssueSync as f } from "./GitHub.js";
10
- import { Button as p, Card as m, Checkbox as h, Combobox as g, ErrorText as ne, InfoTip as _, Section as v, Tooltip as y, menuDivider as b, useOpenMenu as x } from "@parallelworks/ui";
11
- import { useState as S } from "react";
12
- import { useTranslations as C } from "use-intl";
13
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
14
- import { useMutation as E, useQuery as D, useQueryClient as O, useSuspenseQuery as k } from "@tanstack/react-query";
3
+ import { availableRepositoriesQuery as r, codeHostQuery as i, githubSettingsQuery as a, repositoriesQuery as o, teamsQuery as s } from "../api/queries.js";
4
+ import { copyItem as c } from "../lib/menus.js";
5
+ import { externalUrl as ee } from "../lib/externalUrl.js";
6
+ import { AddIcon as l, CodeHostIcon as u, RepositoryIcon as d } from "./icons.js";
7
+ import { useConfirm as f } from "../lib/confirm.js";
8
+ import { useFormError as p } from "./settings.js";
9
+ import { RepositoryIssueSync as m } from "./GitHub.js";
10
+ import { Button as h, Card as g, Checkbox as te, Combobox as _, ErrorText as v, InfoTip as y, Section as b, Tooltip as ne, menuDivider as x, useOpenMenu as S } from "@parallelworks/ui";
11
+ import { useState as C } from "react";
12
+ import { useTranslations as w } from "use-intl";
13
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
14
+ import { useMutation as D, useQuery as O, useQueryClient as re, useSuspenseQuery as k } from "@tanstack/react-query";
15
15
  // src/components/TeamRepositories.tsx
16
16
  var A = "cursor-help underline decoration-dotted underline-offset-2";
17
17
  function j({ workspace: j, team: M, isAdmin: N }) {
18
- let P = C("code"), F = C("common"), { data: I } = k(ee(j)), { data: L } = k(a(j, M.key)), { data: R } = D({
19
- ...i(j),
18
+ let P = w("code"), F = w("common"), { data: I } = k(i(j)), { data: L } = k(o(j, M.key)), { data: R } = O({
19
+ ...a(j),
20
20
  enabled: N
21
- }), z = C("github"), [B, V] = S(!1), H = I.connections.some((e) => !e.removed), U = D({
21
+ }), z = w("github"), [B, V] = C(!1), H = I.connections.some((e) => !e.removed), U = O({
22
22
  ...r(j, M.key),
23
23
  enabled: B && N && H
24
- }), W = O(), G = x(), K = d(), { confirm: q, dialog: J } = te(), Y = () => W.invalidateQueries({ queryKey: a(j, M.key).queryKey }), X = (e) => {
24
+ }), W = re(), G = S(), K = p(), { confirm: q, dialog: J } = f(), Y = () => W.invalidateQueries({ queryKey: o(j, M.key).queryKey }), X = (e) => {
25
25
  let [t = "", n = ""] = e.split("/");
26
26
  return { path: {
27
27
  workspace: j,
@@ -29,7 +29,7 @@ function j({ workspace: j, team: M, isAdmin: N }) {
29
29
  owner: t,
30
30
  name: n
31
31
  } };
32
- }, Z = E({
32
+ }, Z = D({
33
33
  mutationFn: async (n) => t(await e.PUT("/api/v1/workspaces/{workspace}/teams/{key}/repositories/{owner}/{name}", {
34
34
  params: X(n.repository),
35
35
  body: { default: n.makeDefault }
@@ -37,11 +37,11 @@ function j({ workspace: j, team: M, isAdmin: N }) {
37
37
  onMutate: K.clear,
38
38
  onError: K.set,
39
39
  onSettled: Y
40
- }), re = E({
40
+ }), ie = D({
41
41
  mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/teams/{key}/repositories/{owner}/{name}", { params: X(n) })),
42
42
  onMutate: K.clear,
43
43
  onSettled: Y
44
- }), Q = E({
44
+ }), Q = D({
45
45
  mutationFn: async (n) => t(await e.PATCH("/api/v1/workspaces/{workspace}/teams/{key}", {
46
46
  params: { path: {
47
47
  workspace: j,
@@ -51,40 +51,40 @@ function j({ workspace: j, team: M, isAdmin: N }) {
51
51
  })),
52
52
  onMutate: K.clear,
53
53
  onError: K.set,
54
- onSettled: () => W.invalidateQueries({ queryKey: o(j).queryKey })
54
+ onSettled: () => W.invalidateQueries({ queryKey: s(j).queryKey })
55
55
  }), $ = (e) => q({
56
56
  title: P("unlinkConfirm", { repository: e }),
57
57
  description: P("unlinkDetail"),
58
58
  confirmLabel: P("unlink"),
59
- onConfirm: () => re.mutateAsync(e)
59
+ onConfirm: () => ie.mutateAsync(e)
60
60
  });
61
- if (I.provider === "") return /* @__PURE__ */ w(v, {
61
+ if (I.provider === "") return /* @__PURE__ */ T(b, {
62
62
  variant: "bare",
63
63
  headingLevel: 2,
64
64
  collapsible: !1,
65
65
  title: P("repositories"),
66
- children: /* @__PURE__ */ w("p", {
66
+ children: /* @__PURE__ */ T("p", {
67
67
  className: "text-sm text-muted-foreground",
68
68
  children: P("notConfigured")
69
69
  })
70
70
  });
71
- let ie = new Set(L.map((e) => `${e.owner}/${e.name}`.toLowerCase()));
72
- return /* @__PURE__ */ T(v, {
71
+ let ae = new Set(L.map((e) => `${e.owner}/${e.name}`.toLowerCase()));
72
+ return /* @__PURE__ */ E(b, {
73
73
  variant: "bare",
74
74
  headingLevel: 2,
75
75
  collapsible: !1,
76
76
  title: P("repositories"),
77
77
  description: P("repositoriesDescription"),
78
78
  children: [
79
- /* @__PURE__ */ T(m, {
79
+ /* @__PURE__ */ E(g, {
80
80
  size: "fill",
81
81
  padding: "none",
82
82
  divided: !0,
83
83
  interactive: !1,
84
- render: /* @__PURE__ */ w("ul", {}),
84
+ render: /* @__PURE__ */ T("ul", {}),
85
85
  children: [L.map((e) => {
86
- let t = `${e.owner}/${e.name}`, n = c(e.url), r = R?.enabled && R.repositories.find((e) => e.team === M.key && e.fullName.toLowerCase() === t.toLowerCase());
87
- return /* @__PURE__ */ T("li", {
86
+ let t = `${e.owner}/${e.name}`, n = ee(e.url), r = R?.enabled && R.repositories.find((e) => e.team === M.key && e.fullName.toLowerCase() === t.toLowerCase());
87
+ return /* @__PURE__ */ E("li", {
88
88
  onContextMenu: (r) => G(r, [
89
89
  n ? {
90
90
  label: P("openOnHost"),
@@ -95,9 +95,9 @@ function j({ workspace: j, team: M, isAdmin: N }) {
95
95
  disabled: !0,
96
96
  onClick: () => {}
97
97
  },
98
- s(F("copyName"), t),
98
+ c(F("copyName"), t),
99
99
  ...N ? [
100
- b,
100
+ x,
101
101
  {
102
102
  label: P("makeDefault"),
103
103
  disabled: e.default,
@@ -114,29 +114,32 @@ function j({ workspace: j, team: M, isAdmin: N }) {
114
114
  ] : []
115
115
  ]),
116
116
  className: "px-3 py-2 text-sm",
117
- children: [/* @__PURE__ */ T("div", {
117
+ children: [/* @__PURE__ */ E("div", {
118
118
  className: "flex items-center gap-3",
119
119
  children: [
120
- /* @__PURE__ */ w(u, { className: "size-4 text-muted-foreground" }),
121
- /* @__PURE__ */ w("a", {
120
+ /* @__PURE__ */ T(u, {
121
+ provider: e.provider,
122
+ className: "size-4 text-muted-foreground"
123
+ }),
124
+ /* @__PURE__ */ T("a", {
122
125
  href: n,
123
126
  target: "_blank",
124
127
  rel: "noopener noreferrer",
125
128
  className: "min-w-0 truncate hover:underline",
126
129
  children: t
127
130
  }),
128
- /* @__PURE__ */ w("span", {
131
+ /* @__PURE__ */ T("span", {
129
132
  className: "flex-1 text-xs text-muted-foreground",
130
- children: e.default ? /* @__PURE__ */ w(_, {
133
+ children: e.default ? /* @__PURE__ */ T(y, {
131
134
  text: P("defaultHint"),
132
135
  className: A,
133
136
  children: P("defaultRepository")
134
137
  }) : e.private && P("private")
135
138
  }),
136
- N && !e.default && /* @__PURE__ */ w(y, {
139
+ N && !e.default && /* @__PURE__ */ T(ne, {
137
140
  content: P("makeDefaultHint"),
138
141
  describesAnchor: !0,
139
- children: /* @__PURE__ */ w("button", {
142
+ children: /* @__PURE__ */ T("button", {
140
143
  type: "button",
141
144
  onClick: () => Z.mutate({
142
145
  repository: t,
@@ -146,22 +149,22 @@ function j({ workspace: j, team: M, isAdmin: N }) {
146
149
  children: P("makeDefault")
147
150
  })
148
151
  }),
149
- N && /* @__PURE__ */ w("button", {
152
+ N && /* @__PURE__ */ T("button", {
150
153
  type: "button",
151
154
  onClick: () => $(t),
152
155
  className: "text-xs text-muted-foreground hover:text-danger",
153
156
  children: P("unlink")
154
157
  })
155
158
  ]
156
- }), r && /* @__PURE__ */ w("div", {
159
+ }), r && /* @__PURE__ */ T("div", {
157
160
  className: "mt-2 pl-7",
158
- children: /* @__PURE__ */ w(f, {
161
+ children: /* @__PURE__ */ T(m, {
159
162
  workspace: j,
160
163
  repository: r,
161
164
  teamName: M.name,
162
- children: /* @__PURE__ */ w("span", {
165
+ children: /* @__PURE__ */ T("span", {
163
166
  className: "flex-1 text-xs text-muted-foreground",
164
- children: /* @__PURE__ */ w(_, {
167
+ children: /* @__PURE__ */ T(y, {
165
168
  text: z("issueSyncHint"),
166
169
  className: A,
167
170
  children: z("issueSync")
@@ -170,30 +173,30 @@ function j({ workspace: j, team: M, isAdmin: N }) {
170
173
  })
171
174
  })]
172
175
  }, t);
173
- }), L.length === 0 && /* @__PURE__ */ w("li", {
176
+ }), L.length === 0 && /* @__PURE__ */ T("li", {
174
177
  className: "px-3 py-2 text-sm text-muted-foreground",
175
178
  children: P("noRepositories")
176
179
  })]
177
180
  }),
178
- N && !H && /* @__PURE__ */ w("p", {
181
+ N && !H && /* @__PURE__ */ T("p", {
179
182
  className: "mt-3 text-sm text-muted-foreground",
180
- children: P.rich("connectFirst", { settings: (e) => /* @__PURE__ */ w(n, {
183
+ children: P.rich("connectFirst", { settings: (e) => /* @__PURE__ */ T(n, {
181
184
  to: "/$workspace/settings/github",
182
185
  params: { workspace: j },
183
186
  className: "underline",
184
187
  children: e
185
188
  }) })
186
189
  }),
187
- N && H && /* @__PURE__ */ w("div", {
190
+ N && H && /* @__PURE__ */ T("div", {
188
191
  className: "mt-3",
189
- children: /* @__PURE__ */ w(g, {
192
+ children: /* @__PURE__ */ T(_, {
190
193
  open: B,
191
194
  onOpenChange: V,
192
- items: (U.data ?? []).filter((e) => !ie.has(`${e.owner}/${e.name}`.toLowerCase())).map((e) => ({
195
+ items: (U.data ?? []).filter((e) => !ae.has(`${e.owner}/${e.name}`.toLowerCase())).map((e) => ({
193
196
  value: `${e.owner}/${e.name}`,
194
197
  label: `${e.owner}/${e.name}`,
195
198
  ...e.private && { hint: P("private") },
196
- icon: /* @__PURE__ */ w(u, { className: "size-3.5 text-muted-foreground" })
199
+ icon: /* @__PURE__ */ T(d, { className: "size-3.5 text-muted-foreground" })
197
200
  })),
198
201
  value: null,
199
202
  onValueChange: (e) => e !== null && Z.mutate({
@@ -203,25 +206,25 @@ function j({ workspace: j, team: M, isAdmin: N }) {
203
206
  placeholder: P("linkPlaceholder"),
204
207
  "aria-label": P("linkRepository"),
205
208
  loading: U.isPending,
206
- trigger: /* @__PURE__ */ T(p, {
209
+ trigger: /* @__PURE__ */ E(h, {
207
210
  type: "button",
208
211
  children: [
209
- /* @__PURE__ */ w(l, { className: "size-3.5" }),
212
+ /* @__PURE__ */ T(l, { className: "size-3.5" }),
210
213
  " ",
211
214
  P("linkRepository")
212
215
  ]
213
216
  })
214
217
  })
215
218
  }),
216
- /* @__PURE__ */ T("label", {
219
+ /* @__PURE__ */ E("label", {
217
220
  className: "mt-4 flex w-fit items-center gap-2 text-sm",
218
- children: [/* @__PURE__ */ w(h, {
221
+ children: [/* @__PURE__ */ T(te, {
219
222
  checked: M.closeIssuesOnMerge,
220
223
  disabled: !N || Q.isPending,
221
224
  onCheckedChange: (e) => Q.mutate(e)
222
225
  }), P("closeOnMerge")]
223
226
  }),
224
- (K.error || U.isError) && /* @__PURE__ */ w(ne, {
227
+ (K.error || U.isError) && /* @__PURE__ */ T(v, {
225
228
  size: "md",
226
229
  className: "mt-2",
227
230
  children: K.error ?? P("unavailable")