@parallelworks/tandem-web 0.170.0 → 0.170.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.
- package/components/CycleSwitcher.js +24 -23
- package/components/IssueFilters.js +1 -1
- package/lib/cycleLinks.js +11 -0
- package/lib/cycleSwitcher.js +9 -9
- package/package.json +1 -1
- package/pages/issues.js +2 -2
- package/routes/_workspace/teams/_key/cycles/_number2.js +60 -59
- package/routes/_workspace/teams/_key/cycles/_number3.js +15 -5
- package/routes/_workspace/teams/_key/cycles/index2.js +72 -71
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { useNavigate as e } from "../lib/router.js";
|
|
2
2
|
import { ChevronDownIcon as t, ChevronRightIcon as n } from "./icons.js";
|
|
3
3
|
import { useTime as r } from "../lib/time.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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";
|
|
9
10
|
// src/components/CycleSwitcher.tsx
|
|
10
|
-
function
|
|
11
|
-
let
|
|
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", {
|
|
12
13
|
number: e.number,
|
|
13
14
|
name: e.name
|
|
14
|
-
}) :
|
|
15
|
-
return /* @__PURE__ */
|
|
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", {
|
|
16
17
|
className: "flex min-w-0 items-center gap-1.5 text-[13px] leading-none",
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ l(n, {
|
|
18
19
|
"aria-hidden": "true",
|
|
19
20
|
className: "size-3 shrink-0 text-muted-foreground opacity-60 rtl:rotate-180"
|
|
20
|
-
}), /* @__PURE__ */
|
|
21
|
-
"aria-label":
|
|
22
|
-
placeholder:
|
|
23
|
-
items:
|
|
24
|
-
value:
|
|
21
|
+
}), /* @__PURE__ */ l(s, {
|
|
22
|
+
"aria-label": h("switchCycle"),
|
|
23
|
+
placeholder: h("findCycle"),
|
|
24
|
+
items: y,
|
|
25
|
+
value: i(m),
|
|
25
26
|
onValueChange: (e) => {
|
|
26
|
-
e !== null && e !==
|
|
27
|
+
e !== null && e !== i(m) && _({
|
|
27
28
|
to: "/$workspace/teams/$key/cycles/$number",
|
|
28
29
|
params: {
|
|
29
|
-
workspace:
|
|
30
|
-
key:
|
|
30
|
+
workspace: d,
|
|
31
|
+
key: f,
|
|
31
32
|
number: e
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
},
|
|
35
|
-
trigger: /* @__PURE__ */
|
|
36
|
+
trigger: /* @__PURE__ */ u("button", {
|
|
36
37
|
type: "button",
|
|
37
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",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ l("span", {
|
|
39
40
|
className: "truncate",
|
|
40
|
-
children:
|
|
41
|
-
}), /* @__PURE__ */
|
|
41
|
+
children: v(m)
|
|
42
|
+
}), /* @__PURE__ */ l(t, { className: "size-3.5 shrink-0 text-muted-foreground" })]
|
|
42
43
|
})
|
|
43
44
|
})]
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
export {
|
|
47
|
+
export { d as CycleSwitcher };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/lib/cycleLinks.ts
|
|
2
|
+
var e = (e) => e.replaceAll("-", "").slice(-8).toLowerCase(), t = (t) => `${t.number}~${e(t.id)}`;
|
|
3
|
+
function n(t, n) {
|
|
4
|
+
let [r, i] = n.split("~");
|
|
5
|
+
if (i) {
|
|
6
|
+
let n = t.find((t) => e(t.id) === i.toLowerCase());
|
|
7
|
+
if (n) return n;
|
|
8
|
+
}
|
|
9
|
+
return t.find((e) => String(e.number) === r);
|
|
10
|
+
}
|
|
11
|
+
export { t as cycleParam, n as findCycle };
|
package/lib/cycleSwitcher.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// src/lib/cycleSwitcher.ts
|
|
2
|
-
function e(e, t, n, r) {
|
|
3
|
-
let
|
|
4
|
-
for (let
|
|
5
|
-
label:
|
|
2
|
+
function e(e, t, n, r, i) {
|
|
3
|
+
let a = [], o = "";
|
|
4
|
+
for (let s of e) (s.state !== o || a.length === 0) && (a.push({
|
|
5
|
+
label: i(s.state),
|
|
6
6
|
items: []
|
|
7
|
-
}),
|
|
8
|
-
value:
|
|
9
|
-
label:
|
|
10
|
-
hint:
|
|
7
|
+
}), o = s.state), a[a.length - 1]?.items.push({
|
|
8
|
+
value: t(s),
|
|
9
|
+
label: n(s),
|
|
10
|
+
hint: r(s)
|
|
11
11
|
});
|
|
12
|
-
return
|
|
12
|
+
return a;
|
|
13
13
|
}
|
|
14
14
|
export { e as cycleChoices };
|
package/package.json
CHANGED
package/pages/issues.js
CHANGED
|
@@ -325,8 +325,8 @@ function Mt({ person: e } = {}) {
|
|
|
325
325
|
x.label && e.test(x.label) && n && (t.label = n.name);
|
|
326
326
|
let r = ir?.find((e) => e.id === x.project);
|
|
327
327
|
x.project && e.test(x.project) && r && (t.project = _e(r));
|
|
328
|
-
let i = ar?.find((e) => e.
|
|
329
|
-
|
|
328
|
+
let i = ar?.find((e) => String(e.number) === x.cycle);
|
|
329
|
+
i && (t.cycle = i.id), x.saved && e.test(x.saved) && Q && (t.saved = De(Q)), JSON.stringify(t) !== JSON.stringify(x) && zt.current(t);
|
|
330
330
|
}, [
|
|
331
331
|
x,
|
|
332
332
|
rr,
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../../../../../api/client.js";
|
|
2
2
|
import { NotFound as n } from "../../../../../components/status.js";
|
|
3
|
-
import { usePageTitle as
|
|
4
|
-
import { useNavigate as
|
|
5
|
-
import { cyclesQuery as
|
|
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 ee, teamsQuery as o } from "../../../../../api/queries.js";
|
|
6
6
|
import { invalidateIssueViews as s } from "../../../../../api/mutations.js";
|
|
7
|
-
import { CloseIcon as
|
|
8
|
-
import { addDays as
|
|
9
|
-
import { ProgressBar as
|
|
10
|
-
import { useCan as
|
|
11
|
-
import { teamPath as
|
|
12
|
-
import { Route as
|
|
13
|
-
import { FavoriteStar as
|
|
14
|
-
import { BurnUp as
|
|
15
|
-
import { IssueBreakdown as
|
|
16
|
-
import { StatusGroups as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
7
|
+
import { CloseIcon as te, CycleIcon as ne } from "../../../../../components/icons.js";
|
|
8
|
+
import { addDays as re, today as c, useTime as l } from "../../../../../lib/time.js";
|
|
9
|
+
import { ProgressBar as ie } from "../../../../../components/Planning.js";
|
|
10
|
+
import { useCan as u } from "../../../../../lib/roles.js";
|
|
11
|
+
import { teamPath as d } from "../../../../../lib/teamPaths.js";
|
|
12
|
+
import { Route as f } from "./_number.js";
|
|
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";
|
|
19
|
+
import { Button as g, Card as _, EmptyState as v, ErrorText as y, IconButton as b, PageHeader as x } from "@parallelworks/ui";
|
|
19
20
|
import { useState as S } from "react";
|
|
20
21
|
import { useErrorMessage as C } from "@parallelworks/problem/react";
|
|
21
22
|
import { useTranslations as w } from "use-intl";
|
|
@@ -29,48 +30,48 @@ var M = [
|
|
|
29
30
|
"projects"
|
|
30
31
|
];
|
|
31
32
|
function N() {
|
|
32
|
-
let { workspace: N, key: P, number: F } =
|
|
33
|
-
|
|
34
|
-
number:
|
|
35
|
-
name:
|
|
36
|
-
}) : I("cycle", { number:
|
|
37
|
-
let
|
|
38
|
-
...
|
|
39
|
-
enabled: !!
|
|
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
|
|
40
41
|
}), X = O({
|
|
41
42
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/cycles/{number}/move-unfinished", { params: { path: {
|
|
42
43
|
workspace: N,
|
|
43
44
|
key: P,
|
|
44
|
-
number:
|
|
45
|
+
number: H?.number ?? 0
|
|
45
46
|
} } })),
|
|
46
|
-
onSuccess: (e) =>
|
|
47
|
-
onSettled: () => s(
|
|
47
|
+
onSuccess: (e) => de(e.moved),
|
|
48
|
+
onSettled: () => s(ue, N)
|
|
48
49
|
});
|
|
49
|
-
if (!
|
|
50
|
-
let Z =
|
|
51
|
-
number:
|
|
52
|
-
name:
|
|
53
|
-
}) : I("cycle", { number:
|
|
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 });
|
|
54
55
|
return /* @__PURE__ */ D("div", {
|
|
55
56
|
className: "flex h-full min-h-0 flex-col",
|
|
56
57
|
children: [/* @__PURE__ */ E(x, {
|
|
57
58
|
heading: !1,
|
|
58
59
|
breadcrumbs: [{
|
|
59
|
-
label:
|
|
60
|
-
href:
|
|
60
|
+
label: U?.name ?? P,
|
|
61
|
+
href: d(N, P, "issues")
|
|
61
62
|
}, {
|
|
62
63
|
label: I("cycles"),
|
|
63
|
-
href:
|
|
64
|
+
href: d(N, P, "cycles")
|
|
64
65
|
}],
|
|
65
|
-
titleActions: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(
|
|
66
|
+
titleActions: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(h, {
|
|
66
67
|
workspace: N,
|
|
67
68
|
teamKey: P,
|
|
68
|
-
cycles:
|
|
69
|
-
cycle:
|
|
70
|
-
}), /* @__PURE__ */ E(
|
|
69
|
+
cycles: V,
|
|
70
|
+
cycle: H
|
|
71
|
+
}), /* @__PURE__ */ E(p, {
|
|
71
72
|
workspace: N,
|
|
72
73
|
kind: "cycle",
|
|
73
|
-
target:
|
|
74
|
+
target: H.id
|
|
74
75
|
})] })
|
|
75
76
|
}), /* @__PURE__ */ D("div", {
|
|
76
77
|
className: "flex min-h-0 flex-1 flex-col overflow-y-auto xl:flex-row xl:overflow-hidden",
|
|
@@ -80,28 +81,28 @@ function N() {
|
|
|
80
81
|
/* @__PURE__ */ D("div", {
|
|
81
82
|
className: "flex flex-wrap items-center gap-3",
|
|
82
83
|
children: [
|
|
83
|
-
/* @__PURE__ */ E(
|
|
84
|
+
/* @__PURE__ */ E(ne, { className: `size-5 shrink-0 ${H.state === "current" ? "text-status-started" : "text-muted-foreground"}` }),
|
|
84
85
|
/* @__PURE__ */ E("h1", {
|
|
85
86
|
className: "text-xl font-semibold tracking-tight",
|
|
86
|
-
children:
|
|
87
|
+
children: me
|
|
87
88
|
}),
|
|
88
89
|
/* @__PURE__ */ E("span", {
|
|
89
90
|
className: "rounded-md border border-border px-1.5 py-0.5 text-xs text-muted-foreground",
|
|
90
|
-
children: I(`states.${
|
|
91
|
+
children: I(`states.${H.state}`)
|
|
91
92
|
}),
|
|
92
93
|
/* @__PURE__ */ E("span", {
|
|
93
94
|
className: "text-sm text-muted-foreground",
|
|
94
|
-
children:
|
|
95
|
+
children: R.dayRange(H.startsOn, H.endsOn)
|
|
95
96
|
}),
|
|
96
|
-
|
|
97
|
+
H.carriedIn > 0 && /* @__PURE__ */ E("span", {
|
|
97
98
|
className: "text-sm text-muted-foreground",
|
|
98
|
-
children: I("carriedIn", { count:
|
|
99
|
+
children: I("carriedIn", { count: H.carriedIn })
|
|
99
100
|
}),
|
|
100
|
-
|
|
101
|
+
H.carriedOut > 0 && /* @__PURE__ */ E("span", {
|
|
101
102
|
className: "text-sm text-muted-foreground",
|
|
102
|
-
children: I("carriedOut", { count:
|
|
103
|
+
children: I("carriedOut", { count: H.carriedOut })
|
|
103
104
|
}),
|
|
104
|
-
|
|
105
|
+
W && $ > 0 && pe && /* @__PURE__ */ E(g, {
|
|
105
106
|
type: "button",
|
|
106
107
|
onClick: () => X.mutate(),
|
|
107
108
|
loading: X.isPending,
|
|
@@ -113,7 +114,7 @@ function N() {
|
|
|
113
114
|
X.isError && /* @__PURE__ */ E(y, {
|
|
114
115
|
size: "md",
|
|
115
116
|
className: "mt-2",
|
|
116
|
-
children:
|
|
117
|
+
children: L(X.error)
|
|
117
118
|
}),
|
|
118
119
|
G !== null && X.data && /* @__PURE__ */ D("p", {
|
|
119
120
|
className: "mt-2 text-sm text-muted-foreground",
|
|
@@ -124,12 +125,12 @@ function N() {
|
|
|
124
125
|
/* @__PURE__ */ E("button", {
|
|
125
126
|
type: "button",
|
|
126
127
|
className: "text-primary hover:underline",
|
|
127
|
-
onClick: () =>
|
|
128
|
+
onClick: () => z({
|
|
128
129
|
to: "/$workspace/teams/$key/cycles/$number",
|
|
129
130
|
params: {
|
|
130
131
|
workspace: N,
|
|
131
132
|
key: P,
|
|
132
|
-
number:
|
|
133
|
+
number: ce(X.data.cycle)
|
|
133
134
|
}
|
|
134
135
|
}),
|
|
135
136
|
children: I("openCycle", { number: X.data.cycle.number })
|
|
@@ -139,19 +140,19 @@ function N() {
|
|
|
139
140
|
/* @__PURE__ */ E("section", {
|
|
140
141
|
className: "mt-6",
|
|
141
142
|
"aria-label": I("progressTitle"),
|
|
142
|
-
children: /* @__PURE__ */ E(
|
|
143
|
+
children: /* @__PURE__ */ E(ie, { progress: H.progress })
|
|
143
144
|
}),
|
|
144
145
|
/* @__PURE__ */ E("section", {
|
|
145
146
|
className: "mt-6 rounded-xl border border-border bg-card p-4",
|
|
146
|
-
children: /* @__PURE__ */ E(
|
|
147
|
+
children: /* @__PURE__ */ E(ae, {
|
|
147
148
|
workspace: N,
|
|
148
149
|
teamKey: P,
|
|
149
|
-
cycle:
|
|
150
|
+
cycle: H
|
|
150
151
|
})
|
|
151
152
|
}),
|
|
152
153
|
Z.length > 0 && /* @__PURE__ */ E("div", {
|
|
153
154
|
className: "mt-8 xl:hidden",
|
|
154
|
-
children: /* @__PURE__ */ E(
|
|
155
|
+
children: /* @__PURE__ */ E(m, {
|
|
155
156
|
workspace: N,
|
|
156
157
|
issues: Z,
|
|
157
158
|
tabs: M,
|
|
@@ -170,14 +171,14 @@ function N() {
|
|
|
170
171
|
size: "sm",
|
|
171
172
|
variant: "ghost",
|
|
172
173
|
label: I("issueBreakdown.showAll"),
|
|
173
|
-
icon: /* @__PURE__ */ E(
|
|
174
|
+
icon: /* @__PURE__ */ E(te, {}),
|
|
174
175
|
onClick: () => Y(null)
|
|
175
176
|
})]
|
|
176
|
-
}), Q.length === 0 ? /* @__PURE__ */ E(v, { title: I("noIssuesInCycle") }) : /* @__PURE__ */ E(
|
|
177
|
+
}), Q.length === 0 ? /* @__PURE__ */ E(v, { title: I("noIssuesInCycle") }) : /* @__PURE__ */ E(_, {
|
|
177
178
|
size: "fill",
|
|
178
179
|
padding: "none",
|
|
179
180
|
className: "overflow-hidden",
|
|
180
|
-
children: /* @__PURE__ */ E(
|
|
181
|
+
children: /* @__PURE__ */ E(se, {
|
|
181
182
|
workspace: N,
|
|
182
183
|
issues: Q
|
|
183
184
|
})
|
|
@@ -187,7 +188,7 @@ function N() {
|
|
|
187
188
|
}), Z.length > 0 && /* @__PURE__ */ E("aside", {
|
|
188
189
|
"aria-label": I("issueBreakdown.label"),
|
|
189
190
|
className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-6 xl:block",
|
|
190
|
-
children: /* @__PURE__ */ E(
|
|
191
|
+
children: /* @__PURE__ */ E(m, {
|
|
191
192
|
workspace: N,
|
|
192
193
|
issues: Z,
|
|
193
194
|
tabs: M,
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { redirect as e } from "../../../../../lib/router.js";
|
|
2
|
+
import { cyclesQuery as t, issuesQuery as n } from "../../../../../api/queries.js";
|
|
3
|
+
import { cycleParam as r, findCycle as i } from "../../../../../lib/cycleLinks.js";
|
|
2
4
|
// src/routes/$workspace/teams/$key/cycles/$number.tsx?tsr-split=loader
|
|
3
|
-
var
|
|
4
|
-
let o =
|
|
5
|
-
|
|
5
|
+
var a = async ({ context: { queryClient: a }, params: o }) => {
|
|
6
|
+
let { workspace: s, key: c, number: l } = o, u = await a.ensureQueryData(t(s, c)), d = i(u, l);
|
|
7
|
+
if (d && l !== r(d)) throw e({
|
|
8
|
+
to: "/$workspace/teams/$key/cycles/$number",
|
|
9
|
+
params: {
|
|
10
|
+
...o,
|
|
11
|
+
number: r(d)
|
|
12
|
+
},
|
|
13
|
+
replace: !0
|
|
14
|
+
});
|
|
15
|
+
d && await a.ensureQueryData(n(s, { cycle: d.id }));
|
|
6
16
|
};
|
|
7
|
-
export {
|
|
17
|
+
export { a as loader };
|
|
@@ -8,25 +8,26 @@ import { useCan as l } from "../../../../../lib/roles.js";
|
|
|
8
8
|
import { teamPath as u } from "../../../../../lib/teamPaths.js";
|
|
9
9
|
import { Route as d } from "./index.js";
|
|
10
10
|
import { BurnUp as f } from "../../../../../components/Reports.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
11
|
+
import { cycleParam as p } from "../../../../../lib/cycleLinks.js";
|
|
12
|
+
import { byStart as m } from "../../../../../lib/cycleOrder.js";
|
|
13
|
+
import { Button as h, EmptyState as g, ErrorText as _, PageHeader as v, StatusBadge as y } from "@parallelworks/ui";
|
|
14
|
+
import { useState as b } from "react";
|
|
15
|
+
import { useErrorMessage as x } from "@parallelworks/problem/react";
|
|
16
|
+
import { useFormatter as S, useTranslations as C } from "use-intl";
|
|
17
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
18
|
+
import { useMutation as D, useQueryClient as O, useSuspenseQuery as k } from "@tanstack/react-query";
|
|
18
19
|
// src/routes/$workspace/teams/$key/cycles/index.tsx?tsr-split=component
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
let t = e.filter((e) => e.state === "past").sort(
|
|
20
|
+
var A = 5, j = (e) => e.progress.total + e.carriedOut;
|
|
21
|
+
function M(e) {
|
|
22
|
+
let t = e.filter((e) => e.state === "past").sort(m).slice(-3);
|
|
22
23
|
if (t.length === 0) return null;
|
|
23
24
|
let n = t.reduce((e, t) => e + t.progress.completed, 0) / t.length;
|
|
24
25
|
return n > 0 ? n : null;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
let { workspace: c, key: f } = d.useParams(),
|
|
28
|
-
n(
|
|
29
|
-
let F = l(c, "manage_cycles", { team: f }), I =
|
|
27
|
+
function N() {
|
|
28
|
+
let { workspace: c, key: f } = d.useParams(), p = C("planning"), y = x(), { data: S } = k(a(c)), { data: j } = k(i(c, f)), N = S.find((e) => e.key === f);
|
|
29
|
+
n(p("cycles"), N?.name);
|
|
30
|
+
let F = l(c, "manage_cycles", { team: f }), I = O(), [L, R] = b(!1), z = D({
|
|
30
31
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/cycles", {
|
|
31
32
|
params: { path: {
|
|
32
33
|
workspace: c,
|
|
@@ -35,69 +36,69 @@ function M() {
|
|
|
35
36
|
body: {}
|
|
36
37
|
})),
|
|
37
38
|
onSettled: () => I.invalidateQueries({ queryKey: i(c, f).queryKey })
|
|
38
|
-
}), B = [...
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
}), B = [...j].sort(m), V = B.filter((e) => e.state === "past"), H = L ? 0 : Math.max(0, V.length - A), U = B.filter((e) => e.state !== "past" || V.indexOf(e) >= H), W = M(j);
|
|
40
|
+
return /* @__PURE__ */ E("div", {
|
|
40
41
|
className: "flex h-full min-h-0 flex-col",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ T(v, {
|
|
42
43
|
heading: !1,
|
|
43
44
|
breadcrumbs: [{
|
|
44
|
-
label:
|
|
45
|
+
label: N?.name ?? f,
|
|
45
46
|
href: u(c, f, "issues")
|
|
46
|
-
}, { label:
|
|
47
|
-
}), /* @__PURE__ */
|
|
47
|
+
}, { label: p("cycles") }]
|
|
48
|
+
}), /* @__PURE__ */ T("div", {
|
|
48
49
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ E("div", {
|
|
50
51
|
className: "w-full px-4 py-6 md:px-8 md:py-8",
|
|
51
52
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ E("div", {
|
|
53
54
|
className: "flex items-center gap-3",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ T("div", {
|
|
55
56
|
className: "min-w-0",
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ T("h1", {
|
|
57
58
|
className: "text-xl font-semibold tracking-tight",
|
|
58
|
-
children:
|
|
59
|
+
children: p("cycles")
|
|
59
60
|
})
|
|
60
|
-
}), F &&
|
|
61
|
+
}), F && N?.cyclesEnabled && /* @__PURE__ */ E(h, {
|
|
61
62
|
type: "button",
|
|
62
63
|
onClick: () => z.mutate(),
|
|
63
64
|
loading: z.isPending,
|
|
64
65
|
className: "ml-auto",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ T(o, { className: "size-3.5" }), p("newCycle")]
|
|
66
67
|
})]
|
|
67
68
|
}),
|
|
68
|
-
z.isError && /* @__PURE__ */
|
|
69
|
+
z.isError && /* @__PURE__ */ T(_, {
|
|
69
70
|
size: "md",
|
|
70
71
|
className: "mt-2",
|
|
71
|
-
children:
|
|
72
|
+
children: y(z.error)
|
|
72
73
|
}),
|
|
73
|
-
!
|
|
74
|
+
!N?.cyclesEnabled && j.length === 0 ? /* @__PURE__ */ T("div", {
|
|
74
75
|
className: "mt-8",
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
-
icon: /* @__PURE__ */
|
|
77
|
-
title:
|
|
78
|
-
description:
|
|
79
|
-
action: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ T(g, {
|
|
77
|
+
icon: /* @__PURE__ */ T(s, {}),
|
|
78
|
+
title: p("cyclesOff"),
|
|
79
|
+
description: p("cyclesOffDescription"),
|
|
80
|
+
action: /* @__PURE__ */ T(r, {
|
|
80
81
|
to: "/$workspace/teams/$key/settings",
|
|
81
82
|
params: {
|
|
82
83
|
workspace: c,
|
|
83
84
|
key: f
|
|
84
85
|
},
|
|
85
86
|
className: "text-sm text-primary hover:underline",
|
|
86
|
-
children:
|
|
87
|
+
children: p("teamSettings")
|
|
87
88
|
})
|
|
88
89
|
})
|
|
89
|
-
}) : /* @__PURE__ */
|
|
90
|
+
}) : /* @__PURE__ */ E(w, { children: [V.length > A && /* @__PURE__ */ T("div", {
|
|
90
91
|
className: "mt-4 flex justify-center",
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
+
children: /* @__PURE__ */ T(h, {
|
|
92
93
|
type: "button",
|
|
93
94
|
variant: "ghost",
|
|
94
95
|
size: "sm",
|
|
95
96
|
onClick: () => R(!L),
|
|
96
|
-
children: L ?
|
|
97
|
+
children: L ? p("fewerCycles") : p("olderCycles", { count: V.length - A })
|
|
97
98
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
99
|
+
}), /* @__PURE__ */ T("ol", {
|
|
99
100
|
className: "relative mt-6",
|
|
100
|
-
children: U.map((e, t) => /* @__PURE__ */
|
|
101
|
+
children: U.map((e, t) => /* @__PURE__ */ T(P, {
|
|
101
102
|
workspace: c,
|
|
102
103
|
teamKey: f,
|
|
103
104
|
cycle: e,
|
|
@@ -111,81 +112,81 @@ function M() {
|
|
|
111
112
|
})]
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
let l =
|
|
115
|
+
function P({ workspace: e, teamKey: t, cycle: n, capacity: i, first: a, last: o }) {
|
|
116
|
+
let l = C("planning"), u = c(), d = S(), m = n.state === "current", h = (e) => d.number(e, {
|
|
116
117
|
style: "percent",
|
|
117
118
|
maximumFractionDigits: 0
|
|
118
|
-
}),
|
|
119
|
-
...
|
|
119
|
+
}), g = n.state === "past" ? j(n) : n.progress.total, _ = i !== null && n.state !== "past" && g > i, v = n.state === "past" ? [
|
|
120
|
+
...g > 0 ? [l("success", { percent: h(n.progress.completed / g) })] : [],
|
|
120
121
|
l("completedCount", { count: n.progress.completed }),
|
|
121
|
-
l("scopeCount", { count:
|
|
122
|
+
l("scopeCount", { count: g }),
|
|
122
123
|
...n.carriedOut > 0 ? [l("carriedOut", { count: n.carriedOut })] : []
|
|
123
124
|
] : [
|
|
124
|
-
...i ? [l("ofCapacity", { percent:
|
|
125
|
-
l("scopeCount", { count:
|
|
125
|
+
...i ? [l("ofCapacity", { percent: h(g / i) })] : [],
|
|
126
|
+
l("scopeCount", { count: g }),
|
|
126
127
|
...n.carriedIn > 0 ? [l("carriedIn", { count: n.carriedIn })] : []
|
|
127
128
|
];
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ E("li", {
|
|
129
130
|
className: "grid grid-cols-[3.5rem_1fr] gap-x-3 md:grid-cols-[4.5rem_1fr] md:gap-x-4",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ E("div", {
|
|
131
132
|
className: "relative",
|
|
132
133
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ T("span", {
|
|
134
135
|
className: "absolute top-4 right-5 text-right text-xs leading-tight text-muted-foreground tabular-nums",
|
|
135
136
|
children: u.day(n.startsOn)
|
|
136
137
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ T("span", {
|
|
138
139
|
"aria-hidden": "true",
|
|
139
|
-
className: `absolute right-[7px] w-px ${a ? "top-6" : "top-0"} ${o ? "h-6" : "bottom-0"} ${a && o ? "hidden" : ""} ${
|
|
140
|
+
className: `absolute right-[7px] w-px ${a ? "top-6" : "top-0"} ${o ? "h-6" : "bottom-0"} ${a && o ? "hidden" : ""} ${m ? "bg-primary" : "bg-border"}`
|
|
140
141
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ T("span", {
|
|
142
143
|
"aria-hidden": "true",
|
|
143
|
-
className: `absolute top-[18px] right-0.5 size-[11px] rounded-full border-2 ${
|
|
144
|
+
className: `absolute top-[18px] right-0.5 size-[11px] rounded-full border-2 ${m ? "border-primary bg-primary" : n.state === "past" ? "border-muted-foreground bg-muted-foreground" : "border-border bg-background"}`
|
|
144
145
|
})
|
|
145
146
|
]
|
|
146
|
-
}), /* @__PURE__ */
|
|
147
|
-
className: `min-w-0 border-b border-border ${
|
|
148
|
-
children: [/* @__PURE__ */
|
|
147
|
+
}), /* @__PURE__ */ E("div", {
|
|
148
|
+
className: `min-w-0 border-b border-border ${m ? "rounded-xl bg-muted/50" : ""}`,
|
|
149
|
+
children: [/* @__PURE__ */ E(r, {
|
|
149
150
|
to: "/$workspace/teams/$key/cycles/$number",
|
|
150
151
|
params: {
|
|
151
152
|
workspace: e,
|
|
152
153
|
key: t,
|
|
153
|
-
number:
|
|
154
|
+
number: p(n)
|
|
154
155
|
},
|
|
155
156
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-xl px-3 py-3.5 hover:bg-muted/60",
|
|
156
157
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ E("span", {
|
|
158
159
|
className: "flex min-w-0 flex-1 basis-full items-center gap-2 md:basis-auto",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ T(s, { className: `size-4 shrink-0 ${m ? "text-primary" : "text-muted-foreground"}` }), /* @__PURE__ */ E("span", {
|
|
160
161
|
className: "min-w-0",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ T("span", {
|
|
162
163
|
className: "block truncate text-sm font-medium",
|
|
163
164
|
children: n.name ? l("cycleNamed", {
|
|
164
165
|
number: n.number,
|
|
165
166
|
name: n.name
|
|
166
167
|
}) : l("cycle", { number: n.number })
|
|
167
|
-
}), /* @__PURE__ */
|
|
168
|
+
}), /* @__PURE__ */ T("span", {
|
|
168
169
|
className: "block text-xs text-muted-foreground",
|
|
169
170
|
children: u.dayRange(n.startsOn, n.endsOn)
|
|
170
171
|
})]
|
|
171
172
|
})]
|
|
172
173
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
variant:
|
|
174
|
+
/* @__PURE__ */ T(y, {
|
|
175
|
+
variant: m ? "info" : "muted",
|
|
175
176
|
size: "sm",
|
|
176
177
|
children: l(`states.${n.state}`)
|
|
177
178
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ T("span", {
|
|
179
180
|
className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums",
|
|
180
|
-
children:
|
|
181
|
-
className:
|
|
181
|
+
children: v.map((e, t) => /* @__PURE__ */ T("span", {
|
|
182
|
+
className: _ && t === 0 ? "font-medium text-warning" : void 0,
|
|
182
183
|
children: e
|
|
183
184
|
}, e))
|
|
184
185
|
})
|
|
185
186
|
]
|
|
186
|
-
}),
|
|
187
|
+
}), m && /* @__PURE__ */ T("div", {
|
|
187
188
|
className: "px-3 pb-4",
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ T(f, {
|
|
189
190
|
workspace: e,
|
|
190
191
|
teamKey: t,
|
|
191
192
|
cycle: n
|
|
@@ -194,4 +195,4 @@ function N({ workspace: e, teamKey: t, cycle: n, capacity: i, first: a, last: o
|
|
|
194
195
|
})]
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
|
-
export {
|
|
198
|
+
export { N as component };
|