@parallelworks/tandem-web 0.189.9 → 0.189.11

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