@parallelworks/tandem-web 0.167.0 → 0.168.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.
@@ -1,196 +1,194 @@
1
1
  import { api as e, unwrap as t } from "../../../../../api/client.js";
2
- import { usePageTitle as n } from "../../../../../lib/pageTitle.js";
3
- import { useNavigate as r } from "../../../../../lib/router.js";
4
- import { cyclesQuery as i, issuesQuery as a, teamsQuery as ee } from "../../../../../api/queries.js";
5
- import { invalidateIssueViews as o } from "../../../../../api/mutations.js";
2
+ import { NotFound as n } from "../../../../../components/status.js";
3
+ import { usePageTitle as r } from "../../../../../lib/pageTitle.js";
4
+ import { useNavigate as i } from "../../../../../lib/router.js";
5
+ import { cyclesQuery as a, issuesQuery as o, teamsQuery as s } from "../../../../../api/queries.js";
6
+ import { invalidateIssueViews as ee } from "../../../../../api/mutations.js";
6
7
  import { CloseIcon as te, CycleIcon as ne } from "../../../../../components/icons.js";
7
- import { addDays as re, today as ie, useTime as s } from "../../../../../lib/time.js";
8
- import { ProgressBar as c } from "../../../../../components/Planning.js";
9
- import { useCan as l } from "../../../../../lib/roles.js";
10
- import { teamPath as u } from "../../../../../lib/teamPaths.js";
11
- import { Route as d } from "./_number.js";
12
- import { FavoriteStar as f } from "../../../../../components/FavoriteStar.js";
13
- import { BurnUp as p } from "../../../../../components/Reports.js";
14
- import { IssueBreakdown as m, breakdownKeys as h } from "../../../../../components/IssueBreakdown.js";
15
- import { StatusGroups as g } from "../../../../../components/IssueGroup.js";
16
- import { Button as _, Card as ae, EmptyState as oe, ErrorText as se, IconButton as v, PageHeader as y } from "@parallelworks/ui";
17
- import { useState as b } from "react";
18
- import { useErrorMessage as x } from "@parallelworks/problem/react";
19
- import { useTranslations as S } from "use-intl";
20
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
21
- import { useMutation as T, useQuery as E, useQueryClient as D, useSuspenseQuery as O } from "@tanstack/react-query";
8
+ import { addDays as c, today as l, useTime as u } from "../../../../../lib/time.js";
9
+ import { ProgressBar as d } from "../../../../../components/Planning.js";
10
+ import { useCan as f } from "../../../../../lib/roles.js";
11
+ import { teamPath as p } from "../../../../../lib/teamPaths.js";
12
+ import { Route as m } from "./_number.js";
13
+ import { FavoriteStar as h } from "../../../../../components/FavoriteStar.js";
14
+ import { BurnUp as g } from "../../../../../components/Reports.js";
15
+ import { IssueBreakdown as _, breakdownKeys as re } from "../../../../../components/IssueBreakdown.js";
16
+ import { StatusGroups as ie } from "../../../../../components/IssueGroup.js";
17
+ import { Button as ae, Card as oe, EmptyState as se, ErrorText as v, IconButton as y, PageHeader as b } from "@parallelworks/ui";
18
+ import { useState as x } from "react";
19
+ import { useErrorMessage as S } from "@parallelworks/problem/react";
20
+ import { useTranslations as C } from "use-intl";
21
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
22
+ import { useMutation as E, useQuery as D, useQueryClient as O, useSuspenseQuery as k } from "@tanstack/react-query";
22
23
  // src/routes/$workspace/teams/$key/cycles/$number.tsx?tsr-split=component
23
- var k = [
24
+ var A = [
24
25
  "assignees",
25
26
  "labels",
26
27
  "priority",
27
28
  "projects"
28
29
  ];
29
- function A() {
30
- let { workspace: A, key: j, number: M } = d.useParams(), N = S("planning"), P = x(), F = s(), I = r(), { data: L } = O(ee(A)), { data: R } = O(i(A, j)), z = R.find((e) => String(e.number) === M), B = L.find((e) => e.key === j);
31
- n(z && (z.name ? N("cycleNamed", {
30
+ function j() {
31
+ let { workspace: j, key: M, number: N } = m.useParams(), P = C("planning"), F = S(), I = u(), ce = i(), { data: L } = k(s(j)), { data: R } = k(a(j, M)), z = R.find((e) => String(e.number) === N), B = L.find((e) => e.key === M);
32
+ r(z && (z.name ? P("cycleNamed", {
32
33
  number: z.number,
33
34
  name: z.name
34
- }) : N("cycle", { number: z.number })), B?.name);
35
- let V = l(A, "manage_cycles", { team: j }), H = D(), [U, W] = b(null), [G, K] = b("assignees"), [q, J] = b(null), { data: ce } = E({
36
- ...a(A, { cycle: z?.id ?? "" }),
35
+ }) : P("cycle", { number: z.number })), B?.name);
36
+ let V = f(j, "manage_cycles", { team: M }), H = O(), [U, W] = x(null), [G, K] = x("assignees"), [q, J] = x(null), { data: le } = D({
37
+ ...o(j, { cycle: z?.id ?? "" }),
37
38
  enabled: !!z
38
- }), Y = T({
39
+ }), Y = E({
39
40
  mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/cycles/{number}/move-unfinished", { params: { path: {
40
- workspace: A,
41
- key: j,
42
- number: Number(M)
41
+ workspace: j,
42
+ key: M,
43
+ number: Number(N)
43
44
  } } })),
44
45
  onSuccess: (e) => W(e.moved),
45
- onSettled: () => o(H, A)
46
+ onSettled: () => ee(H, j)
46
47
  });
47
- if (!z) return /* @__PURE__ */ C("p", {
48
- className: "px-8 py-10 text-sm text-muted-foreground",
49
- children: N("noSuchCycle")
50
- });
51
- let X = ce?.issues ?? [], Z = q ? X.filter((e) => h(e, q.tab).includes(q.key)) : X, Q = X.filter((e) => e.status.category !== "completed" && e.status.category !== "canceled").length, le = z.state === "past" || z.state === "current" && re(ie(), 2) >= z.endsOn, $ = z.name ? N("cycleNamed", {
48
+ if (!z) return /* @__PURE__ */ w(n, { title: P("noSuchCycle") });
49
+ let X = le?.issues ?? [], Z = q ? X.filter((e) => re(e, q.tab).includes(q.key)) : X, Q = X.filter((e) => e.status.category !== "completed" && e.status.category !== "canceled").length, ue = z.state === "past" || z.state === "current" && c(l(), 2) >= z.endsOn, $ = z.name ? P("cycleNamed", {
52
50
  number: z.number,
53
51
  name: z.name
54
- }) : N("cycle", { number: z.number });
55
- return /* @__PURE__ */ w("div", {
52
+ }) : P("cycle", { number: z.number });
53
+ return /* @__PURE__ */ T("div", {
56
54
  className: "flex h-full min-h-0 flex-col",
57
- children: [/* @__PURE__ */ C(y, {
55
+ children: [/* @__PURE__ */ w(b, {
58
56
  heading: !1,
59
57
  breadcrumbs: [
60
58
  {
61
- label: B?.name ?? j,
62
- href: u(A, j, "issues")
59
+ label: B?.name ?? M,
60
+ href: p(j, M, "issues")
63
61
  },
64
62
  {
65
- label: N("cycles"),
66
- href: u(A, j, "cycles")
63
+ label: P("cycles"),
64
+ href: p(j, M, "cycles")
67
65
  },
68
66
  { label: $ }
69
67
  ],
70
- titleActions: /* @__PURE__ */ C(f, {
71
- workspace: A,
68
+ titleActions: /* @__PURE__ */ w(h, {
69
+ workspace: j,
72
70
  kind: "cycle",
73
71
  target: z.id
74
72
  })
75
- }), /* @__PURE__ */ w("div", {
73
+ }), /* @__PURE__ */ T("div", {
76
74
  className: "flex min-h-0 flex-1 flex-col overflow-y-auto xl:flex-row xl:overflow-hidden",
77
- children: [/* @__PURE__ */ w("div", {
75
+ children: [/* @__PURE__ */ T("div", {
78
76
  className: "w-full min-w-0 px-4 py-6 md:px-8 md:py-8 xl:flex-1 xl:overflow-y-auto",
79
77
  children: [
80
- /* @__PURE__ */ w("div", {
78
+ /* @__PURE__ */ T("div", {
81
79
  className: "flex flex-wrap items-center gap-3",
82
80
  children: [
83
- /* @__PURE__ */ C(ne, { className: `size-5 shrink-0 ${z.state === "current" ? "text-status-started" : "text-muted-foreground"}` }),
84
- /* @__PURE__ */ C("h1", {
81
+ /* @__PURE__ */ w(ne, { className: `size-5 shrink-0 ${z.state === "current" ? "text-status-started" : "text-muted-foreground"}` }),
82
+ /* @__PURE__ */ w("h1", {
85
83
  className: "text-xl font-semibold tracking-tight",
86
84
  children: $
87
85
  }),
88
- /* @__PURE__ */ C("span", {
86
+ /* @__PURE__ */ w("span", {
89
87
  className: "rounded-md border border-border px-1.5 py-0.5 text-xs text-muted-foreground",
90
- children: N(`states.${z.state}`)
88
+ children: P(`states.${z.state}`)
91
89
  }),
92
- /* @__PURE__ */ C("span", {
90
+ /* @__PURE__ */ w("span", {
93
91
  className: "text-sm text-muted-foreground",
94
- children: F.dayRange(z.startsOn, z.endsOn)
92
+ children: I.dayRange(z.startsOn, z.endsOn)
95
93
  }),
96
- z.carriedIn > 0 && /* @__PURE__ */ C("span", {
94
+ z.carriedIn > 0 && /* @__PURE__ */ w("span", {
97
95
  className: "text-sm text-muted-foreground",
98
- children: N("carriedIn", { count: z.carriedIn })
96
+ children: P("carriedIn", { count: z.carriedIn })
99
97
  }),
100
- z.carriedOut > 0 && /* @__PURE__ */ C("span", {
98
+ z.carriedOut > 0 && /* @__PURE__ */ w("span", {
101
99
  className: "text-sm text-muted-foreground",
102
- children: N("carriedOut", { count: z.carriedOut })
100
+ children: P("carriedOut", { count: z.carriedOut })
103
101
  }),
104
- V && Q > 0 && le && /* @__PURE__ */ C(_, {
102
+ V && Q > 0 && ue && /* @__PURE__ */ w(ae, {
105
103
  type: "button",
106
104
  onClick: () => Y.mutate(),
107
105
  loading: Y.isPending,
108
106
  className: "ml-auto",
109
- children: N("moveUnfinished", { count: Q })
107
+ children: P("moveUnfinished", { count: Q })
110
108
  })
111
109
  ]
112
110
  }),
113
- Y.isError && /* @__PURE__ */ C(se, {
111
+ Y.isError && /* @__PURE__ */ w(v, {
114
112
  size: "md",
115
113
  className: "mt-2",
116
- children: P(Y.error)
114
+ children: F(Y.error)
117
115
  }),
118
- U !== null && Y.data && /* @__PURE__ */ w("p", {
116
+ U !== null && Y.data && /* @__PURE__ */ T("p", {
119
117
  className: "mt-2 text-sm text-muted-foreground",
120
118
  role: "status",
121
119
  children: [
122
- N("moved", { count: U }),
120
+ P("moved", { count: U }),
123
121
  " ",
124
- /* @__PURE__ */ C("button", {
122
+ /* @__PURE__ */ w("button", {
125
123
  type: "button",
126
124
  className: "text-primary hover:underline",
127
- onClick: () => I({
125
+ onClick: () => ce({
128
126
  to: "/$workspace/teams/$key/cycles/$number",
129
127
  params: {
130
- workspace: A,
131
- key: j,
128
+ workspace: j,
129
+ key: M,
132
130
  number: String(Y.data.cycle.number)
133
131
  }
134
132
  }),
135
- children: N("openCycle", { number: Y.data.cycle.number })
133
+ children: P("openCycle", { number: Y.data.cycle.number })
136
134
  })
137
135
  ]
138
136
  }),
139
- /* @__PURE__ */ C("section", {
137
+ /* @__PURE__ */ w("section", {
140
138
  className: "mt-6",
141
- "aria-label": N("progressTitle"),
142
- children: /* @__PURE__ */ C(c, { progress: z.progress })
139
+ "aria-label": P("progressTitle"),
140
+ children: /* @__PURE__ */ w(d, { progress: z.progress })
143
141
  }),
144
- /* @__PURE__ */ C("section", {
142
+ /* @__PURE__ */ w("section", {
145
143
  className: "mt-6 rounded-xl border border-border bg-card p-4",
146
- children: /* @__PURE__ */ C(p, {
147
- workspace: A,
148
- teamKey: j,
144
+ children: /* @__PURE__ */ w(g, {
145
+ workspace: j,
146
+ teamKey: M,
149
147
  cycle: z
150
148
  })
151
149
  }),
152
- X.length > 0 && /* @__PURE__ */ C("div", {
150
+ X.length > 0 && /* @__PURE__ */ w("div", {
153
151
  className: "mt-8 xl:hidden",
154
- children: /* @__PURE__ */ C(m, {
155
- workspace: A,
152
+ children: /* @__PURE__ */ w(_, {
153
+ workspace: j,
156
154
  issues: X,
157
- tabs: k,
155
+ tabs: A,
158
156
  tab: G,
159
157
  onTabChange: K,
160
158
  focus: q,
161
159
  onFocus: (e) => J(e)
162
160
  })
163
161
  }),
164
- /* @__PURE__ */ w("section", {
162
+ /* @__PURE__ */ T("section", {
165
163
  className: "mt-8",
166
- children: [q && /* @__PURE__ */ w("div", {
164
+ children: [q && /* @__PURE__ */ T("div", {
167
165
  className: "mb-3 flex items-center gap-2 text-sm text-muted-foreground",
168
166
  role: "status",
169
- children: [N("issueBreakdown.showing", { count: Z.length }), /* @__PURE__ */ C(v, {
167
+ children: [P("issueBreakdown.showing", { count: Z.length }), /* @__PURE__ */ w(y, {
170
168
  size: "sm",
171
169
  variant: "ghost",
172
- label: N("issueBreakdown.showAll"),
173
- icon: /* @__PURE__ */ C(te, {}),
170
+ label: P("issueBreakdown.showAll"),
171
+ icon: /* @__PURE__ */ w(te, {}),
174
172
  onClick: () => J(null)
175
173
  })]
176
- }), Z.length === 0 ? /* @__PURE__ */ C(oe, { title: N("noIssuesInCycle") }) : /* @__PURE__ */ C(ae, {
174
+ }), Z.length === 0 ? /* @__PURE__ */ w(se, { title: P("noIssuesInCycle") }) : /* @__PURE__ */ w(oe, {
177
175
  size: "fill",
178
176
  padding: "none",
179
177
  className: "overflow-hidden",
180
- children: /* @__PURE__ */ C(g, {
181
- workspace: A,
178
+ children: /* @__PURE__ */ w(ie, {
179
+ workspace: j,
182
180
  issues: Z
183
181
  })
184
182
  })]
185
183
  })
186
184
  ]
187
- }), X.length > 0 && /* @__PURE__ */ C("aside", {
188
- "aria-label": N("issueBreakdown.label"),
185
+ }), X.length > 0 && /* @__PURE__ */ w("aside", {
186
+ "aria-label": P("issueBreakdown.label"),
189
187
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-6 xl:block",
190
- children: /* @__PURE__ */ C(m, {
191
- workspace: A,
188
+ children: /* @__PURE__ */ w(_, {
189
+ workspace: j,
192
190
  issues: X,
193
- tabs: k,
191
+ tabs: A,
194
192
  tab: G,
195
193
  onTabChange: K,
196
194
  focus: q,
@@ -200,4 +198,4 @@ function A() {
200
198
  })]
201
199
  });
202
200
  }
203
- export { A as component };
201
+ export { j as component };
@@ -1,8 +1,5 @@
1
- import { ErrorPage as e } from "@parallelworks/ui";
1
+ import { NotFound as e } from "../../../components/status.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  // src/routes/$workspace/teams/$key.tsx?tsr-split=notFoundComponent
4
- var n = () => /* @__PURE__ */ t("div", {
5
- className: "flex h-full min-h-0 flex-1",
6
- children: /* @__PURE__ */ t(e, { status: 404 })
7
- });
4
+ var n = () => /* @__PURE__ */ t(e, {});
8
5
  export { n as notFoundComponent };