@parallelworks/tandem-web 0.141.2 → 0.143.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 (64) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +162 -5
  2. package/_virtual/_virtual_i18n/es/common.js +162 -5
  3. package/_virtual/_virtual_i18n/ja/common.js +162 -5
  4. package/_virtual/_virtual_i18n/ko/common.js +162 -5
  5. package/_virtual/_virtual_i18n/zh/common.js +162 -5
  6. package/components/AccessGrants.js +6 -6
  7. package/components/ActivityTimeline.js +2 -0
  8. package/components/CodeHostSettings.js +25 -25
  9. package/components/CustomFields.js +349 -0
  10. package/components/DocProperties.js +320 -0
  11. package/components/DocTable.js +176 -0
  12. package/components/DocViewBlock.js +104 -0
  13. package/components/DocsTree.js +16 -6
  14. package/components/Editor.js +30 -28
  15. package/components/GitHub.js +22 -22
  16. package/components/IssueBoard.js +48 -43
  17. package/components/IssueEvent.js +2 -0
  18. package/components/IssueFilters.js +210 -122
  19. package/components/IssueImport.js +1 -1
  20. package/components/IssueRow.js +96 -79
  21. package/components/IssueTemplates.js +216 -156
  22. package/components/IssueTypes.js +318 -0
  23. package/components/NewIssueDialog.js +254 -216
  24. package/components/SettingsNav.js +40 -35
  25. package/components/SlashMenu.js +2 -0
  26. package/components/TeamForm.js +49 -35
  27. package/components/TeamRepositories.js +51 -51
  28. package/components/TeamWorkflow.js +8 -8
  29. package/components/Updates.js +8 -8
  30. package/lib/boardMove.js +69 -47
  31. package/lib/customFields.js +113 -0
  32. package/lib/docProperties.js +135 -0
  33. package/lib/issueDisplay.js +27 -12
  34. package/lib/issueList.js +166 -62
  35. package/lib/issueTypes.js +50 -0
  36. package/lib/teamTree.js +24 -0
  37. package/lib/views.js +13 -11
  38. package/package.json +1 -1
  39. package/pages/issues.js +331 -291
  40. package/routeTree.gen.js +174 -162
  41. package/routes/_workspace/agents/index2.js +9 -9
  42. package/routes/_workspace/docs/_doc2.js +147 -140
  43. package/routes/_workspace/docs/space._space.js +6 -0
  44. package/routes/_workspace/docs/space2._space.js +256 -0
  45. package/routes/_workspace/docs2.js +3 -3
  46. package/routes/_workspace/issues/_identifier2.js +433 -370
  47. package/routes/_workspace/projects/_projectId3.js +213 -201
  48. package/routes/_workspace/settings/audit-log3.js +2 -0
  49. package/routes/_workspace/settings/fields.js +6 -0
  50. package/routes/_workspace/settings/fields2.js +30 -0
  51. package/routes/_workspace/settings/fields3.js +5 -0
  52. package/routes/_workspace/settings/groups2.js +74 -74
  53. package/routes/_workspace/settings/labels2.js +33 -33
  54. package/routes/_workspace/settings/members2.js +35 -35
  55. package/routes/_workspace/settings/roles2.js +24 -24
  56. package/routes/_workspace/settings/runners2.js +18 -18
  57. package/routes/_workspace/settings/sessions2.js +9 -9
  58. package/routes/_workspace/settings/slack2.js +8 -8
  59. package/routes/_workspace/settings/sso2.js +50 -50
  60. package/routes/_workspace/settings/tokens2.js +15 -15
  61. package/routes/_workspace/settings/webhooks2.js +42 -42
  62. package/routes/_workspace/teams/_key/settings2.js +138 -76
  63. package/routes/_workspace2.js +321 -319
  64. package/styles.css +39 -0
@@ -309,6 +309,8 @@ function H(e) {
309
309
  case "issue.cycle_changed": return o.number ? ["issueCycleSet", { number: l("number") }] : ["issueCycleCleared", {}];
310
310
  case "issue.estimate_changed": return Number(o.to) ? ["issueEstimateSet", { points: r.number(Number(o.to)) }] : ["issueEstimateCleared", {}];
311
311
  case "issue.due_date_changed": return o.to ? ["issueDueDateSet", { date: i.day(l("to")) }] : ["issueDueDateCleared", {}];
312
+ case "issue.type_changed": return o.to ? ["issueTypeChanged", { type: l("to") }] : ["issueTypeCleared", {}];
313
+ case "issue.fields_changed": return ["issueFieldsChanged", { fields: r.list(o.fields ?? []) }];
312
314
  case "issue.reaction_added":
313
315
  case "issue.reaction_removed": return [e.type === "issue.reaction_added" ? "issueReactionAdded" : "issueReactionRemoved", { emoji: _[l("emoji")] ?? l("emoji") }];
314
316
  case "issue.triage_accepted": return ["issueTriageAccepted", {}];
@@ -0,0 +1,6 @@
1
+ import { createFileRoute as e, lazyFn as t, lazyRouteComponent as n } from "@tanstack/react-router";
2
+ var r = e("/$workspace/settings/fields")({
3
+ loader: t(() => import("./fields3.js"), "loader"),
4
+ component: n(() => import("./fields2.js"), "component")
5
+ });
6
+ export { r as Route };
@@ -0,0 +1,30 @@
1
+ import { IssueTypeSettings as e } from "../../../components/IssueTypes.js";
2
+ import { Route as t } from "./fields.js";
3
+ import { useCan as n } from "../../../lib/roles.js";
4
+ import { AdminOnly as r, SettingsPage as i } from "../../../components/settings.js";
5
+ import { FieldSettings as a } from "../../../components/CustomFields.js";
6
+ import { useTranslations as o } from "use-intl";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ // src/routes/$workspace/settings/fields.tsx?tsr-split=component
9
+ function l() {
10
+ let { workspace: l } = t.useParams(), u = o("customFields"), d = n(l, "manage_labels");
11
+ return /* @__PURE__ */ c(i, {
12
+ title: u("title"),
13
+ description: u("pageDescription"),
14
+ children: [/* @__PURE__ */ s(r, { workspace: l }), d && /* @__PURE__ */ c("div", {
15
+ className: "space-y-10",
16
+ children: [
17
+ /* @__PURE__ */ s(e, { workspace: l }),
18
+ /* @__PURE__ */ s(a, {
19
+ workspace: l,
20
+ target: "issue"
21
+ }),
22
+ /* @__PURE__ */ s(a, {
23
+ workspace: l,
24
+ target: "project"
25
+ })
26
+ ]
27
+ })]
28
+ });
29
+ }
30
+ export { l as component };
@@ -0,0 +1,5 @@
1
+ import { customFieldsQuery as e } from "../../../lib/customFields.js";
2
+ import { issueTypesQuery as t } from "../../../lib/issueTypes.js";
3
+ // src/routes/$workspace/settings/fields.tsx?tsr-split=loader
4
+ var n = ({ context: { queryClient: n }, params: { workspace: r } }) => Promise.all([n.ensureQueryData(e(r)), n.ensureQueryData(t(r))]);
5
+ export { n as loader };
@@ -1,28 +1,28 @@
1
1
  import { api as e, unwrap as t } from "../../../api/client.js";
2
2
  import { groupsQuery as n, meQuery as r } from "../../../api/queries.js";
3
- import { AddIcon as i, UsersIcon as a } from "../../../components/icons.js";
4
- import { Route as o } from "./groups.js";
5
- import { usePeople as s } from "../../../lib/people.js";
6
- import { useCan as c } from "../../../lib/roles.js";
7
- import { AdminOnly as l, SettingsPage as u, useFormError as d } from "../../../components/settings.js";
8
- import { useConfirm as f } from "../../../lib/confirm.js";
3
+ import { useConfirm as i } from "../../../lib/confirm.js";
4
+ import { AddIcon as a, UsersIcon as o } from "../../../components/icons.js";
5
+ import { Route as s } from "./groups.js";
6
+ import { usePeople as c } from "../../../lib/people.js";
7
+ import { useCan as l } from "../../../lib/roles.js";
8
+ import { AdminOnly as u, SettingsPage as d, useFormError as f } from "../../../components/settings.js";
9
9
  import { Avatar as p, AvatarGroup as m, Button as h, Combobox as g, ErrorText as _, Input as v, Modal as y, ModalTitle as b, PageHeaderAddButton as x, Table as S, useOpenMenu as C } from "@parallelworks/ui";
10
10
  import { useMemo as w, useState as T } from "react";
11
11
  import { useTranslations as E } from "use-intl";
12
12
  import { jsx as D, jsxs as O } from "react/jsx-runtime";
13
13
  import { useMutation as k, useQueryClient as A, useSuspenseQuery as j } from "@tanstack/react-query";
14
- import { ListCellText as M, ListColumns as N, ListPage as P, ListRow as F, ListToolbar as I, NameCell as L, listTableProps as R, useCopySubmenu as ee, useListNavigate as te, useListSearch as ne, useListView as re } from "@parallelworks/ui/list";
14
+ import { ListCellText as M, ListColumns as N, ListPage as ee, ListRow as te, ListToolbar as ne, NameCell as P, listTableProps as F, useCopySubmenu as I, useListNavigate as L, useListSearch as R, useListView as z } from "@parallelworks/ui/list";
15
15
  // src/routes/$workspace/settings/groups.tsx?tsr-split=component
16
- function z() {
17
- let { workspace: e } = o.useParams(), { data: t } = j(r), n = c(e, "manage_members"), i = t?.mode === "platform";
18
- return /* @__PURE__ */ D(V, {
16
+ function B() {
17
+ let { workspace: e } = s.useParams(), { data: t } = j(r), n = l(e, "manage_members"), i = t?.mode === "platform";
18
+ return /* @__PURE__ */ D(H, {
19
19
  workspace: e,
20
20
  isAdmin: n && !i,
21
21
  managed: i
22
22
  });
23
23
  }
24
- function B(r) {
25
- let i = A(), a = d(), o = () => i.invalidateQueries({ queryKey: n(r).queryKey });
24
+ function V(r) {
25
+ let i = A(), a = f(), o = () => i.invalidateQueries({ queryKey: n(r).queryKey });
26
26
  return {
27
27
  create: k({
28
28
  mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/groups", {
@@ -71,136 +71,136 @@ function B(r) {
71
71
  err: a
72
72
  };
73
73
  }
74
- function V({ workspace: e, isAdmin: t, managed: r }) {
75
- let { data: i } = j(n(e)), o = E("settings"), c = E("common"), { person: d } = s(e), h = B(e), g = ne(), v = C(), y = te(), b = ee(), { confirm: k, dialog: A } = f(), [z, V] = T(null), [W, G] = T(!1), K = h.setMembers.isError ? h.setMembers.variables?.group : h.rename.isError ? h.rename.variables?.group.slug : void 0, q = w(() => [
74
+ function H({ workspace: e, isAdmin: t, managed: r }) {
75
+ let { data: a } = j(n(e)), s = E("settings"), l = E("common"), { person: f } = c(e), h = V(e), g = R(), v = C(), y = L(), b = I(), { confirm: k, dialog: A } = i(), [B, H] = T(null), [G, K] = T(!1), q = h.setMembers.isError ? h.setMembers.variables?.group : h.rename.isError ? h.rename.variables?.group.slug : void 0, J = w(() => [
76
76
  {
77
77
  key: "name",
78
- label: o("groupColName"),
78
+ label: s("groupColName"),
79
79
  headerClassName: "py-2 @[36rem]:w-[45%]",
80
80
  alwaysVisible: !0
81
81
  },
82
82
  {
83
83
  key: "members",
84
- label: o("members"),
84
+ label: s("members"),
85
85
  headerClassName: "py-2"
86
86
  },
87
87
  {
88
88
  key: "slug",
89
- label: o("groupColSlug"),
89
+ label: s("groupColSlug"),
90
90
  headerClassName: "py-2",
91
91
  defaultHidden: !0
92
92
  }
93
- ], [o]), J = w(() => [{
93
+ ], [s]), re = w(() => [{
94
94
  value: "name",
95
- label: o("groupColName"),
95
+ label: s("groupColName"),
96
96
  compare: (e, t) => e.name.localeCompare(t.name)
97
97
  }, {
98
98
  value: "members",
99
- label: o("members"),
99
+ label: s("members"),
100
100
  compare: (e, t) => e.usernames.length - t.usernames.length
101
- }], [o]), Y = re({
101
+ }], [s]), Y = z({
102
102
  storageKey: `tandem-groups-${e}`,
103
103
  defaultShowColumnHeaders: !1,
104
- columns: q,
105
- orderBys: J,
104
+ columns: J,
105
+ orderBys: re,
106
106
  defaultOrderBy: "name",
107
107
  facets: []
108
- }), X = g.filter.trim().toLowerCase(), Z = i.filter((e) => !X || [
108
+ }), X = g.filter.trim().toLowerCase(), Z = a.filter((e) => !X || [
109
109
  e.name,
110
110
  e.slug,
111
- ...e.usernames.map((e) => d(e).name)
111
+ ...e.usernames.map((e) => f(e).name)
112
112
  ].some((e) => e.toLowerCase().includes(X))), ie = Y.applyOrder(Z), Q = (e) => k({
113
- title: o("deleteGroupTitle"),
114
- description: o("deleteGroupDescription", { name: e.name }),
115
- confirmLabel: c("delete"),
113
+ title: s("deleteGroupTitle"),
114
+ description: s("deleteGroupDescription", { name: e.name }),
115
+ confirmLabel: l("delete"),
116
116
  onConfirm: () => h.remove.mutateAsync(e.slug)
117
117
  }), ae = (e) => [
118
118
  {
119
- label: o(t ? "editGroup" : "viewGroup"),
120
- onClick: () => V(e.slug)
119
+ label: s(t ? "editGroup" : "viewGroup"),
120
+ onClick: () => H(e.slug)
121
121
  },
122
122
  b({
123
123
  name: e.name,
124
124
  extra: [{
125
- label: o("groupColSlug"),
125
+ label: s("groupColSlug"),
126
126
  value: e.slug
127
127
  }]
128
128
  }),
129
129
  ...t && !r ? [{ divider: !0 }, {
130
- label: o("deleteGroup"),
130
+ label: s("deleteGroup"),
131
131
  destructive: !0,
132
132
  onClick: () => Q(e)
133
133
  }] : []
134
- ], $ = i.find((e) => e.slug === z);
135
- return /* @__PURE__ */ O(u, {
134
+ ], $ = a.find((e) => e.slug === B);
135
+ return /* @__PURE__ */ O(d, {
136
136
  wide: !0,
137
- title: o("groups"),
138
- description: o(r ? "groupsManaged" : "groupsDescription"),
137
+ title: s("groups"),
138
+ description: s(r ? "groupsManaged" : "groupsDescription"),
139
139
  actions: t && !r && /* @__PURE__ */ D(x, {
140
- label: o("newGroup"),
140
+ label: s("newGroup"),
141
141
  word: "create",
142
- onClick: () => G(!0)
142
+ onClick: () => K(!0)
143
143
  }),
144
- toolbar: i.length > 0 && /* @__PURE__ */ D(I, {
144
+ toolbar: a.length > 0 && /* @__PURE__ */ D(ne, {
145
145
  view: Y,
146
146
  search: g,
147
- searchLabel: o("groupSearch"),
148
- searchPlaceholder: o("groupSearch")
147
+ searchLabel: s("groupSearch"),
148
+ searchPlaceholder: s("groupSearch")
149
149
  }),
150
150
  children: [
151
151
  /* @__PURE__ */ D("div", {
152
152
  className: "px-4",
153
- children: /* @__PURE__ */ D(l, {
153
+ children: /* @__PURE__ */ D(u, {
154
154
  workspace: e,
155
155
  permission: "manage_members"
156
156
  })
157
157
  }),
158
158
  /* @__PURE__ */ D("div", {
159
159
  className: "border-t border-border",
160
- children: /* @__PURE__ */ D(P, {
160
+ children: /* @__PURE__ */ D(ee, {
161
161
  view: Y,
162
- total: i.length,
162
+ total: a.length,
163
163
  matches: Z.length,
164
164
  count: {
165
165
  filterActive: X !== "",
166
- noun: o("groupNoun"),
167
- nounPlural: o("groupNounPlural")
166
+ noun: s("groupNoun"),
167
+ nounPlural: s("groupNounPlural")
168
168
  },
169
169
  empty: {
170
- icon: /* @__PURE__ */ D(a, {}),
171
- title: o("noGroups")
170
+ icon: /* @__PURE__ */ D(o, {}),
171
+ title: s("noGroups")
172
172
  },
173
- noMatches: o("groupNoMatches"),
173
+ noMatches: s("groupNoMatches"),
174
174
  children: /* @__PURE__ */ O(S, {
175
- ...R,
176
- children: [/* @__PURE__ */ D(N, { view: Y }), ie.map((e) => /* @__PURE__ */ O(F, {
175
+ ...F,
176
+ children: [/* @__PURE__ */ D(N, { view: Y }), ie.map((e) => /* @__PURE__ */ O(te, {
177
177
  href: null,
178
- onActivate: () => V(e.slug),
178
+ onActivate: () => H(e.slug),
179
179
  items: ae(e),
180
180
  goTo: y,
181
181
  openMenu: v,
182
182
  children: [
183
- /* @__PURE__ */ D(L, {
184
- icon: /* @__PURE__ */ D(a, {}),
183
+ /* @__PURE__ */ D(P, {
184
+ icon: /* @__PURE__ */ D(o, {}),
185
185
  iconTile: !0,
186
186
  name: e.name,
187
187
  subtitle: e.slug,
188
188
  href: null,
189
- children: !$ && !W && K === e.slug && /* @__PURE__ */ D(_, {
189
+ children: !$ && !G && q === e.slug && /* @__PURE__ */ D(_, {
190
190
  className: "mt-1",
191
191
  children: h.err.error
192
192
  })
193
193
  }),
194
194
  Y.isVisible("members") && /* @__PURE__ */ D(S.Item, {
195
195
  className: "py-2.5",
196
- children: e.usernames.length === 0 ? /* @__PURE__ */ D(M, { children: o("noMembers") }) : /* @__PURE__ */ O("span", {
196
+ children: e.usernames.length === 0 ? /* @__PURE__ */ D(M, { children: s("noMembers") }) : /* @__PURE__ */ O("span", {
197
197
  className: "flex items-center gap-2",
198
198
  children: [/* @__PURE__ */ D(m, {
199
199
  size: "sm",
200
200
  max: 5,
201
201
  showOverflow: !1,
202
202
  children: e.usernames.map((e) => {
203
- let t = d(e);
203
+ let t = f(e);
204
204
  return /* @__PURE__ */ D(p, {
205
205
  name: t.name,
206
206
  src: t.avatarUrl,
@@ -209,7 +209,7 @@ function V({ workspace: e, isAdmin: t, managed: r }) {
209
209
  })
210
210
  }), /* @__PURE__ */ D(M, {
211
211
  className: "tabular-nums",
212
- children: o("groupMemberCount", { count: e.usernames.length })
212
+ children: s("groupMemberCount", { count: e.usernames.length })
213
213
  })]
214
214
  })
215
215
  }),
@@ -226,28 +226,28 @@ function V({ workspace: e, isAdmin: t, managed: r }) {
226
226
  })
227
227
  }),
228
228
  A,
229
- $ && /* @__PURE__ */ D(U, {
229
+ $ && /* @__PURE__ */ D(W, {
230
230
  workspace: e,
231
231
  group: $,
232
232
  isAdmin: t,
233
233
  managed: r,
234
234
  actions: h,
235
235
  onDelete: () => {
236
- V(null), Q($);
236
+ H(null), Q($);
237
237
  },
238
- onClose: () => V(null)
238
+ onClose: () => H(null)
239
239
  }),
240
- W && /* @__PURE__ */ D(H, {
240
+ G && /* @__PURE__ */ D(U, {
241
241
  actions: h,
242
242
  onCreated: (e) => {
243
- G(!1), V(e);
243
+ K(!1), H(e);
244
244
  },
245
- onClose: () => G(!1)
245
+ onClose: () => K(!1)
246
246
  })
247
247
  ]
248
248
  });
249
249
  }
250
- function H({ actions: e, onCreated: t, onClose: n }) {
250
+ function U({ actions: e, onCreated: t, onClose: n }) {
251
251
  let r = E("settings"), i = E("common"), [a, o] = T("");
252
252
  return /* @__PURE__ */ D(y, {
253
253
  open: !0,
@@ -296,8 +296,8 @@ function H({ actions: e, onCreated: t, onClose: n }) {
296
296
  })
297
297
  });
298
298
  }
299
- function U({ workspace: e, group: t, isAdmin: n, managed: r, actions: o, onDelete: c, onClose: l }) {
300
- let u = E("settings"), d = E("common"), { members: f, person: m } = s(e), [x, S] = T(t.name), [C, w] = T(t.slug), k = n && !r, A = x.trim() !== t.name || C !== t.slug, j = (e) => o.setMembers.mutate({
299
+ function W({ workspace: e, group: t, isAdmin: n, managed: r, actions: i, onDelete: s, onClose: l }) {
300
+ let u = E("settings"), d = E("common"), { members: f, person: m } = c(e), [x, S] = T(t.name), [C, w] = T(t.slug), k = n && !r, A = x.trim() !== t.name || C !== t.slug, j = (e) => i.setMembers.mutate({
301
301
  group: t.slug,
302
302
  usernames: e
303
303
  });
@@ -308,12 +308,12 @@ function U({ workspace: e, group: t, isAdmin: n, managed: r, actions: o, onDelet
308
308
  children: [
309
309
  /* @__PURE__ */ O(b, {
310
310
  className: "flex items-center gap-2 text-sm font-semibold",
311
- children: [/* @__PURE__ */ D(a, { className: "size-4 text-muted-foreground" }), t.name]
311
+ children: [/* @__PURE__ */ D(o, { className: "size-4 text-muted-foreground" }), t.name]
312
312
  }),
313
313
  k && /* @__PURE__ */ O("form", {
314
314
  className: "mt-4 flex flex-wrap items-end gap-2",
315
315
  onSubmit: (e) => {
316
- e.preventDefault(), o.rename.mutate({
316
+ e.preventDefault(), i.rename.mutate({
317
317
  group: t,
318
318
  name: x.trim(),
319
319
  slug: C
@@ -345,7 +345,7 @@ function U({ workspace: e, group: t, isAdmin: n, managed: r, actions: o, onDelet
345
345
  type: "submit",
346
346
  variant: "primary",
347
347
  disabled: !A,
348
- loading: o.rename.isPending,
348
+ loading: i.rename.isPending,
349
349
  children: d("save")
350
350
  })
351
351
  ]
@@ -376,7 +376,7 @@ function U({ workspace: e, group: t, isAdmin: n, managed: r, actions: o, onDelet
376
376
  trigger: /* @__PURE__ */ O(h, {
377
377
  type: "button",
378
378
  size: "sm",
379
- children: [/* @__PURE__ */ D(i, { className: "size-3.5" }), u("addPeople")]
379
+ children: [/* @__PURE__ */ D(a, { className: "size-3.5" }), u("addPeople")]
380
380
  })
381
381
  })
382
382
  })]
@@ -421,13 +421,13 @@ function U({ workspace: e, group: t, isAdmin: n, managed: r, actions: o, onDelet
421
421
  /* @__PURE__ */ D(_, {
422
422
  size: "md",
423
423
  className: "mt-3",
424
- children: o.err.error
424
+ children: i.err.error
425
425
  }),
426
426
  /* @__PURE__ */ O("div", {
427
427
  className: "mt-5 flex items-center gap-2",
428
428
  children: [k && /* @__PURE__ */ D("button", {
429
429
  type: "button",
430
- onClick: c,
430
+ onClick: s,
431
431
  className: "text-sm text-danger hover:underline",
432
432
  children: u("deleteGroup")
433
433
  }), /* @__PURE__ */ D(h, {
@@ -440,4 +440,4 @@ function U({ workspace: e, group: t, isAdmin: n, managed: r, actions: o, onDelet
440
440
  ]
441
441
  });
442
442
  }
443
- export { z as component };
443
+ export { B as component };
@@ -1,12 +1,12 @@
1
1
  import { api as e, unwrap as t } from "../../../api/client.js";
2
2
  import { useNavigate as n } from "../../../lib/router.js";
3
3
  import { labelsQuery as r } from "../../../api/queries.js";
4
- import { TagIcon as i } from "../../../components/icons.js";
5
- import { Route as a } from "./labels.js";
6
- import { copyItem as o } from "../../../lib/menus.js";
7
- import { useCan as s } from "../../../lib/roles.js";
8
- import { AdminOnly as c, SettingsPage as l, useFormError as u } from "../../../components/settings.js";
9
- import { useConfirm as d } from "../../../lib/confirm.js";
4
+ import { useConfirm as i } from "../../../lib/confirm.js";
5
+ import { TagIcon as a } from "../../../components/icons.js";
6
+ import { Route as o } from "./labels.js";
7
+ import { copyItem as s } from "../../../lib/menus.js";
8
+ import { useCan as c } from "../../../lib/roles.js";
9
+ import { AdminOnly as l, SettingsPage as u, useFormError as d } from "../../../components/settings.js";
10
10
  import { Button as f, ColorInput as p, ErrorText as m, Input as h, Modal as g, ModalTitle as _, PageHeaderAddButton as v, Table as y, menuDivider as b, useOpenMenu as x } from "@parallelworks/ui";
11
11
  import { useMemo as S, useState as C } from "react";
12
12
  import { useTranslations as w } from "use-intl";
@@ -15,22 +15,22 @@ import { useMutation as D, useQueryClient as O, useSuspenseQuery as k } from "@t
15
15
  import { ListCellText as A, ListColumns as j, ListPage as M, ListRow as N, ListToolbar as P, NameCell as F, listTableProps as I, useListNavigate as L, useListSearch as R, useListView as z } from "@parallelworks/ui/list";
16
16
  // src/routes/$workspace/settings/labels.tsx?tsr-split=component
17
17
  function B() {
18
- let { workspace: e } = a.useParams();
18
+ let { workspace: e } = o.useParams();
19
19
  return /* @__PURE__ */ T(V, {
20
20
  workspace: e,
21
- isAdmin: s(e, "manage_labels")
21
+ isAdmin: c(e, "manage_labels")
22
22
  });
23
23
  }
24
- function V({ workspace: a, isAdmin: s }) {
25
- let { data: u } = k(r(a)), f = n(), p = w("settings"), m = w("common"), h = R(), g = L(), _ = x(), [B, V] = C(null), U = O(), { confirm: W, dialog: G } = d(), K = D({
24
+ function V({ workspace: o, isAdmin: c }) {
25
+ let { data: d } = k(r(o)), f = n(), p = w("settings"), m = w("common"), h = R(), g = L(), _ = x(), [B, V] = C(null), U = O(), { confirm: W, dialog: G } = i(), K = D({
26
26
  mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/labels/{labelId}", { params: { path: {
27
- workspace: a,
27
+ workspace: o,
28
28
  labelId: n.id
29
29
  } } })),
30
30
  onSettled: () => {
31
- U.invalidateQueries({ queryKey: r(a).queryKey }), U.invalidateQueries({ queryKey: [
31
+ U.invalidateQueries({ queryKey: r(o).queryKey }), U.invalidateQueries({ queryKey: [
32
32
  "workspace",
33
- a,
33
+ o,
34
34
  "issues"
35
35
  ] });
36
36
  }
@@ -54,23 +54,23 @@ function V({ workspace: a, isAdmin: s }) {
54
54
  label: m("name"),
55
55
  compare: (e, t) => e.name.localeCompare(t.name)
56
56
  }], [m]), X = z({
57
- storageKey: `tandem-labels-${a}`,
57
+ storageKey: `tandem-labels-${o}`,
58
58
  defaultShowColumnHeaders: !1,
59
59
  columns: J,
60
60
  orderBys: Y,
61
61
  defaultOrderBy: "name",
62
62
  facets: []
63
- }), Z = h.filter.trim().toLowerCase(), Q = u.filter((e) => !Z || e.name.toLowerCase().includes(Z)), $ = u.find((e) => e.id === B);
64
- return /* @__PURE__ */ E(l, {
63
+ }), Z = h.filter.trim().toLowerCase(), Q = d.filter((e) => !Z || e.name.toLowerCase().includes(Z)), $ = d.find((e) => e.id === B);
64
+ return /* @__PURE__ */ E(u, {
65
65
  wide: !0,
66
66
  title: m("labels"),
67
67
  description: p("labelsDescription"),
68
- actions: s && /* @__PURE__ */ T(v, {
68
+ actions: c && /* @__PURE__ */ T(v, {
69
69
  label: p("newLabel"),
70
70
  word: "create",
71
71
  onClick: () => V("new")
72
72
  }),
73
- toolbar: u.length > 0 && /* @__PURE__ */ T(P, {
73
+ toolbar: d.length > 0 && /* @__PURE__ */ T(P, {
74
74
  view: X,
75
75
  search: h,
76
76
  searchLabel: p("labelSearch"),
@@ -79,8 +79,8 @@ function V({ workspace: a, isAdmin: s }) {
79
79
  children: [
80
80
  /* @__PURE__ */ T("div", {
81
81
  className: "px-4",
82
- children: /* @__PURE__ */ T(c, {
83
- workspace: a,
82
+ children: /* @__PURE__ */ T(l, {
83
+ workspace: o,
84
84
  permission: "manage_labels"
85
85
  })
86
86
  }),
@@ -88,7 +88,7 @@ function V({ workspace: a, isAdmin: s }) {
88
88
  className: "border-t border-border",
89
89
  children: /* @__PURE__ */ T(M, {
90
90
  view: X,
91
- total: u.length,
91
+ total: d.length,
92
92
  matches: Q.length,
93
93
  count: {
94
94
  filterActive: h.filter.trim() !== "",
@@ -96,7 +96,7 @@ function V({ workspace: a, isAdmin: s }) {
96
96
  nounPlural: p("labelNounPlural")
97
97
  },
98
98
  empty: {
99
- icon: /* @__PURE__ */ T(i, {}),
99
+ icon: /* @__PURE__ */ T(a, {}),
100
100
  title: p("noLabels")
101
101
  },
102
102
  noMatches: p("labelNoMatches"),
@@ -104,7 +104,7 @@ function V({ workspace: a, isAdmin: s }) {
104
104
  ...I,
105
105
  children: [/* @__PURE__ */ T(j, { view: X }), X.applyOrder(Q).map((e) => /* @__PURE__ */ E(N, {
106
106
  href: null,
107
- onActivate: s ? () => V(e.id) : void 0,
107
+ onActivate: c ? () => V(e.id) : void 0,
108
108
  goTo: g,
109
109
  openMenu: _,
110
110
  items: [
@@ -112,13 +112,13 @@ function V({ workspace: a, isAdmin: s }) {
112
112
  label: p("viewIssues"),
113
113
  onClick: () => f({
114
114
  to: "/$workspace/issues",
115
- params: { workspace: a },
115
+ params: { workspace: o },
116
116
  search: { label: e.name }
117
117
  })
118
118
  },
119
- o(m("copyName"), e.name),
120
- o(p("copyColor"), e.color),
121
- ...s ? [
119
+ s(m("copyName"), e.name),
120
+ s(p("copyColor"), e.color),
121
+ ...c ? [
122
122
  b,
123
123
  {
124
124
  label: p("editLabel"),
@@ -151,7 +151,7 @@ function V({ workspace: a, isAdmin: s }) {
151
151
  })
152
152
  }),
153
153
  (B === "new" || $) && /* @__PURE__ */ T(H, {
154
- workspace: a,
154
+ workspace: o,
155
155
  label: $,
156
156
  onDone: () => V(null)
157
157
  }),
@@ -160,20 +160,20 @@ function V({ workspace: a, isAdmin: s }) {
160
160
  });
161
161
  }
162
162
  function H({ workspace: n, label: i, onDone: a }) {
163
- let o = w("settings"), s = w("common"), c = O(), l = u(), [d, v] = C(i?.name ?? ""), [y, b] = C(i?.color ?? "#d73a4a"), x = D({
163
+ let o = w("settings"), s = w("common"), c = O(), l = d(), [u, v] = C(i?.name ?? ""), [y, b] = C(i?.color ?? "#d73a4a"), x = D({
164
164
  mutationFn: async () => t(i ? await e.PATCH("/api/v1/workspaces/{workspace}/labels/{labelId}", {
165
165
  params: { path: {
166
166
  workspace: n,
167
167
  labelId: i.id
168
168
  } },
169
169
  body: {
170
- ...d !== i.name && { name: d },
170
+ ...u !== i.name && { name: u },
171
171
  ...y !== i.color && { color: y }
172
172
  }
173
173
  }) : await e.POST("/api/v1/workspaces/{workspace}/labels", {
174
174
  params: { path: { workspace: n } },
175
175
  body: {
176
- name: d,
176
+ name: u,
177
177
  color: y
178
178
  }
179
179
  })),
@@ -211,7 +211,7 @@ function H({ workspace: n, label: i, onDone: a }) {
211
211
  required: !0,
212
212
  autoFocus: !0,
213
213
  placeholder: o("labelName"),
214
- value: d,
214
+ value: u,
215
215
  onChange: (e) => v(e.target.value),
216
216
  "aria-label": o("labelName"),
217
217
  className: "min-w-0 flex-1"
@@ -231,7 +231,7 @@ function H({ workspace: n, label: i, onDone: a }) {
231
231
  }), /* @__PURE__ */ T(f, {
232
232
  type: "submit",
233
233
  variant: "primary",
234
- disabled: !d.trim(),
234
+ disabled: !u.trim(),
235
235
  loading: x.isPending,
236
236
  children: i ? s("save") : o("createLabel")
237
237
  })]