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