@parallelworks/tandem-web 0.161.2 → 0.163.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.
@@ -903,7 +903,8 @@ var e = {
903
903
  project: "Project",
904
904
  cycle: "Cycle",
905
905
  overdue: "Overdue",
906
- customer: "Customer"
906
+ customer: "Customer",
907
+ noAssignee: "No assignee"
907
908
  },
908
909
  issue: {
909
910
  archivedNote: "Archived on {when}.",
@@ -1685,6 +1686,7 @@ var e = {
1685
1686
  connectFirst: "Add a GitHub organization in <settings>GitHub settings</settings> first.",
1686
1687
  unavailable: "Couldn’t list repositories. Try again.",
1687
1688
  closeOnMerge: "Start an issue when its pull request opens, and complete it when the pull request merges",
1689
+ keepIssuesHere: "Don't open this team's issues on GitHub. Issues already on GitHub keep syncing",
1688
1690
  pullRequests: "Pull requests",
1689
1691
  pullRequestRef: "{repository} {number}",
1690
1692
  copyBranch: "Copy branch name",
@@ -903,7 +903,8 @@ var e = {
903
903
  project: "Proyecto",
904
904
  cycle: "Ciclo",
905
905
  overdue: "Vencidas",
906
- customer: "Cliente"
906
+ customer: "Cliente",
907
+ noAssignee: "Sin asignar"
907
908
  },
908
909
  issue: {
909
910
  archivedNote: "Archivada el {when}.",
@@ -1685,6 +1686,7 @@ var e = {
1685
1686
  connectFirst: "Primero añade una organización de GitHub en <settings>Ajustes de GitHub</settings>.",
1686
1687
  unavailable: "No se pudieron listar los repositorios. Inténtalo de nuevo.",
1687
1688
  closeOnMerge: "Iniciar una incidencia cuando se abra su pull request y completarla cuando se fusione",
1689
+ keepIssuesHere: "No abrir las incidencias de este equipo en GitHub. Las que ya están en GitHub siguen sincronizándose",
1688
1690
  pullRequests: "Pull requests",
1689
1691
  pullRequestRef: "{repository} {number}",
1690
1692
  copyBranch: "Copiar nombre de la rama",
@@ -903,7 +903,8 @@ var e = {
903
903
  project: "プロジェクト",
904
904
  cycle: "サイクル",
905
905
  overdue: "期限切れ",
906
- customer: "顧客"
906
+ customer: "顧客",
907
+ noAssignee: "担当者なし"
907
908
  },
908
909
  issue: {
909
910
  archivedNote: "{when} にアーカイブしました。",
@@ -1685,6 +1686,7 @@ var e = {
1685
1686
  connectFirst: "先に<settings>GitHub 設定</settings>で GitHub の組織を追加してください。",
1686
1687
  unavailable: "リポジトリを一覧表示できませんでした。もう一度お試しください。",
1687
1688
  closeOnMerge: "プルリクエストが開かれたら課題を開始し、マージされたら完了にする",
1689
+ keepIssuesHere: "このチームの課題を GitHub で作成しない。すでに GitHub にある課題は同期を続けます",
1688
1690
  pullRequests: "プルリクエスト",
1689
1691
  pullRequestRef: "{repository} {number}",
1690
1692
  copyBranch: "ブランチ名をコピー",
@@ -903,7 +903,8 @@ var e = {
903
903
  project: "프로젝트",
904
904
  cycle: "사이클",
905
905
  overdue: "기한 지남",
906
- customer: "고객"
906
+ customer: "고객",
907
+ noAssignee: "담당자 없음"
907
908
  },
908
909
  issue: {
909
910
  archivedNote: "{when}에 보관됨.",
@@ -1685,6 +1686,7 @@ var e = {
1685
1686
  connectFirst: "먼저 <settings>GitHub 설정</settings>에서 GitHub 조직을 추가하세요.",
1686
1687
  unavailable: "저장소 목록을 불러오지 못했습니다. 다시 시도하세요.",
1687
1688
  closeOnMerge: "풀 리퀘스트가 열리면 이슈를 시작하고, 병합되면 완료",
1689
+ keepIssuesHere: "이 팀의 이슈를 GitHub에 열지 않습니다. 이미 GitHub에 있는 이슈는 계속 동기화됩니다",
1688
1690
  pullRequests: "풀 리퀘스트",
1689
1691
  pullRequestRef: "{repository} {number}",
1690
1692
  copyBranch: "브랜치 이름 복사",
@@ -903,7 +903,8 @@ var e = {
903
903
  project: "项目",
904
904
  cycle: "周期",
905
905
  overdue: "已逾期",
906
- customer: "客户"
906
+ customer: "客户",
907
+ noAssignee: "无负责人"
907
908
  },
908
909
  issue: {
909
910
  archivedNote: "已于 {when} 归档。",
@@ -1685,6 +1686,7 @@ var e = {
1685
1686
  connectFirst: "请先在<settings>GitHub 设置</settings>中添加一个 GitHub 组织。",
1686
1687
  unavailable: "无法列出仓库。请重试。",
1687
1688
  closeOnMerge: "拉取请求打开时开始议题,合并时完成议题",
1689
+ keepIssuesHere: "不在 GitHub 上创建此团队的事项。已在 GitHub 上的事项继续同步",
1688
1690
  pullRequests: "拉取请求",
1689
1691
  pullRequestRef: "{repository} {number}",
1690
1692
  copyBranch: "复制分支名称",
@@ -1,23 +1,24 @@
1
- import { customersQuery as e, cyclesQuery as t, labelsQuery as n, myTeamsQuery as r, projectsQuery as i, statusesQuery as ee, teamsQuery as te } from "../api/queries.js";
2
- import { CalendarIcon as a, CycleIcon as ne, FolderIcon as o, PriorityIcon as s, ProjectIcon as c, StatusIcon as l, TagIcon as u, UserIcon as d, UsersIcon as f, usePriorityNames as p } from "./icons.js";
3
- import { usePeople as m } from "../lib/people.js";
4
- import { ProjectStatusIcon as h } from "./Planning.js";
5
- import { projectRef as g } from "../lib/projects.js";
6
- import { customFieldsQuery as re, fieldsFor as ie, filterableKinds as _, formatFieldFilters as v, parseFieldFilters as y } from "../lib/customFields.js";
7
- import { issueTypesQuery as b } from "../lib/issueTypes.js";
8
- import { TypeIcon as x } from "./IssueTypes.js";
9
- import { statusRef as S } from "../lib/refs.js";
10
- import { Avatar as C } from "@parallelworks/ui";
11
- import { useMemo as ae } from "react";
12
- import { useTranslations as w } from "use-intl";
13
- import { jsx as T } from "react/jsx-runtime";
14
- import { useQuery as E } from "@tanstack/react-query";
15
- import { useListFilters as D } from "@parallelworks/ui/list";
1
+ import { customersQuery as e, cyclesQuery as t, labelsQuery as n, myTeamsQuery as r, projectsQuery as i, statusesQuery as a, teamsQuery as o } from "../api/queries.js";
2
+ import { CalendarIcon as ee, CycleIcon as s, FolderIcon as c, PriorityIcon as l, ProjectIcon as u, StatusIcon as d, TagIcon as f, UserIcon as p, UsersIcon as te, usePriorityNames as ne } from "./icons.js";
3
+ import { usePeople as re } from "../lib/people.js";
4
+ import { ProjectStatusIcon as m } from "./Planning.js";
5
+ import { projectRef as ie } from "../lib/projects.js";
6
+ import { customFieldsQuery as h, fieldsFor as g, filterableKinds as _, formatFieldFilters as v, parseFieldFilters as y } from "../lib/customFields.js";
7
+ import { issueTypesQuery as ae } from "../lib/issueTypes.js";
8
+ import { TypeIcon as oe } from "./IssueTypes.js";
9
+ import { statusRef as b } from "../lib/refs.js";
10
+ import { Avatar as x } from "@parallelworks/ui";
11
+ import { useMemo as S } from "react";
12
+ import { useTranslations as C } from "use-intl";
13
+ import { jsx as w } from "react/jsx-runtime";
14
+ import { useQuery as T } from "@tanstack/react-query";
15
+ import { useListFilters as E } from "@parallelworks/ui/list";
16
16
  // src/components/IssueFilters.tsx
17
- var O = (e) => `field:${e}`, k = [
17
+ var D = (e) => `field:${e}`, O = [
18
18
  "team",
19
19
  "assignee",
20
20
  "assigneeKind",
21
+ "unassigned",
21
22
  "creator",
22
23
  "status",
23
24
  "priority",
@@ -28,8 +29,8 @@ var O = (e) => `field:${e}`, k = [
28
29
  "type",
29
30
  "fields",
30
31
  "overdue"
31
- ], A = (e) => `agent:${e}`;
32
- function oe(e) {
32
+ ], k = ":none", A = (e) => `agent:${e}`;
33
+ function se(e) {
33
34
  let t = [], n = (e, n) => {
34
35
  n && t.push({
35
36
  field: e,
@@ -37,7 +38,7 @@ function oe(e) {
37
38
  values: [n]
38
39
  });
39
40
  };
40
- n("team", e.team), n("assignee", e.assignee && (e.assigneeKind === "agent" ? A(e.assignee) : e.assignee)), n("creator", e.creator);
41
+ n("team", e.team), n("assignee", e.assignee ? e.assigneeKind === "agent" ? A(e.assignee) : e.assignee : e.unassigned && k), n("creator", e.creator);
41
42
  for (let n of ["status", "priority"]) {
42
43
  let r = e[n]?.split(",").filter(Boolean) ?? [];
43
44
  r.length > 0 && t.push({
@@ -56,13 +57,13 @@ function oe(e) {
56
57
  let i = /* @__PURE__ */ new Map();
57
58
  for (let t of y(e.fields)) i.set(t.field, [...i.get(t.field) ?? [], t.value]);
58
59
  for (let [e, n] of i) t.push({
59
- field: O(e),
60
+ field: D(e),
60
61
  op: "is",
61
62
  values: n
62
63
  });
63
64
  return n("overdue", e.overdue), t;
64
65
  }
65
- function se(e) {
66
+ function ce(e) {
66
67
  let t = {}, n = [];
67
68
  for (let r of e) {
68
69
  let e = r.values[0];
@@ -73,7 +74,7 @@ function se(e) {
73
74
  });
74
75
  else switch (r.field) {
75
76
  case "assignee":
76
- e.startsWith("agent:") ? (t.assignee = e.slice(6), t.assigneeKind = "agent") : t.assignee = e;
77
+ e === k ? t.unassigned = "true" : e.startsWith("agent:") ? (t.assignee = e.slice(6), t.assigneeKind = "agent") : t.assignee = e;
77
78
  break;
78
79
  case "overdue":
79
80
  e === "true" && (t.overdue = "true");
@@ -96,20 +97,20 @@ function se(e) {
96
97
  }
97
98
  function j(e, t) {
98
99
  let n = { ...e };
99
- for (let e of k) delete n[e];
100
+ for (let e of O) delete n[e];
100
101
  return {
101
102
  ...n,
102
103
  ...t
103
104
  };
104
105
  }
105
- function M(v, k, j, M = !1) {
106
- let N = w("issueFilters"), P = w("planning"), { data: F = [] } = E(te(v)), { data: I = [] } = E(r(v)), L = I.some((e) => e.key === k.team) ? I : [...I, ...F.filter((e) => e.key === k.team)], { data: R = [] } = E(n(v)), { data: z = [] } = E(i(v)), { data: B = [] } = E(e(v)), V = L.find((e) => e.key === k.team), { data: H = [] } = E({
106
+ function M(v, O, j, M = !1) {
107
+ let N = C("issueFilters"), P = C("planning"), { data: F = [] } = T(o(v)), { data: I = [] } = T(r(v)), L = I.some((e) => e.key === O.team) ? I : [...I, ...F.filter((e) => e.key === O.team)], { data: R = [] } = T(n(v)), { data: z = [] } = T(i(v)), { data: B = [] } = T(e(v)), V = L.find((e) => e.key === O.team), { data: H = [] } = T({
107
108
  ...t(v, V?.key ?? ""),
108
109
  enabled: !!V?.cyclesEnabled
109
- }), { data: U = [] } = E({
110
- ...ee(v, V?.key ?? ""),
110
+ }), { data: U = [] } = T({
111
+ ...a(v, V?.key ?? ""),
111
112
  enabled: !!V
112
- }), W = p(), { members: G, agents: K, person: q, agentName: J } = m(v), { data: Y } = E(re(v)), { data: X } = E(b(v)), Z = w("issueTypes"), Q = w("customFields"), ce = ae(() => {
113
+ }), W = ne(), { members: G, agents: K, person: q, agentName: J } = re(v), { data: Y } = T(h(v)), { data: X } = T(ae(v)), Z = C("issueTypes"), Q = C("customFields"), le = S(() => {
113
114
  let e = {
114
115
  multiple: !1,
115
116
  operators: ["is"]
@@ -120,7 +121,7 @@ function M(v, k, j, M = !1) {
120
121
  {
121
122
  key: "team",
122
123
  label: N("team"),
123
- icon: /* @__PURE__ */ T(o, {}),
124
+ icon: /* @__PURE__ */ w(c, {}),
124
125
  kind: "enum",
125
126
  ...e,
126
127
  required: M,
@@ -133,42 +134,50 @@ function M(v, k, j, M = !1) {
133
134
  {
134
135
  key: "assignee",
135
136
  label: N("assignee"),
136
- icon: /* @__PURE__ */ T(d, {}),
137
+ icon: /* @__PURE__ */ w(p, {}),
137
138
  kind: "people",
138
139
  ...e,
139
- options: [...G.map((e) => ({
140
- value: e.user.username,
141
- label: e.user.name,
142
- group: N("people"),
143
- icon: /* @__PURE__ */ T(C, {
144
- name: e.user.name,
145
- src: e.user.avatarUrl,
146
- size: "xs",
147
- decorative: !0
148
- })
149
- })), ...K.map((e) => ({
150
- value: A(e.slug),
151
- label: e.name,
152
- group: N("agents"),
153
- icon: /* @__PURE__ */ T(C, {
154
- name: e.name,
155
- kind: "agent",
156
- size: "xs",
157
- decorative: !0
158
- })
159
- }))],
140
+ options: [
141
+ {
142
+ value: k,
143
+ label: N("noAssignee"),
144
+ icon: /* @__PURE__ */ w(p, {})
145
+ },
146
+ ...G.map((e) => ({
147
+ value: e.user.username,
148
+ label: e.user.name,
149
+ group: N("people"),
150
+ icon: /* @__PURE__ */ w(x, {
151
+ name: e.user.name,
152
+ src: e.user.avatarUrl,
153
+ size: "xs",
154
+ decorative: !0
155
+ })
156
+ })),
157
+ ...K.map((e) => ({
158
+ value: A(e.slug),
159
+ label: e.name,
160
+ group: N("agents"),
161
+ icon: /* @__PURE__ */ w(x, {
162
+ name: e.name,
163
+ kind: "agent",
164
+ size: "xs",
165
+ decorative: !0
166
+ })
167
+ }))
168
+ ],
160
169
  valueLabel: (e) => e.startsWith("agent:") ? J(e.slice(6)) : q(e).name
161
170
  },
162
171
  {
163
172
  key: "creator",
164
173
  label: N("creator"),
165
- icon: /* @__PURE__ */ T(d, {}),
174
+ icon: /* @__PURE__ */ w(p, {}),
166
175
  kind: "people",
167
176
  ...e,
168
177
  options: G.map((e) => ({
169
178
  value: e.user.username,
170
179
  label: e.user.name,
171
- icon: /* @__PURE__ */ T(C, {
180
+ icon: /* @__PURE__ */ w(x, {
172
181
  name: e.user.name,
173
182
  src: e.user.avatarUrl,
174
183
  size: "xs",
@@ -180,7 +189,7 @@ function M(v, k, j, M = !1) {
180
189
  {
181
190
  key: "priority",
182
191
  label: N("priority"),
183
- icon: /* @__PURE__ */ T(s, { priority: 2 }),
192
+ icon: /* @__PURE__ */ w(l, { priority: 2 }),
184
193
  kind: "enum",
185
194
  operators: ["is"],
186
195
  options: [
@@ -192,19 +201,19 @@ function M(v, k, j, M = !1) {
192
201
  ].map((e) => ({
193
202
  value: String(e),
194
203
  label: W[e] ?? "",
195
- icon: /* @__PURE__ */ T(s, { priority: e })
204
+ icon: /* @__PURE__ */ w(l, { priority: e })
196
205
  }))
197
206
  },
198
207
  {
199
208
  key: "label",
200
209
  label: N("label"),
201
- icon: /* @__PURE__ */ T(u, {}),
210
+ icon: /* @__PURE__ */ w(f, {}),
202
211
  kind: "enum",
203
212
  ...e,
204
213
  options: R.map((e) => ({
205
214
  value: e.name,
206
215
  label: e.name,
207
- icon: /* @__PURE__ */ T("span", {
216
+ icon: /* @__PURE__ */ w("span", {
208
217
  className: "size-2 rounded-full",
209
218
  style: { background: e.color }
210
219
  })
@@ -214,44 +223,44 @@ function M(v, k, j, M = !1) {
214
223
  {
215
224
  key: "project",
216
225
  label: N("project"),
217
- icon: /* @__PURE__ */ T(c, {}),
226
+ icon: /* @__PURE__ */ w(u, {}),
218
227
  kind: "enum",
219
228
  ...e,
220
229
  options: z.map((e) => ({
221
- value: g(e),
230
+ value: ie(e),
222
231
  label: e.name,
223
- icon: /* @__PURE__ */ T(h, { status: e.status })
232
+ icon: /* @__PURE__ */ w(m, { status: e.status })
224
233
  }))
225
234
  }
226
235
  ];
227
- (B.length > 0 || k.customer) && n.push({
236
+ (B.length > 0 || O.customer) && n.push({
228
237
  key: "customer",
229
238
  label: N("customer"),
230
- icon: /* @__PURE__ */ T(f, {}),
239
+ icon: /* @__PURE__ */ w(te, {}),
231
240
  kind: "enum",
232
241
  ...e,
233
242
  options: B.map((e) => ({
234
243
  value: e.id,
235
244
  label: e.name
236
245
  }))
237
- }), (V || k.status) && n.splice(3, 0, {
246
+ }), (V || O.status) && n.splice(3, 0, {
238
247
  key: "status",
239
248
  label: N("status"),
240
- icon: /* @__PURE__ */ T(l, { category: "started" }),
249
+ icon: /* @__PURE__ */ w(d, { category: "started" }),
241
250
  kind: "enum",
242
251
  operators: ["is"],
243
252
  options: U.map((e) => ({
244
- value: S(e),
253
+ value: b(e),
245
254
  label: e.name,
246
- icon: /* @__PURE__ */ T(l, {
255
+ icon: /* @__PURE__ */ w(d, {
247
256
  category: e.category,
248
257
  step: e.step
249
258
  })
250
259
  }))
251
- }), (V?.cyclesEnabled || k.cycle) && n.push({
260
+ }), (V?.cyclesEnabled || O.cycle) && n.push({
252
261
  key: "cycle",
253
262
  label: N("cycle"),
254
- icon: /* @__PURE__ */ T(ne, {}),
263
+ icon: /* @__PURE__ */ w(s, {}),
255
264
  kind: "enum",
256
265
  ...e,
257
266
  options: H.map((e) => ({
@@ -261,17 +270,17 @@ function M(v, k, j, M = !1) {
261
270
  }))
262
271
  });
263
272
  let r = (X ?? []).filter((e) => !e.archivedAt && (!V || e.teamIds.length === 0 || e.teamIds.includes(V.id)));
264
- (r.length > 0 || k.type) && n.push({
273
+ (r.length > 0 || O.type) && n.push({
265
274
  key: "type",
266
275
  label: Z("type"),
267
- icon: /* @__PURE__ */ T(u, {}),
276
+ icon: /* @__PURE__ */ w(f, {}),
268
277
  kind: "enum",
269
278
  multiple: !0,
270
279
  operators: ["is"],
271
280
  options: [...r.map((e) => ({
272
281
  value: e.id,
273
282
  label: e.name,
274
- icon: /* @__PURE__ */ T(x, {
283
+ icon: /* @__PURE__ */ w(oe, {
275
284
  type: e,
276
285
  className: "size-3.5"
277
286
  })
@@ -280,23 +289,23 @@ function M(v, k, j, M = !1) {
280
289
  label: Z("noType")
281
290
  }]
282
291
  });
283
- let i = new Set(y(k.fields).map((e) => e.field));
284
- for (let e of (Y ?? []).filter((e) => e.target === "issue" && _.includes(e.kind) && (ie([e], "issue", V?.id).length > 0 || i.has(e.id)))) {
292
+ let i = new Set(y(O.fields).map((e) => e.field));
293
+ for (let e of (Y ?? []).filter((e) => e.target === "issue" && _.includes(e.kind) && (g([e], "issue", V?.id).length > 0 || i.has(e.id)))) {
285
294
  let t = {
286
295
  value: "none",
287
296
  label: Q("noValue")
288
297
  };
289
298
  n.push({
290
- key: O(e.id),
299
+ key: D(e.id),
291
300
  label: e.name,
292
- icon: /* @__PURE__ */ T(u, {}),
301
+ icon: /* @__PURE__ */ w(f, {}),
293
302
  kind: "enum",
294
303
  multiple: !0,
295
304
  operators: ["is"],
296
305
  options: e.kind === "person" ? [...G.map((e) => ({
297
306
  value: e.user.username,
298
307
  label: e.user.name,
299
- icon: /* @__PURE__ */ T(C, {
308
+ icon: /* @__PURE__ */ w(x, {
300
309
  name: e.user.name,
301
310
  src: e.user.avatarUrl,
302
311
  size: "xs",
@@ -308,7 +317,7 @@ function M(v, k, j, M = !1) {
308
317
  }, t] : [...e.options.map((e) => ({
309
318
  value: e.id ?? "",
310
319
  label: e.name,
311
- ...e.color && { icon: /* @__PURE__ */ T("span", {
320
+ ...e.color && { icon: /* @__PURE__ */ w("span", {
312
321
  className: "size-2 rounded-full",
313
322
  style: { background: e.color }
314
323
  }) }
@@ -318,16 +327,16 @@ function M(v, k, j, M = !1) {
318
327
  return n.push({
319
328
  key: "overdue",
320
329
  label: N("overdue"),
321
- icon: /* @__PURE__ */ T(a, {}),
330
+ icon: /* @__PURE__ */ w(ee, {}),
322
331
  kind: "boolean"
323
332
  }), n;
324
333
  }, [
325
334
  X,
326
335
  Z,
327
- k.type,
336
+ O.type,
328
337
  Y,
329
338
  Q,
330
- k.fields,
339
+ O.fields,
331
340
  N,
332
341
  P,
333
342
  L,
@@ -336,27 +345,27 @@ function M(v, k, j, M = !1) {
336
345
  R,
337
346
  z,
338
347
  B,
339
- k.customer,
348
+ O.customer,
340
349
  H,
341
350
  U,
342
351
  W,
343
352
  V,
344
- k.cycle,
345
- k.status,
353
+ O.cycle,
354
+ O.status,
346
355
  q,
347
356
  J,
348
357
  M
349
- ]), $ = oe(k), le = {
358
+ ]), $ = se(O), ue = {
350
359
  value: $.length > 0 ? $ : null,
351
360
  onChange: (e) => {
352
- let t = se(e);
353
- t.team !== k.team && delete t.status, j(t);
361
+ let t = ce(e);
362
+ t.team !== O.team && delete t.status, j(t);
354
363
  }
355
364
  };
356
- return D({
365
+ return E({
357
366
  storageKey: `issues:${v}`,
358
- fields: ce,
359
- store: le,
367
+ fields: le,
368
+ store: ue,
360
369
  remember: !1
361
370
  });
362
371
  }
@@ -2,235 +2,254 @@ import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { Link as n } from "../lib/router.js";
3
3
  import { availableRepositoriesQuery as r, codeHostQuery as i, githubSettingsQuery as a, repositoriesQuery as o, teamsQuery as s } from "../api/queries.js";
4
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";
5
+ import { externalUrl as l } from "../lib/externalUrl.js";
6
+ import { AddIcon as ee, CodeHostIcon as te, RepositoryIcon as u } from "./icons.js";
7
+ import { useConfirm as d } from "../lib/confirm.js";
8
+ import { useFormError as f } from "./settings.js";
9
+ import { RepositoryIssueSync as p } from "./GitHub.js";
10
+ import { Button as m, Card as h, Checkbox as g, Combobox as ne, ErrorText as _, InfoTip as v, Section as y, Tooltip as b, menuDivider as x, useOpenMenu as re } from "@parallelworks/ui";
11
+ import { useState as ie } from "react";
12
+ import { useTranslations as S } from "use-intl";
13
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
14
+ import { useMutation as T, useQuery as E, useQueryClient as D, useSuspenseQuery as O } from "@tanstack/react-query";
15
15
  // src/components/TeamRepositories.tsx
16
- var A = "cursor-help underline decoration-dotted underline-offset-2";
17
- function j({ workspace: j, team: M, isAdmin: N }) {
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
- enabled: N
21
- }), z = w("github"), [B, V] = C(!1), H = I.connections.some((e) => !e.removed), U = O({
22
- ...r(j, M.key),
23
- enabled: B && N && H
24
- }), W = re(), G = S(), K = p(), { confirm: q, dialog: J } = f(), Y = () => W.invalidateQueries({ queryKey: o(j, M.key).queryKey }), X = (e) => {
16
+ var k = "cursor-help underline decoration-dotted underline-offset-2";
17
+ function A({ workspace: A, team: j, isAdmin: M }) {
18
+ let N = S("code"), P = S("common"), { data: F } = O(i(A)), { data: I } = O(o(A, j.key)), { data: L } = E({
19
+ ...a(A),
20
+ enabled: M
21
+ }), R = S("github"), [z, B] = ie(!1), V = F.connections.some((e) => !e.removed), H = E({
22
+ ...r(A, j.key),
23
+ enabled: z && M && V
24
+ }), U = D(), W = re(), G = f(), { confirm: K, dialog: q } = d(), J = () => U.invalidateQueries({ queryKey: o(A, j.key).queryKey }), Y = (e) => {
25
25
  let [t = "", n = ""] = e.split("/");
26
26
  return { path: {
27
- workspace: j,
28
- key: M.key,
27
+ workspace: A,
28
+ key: j.key,
29
29
  owner: t,
30
30
  name: n
31
31
  } };
32
- }, Z = D({
32
+ }, X = T({
33
33
  mutationFn: async (n) => t(await e.PUT("/api/v1/workspaces/{workspace}/teams/{key}/repositories/{owner}/{name}", {
34
- params: X(n.repository),
34
+ params: Y(n.repository),
35
35
  body: { default: n.makeDefault }
36
36
  })),
37
- onMutate: K.clear,
38
- onError: K.set,
39
- onSettled: Y
40
- }), ie = D({
41
- mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/teams/{key}/repositories/{owner}/{name}", { params: X(n) })),
42
- onMutate: K.clear,
43
- onSettled: Y
44
- }), Q = D({
37
+ onMutate: G.clear,
38
+ onError: G.set,
39
+ onSettled: J
40
+ }), ae = T({
41
+ mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/teams/{key}/repositories/{owner}/{name}", { params: Y(n) })),
42
+ onMutate: G.clear,
43
+ onSettled: J
44
+ }), Z = T({
45
45
  mutationFn: async (n) => t(await e.PATCH("/api/v1/workspaces/{workspace}/teams/{key}", {
46
46
  params: { path: {
47
- workspace: j,
48
- key: M.key
47
+ workspace: A,
48
+ key: j.key
49
49
  } },
50
50
  body: { closeIssuesOnMerge: n }
51
51
  })),
52
- onMutate: K.clear,
53
- onError: K.set,
54
- onSettled: () => W.invalidateQueries({ queryKey: s(j).queryKey })
55
- }), $ = (e) => q({
56
- title: P("unlinkConfirm", { repository: e }),
57
- description: P("unlinkDetail"),
58
- confirmLabel: P("unlink"),
59
- onConfirm: () => ie.mutateAsync(e)
52
+ onMutate: G.clear,
53
+ onError: G.set,
54
+ onSettled: () => U.invalidateQueries({ queryKey: s(A).queryKey })
55
+ }), Q = T({
56
+ mutationFn: async (n) => t(await e.PATCH("/api/v1/workspaces/{workspace}/teams/{key}", {
57
+ params: { path: {
58
+ workspace: A,
59
+ key: j.key
60
+ } },
61
+ body: { keepIssuesHere: n }
62
+ })),
63
+ onMutate: G.clear,
64
+ onError: G.set,
65
+ onSettled: () => U.invalidateQueries({ queryKey: s(A).queryKey })
66
+ }), $ = (e) => K({
67
+ title: N("unlinkConfirm", { repository: e }),
68
+ description: N("unlinkDetail"),
69
+ confirmLabel: N("unlink"),
70
+ onConfirm: () => ae.mutateAsync(e)
60
71
  });
61
- if (I.provider === "") return /* @__PURE__ */ T(b, {
72
+ if (F.provider === "") return /* @__PURE__ */ C(y, {
62
73
  variant: "bare",
63
74
  headingLevel: 2,
64
75
  collapsible: !1,
65
- title: P("repositories"),
66
- children: /* @__PURE__ */ T("p", {
76
+ title: N("repositories"),
77
+ children: /* @__PURE__ */ C("p", {
67
78
  className: "text-sm text-muted-foreground",
68
- children: P("notConfigured")
79
+ children: N("notConfigured")
69
80
  })
70
81
  });
71
- let ae = new Set(L.map((e) => `${e.owner}/${e.name}`.toLowerCase()));
72
- return /* @__PURE__ */ E(b, {
82
+ let oe = new Set(I.map((e) => `${e.owner}/${e.name}`.toLowerCase()));
83
+ return /* @__PURE__ */ w(y, {
73
84
  variant: "bare",
74
85
  headingLevel: 2,
75
86
  collapsible: !1,
76
- title: P("repositories"),
77
- description: P("repositoriesDescription"),
87
+ title: N("repositories"),
88
+ description: N("repositoriesDescription"),
78
89
  children: [
79
- /* @__PURE__ */ E(g, {
90
+ /* @__PURE__ */ w(h, {
80
91
  size: "fill",
81
92
  padding: "none",
82
93
  divided: !0,
83
94
  interactive: !1,
84
- render: /* @__PURE__ */ T("ul", {}),
85
- children: [L.map((e) => {
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
- onContextMenu: (r) => G(r, [
95
+ render: /* @__PURE__ */ C("ul", {}),
96
+ children: [I.map((e) => {
97
+ let t = `${e.owner}/${e.name}`, n = l(e.url), r = L?.enabled && L.repositories.find((e) => e.team === j.key && e.fullName.toLowerCase() === t.toLowerCase());
98
+ return /* @__PURE__ */ w("li", {
99
+ onContextMenu: (r) => W(r, [
89
100
  n ? {
90
- label: P("openOnHost"),
101
+ label: N("openOnHost"),
91
102
  href: n,
92
103
  target: "_blank"
93
104
  } : {
94
- label: P("openOnHost"),
105
+ label: N("openOnHost"),
95
106
  disabled: !0,
96
107
  onClick: () => {}
97
108
  },
98
- c(F("copyName"), t),
99
- ...N ? [
109
+ c(P("copyName"), t),
110
+ ...M ? [
100
111
  x,
101
112
  {
102
- label: P("makeDefault"),
113
+ label: N("makeDefault"),
103
114
  disabled: e.default,
104
- onClick: () => Z.mutate({
115
+ onClick: () => X.mutate({
105
116
  repository: t,
106
117
  makeDefault: !0
107
118
  })
108
119
  },
109
120
  {
110
- label: P("unlink"),
121
+ label: N("unlink"),
111
122
  destructive: !0,
112
123
  onClick: () => $(t)
113
124
  }
114
125
  ] : []
115
126
  ]),
116
127
  className: "px-3 py-2 text-sm",
117
- children: [/* @__PURE__ */ E("div", {
128
+ children: [/* @__PURE__ */ w("div", {
118
129
  className: "flex items-center gap-3",
119
130
  children: [
120
- /* @__PURE__ */ T(u, {
131
+ /* @__PURE__ */ C(te, {
121
132
  provider: e.provider,
122
133
  className: "size-4 text-muted-foreground"
123
134
  }),
124
- /* @__PURE__ */ T("a", {
135
+ /* @__PURE__ */ C("a", {
125
136
  href: n,
126
137
  target: "_blank",
127
138
  rel: "noopener noreferrer",
128
139
  className: "min-w-0 truncate hover:underline",
129
140
  children: t
130
141
  }),
131
- /* @__PURE__ */ T("span", {
142
+ /* @__PURE__ */ C("span", {
132
143
  className: "flex-1 text-xs text-muted-foreground",
133
- children: e.default ? /* @__PURE__ */ T(y, {
134
- text: P("defaultHint"),
135
- className: A,
136
- children: P("defaultRepository")
137
- }) : e.private && P("private")
144
+ children: e.default ? /* @__PURE__ */ C(v, {
145
+ text: N("defaultHint"),
146
+ className: k,
147
+ children: N("defaultRepository")
148
+ }) : e.private && N("private")
138
149
  }),
139
- N && !e.default && /* @__PURE__ */ T(ne, {
140
- content: P("makeDefaultHint"),
150
+ M && !e.default && /* @__PURE__ */ C(b, {
151
+ content: N("makeDefaultHint"),
141
152
  describesAnchor: !0,
142
- children: /* @__PURE__ */ T("button", {
153
+ children: /* @__PURE__ */ C("button", {
143
154
  type: "button",
144
- onClick: () => Z.mutate({
155
+ onClick: () => X.mutate({
145
156
  repository: t,
146
157
  makeDefault: !0
147
158
  }),
148
159
  className: "text-xs text-muted-foreground hover:text-foreground",
149
- children: P("makeDefault")
160
+ children: N("makeDefault")
150
161
  })
151
162
  }),
152
- N && /* @__PURE__ */ T("button", {
163
+ M && /* @__PURE__ */ C("button", {
153
164
  type: "button",
154
165
  onClick: () => $(t),
155
166
  className: "text-xs text-muted-foreground hover:text-danger",
156
- children: P("unlink")
167
+ children: N("unlink")
157
168
  })
158
169
  ]
159
- }), r && /* @__PURE__ */ T("div", {
170
+ }), r && /* @__PURE__ */ C("div", {
160
171
  className: "mt-2 pl-7",
161
- children: /* @__PURE__ */ T(m, {
162
- workspace: j,
172
+ children: /* @__PURE__ */ C(p, {
173
+ workspace: A,
163
174
  repository: r,
164
- teamName: M.name,
165
- children: /* @__PURE__ */ T("span", {
175
+ teamName: j.name,
176
+ children: /* @__PURE__ */ C("span", {
166
177
  className: "flex-1 text-xs text-muted-foreground",
167
- children: /* @__PURE__ */ T(y, {
168
- text: z("issueSyncHint"),
169
- className: A,
170
- children: z("issueSync")
178
+ children: /* @__PURE__ */ C(v, {
179
+ text: R("issueSyncHint"),
180
+ className: k,
181
+ children: R("issueSync")
171
182
  })
172
183
  })
173
184
  })
174
185
  })]
175
186
  }, t);
176
- }), L.length === 0 && /* @__PURE__ */ T("li", {
187
+ }), I.length === 0 && /* @__PURE__ */ C("li", {
177
188
  className: "px-3 py-2 text-sm text-muted-foreground",
178
- children: P("noRepositories")
189
+ children: N("noRepositories")
179
190
  })]
180
191
  }),
181
- N && !H && /* @__PURE__ */ T("p", {
192
+ M && !V && /* @__PURE__ */ C("p", {
182
193
  className: "mt-3 text-sm text-muted-foreground",
183
- children: P.rich("connectFirst", { settings: (e) => /* @__PURE__ */ T(n, {
194
+ children: N.rich("connectFirst", { settings: (e) => /* @__PURE__ */ C(n, {
184
195
  to: "/$workspace/settings/github",
185
- params: { workspace: j },
196
+ params: { workspace: A },
186
197
  className: "underline",
187
198
  children: e
188
199
  }) })
189
200
  }),
190
- N && H && /* @__PURE__ */ T("div", {
201
+ M && V && /* @__PURE__ */ C("div", {
191
202
  className: "mt-3",
192
- children: /* @__PURE__ */ T(_, {
193
- open: B,
194
- onOpenChange: V,
195
- items: (U.data ?? []).filter((e) => !ae.has(`${e.owner}/${e.name}`.toLowerCase())).map((e) => ({
203
+ children: /* @__PURE__ */ C(ne, {
204
+ open: z,
205
+ onOpenChange: B,
206
+ items: (H.data ?? []).filter((e) => !oe.has(`${e.owner}/${e.name}`.toLowerCase())).map((e) => ({
196
207
  value: `${e.owner}/${e.name}`,
197
208
  label: `${e.owner}/${e.name}`,
198
- ...e.private && { hint: P("private") },
199
- icon: /* @__PURE__ */ T(d, { className: "size-3.5 text-muted-foreground" })
209
+ ...e.private && { hint: N("private") },
210
+ icon: /* @__PURE__ */ C(u, { className: "size-3.5 text-muted-foreground" })
200
211
  })),
201
212
  value: null,
202
- onValueChange: (e) => e !== null && Z.mutate({
213
+ onValueChange: (e) => e !== null && X.mutate({
203
214
  repository: e,
204
215
  makeDefault: !1
205
216
  }),
206
- placeholder: P("linkPlaceholder"),
207
- "aria-label": P("linkRepository"),
208
- loading: U.isPending,
209
- trigger: /* @__PURE__ */ E(h, {
217
+ placeholder: N("linkPlaceholder"),
218
+ "aria-label": N("linkRepository"),
219
+ loading: H.isPending,
220
+ trigger: /* @__PURE__ */ w(m, {
210
221
  type: "button",
211
222
  children: [
212
- /* @__PURE__ */ T(l, { className: "size-3.5" }),
223
+ /* @__PURE__ */ C(ee, { className: "size-3.5" }),
213
224
  " ",
214
- P("linkRepository")
225
+ N("linkRepository")
215
226
  ]
216
227
  })
217
228
  })
218
229
  }),
219
- /* @__PURE__ */ E("label", {
230
+ /* @__PURE__ */ w("label", {
220
231
  className: "mt-4 flex w-fit items-center gap-2 text-sm",
221
- children: [/* @__PURE__ */ T(te, {
222
- checked: M.closeIssuesOnMerge,
223
- disabled: !N || Q.isPending,
232
+ children: [/* @__PURE__ */ C(g, {
233
+ checked: j.closeIssuesOnMerge,
234
+ disabled: !M || Z.isPending,
235
+ onCheckedChange: (e) => Z.mutate(e)
236
+ }), N("closeOnMerge")]
237
+ }),
238
+ /* @__PURE__ */ w("label", {
239
+ className: "mt-2 flex w-fit items-center gap-2 text-sm",
240
+ children: [/* @__PURE__ */ C(g, {
241
+ checked: j.keepIssuesHere,
242
+ disabled: !M || Q.isPending,
224
243
  onCheckedChange: (e) => Q.mutate(e)
225
- }), P("closeOnMerge")]
244
+ }), N("keepIssuesHere")]
226
245
  }),
227
- (K.error || U.isError) && /* @__PURE__ */ T(v, {
246
+ (G.error || H.isError) && /* @__PURE__ */ C(_, {
228
247
  size: "md",
229
248
  className: "mt-2",
230
- children: K.error ?? P("unavailable")
249
+ children: G.error ?? N("unavailable")
231
250
  }),
232
- J
251
+ q
233
252
  ]
234
253
  });
235
254
  }
236
- export { j as TeamRepositories };
255
+ export { A as TeamRepositories };
package/lib/issueList.js CHANGED
@@ -46,7 +46,7 @@ function g(e) {
46
46
  let r = h(e[n]);
47
47
  r && (t[n] = r);
48
48
  }
49
- t.assignee && e.assigneeKind === "agent" && (t.assigneeKind = "agent"), (e.overdue === "true" || e.overdue === !0) && (t.overdue = "true");
49
+ t.assignee && e.assigneeKind === "agent" && (t.assigneeKind = "agent"), t.assignee || e.unassigned !== "true" && e.unassigned !== !0 || (t.unassigned = "true"), (e.overdue === "true" || e.overdue === !0) && (t.overdue = "true");
50
50
  let i = h(e.order);
51
51
  i && i !== "updated" && (d.includes(i) || n(i)) && (t.order = i), e.layout === "board" && (t.layout = "board"), e.scope === "workspace" && (t.scope = "workspace");
52
52
  let a = h(e.group);
@@ -239,6 +239,7 @@ function C(e, t) {
239
239
  ...e.team && { team: e.team },
240
240
  ...e.assignee && { assignee: e.assignee },
241
241
  ...e.assignee && e.assigneeKind && { assigneeKind: e.assigneeKind },
242
+ ...!e.assignee && e.unassigned && { unassigned: !0 },
242
243
  ...e.creator && { creator: e.creator },
243
244
  ...e.status && { status: r },
244
245
  ...e.priority && { priority: e.priority.split(",").map(Number) },
package/lib/views.js CHANGED
@@ -17,6 +17,7 @@ var v = [
17
17
  "team",
18
18
  "assignee",
19
19
  "assigneeKind",
20
+ "unassigned",
20
21
  "creator",
21
22
  "status",
22
23
  "priority",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.161.2",
3
+ "version": "0.163.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",