@parallelworks/tandem-web 0.169.1 → 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/_virtual/_virtual_i18n/en/common.js +5 -0
- package/_virtual/_virtual_i18n/es/common.js +5 -0
- package/_virtual/_virtual_i18n/ja/common.js +5 -0
- package/_virtual/_virtual_i18n/ko/common.js +5 -0
- package/_virtual/_virtual_i18n/zh/common.js +5 -0
- package/components/ActorAvatar.js +14 -14
- 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 +2 -2
- package/pages/issues.js +2 -2
- package/routes/_workspace/settings/runners2.js +87 -69
- 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
|
@@ -143,6 +143,10 @@ var e = {
|
|
|
143
143
|
runnerSeen: "seen {seen}",
|
|
144
144
|
runnerNeverConnected: "never connected",
|
|
145
145
|
runnerSharedWith: "shared with {group}",
|
|
146
|
+
runnerSharingRefused: "{count, plural, one {{names} is shared, but only platform admins can share runners here, so it takes no runs. A platform admin can register it again as shared, or revoke it.} other {{names} are shared, but only platform admins can share runners here, so they take no runs. A platform admin can register them again as shared, or revoke them.}}",
|
|
147
|
+
runnerNotTakingRuns: "not taking runs",
|
|
148
|
+
runnerSharingUnchecked: "{count, plural, one {Couldn't check sharing permission for {names}, so it takes no runs for now. Reload to try again.} other {Couldn't check sharing permission for {names}, so they take no runs for now. Reload to try again.}}",
|
|
149
|
+
runnerSharingUnknown: "sharing permission unknown",
|
|
146
150
|
runnerModeDefault: "agents ask first",
|
|
147
151
|
runnerModeAcceptEdits: "agents may accept edits",
|
|
148
152
|
runnerModeAuto: "agents may decide with a reviewer",
|
|
@@ -1100,6 +1104,7 @@ var e = {
|
|
|
1100
1104
|
apiErrors: {
|
|
1101
1105
|
network: "Could not reach the server. Check your connection and try again.",
|
|
1102
1106
|
compute_admin_required: "Only platform admins can see and turn on compute for agents.",
|
|
1107
|
+
runner_share_admin_required: "Only platform admins can share runners here.",
|
|
1103
1108
|
conflict: "This changed since you loaded it. Reload and try again.",
|
|
1104
1109
|
device_code_invalid: "That code is unknown, expired or already used.",
|
|
1105
1110
|
insufficient_scope: "This app can only read Tandem. Sign in to it again and allow it to make changes.",
|
|
@@ -143,6 +143,10 @@ var e = {
|
|
|
143
143
|
runnerSeen: "visto {seen}",
|
|
144
144
|
runnerNeverConnected: "nunca se ha conectado",
|
|
145
145
|
runnerSharedWith: "compartido con {group}",
|
|
146
|
+
runnerSharingRefused: "{count, plural, one {{names} está compartido, pero aquí solo los administradores de la plataforma pueden compartir ejecutores, así que no toma ejecuciones. Un administrador de la plataforma puede registrarlo de nuevo como compartido, o revocarlo.} other {{names} están compartidos, pero aquí solo los administradores de la plataforma pueden compartir ejecutores, así que no toman ejecuciones. Un administrador de la plataforma puede registrarlos de nuevo como compartidos, o revocarlos.}}",
|
|
147
|
+
runnerNotTakingRuns: "no toma ejecuciones",
|
|
148
|
+
runnerSharingUnchecked: "{count, plural, one {No se pudo comprobar el permiso para compartir {names}, así que por ahora no toma ejecuciones. Recarga para intentarlo de nuevo.} other {No se pudo comprobar el permiso para compartir {names}, así que por ahora no toman ejecuciones. Recarga para intentarlo de nuevo.}}",
|
|
149
|
+
runnerSharingUnknown: "permiso para compartir desconocido",
|
|
146
150
|
runnerModeDefault: "los agentes preguntan primero",
|
|
147
151
|
runnerModeAcceptEdits: "los agentes pueden aceptar ediciones",
|
|
148
152
|
runnerModeAuto: "los agentes pueden decidir con un revisor",
|
|
@@ -1100,6 +1104,7 @@ var e = {
|
|
|
1100
1104
|
apiErrors: {
|
|
1101
1105
|
network: "No se pudo conectar con el servidor. Revisa tu conexión e inténtalo de nuevo.",
|
|
1102
1106
|
compute_admin_required: "Solo los administradores de la plataforma pueden ver y activar el cómputo para los agentes.",
|
|
1107
|
+
runner_share_admin_required: "Aquí solo los administradores de la plataforma pueden compartir ejecutores.",
|
|
1103
1108
|
conflict: "Esto cambió desde que lo cargaste. Recarga e inténtalo de nuevo.",
|
|
1104
1109
|
device_code_invalid: "Ese código no existe, ha caducado o ya se usó.",
|
|
1105
1110
|
insufficient_scope: "Esta app solo puede leer Tandem. Vuelve a iniciar sesión en ella y permite que haga cambios.",
|
|
@@ -143,6 +143,10 @@ var e = {
|
|
|
143
143
|
runnerSeen: "{seen}に確認",
|
|
144
144
|
runnerNeverConnected: "未接続",
|
|
145
145
|
runnerSharedWith: "{group} と共有",
|
|
146
|
+
runnerSharingRefused: "{count, plural, other {{names} は共有されていますが、ここではプラットフォーム管理者だけがランナーを共有できるため、実行を引き受けません。プラットフォーム管理者が共有ランナーとして登録し直すか、取り消してください。}}",
|
|
147
|
+
runnerNotTakingRuns: "実行を引き受けていません",
|
|
148
|
+
runnerSharingUnchecked: "{count, plural, other {{names} の共有権限を確認できなかったため、現在は実行を引き受けません。再読み込みしてもう一度お試しください。}}",
|
|
149
|
+
runnerSharingUnknown: "共有権限が不明",
|
|
146
150
|
runnerModeDefault: "エージェントは先に確認",
|
|
147
151
|
runnerModeAcceptEdits: "エージェントは編集を許可可能",
|
|
148
152
|
runnerModeAuto: "エージェントはレビュアーと判断可能",
|
|
@@ -1100,6 +1104,7 @@ var e = {
|
|
|
1100
1104
|
apiErrors: {
|
|
1101
1105
|
network: "サーバーに接続できませんでした。接続を確認して、もう一度お試しください。",
|
|
1102
1106
|
compute_admin_required: "エージェント用のコンピュートを表示・有効化できるのはプラットフォーム管理者だけです。",
|
|
1107
|
+
runner_share_admin_required: "ここでランナーを共有できるのはプラットフォーム管理者だけです。",
|
|
1103
1108
|
conflict: "読み込んだ後に変更されています。再読み込みして、もう一度お試しください。",
|
|
1104
1109
|
device_code_invalid: "このコードは不明、期限切れ、または使用済みです。",
|
|
1105
1110
|
insufficient_scope: "このアプリは Tandem の読み取りのみ許可されています。もう一度サインインし、変更を許可してください。",
|
|
@@ -143,6 +143,10 @@ var e = {
|
|
|
143
143
|
runnerSeen: "{seen} 확인됨",
|
|
144
144
|
runnerNeverConnected: "연결된 적 없음",
|
|
145
145
|
runnerSharedWith: "{group}과(와) 공유됨",
|
|
146
|
+
runnerSharingRefused: "{count, plural, other {{names}은(는) 공유되어 있지만 여기서는 플랫폼 관리자만 러너를 공유할 수 있어 실행을 맡지 않습니다. 플랫폼 관리자가 공유 러너로 다시 등록하거나 취소할 수 있습니다.}}",
|
|
147
|
+
runnerNotTakingRuns: "실행을 맡지 않음",
|
|
148
|
+
runnerSharingUnchecked: "{count, plural, other {{names}의 공유 권한을 확인할 수 없어 지금은 실행을 맡지 않습니다. 새로고침해 다시 시도하세요.}}",
|
|
149
|
+
runnerSharingUnknown: "공유 권한 알 수 없음",
|
|
146
150
|
runnerModeDefault: "에이전트가 먼저 물음",
|
|
147
151
|
runnerModeAcceptEdits: "에이전트가 편집 허용 가능",
|
|
148
152
|
runnerModeAuto: "에이전트가 검토자와 결정 가능",
|
|
@@ -1100,6 +1104,7 @@ var e = {
|
|
|
1100
1104
|
apiErrors: {
|
|
1101
1105
|
network: "서버에 연결할 수 없습니다. 연결 상태를 확인하고 다시 시도하세요.",
|
|
1102
1106
|
compute_admin_required: "에이전트용 컴퓨트는 플랫폼 관리자만 보고 켤 수 있습니다.",
|
|
1107
|
+
runner_share_admin_required: "여기서는 플랫폼 관리자만 러너를 공유할 수 있습니다.",
|
|
1103
1108
|
conflict: "불러온 뒤 내용이 변경되었습니다. 새로 고친 후 다시 시도하세요.",
|
|
1104
1109
|
device_code_invalid: "알 수 없거나 만료되었거나 이미 사용된 코드입니다.",
|
|
1105
1110
|
insufficient_scope: "이 앱은 Tandem을 읽기만 할 수 있습니다. 앱에 다시 로그인하고 변경을 허용하세요.",
|
|
@@ -143,6 +143,10 @@ var e = {
|
|
|
143
143
|
runnerSeen: "{seen}在线",
|
|
144
144
|
runnerNeverConnected: "从未连接",
|
|
145
145
|
runnerSharedWith: "已与 {group} 共享",
|
|
146
|
+
runnerSharingRefused: "{count, plural, other {{names} 已共享,但此处只有平台管理员可以共享运行器,因此它不会接收运行。平台管理员可以将其重新注册为共享运行器,或将其撤销。}}",
|
|
147
|
+
runnerNotTakingRuns: "不接收运行",
|
|
148
|
+
runnerSharingUnchecked: "{count, plural, other {无法检查 {names} 的共享权限,因此暂不接收运行。请刷新后重试。}}",
|
|
149
|
+
runnerSharingUnknown: "共享权限未知",
|
|
146
150
|
runnerModeDefault: "代理先询问",
|
|
147
151
|
runnerModeAcceptEdits: "代理可接受编辑",
|
|
148
152
|
runnerModeAuto: "代理可由审查者代为决定",
|
|
@@ -1100,6 +1104,7 @@ var e = {
|
|
|
1100
1104
|
apiErrors: {
|
|
1101
1105
|
network: "无法连接到服务器。请检查网络连接后重试。",
|
|
1102
1106
|
compute_admin_required: "只有平台管理员可以查看并为代理启用计算资源。",
|
|
1107
|
+
runner_share_admin_required: "此处只有平台管理员可以共享运行器。",
|
|
1103
1108
|
conflict: "加载后此内容已被更改。请重新加载后重试。",
|
|
1104
1109
|
device_code_invalid: "该代码无效、已过期或已被使用。",
|
|
1105
1110
|
insufficient_scope: "此应用只能读取 Tandem。请重新登录该应用,并允许它进行更改。",
|
|
@@ -5,25 +5,25 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
|
5
5
|
// src/components/ActorAvatar.tsx
|
|
6
6
|
function a({ actor: a, name: o, src: s, badge: c }) {
|
|
7
7
|
let l = a.kind === "connector" ? a.handle.split(":")[0] : void 0;
|
|
8
|
-
return /* @__PURE__ */ i("span", {
|
|
8
|
+
return l === "github" || l === "gitlab" ? /* @__PURE__ */ i("span", {
|
|
9
9
|
className: "relative flex",
|
|
10
|
-
children: [
|
|
11
|
-
className: "flex size-5 items-center justify-center rounded-full bg-muted text-foreground",
|
|
12
|
-
children: /* @__PURE__ */ r(e, {
|
|
13
|
-
provider: l,
|
|
14
|
-
className: "size-3.5"
|
|
15
|
-
})
|
|
16
|
-
}) : /* @__PURE__ */ r(n, {
|
|
10
|
+
children: [/* @__PURE__ */ r(n, {
|
|
17
11
|
name: o,
|
|
18
|
-
|
|
19
|
-
...t(a.kind),
|
|
12
|
+
colorClassName: "bg-muted text-transparent",
|
|
20
13
|
size: "sm",
|
|
14
|
+
badge: c,
|
|
21
15
|
decorative: !0
|
|
22
|
-
}),
|
|
23
|
-
|
|
24
|
-
className: "absolute -
|
|
25
|
-
children: c
|
|
16
|
+
}), /* @__PURE__ */ r(e, {
|
|
17
|
+
provider: l,
|
|
18
|
+
className: "pointer-events-none absolute top-0.75 left-0.75 size-3.5 text-foreground"
|
|
26
19
|
})]
|
|
20
|
+
}) : /* @__PURE__ */ r(n, {
|
|
21
|
+
name: o,
|
|
22
|
+
src: s,
|
|
23
|
+
...t(a.kind),
|
|
24
|
+
size: "sm",
|
|
25
|
+
badge: c,
|
|
26
|
+
decorative: !0
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
export { a as ActorAvatar };
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallelworks/tandem-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.170.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.
|
|
52
|
+
"@parallelworks/ui": ">=0.117.0 <1",
|
|
53
53
|
"@tanstack/react-router": "^1.170.0",
|
|
54
54
|
"react": "^19.3.0",
|
|
55
55
|
"react-dom": "^19.3.0",
|
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,
|
|
@@ -7,141 +7,159 @@ import { useConfirm as o } from "../../../lib/confirm.js";
|
|
|
7
7
|
import { SettingsPage as s } from "../../../components/settings.js";
|
|
8
8
|
import { Route as c } from "./runners.js";
|
|
9
9
|
import { ComputeTargets as l } from "../../../components/ComputeTargets.js";
|
|
10
|
-
import {
|
|
11
|
-
import { useMemo as
|
|
12
|
-
import { useFormatter as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { useMutation as
|
|
15
|
-
import { ListCellText as
|
|
10
|
+
import { Callout as u, StatusDot as d, Table as f, menuDivider as p, useOpenMenu as m } from "@parallelworks/ui";
|
|
11
|
+
import { useMemo as h } from "react";
|
|
12
|
+
import { useFormatter as g, useTranslations as _ } from "use-intl";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { useMutation as b, useQueryClient as x, useSuspenseQuery as S } from "@tanstack/react-query";
|
|
15
|
+
import { ListCellText as C, ListColumns as w, ListPage as T, ListRow as E, ListToolbar as D, NameCell as O, listTableProps as k, useListNavigate as A, useListSearch as j, useListView as M } from "@parallelworks/ui/list";
|
|
16
16
|
// src/routes/$workspace/settings/runners.tsx?tsr-split=component
|
|
17
|
-
var
|
|
17
|
+
var N = {
|
|
18
18
|
default: "runnerModeDefault",
|
|
19
19
|
"accept-edits": "runnerModeAcceptEdits",
|
|
20
20
|
auto: "runnerModeAuto",
|
|
21
21
|
bypass: "runnerModeBypass"
|
|
22
22
|
};
|
|
23
|
-
function
|
|
23
|
+
function P() {
|
|
24
24
|
let { workspace: e } = c.useParams();
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ v(F, { workspace: e });
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let { data:
|
|
27
|
+
function F({ workspace: c }) {
|
|
28
|
+
let { data: P } = S(n(c)), F = _("account"), I = g(), L = _("common"), R = a(), z = x(), B = j(), V = A(), H = m(), U = b({
|
|
29
29
|
mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
|
|
30
30
|
workspace: c,
|
|
31
31
|
runnerId: n
|
|
32
32
|
} } })),
|
|
33
|
-
onSettled: () =>
|
|
34
|
-
}), { confirm:
|
|
35
|
-
title:
|
|
36
|
-
description:
|
|
37
|
-
confirmLabel:
|
|
38
|
-
onConfirm: () =>
|
|
39
|
-
}),
|
|
33
|
+
onSettled: () => z.invalidateQueries({ queryKey: n(c).queryKey })
|
|
34
|
+
}), { confirm: W, dialog: G } = o(), K = (e) => W({
|
|
35
|
+
title: F("revokeRunnerTitle"),
|
|
36
|
+
description: F("revokeRunnerDescription", { name: e.name }),
|
|
37
|
+
confirmLabel: F("revoke"),
|
|
38
|
+
onConfirm: () => U.mutateAsync(e.id)
|
|
39
|
+
}), q = h(() => [{
|
|
40
40
|
key: "name",
|
|
41
|
-
label:
|
|
41
|
+
label: L("name"),
|
|
42
42
|
headerClassName: "py-2",
|
|
43
43
|
alwaysVisible: !0
|
|
44
44
|
}, {
|
|
45
45
|
key: "seen",
|
|
46
|
-
label:
|
|
46
|
+
label: F("runnerColSeen"),
|
|
47
47
|
headerClassName: "py-2 w-40",
|
|
48
48
|
align: "end"
|
|
49
|
-
}], [
|
|
49
|
+
}], [F, L]), J = h(() => [{
|
|
50
50
|
value: "name",
|
|
51
|
-
label:
|
|
51
|
+
label: L("name"),
|
|
52
52
|
compare: (e, t) => e.name.localeCompare(t.name)
|
|
53
53
|
}, {
|
|
54
54
|
value: "seen",
|
|
55
|
-
label:
|
|
55
|
+
label: F("runnerColSeen"),
|
|
56
56
|
compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
|
|
57
|
-
}], [
|
|
57
|
+
}], [F, L]), Y = M({
|
|
58
58
|
storageKey: `tandem-runners-${c}`,
|
|
59
59
|
defaultShowColumnHeaders: !1,
|
|
60
|
-
columns:
|
|
61
|
-
orderBys:
|
|
60
|
+
columns: q,
|
|
61
|
+
orderBys: J,
|
|
62
62
|
defaultOrderBy: "name",
|
|
63
63
|
facets: []
|
|
64
|
-
}),
|
|
64
|
+
}), X = B.filter.trim().toLowerCase(), Z = P.filter((e) => !X || [
|
|
65
65
|
e.name,
|
|
66
66
|
e.group ?? "",
|
|
67
67
|
...e.harnesses,
|
|
68
68
|
...e.labels
|
|
69
|
-
].some((e) => e.toLowerCase().includes(
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
].some((e) => e.toLowerCase().includes(X))), Q = P.filter((e) => e.sharingRefused), $ = P.filter((e) => e.sharingUnchecked);
|
|
70
|
+
return /* @__PURE__ */ y(s, {
|
|
71
71
|
wide: !0,
|
|
72
|
-
title:
|
|
73
|
-
description:
|
|
72
|
+
title: F("runners"),
|
|
73
|
+
description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */ v("code", {
|
|
74
74
|
className: "rounded bg-muted px-1 py-0.5 text-xs",
|
|
75
75
|
children: e
|
|
76
76
|
}) }),
|
|
77
|
-
toolbar:
|
|
78
|
-
view:
|
|
79
|
-
search:
|
|
80
|
-
searchLabel:
|
|
81
|
-
searchPlaceholder:
|
|
77
|
+
toolbar: P.length > 0 && /* @__PURE__ */ v(D, {
|
|
78
|
+
view: Y,
|
|
79
|
+
search: B,
|
|
80
|
+
searchLabel: F("runnerSearch"),
|
|
81
|
+
searchPlaceholder: F("runnerSearch")
|
|
82
82
|
}),
|
|
83
83
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
84
|
+
Q.length > 0 && /* @__PURE__ */ v(u, {
|
|
85
|
+
tone: "warning",
|
|
86
|
+
className: "mb-6",
|
|
87
|
+
children: F("runnerSharingRefused", {
|
|
88
|
+
count: Q.length,
|
|
89
|
+
names: I.list(Q.map((e) => e.name), { type: "conjunction" })
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
$.length > 0 && /* @__PURE__ */ v(u, {
|
|
93
|
+
tone: "muted",
|
|
94
|
+
className: "mb-6",
|
|
95
|
+
children: F("runnerSharingUnchecked", {
|
|
96
|
+
count: $.length,
|
|
97
|
+
names: I.list($.map((e) => e.name), { type: "conjunction" })
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ v("div", {
|
|
85
101
|
className: "border-t border-border",
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
view:
|
|
88
|
-
total:
|
|
89
|
-
matches:
|
|
102
|
+
children: /* @__PURE__ */ v(T, {
|
|
103
|
+
view: Y,
|
|
104
|
+
total: P.length,
|
|
105
|
+
matches: Z.length,
|
|
90
106
|
count: {
|
|
91
|
-
filterActive:
|
|
92
|
-
noun:
|
|
93
|
-
nounPlural:
|
|
107
|
+
filterActive: B.filter.trim() !== "",
|
|
108
|
+
noun: F("runnerNoun"),
|
|
109
|
+
nounPlural: F("runnerNounPlural")
|
|
94
110
|
},
|
|
95
111
|
empty: {
|
|
96
|
-
icon: /* @__PURE__ */
|
|
97
|
-
title:
|
|
112
|
+
icon: /* @__PURE__ */ v(i, {}),
|
|
113
|
+
title: F("noRunners")
|
|
98
114
|
},
|
|
99
|
-
noMatches:
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
-
...
|
|
102
|
-
children: [/* @__PURE__ */
|
|
115
|
+
noMatches: F("runnerNoMatches"),
|
|
116
|
+
children: /* @__PURE__ */ y(f, {
|
|
117
|
+
...k,
|
|
118
|
+
children: [/* @__PURE__ */ v(w, { view: Y }), Y.applyOrder(Z).map((e) => /* @__PURE__ */ y(E, {
|
|
103
119
|
href: null,
|
|
104
|
-
goTo:
|
|
105
|
-
openMenu:
|
|
120
|
+
goTo: V,
|
|
121
|
+
openMenu: H,
|
|
106
122
|
items: [
|
|
107
|
-
r(
|
|
108
|
-
r(
|
|
109
|
-
|
|
123
|
+
r(F("copyRunnerId"), e.id),
|
|
124
|
+
r(L("copyName"), e.name),
|
|
125
|
+
p,
|
|
110
126
|
{
|
|
111
|
-
label:
|
|
127
|
+
label: F("revoke"),
|
|
112
128
|
destructive: !0,
|
|
113
|
-
onClick: () =>
|
|
129
|
+
onClick: () => K(e)
|
|
114
130
|
}
|
|
115
131
|
],
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
-
icon: /* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ v(O, {
|
|
133
|
+
icon: /* @__PURE__ */ v(i, {}),
|
|
118
134
|
iconTile: !0,
|
|
119
135
|
name: e.name,
|
|
120
|
-
subtitle:
|
|
121
|
-
...e.group ? [
|
|
122
|
-
...e.
|
|
136
|
+
subtitle: I.list([
|
|
137
|
+
...e.group ? [F("runnerSharedWith", { group: e.group })] : [],
|
|
138
|
+
...e.sharingRefused ? [F("runnerNotTakingRuns")] : [],
|
|
139
|
+
...e.sharingUnchecked ? [F("runnerSharingUnknown")] : [],
|
|
140
|
+
...e.permissionMode ? [F(N[e.permissionMode])] : [],
|
|
123
141
|
...e.harnesses,
|
|
124
142
|
...e.labels
|
|
125
143
|
], { type: "unit" }),
|
|
126
144
|
href: null
|
|
127
|
-
}),
|
|
145
|
+
}), Y.isVisible("seen") && /* @__PURE__ */ y(f.Item, {
|
|
128
146
|
className: "py-2.5",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ v(C, { children: e.lastSeenAt ? F("runnerSeen", { seen: R.relative(e.lastSeenAt) }) : F("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ y("span", {
|
|
130
148
|
className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
|
|
131
149
|
title: e.isolation.failures.join("\n") || void 0,
|
|
132
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ v(d, {
|
|
133
151
|
variant: e.isolation.passed ? "success" : "error",
|
|
134
152
|
size: 8
|
|
135
|
-
}), e.isolation.passed ?
|
|
153
|
+
}), e.isolation.passed ? F("runnerIsolated") : F("runnerNotIsolated", { count: e.isolation.failures.length })]
|
|
136
154
|
})]
|
|
137
155
|
})]
|
|
138
156
|
}, e.id))]
|
|
139
157
|
})
|
|
140
158
|
})
|
|
141
159
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
160
|
+
/* @__PURE__ */ v(l, { workspace: c }),
|
|
161
|
+
G
|
|
144
162
|
]
|
|
145
163
|
});
|
|
146
164
|
}
|
|
147
|
-
export {
|
|
165
|
+
export { P as component };
|
|
@@ -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 };
|