@parallelworks/tandem-web 0.170.2 → 0.171.1

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.
@@ -21,6 +21,7 @@ var e = {
21
21
  name: "Name",
22
22
  role: "Role",
23
23
  agent: "Agent",
24
+ you: "You",
24
25
  close: "Close",
25
26
  formerMember: "Former member",
26
27
  userAvatar: "Profile picture",
@@ -21,6 +21,7 @@ var e = {
21
21
  name: "Nombre",
22
22
  role: "Rol",
23
23
  agent: "Agente",
24
+ you: "Tú",
24
25
  close: "Cerrar",
25
26
  formerMember: "Antiguo miembro",
26
27
  userAvatar: "Foto de perfil",
@@ -21,6 +21,7 @@ var e = {
21
21
  name: "名前",
22
22
  role: "ロール",
23
23
  agent: "エージェント",
24
+ you: "あなた",
24
25
  close: "閉じる",
25
26
  formerMember: "元メンバー",
26
27
  userAvatar: "プロフィール画像",
@@ -21,6 +21,7 @@ var e = {
21
21
  name: "이름",
22
22
  role: "역할",
23
23
  agent: "에이전트",
24
+ you: "나",
24
25
  close: "닫기",
25
26
  formerMember: "이전 멤버",
26
27
  userAvatar: "프로필 사진",
@@ -21,6 +21,7 @@ var e = {
21
21
  name: "名称",
22
22
  role: "角色",
23
23
  agent: "代理",
24
+ you: "你",
24
25
  close: "关闭",
25
26
  formerMember: "前成员",
26
27
  userAvatar: "头像",
@@ -1,20 +1,21 @@
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";
1
+ import { customersQuery as e, cyclesQuery as t, labelsQuery as n, meQuery as r, myTeamsQuery as i, projectsQuery as ee, statusesQuery as te, teamsQuery as ne } from "../api/queries.js";
2
+ import { CalendarIcon as a, CycleIcon as re, FolderIcon as ie, PriorityIcon as o, ProjectIcon as ae, StatusIcon as s, TagIcon as c, UserIcon as l, UsersIcon as u, usePriorityNames as d } from "./icons.js";
3
+ import { usePeople as f } from "../lib/people.js";
4
+ import { ProjectStatusIcon as p } from "./Planning.js";
5
+ import { youFirst as m } from "../lib/assigneeOrder.js";
6
+ import { projectRef as oe } from "../lib/projects.js";
7
+ import { customFieldsQuery as se, fieldsFor as ce, filterableKinds as le, formatFieldFilters as h, parseFieldFilters as g } from "../lib/customFields.js";
8
+ import { issueTypesQuery as _ } from "../lib/issueTypes.js";
9
+ import { TypeIcon as v } from "./IssueTypes.js";
10
+ import { statusRef as y } from "../lib/refs.js";
11
+ import { Avatar as b } from "@parallelworks/ui";
12
+ import { useMemo as ue } from "react";
13
+ import { useTranslations as x } from "use-intl";
14
+ import { jsx as S } from "react/jsx-runtime";
15
+ import { useQuery as C } from "@tanstack/react-query";
16
+ import { useListFilters as w } from "@parallelworks/ui/list";
16
17
  // src/components/IssueFilters.tsx
17
- var D = (e) => `field:${e}`, O = [
18
+ var T = (e) => `field:${e}`, E = [
18
19
  "team",
19
20
  "assignee",
20
21
  "assigneeKind",
@@ -29,8 +30,8 @@ var D = (e) => `field:${e}`, O = [
29
30
  "type",
30
31
  "fields",
31
32
  "overdue"
32
- ], k = ":none", A = (e) => `agent:${e}`;
33
- function se(e) {
33
+ ], D = ":none", O = (e) => `agent:${e}`;
34
+ function de(e) {
34
35
  let t = [], n = (e, n) => {
35
36
  n && t.push({
36
37
  field: e,
@@ -38,7 +39,7 @@ function se(e) {
38
39
  values: [n]
39
40
  });
40
41
  };
41
- n("team", e.team), n("assignee", e.assignee ? e.assigneeKind === "agent" ? A(e.assignee) : e.assignee : e.unassigned && k), n("creator", e.creator);
42
+ n("team", e.team), n("assignee", e.assignee ? e.assigneeKind === "agent" ? O(e.assignee) : e.assignee : e.unassigned && D), n("creator", e.creator);
42
43
  for (let n of ["status", "priority"]) {
43
44
  let r = e[n]?.split(",").filter(Boolean) ?? [];
44
45
  r.length > 0 && t.push({
@@ -55,15 +56,15 @@ function se(e) {
55
56
  values: r
56
57
  });
57
58
  let i = /* @__PURE__ */ new Map();
58
- for (let t of y(e.fields)) i.set(t.field, [...i.get(t.field) ?? [], t.value]);
59
+ for (let t of g(e.fields)) i.set(t.field, [...i.get(t.field) ?? [], t.value]);
59
60
  for (let [e, n] of i) t.push({
60
- field: D(e),
61
+ field: T(e),
61
62
  op: "is",
62
63
  values: n
63
64
  });
64
65
  return n("overdue", e.overdue), t;
65
66
  }
66
- function ce(e) {
67
+ function fe(e) {
67
68
  let t = {}, n = [];
68
69
  for (let r of e) {
69
70
  let e = r.values[0];
@@ -74,7 +75,7 @@ function ce(e) {
74
75
  });
75
76
  else switch (r.field) {
76
77
  case "assignee":
77
- e === k ? t.unassigned = "true" : e.startsWith("agent:") ? (t.assignee = e.slice(6), t.assigneeKind = "agent") : t.assignee = e;
78
+ e === D ? t.unassigned = "true" : e.startsWith("agent:") ? (t.assignee = e.slice(6), t.assigneeKind = "agent") : t.assignee = e;
78
79
  break;
79
80
  case "overdue":
80
81
  e === "true" && (t.overdue = "true");
@@ -93,38 +94,38 @@ function ce(e) {
93
94
  }
94
95
  }
95
96
  }
96
- return n.length > 0 && (t.fields = v(n)), t;
97
+ return n.length > 0 && (t.fields = h(n)), t;
97
98
  }
98
- function j(e, t) {
99
+ function k(e, t) {
99
100
  let n = { ...e };
100
- for (let e of O) delete n[e];
101
+ for (let e of E) delete n[e];
101
102
  return {
102
103
  ...n,
103
104
  ...t
104
105
  };
105
106
  }
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({
108
- ...t(v, V?.key ?? ""),
107
+ function A(h, E, k, A = !1) {
108
+ let j = x("issueFilters"), M = x("common"), N = x("planning"), P = C(r).data?.user.username, { data: F = [] } = C(ne(h)), { data: I = [] } = C(i(h)), L = I.some((e) => e.key === E.team) ? I : [...I, ...F.filter((e) => e.key === E.team)], { data: R = [] } = C(n(h)), { data: z = [] } = C(ee(h)), { data: B = [] } = C(e(h)), V = L.find((e) => e.key === E.team), { data: H = [] } = C({
109
+ ...t(h, V?.key ?? ""),
109
110
  enabled: !!V?.cyclesEnabled
110
- }), { data: U = [] } = T({
111
- ...a(v, V?.key ?? ""),
111
+ }), { data: U = [] } = C({
112
+ ...te(h, V?.key ?? ""),
112
113
  enabled: !!V
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(() => {
114
+ }), W = d(), { members: G, agents: K, person: q, agentName: J } = f(h), { data: Y } = C(se(h)), { data: X } = C(_(h)), Z = x("issueTypes"), Q = x("customFields"), pe = ue(() => {
114
115
  let e = {
115
116
  multiple: !1,
116
117
  operators: ["is"]
117
- }, t = (e) => e.name ? P("cycleNamed", {
118
+ }, t = (e) => e.name ? N("cycleNamed", {
118
119
  number: e.number,
119
120
  name: e.name
120
- }) : P("cycle", { number: e.number }), n = [
121
+ }) : N("cycle", { number: e.number }), n = [
121
122
  {
122
123
  key: "team",
123
- label: N("team"),
124
- icon: /* @__PURE__ */ w(c, {}),
124
+ label: j("team"),
125
+ icon: /* @__PURE__ */ S(ie, {}),
125
126
  kind: "enum",
126
127
  ...e,
127
- required: M,
128
+ required: A,
128
129
  options: L.filter((e) => !e.archivedAt).map((e) => ({
129
130
  value: e.key,
130
131
  label: e.name,
@@ -133,21 +134,22 @@ function M(v, O, j, M = !1) {
133
134
  },
134
135
  {
135
136
  key: "assignee",
136
- label: N("assignee"),
137
- icon: /* @__PURE__ */ w(p, {}),
137
+ label: j("assignee"),
138
+ icon: /* @__PURE__ */ S(l, {}),
138
139
  kind: "people",
139
140
  ...e,
140
141
  options: [
141
142
  {
142
- value: k,
143
- label: N("noAssignee"),
144
- icon: /* @__PURE__ */ w(p, {})
143
+ value: D,
144
+ label: j("noAssignee"),
145
+ icon: /* @__PURE__ */ S(l, {})
145
146
  },
146
- ...G.map((e) => ({
147
+ ...m(G, P).map((e) => ({
147
148
  value: e.user.username,
148
149
  label: e.user.name,
149
- group: N("people"),
150
- icon: /* @__PURE__ */ w(x, {
150
+ ...e.user.username === P && { description: M("you") },
151
+ group: j("people"),
152
+ icon: /* @__PURE__ */ S(b, {
151
153
  name: e.user.name,
152
154
  src: e.user.avatarUrl,
153
155
  size: "xs",
@@ -155,10 +157,10 @@ function M(v, O, j, M = !1) {
155
157
  })
156
158
  })),
157
159
  ...K.map((e) => ({
158
- value: A(e.slug),
160
+ value: O(e.slug),
159
161
  label: e.name,
160
- group: N("agents"),
161
- icon: /* @__PURE__ */ w(x, {
162
+ group: j("agents"),
163
+ icon: /* @__PURE__ */ S(b, {
162
164
  name: e.name,
163
165
  kind: "agent",
164
166
  size: "xs",
@@ -170,14 +172,14 @@ function M(v, O, j, M = !1) {
170
172
  },
171
173
  {
172
174
  key: "creator",
173
- label: N("creator"),
174
- icon: /* @__PURE__ */ w(p, {}),
175
+ label: j("creator"),
176
+ icon: /* @__PURE__ */ S(l, {}),
175
177
  kind: "people",
176
178
  ...e,
177
179
  options: G.map((e) => ({
178
180
  value: e.user.username,
179
181
  label: e.user.name,
180
- icon: /* @__PURE__ */ w(x, {
182
+ icon: /* @__PURE__ */ S(b, {
181
183
  name: e.user.name,
182
184
  src: e.user.avatarUrl,
183
185
  size: "xs",
@@ -188,8 +190,8 @@ function M(v, O, j, M = !1) {
188
190
  },
189
191
  {
190
192
  key: "priority",
191
- label: N("priority"),
192
- icon: /* @__PURE__ */ w(l, { priority: 2 }),
193
+ label: j("priority"),
194
+ icon: /* @__PURE__ */ S(o, { priority: 2 }),
193
195
  kind: "enum",
194
196
  operators: ["is"],
195
197
  options: [
@@ -201,86 +203,86 @@ function M(v, O, j, M = !1) {
201
203
  ].map((e) => ({
202
204
  value: String(e),
203
205
  label: W[e] ?? "",
204
- icon: /* @__PURE__ */ w(l, { priority: e })
206
+ icon: /* @__PURE__ */ S(o, { priority: e })
205
207
  }))
206
208
  },
207
209
  {
208
210
  key: "label",
209
- label: N("label"),
210
- icon: /* @__PURE__ */ w(f, {}),
211
+ label: j("label"),
212
+ icon: /* @__PURE__ */ S(c, {}),
211
213
  kind: "enum",
212
214
  ...e,
213
215
  options: R.map((e) => ({
214
216
  value: e.name,
215
217
  label: e.name,
216
- icon: /* @__PURE__ */ w("span", {
218
+ icon: /* @__PURE__ */ S("span", {
217
219
  className: "size-2 rounded-full",
218
220
  style: { background: e.color }
219
221
  })
220
222
  })),
221
- valueLabel: () => N("deletedLabel")
223
+ valueLabel: () => j("deletedLabel")
222
224
  },
223
225
  {
224
226
  key: "project",
225
- label: N("project"),
226
- icon: /* @__PURE__ */ w(u, {}),
227
+ label: j("project"),
228
+ icon: /* @__PURE__ */ S(ae, {}),
227
229
  kind: "enum",
228
230
  ...e,
229
231
  options: z.map((e) => ({
230
- value: ie(e),
232
+ value: oe(e),
231
233
  label: e.name,
232
- icon: /* @__PURE__ */ w(m, { status: e.status })
234
+ icon: /* @__PURE__ */ S(p, { status: e.status })
233
235
  }))
234
236
  }
235
237
  ];
236
- (B.length > 0 || O.customer) && n.push({
238
+ (B.length > 0 || E.customer) && n.push({
237
239
  key: "customer",
238
- label: N("customer"),
239
- icon: /* @__PURE__ */ w(te, {}),
240
+ label: j("customer"),
241
+ icon: /* @__PURE__ */ S(u, {}),
240
242
  kind: "enum",
241
243
  ...e,
242
244
  options: B.map((e) => ({
243
245
  value: e.id,
244
246
  label: e.name
245
247
  }))
246
- }), (V || O.status) && n.splice(3, 0, {
248
+ }), (V || E.status) && n.splice(3, 0, {
247
249
  key: "status",
248
- label: N("status"),
249
- icon: /* @__PURE__ */ w(d, { category: "started" }),
250
+ label: j("status"),
251
+ icon: /* @__PURE__ */ S(s, { category: "started" }),
250
252
  kind: "enum",
251
253
  operators: ["is"],
252
254
  options: U.map((e) => ({
253
- value: b(e),
255
+ value: y(e),
254
256
  label: e.name,
255
- icon: /* @__PURE__ */ w(d, {
257
+ icon: /* @__PURE__ */ S(s, {
256
258
  category: e.category,
257
259
  step: e.step
258
260
  })
259
261
  }))
260
- }), (V?.cyclesEnabled || O.cycle) && n.push({
262
+ }), (V?.cyclesEnabled || E.cycle) && n.push({
261
263
  key: "cycle",
262
- label: N("cycle"),
263
- icon: /* @__PURE__ */ w(s, {}),
264
+ label: j("cycle"),
265
+ icon: /* @__PURE__ */ S(re, {}),
264
266
  kind: "enum",
265
267
  ...e,
266
268
  options: H.map((e) => ({
267
269
  value: e.id,
268
270
  label: t(e),
269
- description: P(`states.${e.state}`)
271
+ description: N(`states.${e.state}`)
270
272
  }))
271
273
  });
272
274
  let r = (X ?? []).filter((e) => !e.archivedAt && (!V || e.teamIds.length === 0 || e.teamIds.includes(V.id)));
273
- (r.length > 0 || O.type) && n.push({
275
+ (r.length > 0 || E.type) && n.push({
274
276
  key: "type",
275
277
  label: Z("type"),
276
- icon: /* @__PURE__ */ w(f, {}),
278
+ icon: /* @__PURE__ */ S(c, {}),
277
279
  kind: "enum",
278
280
  multiple: !0,
279
281
  operators: ["is"],
280
282
  options: [...r.map((e) => ({
281
283
  value: e.id,
282
284
  label: e.name,
283
- icon: /* @__PURE__ */ w(oe, {
285
+ icon: /* @__PURE__ */ S(v, {
284
286
  type: e,
285
287
  className: "size-3.5"
286
288
  })
@@ -289,23 +291,23 @@ function M(v, O, j, M = !1) {
289
291
  label: Z("noType")
290
292
  }]
291
293
  });
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)))) {
294
+ let i = new Set(g(E.fields).map((e) => e.field));
295
+ for (let e of (Y ?? []).filter((e) => e.target === "issue" && le.includes(e.kind) && (ce([e], "issue", V?.id).length > 0 || i.has(e.id)))) {
294
296
  let t = {
295
297
  value: "none",
296
298
  label: Q("noValue")
297
299
  };
298
300
  n.push({
299
- key: D(e.id),
301
+ key: T(e.id),
300
302
  label: e.name,
301
- icon: /* @__PURE__ */ w(f, {}),
303
+ icon: /* @__PURE__ */ S(c, {}),
302
304
  kind: "enum",
303
305
  multiple: !0,
304
306
  operators: ["is"],
305
307
  options: e.kind === "person" ? [...G.map((e) => ({
306
308
  value: e.user.username,
307
309
  label: e.user.name,
308
- icon: /* @__PURE__ */ w(x, {
310
+ icon: /* @__PURE__ */ S(b, {
309
311
  name: e.user.name,
310
312
  src: e.user.avatarUrl,
311
313
  size: "xs",
@@ -317,7 +319,7 @@ function M(v, O, j, M = !1) {
317
319
  }, t] : [...e.options.map((e) => ({
318
320
  value: e.id ?? "",
319
321
  label: e.name,
320
- ...e.color && { icon: /* @__PURE__ */ w("span", {
322
+ ...e.color && { icon: /* @__PURE__ */ S("span", {
321
323
  className: "size-2 rounded-full",
322
324
  style: { background: e.color }
323
325
  }) }
@@ -326,47 +328,49 @@ function M(v, O, j, M = !1) {
326
328
  }
327
329
  return n.push({
328
330
  key: "overdue",
329
- label: N("overdue"),
330
- icon: /* @__PURE__ */ w(ee, {}),
331
+ label: j("overdue"),
332
+ icon: /* @__PURE__ */ S(a, {}),
331
333
  kind: "boolean"
332
334
  }), n;
333
335
  }, [
334
336
  X,
335
337
  Z,
336
- O.type,
338
+ E.type,
337
339
  Y,
338
340
  Q,
339
- O.fields,
341
+ E.fields,
342
+ j,
343
+ M,
340
344
  N,
341
- P,
342
345
  L,
343
346
  G,
347
+ P,
344
348
  K,
345
349
  R,
346
350
  z,
347
351
  B,
348
- O.customer,
352
+ E.customer,
349
353
  H,
350
354
  U,
351
355
  W,
352
356
  V,
353
- O.cycle,
354
- O.status,
357
+ E.cycle,
358
+ E.status,
355
359
  q,
356
360
  J,
357
- M
358
- ]), $ = se(O), ue = {
361
+ A
362
+ ]), $ = de(E), me = {
359
363
  value: $.length > 0 ? $ : null,
360
364
  onChange: (e) => {
361
- let t = ce(e);
362
- t.team !== O.team && delete t.status, j(t);
365
+ let t = fe(e);
366
+ t.team !== E.team && delete t.status, k(t);
363
367
  }
364
368
  };
365
- return E({
366
- storageKey: `issues:${v}`,
367
- fields: le,
368
- store: ue,
369
+ return w({
370
+ storageKey: `issues:${h}`,
371
+ fields: pe,
372
+ store: me,
369
373
  remember: !1
370
374
  });
371
375
  }
372
- export { M as useIssueFilters, j as withIssueFilters };
376
+ export { A as useIssueFilters, k as withIssueFilters };
@@ -0,0 +1,33 @@
1
+ import { useNavigate as e } from "../lib/router.js";
2
+ import { useTime as t } from "../lib/time.js";
3
+ import { cycleParam as n } from "../lib/cycleLinks.js";
4
+ import { byStart as r } from "../lib/cycleOrder.js";
5
+ import { cycleChoices as i } from "../lib/cycleSwitcher.js";
6
+ import { useTranslations as a } from "use-intl";
7
+ // src/components/cycleCrumb.ts
8
+ function o(o, s, c, l) {
9
+ let u = a("planning"), d = t(), f = e(), p = (e) => e.name ? u("cycleNamed", {
10
+ number: e.number,
11
+ name: e.name
12
+ }) : u("cycle", { number: e.number });
13
+ if (l) return {
14
+ label: p(l),
15
+ switcher: {
16
+ label: u("switchCycle"),
17
+ placeholder: u("findCycle"),
18
+ items: i([...c].sort(r), n, p, (e) => d.dayRange(e.startsOn, e.endsOn), (e) => u(`states.${e}`)),
19
+ value: n(l),
20
+ onValueChange: (e) => {
21
+ f({
22
+ to: "/$workspace/teams/$key/cycles/$number",
23
+ params: {
24
+ workspace: o,
25
+ key: s,
26
+ number: e
27
+ }
28
+ });
29
+ }
30
+ }
31
+ };
32
+ }
33
+ export { o as useCycleCrumb };
@@ -0,0 +1,6 @@
1
+ // src/lib/assigneeOrder.ts
2
+ function e(e, t) {
3
+ let n = e.find((e) => e.user.username === t);
4
+ return n ? [n, ...e.filter((e) => e !== n)] : [...e];
5
+ }
6
+ export { e as youFirst };
package/lib/assignees.js CHANGED
@@ -1,50 +1,54 @@
1
- import { usePeople as e } from "./people.js";
2
- import { PickManyBox as t } from "./pickMany.js";
3
- import { Avatar as n } from "@parallelworks/ui";
4
- import { useTranslations as r } from "use-intl";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { meQuery as e } from "../api/queries.js";
2
+ import { usePeople as t } from "./people.js";
3
+ import { youFirst as n } from "./assigneeOrder.js";
4
+ import { PickManyBox as r } from "./pickMany.js";
5
+ import { Avatar as i } from "@parallelworks/ui";
6
+ import { useTranslations as a } from "use-intl";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { useQuery as c } from "@tanstack/react-query";
6
9
  // src/lib/assignees.tsx
7
- var o = (e) => `${e.kind}:${e.handle}`;
8
- function s(e) {
10
+ var l = (e) => `${e.kind}:${e.handle}`;
11
+ function u(e) {
9
12
  let [t, ...n] = e.split(":");
10
13
  return {
11
14
  kind: t === "agent" ? "agent" : "user",
12
15
  handle: n.join(":")
13
16
  };
14
17
  }
15
- function c(s, c = !1) {
16
- let l = r("common"), { members: u, agents: d } = e(s), f = [...u.map((e) => ({
17
- value: o({
18
+ function d(u, d = !1) {
19
+ let f = a("common"), { members: p, agents: m } = t(u), h = c(e).data?.user.username, g = [...n(p, h).map((e) => ({
20
+ value: l({
18
21
  kind: "user",
19
22
  handle: e.user.username
20
23
  }),
21
24
  label: e.user.name,
22
- icon: /* @__PURE__ */ i(n, {
25
+ ...e.user.username === h && { hint: f("you") },
26
+ icon: /* @__PURE__ */ o(i, {
23
27
  name: e.user.name,
24
28
  src: e.user.avatarUrl,
25
29
  size: "xs",
26
30
  decorative: !0
27
31
  })
28
- })), ...d.map((e) => ({
29
- value: o({
32
+ })), ...m.map((e) => ({
33
+ value: l({
30
34
  kind: "agent",
31
35
  handle: e.slug
32
36
  }),
33
37
  label: e.name,
34
- hint: l("agent"),
35
- icon: /* @__PURE__ */ i(n, {
38
+ hint: f("agent"),
39
+ icon: /* @__PURE__ */ o(i, {
36
40
  name: e.name,
37
41
  kind: "agent",
38
42
  size: "xs",
39
43
  decorative: !0
40
44
  })
41
45
  }))];
42
- return c ? f.map((e) => ({
46
+ return d ? g.map((e) => ({
43
47
  ...e,
44
- icon: /* @__PURE__ */ a("span", {
48
+ icon: /* @__PURE__ */ s("span", {
45
49
  className: "flex items-center gap-2",
46
- children: [/* @__PURE__ */ i(t, {}), e.icon]
50
+ children: [/* @__PURE__ */ o(r, {}), e.icon]
47
51
  })
48
- })) : f;
52
+ })) : g;
49
53
  }
50
- export { o as assigneeKey, s as parseAssigneeKey, c as useAssigneeOptions };
54
+ export { l as assigneeKey, u as parseAssigneeKey, d as useAssigneeOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.170.2",
3
+ "version": "0.171.1",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "yjs": "^13.6.33"
50
50
  },
51
51
  "peerDependencies": {
52
- "@parallelworks/ui": ">=0.117.0 <1",
52
+ "@parallelworks/ui": ">=0.119.0 <1",
53
53
  "@tanstack/react-router": "^1.170.0",
54
54
  "react": "^19.3.0",
55
55
  "react-dom": "^19.3.0",
@@ -2,7 +2,7 @@ import { api as e, unwrap as t } from "../../../../../api/client.js";
2
2
  import { NotFound as n } from "../../../../../components/status.js";
3
3
  import { usePageTitle as r } from "../../../../../lib/pageTitle.js";
4
4
  import { useNavigate as i } from "../../../../../lib/router.js";
5
- import { cyclesQuery as a, issuesQuery as ee, teamsQuery as o } from "../../../../../api/queries.js";
5
+ import { cyclesQuery as a, issuesQuery as o, teamsQuery as ee } from "../../../../../api/queries.js";
6
6
  import { invalidateIssueViews as s } from "../../../../../api/mutations.js";
7
7
  import { CloseIcon as te, CycleIcon as ne } from "../../../../../components/icons.js";
8
8
  import { addDays as re, today as c, useTime as l } from "../../../../../lib/time.js";
@@ -11,187 +11,186 @@ import { useCan as u } from "../../../../../lib/roles.js";
11
11
  import { teamPath as d } from "../../../../../lib/teamPaths.js";
12
12
  import { Route as f } from "./_number.js";
13
13
  import { FavoriteStar as p } from "../../../../../components/FavoriteStar.js";
14
- import { BurnUp as ae } from "../../../../../components/Reports.js";
15
- import { IssueBreakdown as m, breakdownKeys as oe } from "../../../../../components/IssueBreakdown.js";
16
- import { StatusGroups as se } from "../../../../../components/IssueGroup.js";
17
- import { cycleParam as ce, findCycle as le } from "../../../../../lib/cycleLinks.js";
18
- import { CycleSwitcher as h } from "../../../../../components/CycleSwitcher.js";
14
+ import { BurnUp as m } from "../../../../../components/Reports.js";
15
+ import { IssueBreakdown as h, breakdownKeys as ae } from "../../../../../components/IssueBreakdown.js";
16
+ import { StatusGroups as oe } from "../../../../../components/IssueGroup.js";
17
+ import { cycleParam as se, findCycle as ce } from "../../../../../lib/cycleLinks.js";
18
+ import { useCycleCrumb as le } from "../../../../../components/cycleCrumb.js";
19
19
  import { Button as g, Card as _, EmptyState as v, ErrorText as y, IconButton as b, PageHeader as x } from "@parallelworks/ui";
20
20
  import { useState as S } from "react";
21
21
  import { useErrorMessage as C } from "@parallelworks/problem/react";
22
22
  import { useTranslations as w } from "use-intl";
23
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
24
- import { useMutation as O, useQuery as k, useQueryClient as A, useSuspenseQuery as j } from "@tanstack/react-query";
23
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
24
+ import { useMutation as D, useQuery as O, useQueryClient as k, useSuspenseQuery as A } from "@tanstack/react-query";
25
25
  // src/routes/$workspace/teams/$key/cycles/$number.tsx?tsr-split=component
26
- var M = [
26
+ var j = [
27
27
  "assignees",
28
28
  "labels",
29
29
  "priority",
30
30
  "projects"
31
31
  ];
32
- function N() {
33
- let { workspace: N, key: P, number: F } = f.useParams(), I = w("planning"), L = C(), R = l(), z = i(), { data: B } = j(o(N)), { data: V } = j(a(N, P)), H = le(V, F), U = B.find((e) => e.key === P);
34
- r(H && (H.name ? I("cycleNamed", {
35
- number: H.number,
36
- name: H.name
37
- }) : I("cycle", { number: H.number })), U?.name);
38
- let W = u(N, "manage_cycles", { team: P }), ue = A(), [G, de] = S(null), [K, q] = S("assignees"), [J, Y] = S(null), { data: fe } = k({
39
- ...ee(N, { cycle: H?.id ?? "" }),
40
- enabled: !!H
41
- }), X = O({
32
+ function M() {
33
+ let { workspace: M, key: N, number: P } = f.useParams(), F = w("planning"), I = C(), L = l(), R = i(), { data: z } = A(ee(M)), { data: B } = A(a(M, N)), V = ce(B, P), H = z.find((e) => e.key === N), U = le(M, N, B, V);
34
+ r(V && (V.name ? F("cycleNamed", {
35
+ number: V.number,
36
+ name: V.name
37
+ }) : F("cycle", { number: V.number })), H?.name);
38
+ let W = u(M, "manage_cycles", { team: N }), ue = k(), [G, de] = S(null), [K, q] = S("assignees"), [J, Y] = S(null), { data: fe } = O({
39
+ ...o(M, { cycle: V?.id ?? "" }),
40
+ enabled: !!V
41
+ }), X = D({
42
42
  mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/cycles/{number}/move-unfinished", { params: { path: {
43
- workspace: N,
44
- key: P,
45
- number: H?.number ?? 0
43
+ workspace: M,
44
+ key: N,
45
+ number: V?.number ?? 0
46
46
  } } })),
47
47
  onSuccess: (e) => de(e.moved),
48
- onSettled: () => s(ue, N)
48
+ onSettled: () => s(ue, M)
49
49
  });
50
- if (!H) return /* @__PURE__ */ E(n, { title: I("noSuchCycle") });
51
- let Z = fe?.issues ?? [], Q = J ? Z.filter((e) => oe(e, J.tab).includes(J.key)) : Z, $ = Z.filter((e) => e.status.category !== "completed" && e.status.category !== "canceled").length, pe = H.state === "past" || H.state === "current" && re(c(), 2) >= H.endsOn, me = H.name ? I("cycleNamed", {
52
- number: H.number,
53
- name: H.name
54
- }) : I("cycle", { number: H.number });
55
- return /* @__PURE__ */ D("div", {
50
+ if (!V) return /* @__PURE__ */ T(n, { title: F("noSuchCycle") });
51
+ let Z = fe?.issues ?? [], Q = J ? Z.filter((e) => ae(e, J.tab).includes(J.key)) : Z, $ = Z.filter((e) => e.status.category !== "completed" && e.status.category !== "canceled").length, pe = V.state === "past" || V.state === "current" && re(c(), 2) >= V.endsOn, me = V.name ? F("cycleNamed", {
52
+ number: V.number,
53
+ name: V.name
54
+ }) : F("cycle", { number: V.number });
55
+ return /* @__PURE__ */ E("div", {
56
56
  className: "flex h-full min-h-0 flex-col",
57
- children: [/* @__PURE__ */ E(x, {
57
+ children: [/* @__PURE__ */ T(x, {
58
58
  heading: !1,
59
- breadcrumbs: [{
60
- label: U?.name ?? P,
61
- href: d(N, P, "issues")
62
- }, {
63
- label: I("cycles"),
64
- href: d(N, P, "cycles")
65
- }],
66
- titleActions: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(h, {
67
- workspace: N,
68
- teamKey: P,
69
- cycles: V,
70
- cycle: H
71
- }), /* @__PURE__ */ E(p, {
72
- workspace: N,
59
+ breadcrumbs: [
60
+ {
61
+ label: H?.name ?? N,
62
+ href: d(M, N, "issues")
63
+ },
64
+ {
65
+ label: F("cycles"),
66
+ href: d(M, N, "cycles")
67
+ },
68
+ ...U ? [U] : []
69
+ ],
70
+ titleActions: /* @__PURE__ */ T(p, {
71
+ workspace: M,
73
72
  kind: "cycle",
74
- target: H.id
75
- })] })
76
- }), /* @__PURE__ */ D("div", {
73
+ target: V.id
74
+ })
75
+ }), /* @__PURE__ */ E("div", {
77
76
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto xl:flex-row xl:overflow-hidden",
78
- children: [/* @__PURE__ */ D("div", {
77
+ children: [/* @__PURE__ */ E("div", {
79
78
  className: "w-full min-w-0 px-4 py-6 md:px-8 md:py-8 xl:flex-1 xl:overflow-y-auto",
80
79
  children: [
81
- /* @__PURE__ */ D("div", {
80
+ /* @__PURE__ */ E("div", {
82
81
  className: "flex flex-wrap items-center gap-3",
83
82
  children: [
84
- /* @__PURE__ */ E(ne, { className: `size-5 shrink-0 ${H.state === "current" ? "text-status-started" : "text-muted-foreground"}` }),
85
- /* @__PURE__ */ E("h1", {
83
+ /* @__PURE__ */ T(ne, { className: `size-5 shrink-0 ${V.state === "current" ? "text-status-started" : "text-muted-foreground"}` }),
84
+ /* @__PURE__ */ T("h1", {
86
85
  className: "text-xl font-semibold tracking-tight",
87
86
  children: me
88
87
  }),
89
- /* @__PURE__ */ E("span", {
88
+ /* @__PURE__ */ T("span", {
90
89
  className: "rounded-md border border-border px-1.5 py-0.5 text-xs text-muted-foreground",
91
- children: I(`states.${H.state}`)
90
+ children: F(`states.${V.state}`)
92
91
  }),
93
- /* @__PURE__ */ E("span", {
92
+ /* @__PURE__ */ T("span", {
94
93
  className: "text-sm text-muted-foreground",
95
- children: R.dayRange(H.startsOn, H.endsOn)
94
+ children: L.dayRange(V.startsOn, V.endsOn)
96
95
  }),
97
- H.carriedIn > 0 && /* @__PURE__ */ E("span", {
96
+ V.carriedIn > 0 && /* @__PURE__ */ T("span", {
98
97
  className: "text-sm text-muted-foreground",
99
- children: I("carriedIn", { count: H.carriedIn })
98
+ children: F("carriedIn", { count: V.carriedIn })
100
99
  }),
101
- H.carriedOut > 0 && /* @__PURE__ */ E("span", {
100
+ V.carriedOut > 0 && /* @__PURE__ */ T("span", {
102
101
  className: "text-sm text-muted-foreground",
103
- children: I("carriedOut", { count: H.carriedOut })
102
+ children: F("carriedOut", { count: V.carriedOut })
104
103
  }),
105
- W && $ > 0 && pe && /* @__PURE__ */ E(g, {
104
+ W && $ > 0 && pe && /* @__PURE__ */ T(g, {
106
105
  type: "button",
107
106
  onClick: () => X.mutate(),
108
107
  loading: X.isPending,
109
108
  className: "ml-auto",
110
- children: I("moveUnfinished", { count: $ })
109
+ children: F("moveUnfinished", { count: $ })
111
110
  })
112
111
  ]
113
112
  }),
114
- X.isError && /* @__PURE__ */ E(y, {
113
+ X.isError && /* @__PURE__ */ T(y, {
115
114
  size: "md",
116
115
  className: "mt-2",
117
- children: L(X.error)
116
+ children: I(X.error)
118
117
  }),
119
- G !== null && X.data && /* @__PURE__ */ D("p", {
118
+ G !== null && X.data && /* @__PURE__ */ E("p", {
120
119
  className: "mt-2 text-sm text-muted-foreground",
121
120
  role: "status",
122
121
  children: [
123
- I("moved", { count: G }),
122
+ F("moved", { count: G }),
124
123
  " ",
125
- /* @__PURE__ */ E("button", {
124
+ /* @__PURE__ */ T("button", {
126
125
  type: "button",
127
126
  className: "text-primary hover:underline",
128
- onClick: () => z({
127
+ onClick: () => R({
129
128
  to: "/$workspace/teams/$key/cycles/$number",
130
129
  params: {
131
- workspace: N,
132
- key: P,
133
- number: ce(X.data.cycle)
130
+ workspace: M,
131
+ key: N,
132
+ number: se(X.data.cycle)
134
133
  }
135
134
  }),
136
- children: I("openCycle", { number: X.data.cycle.number })
135
+ children: F("openCycle", { number: X.data.cycle.number })
137
136
  })
138
137
  ]
139
138
  }),
140
- /* @__PURE__ */ E("section", {
139
+ /* @__PURE__ */ T("section", {
141
140
  className: "mt-6",
142
- "aria-label": I("progressTitle"),
143
- children: /* @__PURE__ */ E(ie, { progress: H.progress })
141
+ "aria-label": F("progressTitle"),
142
+ children: /* @__PURE__ */ T(ie, { progress: V.progress })
144
143
  }),
145
- /* @__PURE__ */ E("section", {
144
+ /* @__PURE__ */ T("section", {
146
145
  className: "mt-6 rounded-xl border border-border bg-card p-4",
147
- children: /* @__PURE__ */ E(ae, {
148
- workspace: N,
149
- teamKey: P,
150
- cycle: H
146
+ children: /* @__PURE__ */ T(m, {
147
+ workspace: M,
148
+ teamKey: N,
149
+ cycle: V
151
150
  })
152
151
  }),
153
- Z.length > 0 && /* @__PURE__ */ E("div", {
152
+ Z.length > 0 && /* @__PURE__ */ T("div", {
154
153
  className: "mt-8 xl:hidden",
155
- children: /* @__PURE__ */ E(m, {
156
- workspace: N,
154
+ children: /* @__PURE__ */ T(h, {
155
+ workspace: M,
157
156
  issues: Z,
158
- tabs: M,
157
+ tabs: j,
159
158
  tab: K,
160
159
  onTabChange: q,
161
160
  focus: J,
162
161
  onFocus: (e) => Y(e)
163
162
  })
164
163
  }),
165
- /* @__PURE__ */ D("section", {
164
+ /* @__PURE__ */ E("section", {
166
165
  className: "mt-8",
167
- children: [J && /* @__PURE__ */ D("div", {
166
+ children: [J && /* @__PURE__ */ E("div", {
168
167
  className: "mb-3 flex items-center gap-2 text-sm text-muted-foreground",
169
168
  role: "status",
170
- children: [I("issueBreakdown.showing", { count: Q.length }), /* @__PURE__ */ E(b, {
169
+ children: [F("issueBreakdown.showing", { count: Q.length }), /* @__PURE__ */ T(b, {
171
170
  size: "sm",
172
171
  variant: "ghost",
173
- label: I("issueBreakdown.showAll"),
174
- icon: /* @__PURE__ */ E(te, {}),
172
+ label: F("issueBreakdown.showAll"),
173
+ icon: /* @__PURE__ */ T(te, {}),
175
174
  onClick: () => Y(null)
176
175
  })]
177
- }), Q.length === 0 ? /* @__PURE__ */ E(v, { title: I("noIssuesInCycle") }) : /* @__PURE__ */ E(_, {
176
+ }), Q.length === 0 ? /* @__PURE__ */ T(v, { title: F("noIssuesInCycle") }) : /* @__PURE__ */ T(_, {
178
177
  size: "fill",
179
178
  padding: "none",
180
179
  className: "overflow-hidden",
181
- children: /* @__PURE__ */ E(se, {
182
- workspace: N,
180
+ children: /* @__PURE__ */ T(oe, {
181
+ workspace: M,
183
182
  issues: Q
184
183
  })
185
184
  })]
186
185
  })
187
186
  ]
188
- }), Z.length > 0 && /* @__PURE__ */ E("aside", {
189
- "aria-label": I("issueBreakdown.label"),
187
+ }), Z.length > 0 && /* @__PURE__ */ T("aside", {
188
+ "aria-label": F("issueBreakdown.label"),
190
189
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-6 xl:block",
191
- children: /* @__PURE__ */ E(m, {
192
- workspace: N,
190
+ children: /* @__PURE__ */ T(h, {
191
+ workspace: M,
193
192
  issues: Z,
194
- tabs: M,
193
+ tabs: j,
195
194
  tab: K,
196
195
  onTabChange: q,
197
196
  focus: J,
@@ -201,4 +200,4 @@ function N() {
201
200
  })]
202
201
  });
203
202
  }
204
- export { N as component };
203
+ export { M as component };
@@ -1,47 +0,0 @@
1
- import { useNavigate as e } from "../lib/router.js";
2
- import { ChevronDownIcon as t, ChevronRightIcon as n } from "./icons.js";
3
- import { useTime as r } from "../lib/time.js";
4
- import { cycleParam as i } from "../lib/cycleLinks.js";
5
- import { byStart as a } from "../lib/cycleOrder.js";
6
- import { cycleChoices as o } from "../lib/cycleSwitcher.js";
7
- import { Combobox as s } from "@parallelworks/ui";
8
- import { useTranslations as c } from "use-intl";
9
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
- // src/components/CycleSwitcher.tsx
11
- function d({ workspace: d, teamKey: f, cycles: p, cycle: m }) {
12
- let h = c("planning"), g = r(), _ = e(), v = (e) => e.name ? h("cycleNamed", {
13
- number: e.number,
14
- name: e.name
15
- }) : h("cycle", { number: e.number }), y = o([...p].sort(a), i, v, (e) => g.dayRange(e.startsOn, e.endsOn), (e) => h(`states.${e}`));
16
- return /* @__PURE__ */ u("span", {
17
- className: "flex min-w-0 items-center gap-1.5 text-[13px] leading-none",
18
- children: [/* @__PURE__ */ l(n, {
19
- "aria-hidden": "true",
20
- className: "size-3 shrink-0 text-muted-foreground opacity-60 rtl:rotate-180"
21
- }), /* @__PURE__ */ l(s, {
22
- "aria-label": h("switchCycle"),
23
- placeholder: h("findCycle"),
24
- items: y,
25
- value: i(m),
26
- onValueChange: (e) => {
27
- e !== null && e !== i(m) && _({
28
- to: "/$workspace/teams/$key/cycles/$number",
29
- params: {
30
- workspace: d,
31
- key: f,
32
- number: e
33
- }
34
- });
35
- },
36
- trigger: /* @__PURE__ */ u("button", {
37
- type: "button",
38
- className: "flex min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 py-0.5 font-medium text-foreground hover:bg-muted",
39
- children: [/* @__PURE__ */ l("span", {
40
- className: "truncate",
41
- children: v(m)
42
- }), /* @__PURE__ */ l(t, { className: "size-3.5 shrink-0 text-muted-foreground" })]
43
- })
44
- })]
45
- });
46
- }
47
- export { d as CycleSwitcher };