@burdenoff/microfe-calendar 2026.1124.1 → 2026.1124.3
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/dist/generated/wspace-operations.d.ts +658 -0
- package/dist/generated/wspace-operations.js +179 -6
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +1243 -10
- package/dist/hooks/useSafePermissions.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/providers/CalendarProvider.d.ts +3 -1
- package/dist/providers/CalendarProvider.js +12 -10
- package/dist/providers/CalendarProvider.js.map +1 -1
- package/dist/translations/en.d.ts +291 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/v2/CalendarPageV2.js +44 -39
- package/dist/v2/CalendarPageV2.js.map +1 -1
- package/dist/v2/data/enums.d.ts +1 -0
- package/dist/v2/data/enums.js +6 -2
- package/dist/v2/data/enums.js.map +1 -1
- package/dist/v2/dialogs/CalendarDialogsV2.js +12 -9
- package/dist/v2/dialogs/CalendarDialogsV2.js.map +1 -1
- package/dist/v2/event/CustomRepeat.d.ts +5 -0
- package/dist/v2/event/CustomRepeat.js +246 -0
- package/dist/v2/event/CustomRepeat.js.map +1 -0
- package/dist/v2/event/EventDetailsTab.d.ts +6 -0
- package/dist/v2/event/EventDetailsTab.js +291 -0
- package/dist/v2/event/EventDetailsTab.js.map +1 -0
- package/dist/v2/event/EventDialog.d.ts +25 -0
- package/dist/v2/event/EventDialog.js +365 -0
- package/dist/v2/event/EventDialog.js.map +1 -0
- package/dist/v2/event/EventDialogs.d.ts +3 -0
- package/dist/v2/event/EventDialogs.js +111 -0
- package/dist/v2/event/EventDialogs.js.map +1 -0
- package/dist/v2/event/EventMoreTab.d.ts +4 -0
- package/dist/v2/event/EventMoreTab.js +214 -0
- package/dist/v2/event/EventMoreTab.js.map +1 -0
- package/dist/v2/event/EventPeopleTab.d.ts +8 -0
- package/dist/v2/event/EventPeopleTab.js +422 -0
- package/dist/v2/event/EventPeopleTab.js.map +1 -0
- package/dist/v2/event/EventPlaceTab.d.ts +6 -0
- package/dist/v2/event/EventPlaceTab.js +264 -0
- package/dist/v2/event/EventPlaceTab.js.map +1 -0
- package/dist/v2/event/FindTimeDialog.d.ts +26 -0
- package/dist/v2/event/FindTimeDialog.js +667 -0
- package/dist/v2/event/FindTimeDialog.js.map +1 -0
- package/dist/v2/event/RepeatField.d.ts +5 -0
- package/dist/v2/event/RepeatField.js +88 -0
- package/dist/v2/event/RepeatField.js.map +1 -0
- package/dist/v2/event/dialogLogic.d.ts +87 -0
- package/dist/v2/event/dialogLogic.js +117 -0
- package/dist/v2/event/dialogLogic.js.map +1 -0
- package/dist/v2/event/dialogModel.d.ts +48 -0
- package/dist/v2/event/dialogModel.js +13 -0
- package/dist/v2/event/dialogModel.js.map +1 -0
- package/dist/v2/event/eventForm.d.ts +209 -0
- package/dist/v2/event/eventForm.js +397 -0
- package/dist/v2/event/eventForm.js.map +1 -0
- package/dist/v2/event/findTime.d.ts +120 -0
- package/dist/v2/event/findTime.js +149 -0
- package/dist/v2/event/findTime.js.map +1 -0
- package/dist/v2/event/findTimeSource.d.ts +102 -0
- package/dist/v2/event/findTimeSource.js +107 -0
- package/dist/v2/event/findTimeSource.js.map +1 -0
- package/dist/v2/event/parts.d.ts +46 -0
- package/dist/v2/event/parts.js +124 -0
- package/dist/v2/event/parts.js.map +1 -0
- package/dist/v2/event/place.d.ts +64 -0
- package/dist/v2/event/place.js +48 -0
- package/dist/v2/event/place.js.map +1 -0
- package/dist/v2/event/repeatWords.d.ts +19 -0
- package/dist/v2/event/repeatWords.js +130 -0
- package/dist/v2/event/repeatWords.js.map +1 -0
- package/dist/v2/event/rrule.d.ts +90 -0
- package/dist/v2/event/rrule.js +368 -0
- package/dist/v2/event/rrule.js.map +1 -0
- package/dist/v2/event/savePlan.d.ts +50 -0
- package/dist/v2/event/savePlan.js +125 -0
- package/dist/v2/event/savePlan.js.map +1 -0
- package/dist/v2/event/useEventData.d.ts +91 -0
- package/dist/v2/event/useEventData.js +202 -0
- package/dist/v2/event/useEventData.js.map +1 -0
- package/dist/v2/event/useEventDialogModel.d.ts +37 -0
- package/dist/v2/event/useEventDialogModel.js +129 -0
- package/dist/v2/event/useEventDialogModel.js.map +1 -0
- package/dist/v2/event/useEventSave.d.ts +41 -0
- package/dist/v2/event/useEventSave.js +185 -0
- package/dist/v2/event/useEventSave.js.map +1 -0
- package/dist/v2/format.d.ts +2 -0
- package/dist/v2/format.js +4 -0
- package/dist/v2/format.js.map +1 -1
- package/dist/v2/grid/GridParts.js +100 -94
- package/dist/v2/grid/GridParts.js.map +1 -1
- package/dist/v2/grid/TimeGrid.js +98 -89
- package/dist/v2/grid/TimeGrid.js.map +1 -1
- package/dist/v2/list/ListViewV2.d.ts +6 -2
- package/dist/v2/list/ListViewV2.js +50 -44
- package/dist/v2/list/ListViewV2.js.map +1 -1
- package/dist/v2/month/MonthView.js +130 -126
- package/dist/v2/month/MonthView.js.map +1 -1
- package/dist/v2/peek/EventPeek.js.map +1 -1
- package/dist/v2/peek/PeekEvent.js.map +1 -1
- package/dist/v2/rail/CalendarRail.js +54 -80
- package/dist/v2/rail/CalendarRail.js.map +1 -1
- package/dist/v2/runs/RunPeek.d.ts +2 -0
- package/dist/v2/runs/RunPeek.js +382 -0
- package/dist/v2/runs/RunPeek.js.map +1 -0
- package/dist/v2/runs/RunPills.d.ts +28 -0
- package/dist/v2/runs/RunPills.js +179 -0
- package/dist/v2/runs/RunPills.js.map +1 -0
- package/dist/v2/runs/RunRows.d.ts +21 -0
- package/dist/v2/runs/RunRows.js +140 -0
- package/dist/v2/runs/RunRows.js.map +1 -0
- package/dist/v2/runs/RunsNotices.d.ts +1 -0
- package/dist/v2/runs/RunsNotices.js +37 -0
- package/dist/v2/runs/RunsNotices.js.map +1 -0
- package/dist/v2/runs/RunsSwitch.d.ts +1 -0
- package/dist/v2/runs/RunsSwitch.js +54 -0
- package/dist/v2/runs/RunsSwitch.js.map +1 -0
- package/dist/v2/runs/WorkflowRunsLayer.d.ts +4 -0
- package/dist/v2/runs/WorkflowRunsLayer.js +82 -0
- package/dist/v2/runs/WorkflowRunsLayer.js.map +1 -0
- package/dist/v2/runs/runAccess.d.ts +37 -0
- package/dist/v2/runs/runAccess.js +14 -0
- package/dist/v2/runs/runAccess.js.map +1 -0
- package/dist/v2/runs/runLayout.d.ts +76 -0
- package/dist/v2/runs/runLayout.js +129 -0
- package/dist/v2/runs/runLayout.js.map +1 -0
- package/dist/v2/runs/runLinks.d.ts +32 -0
- package/dist/v2/runs/runLinks.js +50 -0
- package/dist/v2/runs/runLinks.js.map +1 -0
- package/dist/v2/runs/runModel.d.ts +97 -0
- package/dist/v2/runs/runModel.js +132 -0
- package/dist/v2/runs/runModel.js.map +1 -0
- package/dist/v2/runs/runPeekState.d.ts +53 -0
- package/dist/v2/runs/runPeekState.js +62 -0
- package/dist/v2/runs/runPeekState.js.map +1 -0
- package/dist/v2/runs/runTypes.d.ts +60 -0
- package/dist/v2/runs/runWords.d.ts +23 -0
- package/dist/v2/runs/runWords.js +83 -0
- package/dist/v2/runs/runWords.js.map +1 -0
- package/dist/v2/runs/runsLayerContext.d.ts +26 -0
- package/dist/v2/runs/runsLayerContext.js +33 -0
- package/dist/v2/runs/runsLayerContext.js.map +1 -0
- package/dist/v2/runs/useRunHrefs.d.ts +10 -0
- package/dist/v2/runs/useRunHrefs.js +60 -0
- package/dist/v2/runs/useRunHrefs.js.map +1 -0
- package/dist/v2/runs/useRunLabels.d.ts +6 -0
- package/dist/v2/runs/useRunLabels.js +27 -0
- package/dist/v2/runs/useRunLabels.js.map +1 -0
- package/dist/v2/runs/useRunsAccess.d.ts +2 -0
- package/dist/v2/runs/useRunsAccess.js +14 -0
- package/dist/v2/runs/useRunsAccess.js.map +1 -0
- package/dist/v2/runs/useWorkflowRuns.d.ts +61 -0
- package/dist/v2/runs/useWorkflowRuns.js +119 -0
- package/dist/v2/runs/useWorkflowRuns.js.map +1 -0
- package/dist/v2/states/CalendarStates.js.map +1 -1
- package/dist/v2/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { formatDay as e, formatInstantTime as t, formatMinutes as n } from "../format.js";
|
|
2
|
+
import { useCalendarPage as r } from "../page/CalendarPageContext.js";
|
|
3
|
+
import { Row as i } from "../peek/PeekParts.js";
|
|
4
|
+
import { FOCUS_RING as a, ICON_BUTTON as o } from "../styles.js";
|
|
5
|
+
import { instantToZoned as s } from "../time/calendarTime.js";
|
|
6
|
+
import { isExternalHref as c } from "./runLinks.js";
|
|
7
|
+
import "./runPeekState.js";
|
|
8
|
+
import { RUN_STATUS_CHIP as l, RUN_STATUS_ICON as u, runCountWords as d, runDurationWords as f, runEveryWords as p, runStatusWord as m, runSummaryWords as h } from "./runWords.js";
|
|
9
|
+
import { useRunHrefs as g } from "./useRunHrefs.js";
|
|
10
|
+
import { useWorkflowRunsLayer as _ } from "./runsLayerContext.js";
|
|
11
|
+
import { useMemo as v } from "react";
|
|
12
|
+
import { Activity as y, ArrowLeft as b, ExternalLink as x, GitBranch as S, Info as C, OctagonAlert as ee, Timer as w, X as T } from "lucide-react";
|
|
13
|
+
import { Link as E } from "react-router";
|
|
14
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
15
|
+
import { BottomSheet as A, BottomSheetContent as j, BottomSheetDescription as M, BottomSheetTitle as N, Button as P, Notice as F, Popover as I, PopoverAnchor as L, PopoverContent as R, Spinner as z, StatusChip as B } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { cn as V } from "@burdenoff/fe-libs/utils";
|
|
17
|
+
// src/v2/runs/RunPeek.tsx
|
|
18
|
+
function H() {
|
|
19
|
+
let e = r(), t = _(), { peek: n } = t, i = n?.anchor ?? null, a = v(() => ({ current: { getBoundingClientRect: () => i?.isConnected ? i.getBoundingClientRect() : new DOMRect(window.innerWidth / 2, 120, 0, 0) } }), [i]), o = n?.stack[n.stack.length - 1];
|
|
20
|
+
if (!n || !o) return null;
|
|
21
|
+
let s = o.kind === "run" ? o.run.name : o.kind === "group" ? o.group.name : o.kind === "cluster" ? e.tr("calendar.v2.runsTitleCount", "{{count}} workflow runs", { count: o.runs.length }) : e.tr("calendar.v2.workflowRuns", "Workflow runs"), c = /* @__PURE__ */ O(K, {
|
|
22
|
+
view: o,
|
|
23
|
+
canGoBack: n.stack.length > 1
|
|
24
|
+
});
|
|
25
|
+
return e.compact ? /* @__PURE__ */ O(A, {
|
|
26
|
+
open: !0,
|
|
27
|
+
onOpenChange: (e) => e ? void 0 : t.closePeek(),
|
|
28
|
+
children: /* @__PURE__ */ O(j, {
|
|
29
|
+
className: "max-h-[88dvh] gap-0 p-0",
|
|
30
|
+
showCloseButton: !1,
|
|
31
|
+
"aria-describedby": void 0,
|
|
32
|
+
children: c
|
|
33
|
+
})
|
|
34
|
+
}) : /* @__PURE__ */ k(I, {
|
|
35
|
+
open: !0,
|
|
36
|
+
onOpenChange: (e) => e ? void 0 : t.closePeek(),
|
|
37
|
+
children: [/* @__PURE__ */ O(L, { virtualRef: a }), /* @__PURE__ */ O(R, {
|
|
38
|
+
side: "right",
|
|
39
|
+
align: "start",
|
|
40
|
+
sideOffset: 8,
|
|
41
|
+
collisionPadding: 12,
|
|
42
|
+
className: "flex max-h-[min(560px,calc(100dvh-24px))] w-[360px] flex-col overflow-hidden p-0",
|
|
43
|
+
"aria-label": s,
|
|
44
|
+
onInteractOutside: (e) => {
|
|
45
|
+
(e.target instanceof Element ? e.target : null)?.closest("[data-run-opener]") && e.preventDefault();
|
|
46
|
+
},
|
|
47
|
+
onCloseAutoFocus: (e) => {
|
|
48
|
+
i?.isConnected && (e.preventDefault(), i.focus({ preventScroll: !0 }));
|
|
49
|
+
},
|
|
50
|
+
children: c
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function U({ children: e }) {
|
|
55
|
+
let { compact: t } = r();
|
|
56
|
+
return O(t ? N : "h3", {
|
|
57
|
+
className: "min-w-0 flex-1 text-base leading-snug font-bold break-words text-text-primary",
|
|
58
|
+
children: e
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function W({ title: e, subtitle: t, canGoBack: n }) {
|
|
62
|
+
let { tr: i, compact: a } = r(), s = _();
|
|
63
|
+
return /* @__PURE__ */ k("div", {
|
|
64
|
+
className: "flex items-start gap-2 p-3 ps-4",
|
|
65
|
+
children: [
|
|
66
|
+
n ? /* @__PURE__ */ O("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
className: V(o, "-ms-2"),
|
|
69
|
+
"aria-label": i("calendar.v2.runsBack", "Back to the list"),
|
|
70
|
+
title: i("calendar.v2.runsBack", "Back to the list"),
|
|
71
|
+
onClick: s.backInPeek,
|
|
72
|
+
children: /* @__PURE__ */ O(b, {
|
|
73
|
+
className: "rtl:rotate-180",
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
})
|
|
76
|
+
}) : /* @__PURE__ */ O("span", {
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
className: "mt-0.5 grid size-6 shrink-0 place-items-center rounded-md bg-bg-sunken text-text-link",
|
|
79
|
+
children: /* @__PURE__ */ O(S, { className: "size-3.5" })
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ k("div", {
|
|
82
|
+
className: "flex min-w-0 flex-1 flex-col pt-0.5",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ O(U, { children: e }),
|
|
85
|
+
t ? /* @__PURE__ */ O("p", {
|
|
86
|
+
className: "text-xs text-text-secondary",
|
|
87
|
+
children: t
|
|
88
|
+
}) : null,
|
|
89
|
+
a && t ? /* @__PURE__ */ O(M, {
|
|
90
|
+
className: "sr-only",
|
|
91
|
+
children: t
|
|
92
|
+
}) : null
|
|
93
|
+
]
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ O("button", {
|
|
96
|
+
type: "button",
|
|
97
|
+
className: o,
|
|
98
|
+
"aria-label": i("calendar.v2.close", "Close"),
|
|
99
|
+
onClick: s.closePeek,
|
|
100
|
+
children: /* @__PURE__ */ O(T, { "aria-hidden": "true" })
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function G({ children: e }) {
|
|
106
|
+
let { tr: t } = r(), n = _();
|
|
107
|
+
return /* @__PURE__ */ k("div", {
|
|
108
|
+
className: "flex flex-wrap items-center gap-2 border-t border-border-subtle p-3 ps-4",
|
|
109
|
+
children: [e, /* @__PURE__ */ O("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
onClick: n.hideRuns,
|
|
112
|
+
className: V("ms-auto rounded-sm text-sm font-semibold text-text-link hover:underline", a),
|
|
113
|
+
children: t("calendar.v2.hideRuns", "Hide workflow runs")
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function K({ view: e, canGoBack: t }) {
|
|
118
|
+
switch (e.kind) {
|
|
119
|
+
case "run": return /* @__PURE__ */ O(Y, {
|
|
120
|
+
run: e.run,
|
|
121
|
+
canGoBack: t
|
|
122
|
+
});
|
|
123
|
+
case "group": return /* @__PURE__ */ O(ne, {
|
|
124
|
+
group: e.group,
|
|
125
|
+
canGoBack: t
|
|
126
|
+
});
|
|
127
|
+
case "cluster": return /* @__PURE__ */ O(re, {
|
|
128
|
+
runs: e.runs,
|
|
129
|
+
canGoBack: t
|
|
130
|
+
});
|
|
131
|
+
default: return /* @__PURE__ */ O(ie, {
|
|
132
|
+
day: e.day,
|
|
133
|
+
canGoBack: t
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function q() {
|
|
138
|
+
let { format: n, timeZone: i } = r();
|
|
139
|
+
return (r) => `${e(s(r.at, i).date, n, "mid")} · ${t(r.at, i, n)}`;
|
|
140
|
+
}
|
|
141
|
+
function J() {
|
|
142
|
+
let n = r(), { tr: i, format: a, timeZone: o } = n;
|
|
143
|
+
return (r) => {
|
|
144
|
+
let c = [], l = r.execution;
|
|
145
|
+
return l ? (r.status === "running" || r.status === "retrying" ? c.push(i("calendar.v2.runSince", "since {{time}}", { time: t(l.startedAt, o, a) })) : l.durationMs !== null && c.push(i("calendar.v2.runTook", "took {{duration}}", { duration: f(i, l.durationMs, a.locale, n.durationWords) })), l.attempt > 0 && c.push(i("calendar.v2.runAttempt", "attempt {{n}}", { n: l.attempt + 1 })), l.manual && c.push(i("calendar.v2.runByHand", "run by hand")), l.catchUp && r.fireAt && c.push(i("calendar.v2.runCatchUp", "made up for {{when}}", { when: `${e(s(r.fireAt, o).date, a, "short")}, ${t(r.fireAt, o, a)}` })), c) : (r.status === "overdue" && r.fireAt && c.push(i("calendar.v2.runOverdueNote", "It was due at {{time}} and runs when the scheduler catches up.", { time: t(r.fireAt, o, a) })), c);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function Y({ run: e, canGoBack: t }) {
|
|
149
|
+
let { tr: n } = r(), a = _(), o = q()(e), s = J()(e), c = g(e, a.links), d = e.status === "failed" || e.status === "retrying" ? e.execution?.errorMessage : null;
|
|
150
|
+
return /* @__PURE__ */ k(D, { children: [
|
|
151
|
+
/* @__PURE__ */ O(W, {
|
|
152
|
+
title: e.name,
|
|
153
|
+
subtitle: o,
|
|
154
|
+
canGoBack: t
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ k("div", {
|
|
157
|
+
className: "flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-4 pb-4",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ O(i, {
|
|
160
|
+
icon: /* @__PURE__ */ O(w, { "aria-hidden": "true" }),
|
|
161
|
+
children: /* @__PURE__ */ k("span", {
|
|
162
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
163
|
+
children: [/* @__PURE__ */ O(B, {
|
|
164
|
+
status: l[e.status],
|
|
165
|
+
icon: u[e.status],
|
|
166
|
+
children: m(n, e.status)
|
|
167
|
+
}), s.length > 0 ? /* @__PURE__ */ O("span", {
|
|
168
|
+
className: "text-text-secondary",
|
|
169
|
+
children: s.join(" · ")
|
|
170
|
+
}) : null]
|
|
171
|
+
})
|
|
172
|
+
}),
|
|
173
|
+
d ? /* @__PURE__ */ k(F, {
|
|
174
|
+
tone: "bad",
|
|
175
|
+
icon: ee,
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ O("b", { children: n("calendar.v2.runWhyFailed", "Why it failed:") }),
|
|
178
|
+
" ",
|
|
179
|
+
/* @__PURE__ */ O("span", {
|
|
180
|
+
className: "break-words whitespace-pre-wrap",
|
|
181
|
+
children: d
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
}) : null,
|
|
185
|
+
/* @__PURE__ */ O(i, {
|
|
186
|
+
icon: /* @__PURE__ */ O(C, { "aria-hidden": "true" }),
|
|
187
|
+
children: n("calendar.v2.runFromSchedules", "From Schedules, read-only. Change the schedule in the workflow, not here.")
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ O(G, { children: /* @__PURE__ */ O(Z, {
|
|
192
|
+
links: c,
|
|
193
|
+
failed: e.status === "failed"
|
|
194
|
+
}) })
|
|
195
|
+
] });
|
|
196
|
+
}
|
|
197
|
+
function X({ href: e, primary: t, icon: n, children: r }) {
|
|
198
|
+
let i = c(e);
|
|
199
|
+
return /* @__PURE__ */ O(P, {
|
|
200
|
+
size: "sm",
|
|
201
|
+
variant: t ? "default" : "outline",
|
|
202
|
+
asChild: !0,
|
|
203
|
+
children: i ? /* @__PURE__ */ k("a", {
|
|
204
|
+
href: e,
|
|
205
|
+
target: "_blank",
|
|
206
|
+
rel: "noopener noreferrer",
|
|
207
|
+
children: [n, r]
|
|
208
|
+
}) : /* @__PURE__ */ k(E, {
|
|
209
|
+
to: e,
|
|
210
|
+
children: [n, r]
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function Z({ links: e, failed: t }) {
|
|
215
|
+
let { tr: n } = r();
|
|
216
|
+
switch (e.status) {
|
|
217
|
+
case "none": return null;
|
|
218
|
+
case "loading": return /* @__PURE__ */ k("span", {
|
|
219
|
+
className: "inline-flex items-center gap-1.5 text-xs text-text-secondary",
|
|
220
|
+
children: [/* @__PURE__ */ O(z, { className: "size-3.5" }), n("calendar.v2.runLinksLoading", "Finding its links…")]
|
|
221
|
+
});
|
|
222
|
+
case "gone": return /* @__PURE__ */ O("span", {
|
|
223
|
+
className: "text-xs text-text-secondary",
|
|
224
|
+
children: n("calendar.v2.runScheduleGone", "Its schedule no longer exists.")
|
|
225
|
+
});
|
|
226
|
+
case "error": return /* @__PURE__ */ k("span", {
|
|
227
|
+
className: "inline-flex flex-wrap items-center gap-2 text-xs text-text-secondary",
|
|
228
|
+
children: [n("calendar.v2.runLinksFailed", "Couldn’t find its links."), /* @__PURE__ */ O(P, {
|
|
229
|
+
type: "button",
|
|
230
|
+
size: "sm",
|
|
231
|
+
variant: "ghost",
|
|
232
|
+
onClick: e.retry,
|
|
233
|
+
children: n("calendar.v2.tryAgain", "Try again")
|
|
234
|
+
})]
|
|
235
|
+
});
|
|
236
|
+
default: return /* @__PURE__ */ k(D, { children: [e.hrefs.workflow ? /* @__PURE__ */ O(X, {
|
|
237
|
+
href: e.hrefs.workflow,
|
|
238
|
+
primary: !1,
|
|
239
|
+
icon: /* @__PURE__ */ O(x, { "aria-hidden": "true" }),
|
|
240
|
+
children: n("calendar.v2.openWorkflow", "Open workflow")
|
|
241
|
+
}) : null, e.hrefs.run ? /* @__PURE__ */ O(X, {
|
|
242
|
+
href: e.hrefs.run,
|
|
243
|
+
primary: t,
|
|
244
|
+
icon: /* @__PURE__ */ O(y, { "aria-hidden": "true" }),
|
|
245
|
+
children: n("calendar.v2.openRun", "Open run")
|
|
246
|
+
}) : null] });
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function Q({ run: e, withName: n }) {
|
|
250
|
+
let i = r(), { tr: o } = i, s = _(), c = t(e.at, i.timeZone, i.format), d = m(o, e.status);
|
|
251
|
+
return /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k("button", {
|
|
252
|
+
type: "button",
|
|
253
|
+
onClick: () => s.showInPeek({
|
|
254
|
+
kind: "run",
|
|
255
|
+
run: e
|
|
256
|
+
}),
|
|
257
|
+
"aria-label": n ? o("calendar.v2.runPickLabel", "{{name}}, {{time}}, {{status}}", {
|
|
258
|
+
name: e.name,
|
|
259
|
+
time: c,
|
|
260
|
+
status: d
|
|
261
|
+
}) : o("calendar.v2.runPickTimeLabel", "{{time}}, {{status}}", {
|
|
262
|
+
time: c,
|
|
263
|
+
status: d
|
|
264
|
+
}),
|
|
265
|
+
className: V("flex w-full min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5 text-start text-sm hover:bg-bg-sunken", a),
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ O("span", {
|
|
268
|
+
className: "w-12 shrink-0 tabular-nums text-text-secondary",
|
|
269
|
+
children: c
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ O("span", {
|
|
272
|
+
className: "min-w-0 flex-1 truncate font-medium text-text-primary",
|
|
273
|
+
children: n ? e.name : null
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ O(B, {
|
|
276
|
+
status: l[e.status],
|
|
277
|
+
icon: u[e.status],
|
|
278
|
+
quiet: !0,
|
|
279
|
+
children: d
|
|
280
|
+
})
|
|
281
|
+
]
|
|
282
|
+
}) });
|
|
283
|
+
}
|
|
284
|
+
function te({ group: e }) {
|
|
285
|
+
let t = r(), { tr: i } = t, o = _(), s = e.summary.status, c = [p(i, e.everyMinutes, t.durationWords), d(i, e.runs.length)].filter(Boolean).join(" · ");
|
|
286
|
+
return /* @__PURE__ */ O("li", { children: /* @__PURE__ */ k("button", {
|
|
287
|
+
type: "button",
|
|
288
|
+
onClick: () => o.showInPeek({
|
|
289
|
+
kind: "group",
|
|
290
|
+
group: e
|
|
291
|
+
}),
|
|
292
|
+
className: V("flex w-full min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5 text-start text-sm hover:bg-bg-sunken", a),
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ O("span", {
|
|
295
|
+
className: "w-12 shrink-0 text-xs tabular-nums text-text-secondary",
|
|
296
|
+
children: n(e.firstMinute, t.format)
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ k("span", {
|
|
299
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
300
|
+
children: [/* @__PURE__ */ O("span", {
|
|
301
|
+
className: "truncate font-medium text-text-primary",
|
|
302
|
+
children: e.name
|
|
303
|
+
}), /* @__PURE__ */ O("small", {
|
|
304
|
+
className: "truncate text-xs text-text-secondary",
|
|
305
|
+
children: c
|
|
306
|
+
})]
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ O(B, {
|
|
309
|
+
status: l[s],
|
|
310
|
+
icon: u[s],
|
|
311
|
+
quiet: !0,
|
|
312
|
+
children: m(i, s)
|
|
313
|
+
})
|
|
314
|
+
]
|
|
315
|
+
}) });
|
|
316
|
+
}
|
|
317
|
+
function $({ children: e }) {
|
|
318
|
+
return /* @__PURE__ */ O("ul", {
|
|
319
|
+
className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-2",
|
|
320
|
+
children: e
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function ne({ group: t, canGoBack: n }) {
|
|
324
|
+
let i = r(), { tr: a } = i, o = [
|
|
325
|
+
e(t.day, i.format, "mid"),
|
|
326
|
+
p(a, t.everyMinutes, i.durationWords),
|
|
327
|
+
d(a, t.runs.length)
|
|
328
|
+
].filter(Boolean).join(" · ");
|
|
329
|
+
return /* @__PURE__ */ k(D, { children: [
|
|
330
|
+
/* @__PURE__ */ O(W, {
|
|
331
|
+
title: t.name,
|
|
332
|
+
subtitle: o,
|
|
333
|
+
canGoBack: n
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ O("p", {
|
|
336
|
+
className: "px-4 pb-2 text-xs text-text-secondary",
|
|
337
|
+
children: h(a, t.summary)
|
|
338
|
+
}),
|
|
339
|
+
/* @__PURE__ */ O($, { children: t.runs.map((e) => /* @__PURE__ */ O(Q, {
|
|
340
|
+
run: e,
|
|
341
|
+
withName: !1
|
|
342
|
+
}, e.key)) }),
|
|
343
|
+
/* @__PURE__ */ O(G, {})
|
|
344
|
+
] });
|
|
345
|
+
}
|
|
346
|
+
function re({ runs: n, canGoBack: i }) {
|
|
347
|
+
let a = r(), { tr: o } = a, c = n[0], l = c ? `${e(s(c.at, a.timeZone).date, a.format, "mid")} · ${t(c.at, a.timeZone, a.format)}` : void 0;
|
|
348
|
+
return /* @__PURE__ */ k(D, { children: [
|
|
349
|
+
/* @__PURE__ */ O(W, {
|
|
350
|
+
title: o("calendar.v2.runsTitleCount", "{{count}} workflow runs", { count: n.length }),
|
|
351
|
+
subtitle: l,
|
|
352
|
+
canGoBack: i
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ O($, { children: n.map((e) => /* @__PURE__ */ O(Q, {
|
|
355
|
+
run: e,
|
|
356
|
+
withName: !0
|
|
357
|
+
}, e.key)) }),
|
|
358
|
+
/* @__PURE__ */ O(G, {})
|
|
359
|
+
] });
|
|
360
|
+
}
|
|
361
|
+
function ie({ day: t, canGoBack: n }) {
|
|
362
|
+
let i = r(), { tr: a } = i;
|
|
363
|
+
return /* @__PURE__ */ k(D, { children: [
|
|
364
|
+
/* @__PURE__ */ O(W, {
|
|
365
|
+
title: a("calendar.v2.workflowRuns", "Workflow runs"),
|
|
366
|
+
subtitle: `${e(t.day, i.format, "mid")} · ${d(a, t.total)}`,
|
|
367
|
+
canGoBack: n
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ O("p", {
|
|
370
|
+
className: "px-4 pb-2 text-xs text-text-secondary",
|
|
371
|
+
children: h(a, t.summary)
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ k($, { children: [t.groups.map((e) => /* @__PURE__ */ O(te, { group: e }, e.key)), t.single.map((e) => /* @__PURE__ */ O(Q, {
|
|
374
|
+
run: e,
|
|
375
|
+
withName: !0
|
|
376
|
+
}, e.key))] }),
|
|
377
|
+
/* @__PURE__ */ O(G, {})
|
|
378
|
+
] });
|
|
379
|
+
}
|
|
380
|
+
export { H as RunPeekHost };
|
|
381
|
+
|
|
382
|
+
//# sourceMappingURL=RunPeek.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunPeek.js","names":["_Fragment","Fragment$1","RunPeekHost","page","useCalendarPage","layer","useWorkflowRunsLayer","anchor","peek","virtualRef","useMemo","view","name","body","RunPeekBody","BottomSheet","open","BottomSheetContent","Popover","PopoverAnchor","PopoverContent","interaction","focusEvent","PeekTitle","jsx","compact","BottomSheetTitle","PeekHeader","canGoBack","cn","ICON_BUTTON","tr","ArrowLeft","GitBranch","title","subtitle","BottomSheetDescription","X","PeekFooter","children","FOCUS_RING","RunDetails","GroupList","ClusterList","DayList","useRunWhen","formatDay","instantToZoned","run","timeZone","format","formatInstantTime","useRunFacts","facts","execution","runDurationWords","when","links","useRunHrefs","failure","Row","Timer","StatusChip","RUN_STATUS_CHIP","RUN_STATUS_ICON","runStatusWord","Notice","OctagonAlert","Info","RunLinkButtons","LinkButton","external","isExternalHref","href","Button","primary","icon","Link","Spinner","ExternalLink","failed","Activity","RunPick","time","word","withName","GroupPick","status","group","sub","runEveryWords","runCountWords","formatMinutes","PickList","runSummaryWords","first","runs","day"],"sources":["../../../src/v2/runs/RunPeek.tsx"],"sourcesContent":["/**\n * The run peek (BOFF-15698 B5): a popover beside the pill on wide screens, a sheet on phones.\n * Read-only, like the prototype's:\n *\n * - **A run:** when, how it went (an icon and a word, how long it took, the attempt), why it\n * failed, where it comes from (\"change the schedule in the workflow\"), Open workflow and Open\n * run where the host links them, and Hide workflow runs.\n * - **Several:** a busy schedule's day, runs sharing a pill, a month day: a list, each opening\n * its run; Back returns to the list.\n */\nimport { useMemo, type ReactNode } from 'react';\nimport { Link } from 'react-router';\nimport {\n Activity,\n ArrowLeft,\n ExternalLink,\n GitBranch,\n Info,\n OctagonAlert,\n Timer,\n X,\n} from 'lucide-react';\nimport {\n BottomSheet,\n BottomSheetContent,\n BottomSheetDescription,\n BottomSheetTitle,\n Button,\n Notice,\n Popover,\n PopoverAnchor,\n PopoverContent,\n Spinner,\n StatusChip,\n} from '@burdenoff/fe-libs/ui';\nimport { cn } from '@burdenoff/fe-libs/utils';\nimport { formatDay, formatInstantTime, formatMinutes } from '../format';\nimport { useCalendarPage } from '../page/CalendarPageContext';\nimport { Row } from '../peek/PeekParts';\nimport { FOCUS_RING, ICON_BUTTON } from '../styles';\nimport { instantToZoned } from '../time/calendarTime';\nimport { isExternalHref } from './runLinks';\nimport type { DayRuns, RunGroup } from './runLayout';\nimport type { WorkflowRun } from './runModel';\nimport { RUN_OPENER, type RunPeekView } from './runPeekState';\nimport {\n RUN_STATUS_CHIP,\n RUN_STATUS_ICON,\n runCountWords,\n runDurationWords,\n runEveryWords,\n runStatusWord,\n runSummaryWords,\n} from './runWords';\nimport { useRunHrefs } from './useRunHrefs';\nimport { useWorkflowRunsLayer } from './runsLayerContext';\n\ntype Anchor = { current: { getBoundingClientRect: () => DOMRect } };\n\n/** Hosts the run peek while one is open. */\nexport function RunPeekHost() {\n const page = useCalendarPage();\n const layer = useWorkflowRunsLayer();\n const { peek } = layer;\n const anchor = peek?.anchor ?? null;\n const virtualRef = useMemo<Anchor>(\n () => ({\n current: {\n getBoundingClientRect: () =>\n anchor?.isConnected\n ? anchor.getBoundingClientRect()\n : new DOMRect(window.innerWidth / 2, 120, 0, 0),\n },\n }),\n [anchor]\n );\n const view = peek?.stack[peek.stack.length - 1];\n if (!peek || !view) return null;\n // The popover is a dialog: it is named by what it shows (the sheet by its title).\n const name =\n view.kind === 'run'\n ? view.run.name\n : view.kind === 'group'\n ? view.group.name\n : view.kind === 'cluster'\n ? page.tr('calendar.v2.runsTitleCount', '{{count}} workflow runs', {\n count: view.runs.length,\n })\n : page.tr('calendar.v2.workflowRuns', 'Workflow runs');\n\n const body = <RunPeekBody view={view} canGoBack={peek.stack.length > 1} />;\n if (page.compact) {\n return (\n <BottomSheet open onOpenChange={(open) => (open ? undefined : layer.closePeek())}>\n <BottomSheetContent\n className=\"max-h-[88dvh] gap-0 p-0\"\n showCloseButton={false}\n aria-describedby={undefined}\n >\n {body}\n </BottomSheetContent>\n </BottomSheet>\n );\n }\n return (\n <Popover open onOpenChange={(open) => (open ? undefined : layer.closePeek())}>\n <PopoverAnchor virtualRef={virtualRef} />\n <PopoverContent\n side=\"right\"\n align=\"start\"\n sideOffset={8}\n collisionPadding={12}\n className=\"flex max-h-[min(560px,calc(100dvh-24px))] w-[360px] flex-col overflow-hidden p-0\"\n aria-label={name}\n onInteractOutside={(interaction) => {\n // A press on another run switches the peek to it instead of closing it.\n const target = interaction.target instanceof Element ? interaction.target : null;\n if (target?.closest(`[${RUN_OPENER}]`)) interaction.preventDefault();\n }}\n onCloseAutoFocus={(focusEvent) => {\n // Back to what opened it (this render's opener: the peek unmounts as it closes).\n if (anchor?.isConnected) {\n focusEvent.preventDefault();\n anchor.focus({ preventScroll: true });\n }\n }}\n >\n {body}\n </PopoverContent>\n </Popover>\n );\n}\n\n/** The peek's heading: the sheet's title on phones (it names the dialog), else an h3. */\nfunction PeekTitle({ children }: { children: string }) {\n const { compact } = useCalendarPage();\n const className = 'min-w-0 flex-1 text-base leading-snug font-bold break-words text-text-primary';\n return compact ? (\n <BottomSheetTitle className={className}>{children}</BottomSheetTitle>\n ) : (\n <h3 className={className}>{children}</h3>\n );\n}\n\nfunction PeekHeader({\n title,\n subtitle,\n canGoBack,\n}: {\n title: string;\n subtitle?: string;\n canGoBack: boolean;\n}) {\n const { tr, compact } = useCalendarPage();\n const layer = useWorkflowRunsLayer();\n return (\n <div className=\"flex items-start gap-2 p-3 ps-4\">\n {canGoBack ? (\n <button\n type=\"button\"\n className={cn(ICON_BUTTON, '-ms-2')}\n aria-label={tr('calendar.v2.runsBack', 'Back to the list')}\n title={tr('calendar.v2.runsBack', 'Back to the list')}\n onClick={layer.backInPeek}\n >\n <ArrowLeft className=\"rtl:rotate-180\" aria-hidden=\"true\" />\n </button>\n ) : (\n <span\n aria-hidden=\"true\"\n className=\"mt-0.5 grid size-6 shrink-0 place-items-center rounded-md bg-bg-sunken text-text-link\"\n >\n <GitBranch className=\"size-3.5\" />\n </span>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col pt-0.5\">\n <PeekTitle>{title}</PeekTitle>\n {subtitle ? <p className=\"text-xs text-text-secondary\">{subtitle}</p> : null}\n {compact && subtitle ? (\n <BottomSheetDescription className=\"sr-only\">{subtitle}</BottomSheetDescription>\n ) : null}\n </div>\n <button\n type=\"button\"\n className={ICON_BUTTON}\n aria-label={tr('calendar.v2.close', 'Close')}\n onClick={layer.closePeek}\n >\n <X aria-hidden=\"true\" />\n </button>\n </div>\n );\n}\n\nfunction PeekFooter({ children }: { children?: ReactNode }) {\n const { tr } = useCalendarPage();\n const layer = useWorkflowRunsLayer();\n return (\n <div className=\"flex flex-wrap items-center gap-2 border-t border-border-subtle p-3 ps-4\">\n {children}\n {/* At the end of the line, or of its own when the links fill it. */}\n <button\n type=\"button\"\n onClick={layer.hideRuns}\n className={cn(\n 'ms-auto rounded-sm text-sm font-semibold text-text-link hover:underline',\n FOCUS_RING\n )}\n >\n {tr('calendar.v2.hideRuns', 'Hide workflow runs')}\n </button>\n </div>\n );\n}\n\nfunction RunPeekBody({ view, canGoBack }: { view: RunPeekView; canGoBack: boolean }) {\n switch (view.kind) {\n case 'run':\n return <RunDetails run={view.run} canGoBack={canGoBack} />;\n case 'group':\n return <GroupList group={view.group} canGoBack={canGoBack} />;\n case 'cluster':\n return <ClusterList runs={view.runs} canGoBack={canGoBack} />;\n default:\n return <DayList day={view.day} canGoBack={canGoBack} />;\n }\n}\n\n/** \"Friday 20 Nov · 09:00\". */\nfunction useRunWhen(): (run: WorkflowRun) => string {\n const { format, timeZone } = useCalendarPage();\n return (run) =>\n `${formatDay(instantToZoned(run.at, timeZone).date, format, 'mid')} · ${formatInstantTime(run.at, timeZone, format)}`;\n}\n\n/** What a run did, beside its status: how long, which attempt, by hand, a catch-up. */\nfunction useRunFacts(): (run: WorkflowRun) => string[] {\n const page = useCalendarPage();\n const { tr, format, timeZone } = page;\n return (run) => {\n const facts: string[] = [];\n const execution = run.execution;\n if (!execution) {\n if (run.status === 'overdue' && run.fireAt) {\n facts.push(\n tr(\n 'calendar.v2.runOverdueNote',\n 'It was due at {{time}} and runs when the scheduler catches up.',\n { time: formatInstantTime(run.fireAt, timeZone, format) }\n )\n );\n }\n return facts;\n }\n if (run.status === 'running' || run.status === 'retrying') {\n facts.push(\n tr('calendar.v2.runSince', 'since {{time}}', {\n time: formatInstantTime(execution.startedAt, timeZone, format),\n })\n );\n } else if (execution.durationMs !== null) {\n facts.push(\n tr('calendar.v2.runTook', 'took {{duration}}', {\n duration: runDurationWords(tr, execution.durationMs, format.locale, page.durationWords),\n })\n );\n }\n if (execution.attempt > 0) {\n facts.push(tr('calendar.v2.runAttempt', 'attempt {{n}}', { n: execution.attempt + 1 }));\n }\n if (execution.manual) facts.push(tr('calendar.v2.runByHand', 'run by hand'));\n if (execution.catchUp && run.fireAt) {\n facts.push(\n tr('calendar.v2.runCatchUp', 'made up for {{when}}', {\n when: `${formatDay(instantToZoned(run.fireAt, timeZone).date, format, 'short')}, ${formatInstantTime(run.fireAt, timeZone, format)}`,\n })\n );\n }\n return facts;\n };\n}\n\nfunction RunDetails({ run, canGoBack }: { run: WorkflowRun; canGoBack: boolean }) {\n const page = useCalendarPage();\n const { tr } = page;\n const layer = useWorkflowRunsLayer();\n const when = useRunWhen()(run);\n const facts = useRunFacts()(run);\n const links = useRunHrefs(run, layer.links);\n const failure =\n run.status === 'failed' || run.status === 'retrying' ? run.execution?.errorMessage : null;\n return (\n <>\n <PeekHeader title={run.name} subtitle={when} canGoBack={canGoBack} />\n <div className=\"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-4 pb-4\">\n <Row icon={<Timer aria-hidden=\"true\" />}>\n <span className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n <StatusChip status={RUN_STATUS_CHIP[run.status]} icon={RUN_STATUS_ICON[run.status]}>\n {runStatusWord(tr, run.status)}\n </StatusChip>\n {facts.length > 0 ? (\n <span className=\"text-text-secondary\">{facts.join(' · ')}</span>\n ) : null}\n </span>\n </Row>\n {failure ? (\n <Notice tone=\"bad\" icon={OctagonAlert}>\n <b>{tr('calendar.v2.runWhyFailed', 'Why it failed:')}</b>{' '}\n <span className=\"break-words whitespace-pre-wrap\">{failure}</span>\n </Notice>\n ) : null}\n <Row icon={<Info aria-hidden=\"true\" />}>\n {tr(\n 'calendar.v2.runFromSchedules',\n 'From Schedules, read-only. Change the schedule in the workflow, not here.'\n )}\n </Row>\n </div>\n <PeekFooter>\n <RunLinkButtons links={links} failed={run.status === 'failed'} />\n </PeekFooter>\n </>\n );\n}\n\nfunction LinkButton({\n href,\n primary,\n icon,\n children,\n}: {\n href: string;\n primary: boolean;\n icon: ReactNode;\n children: string;\n}) {\n const external = isExternalHref(href);\n return (\n <Button size=\"sm\" variant={primary ? 'default' : 'outline'} asChild>\n {external ? (\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n {icon}\n {children}\n </a>\n ) : (\n <Link to={href}>\n {icon}\n {children}\n </Link>\n )}\n </Button>\n );\n}\n\n/** Open workflow and Open run, once known; never a link that can't work. */\nfunction RunLinkButtons({\n links,\n failed,\n}: {\n links: ReturnType<typeof useRunHrefs>;\n failed: boolean;\n}) {\n const { tr } = useCalendarPage();\n switch (links.status) {\n case 'none':\n return null;\n case 'loading':\n return (\n <span className=\"inline-flex items-center gap-1.5 text-xs text-text-secondary\">\n <Spinner className=\"size-3.5\" />\n {tr('calendar.v2.runLinksLoading', 'Finding its links…')}\n </span>\n );\n case 'gone':\n return (\n <span className=\"text-xs text-text-secondary\">\n {tr('calendar.v2.runScheduleGone', 'Its schedule no longer exists.')}\n </span>\n );\n case 'error':\n return (\n <span className=\"inline-flex flex-wrap items-center gap-2 text-xs text-text-secondary\">\n {tr('calendar.v2.runLinksFailed', 'Couldn’t find its links.')}\n <Button type=\"button\" size=\"sm\" variant=\"ghost\" onClick={links.retry}>\n {tr('calendar.v2.tryAgain', 'Try again')}\n </Button>\n </span>\n );\n default:\n return (\n <>\n {links.hrefs.workflow ? (\n <LinkButton\n href={links.hrefs.workflow}\n primary={false}\n icon={<ExternalLink aria-hidden=\"true\" />}\n >\n {tr('calendar.v2.openWorkflow', 'Open workflow')}\n </LinkButton>\n ) : null}\n {links.hrefs.run ? (\n <LinkButton\n href={links.hrefs.run}\n primary={failed}\n icon={<Activity aria-hidden=\"true\" />}\n >\n {tr('calendar.v2.openRun', 'Open run')}\n </LinkButton>\n ) : null}\n </>\n );\n }\n}\n\n/** A run in a list: its time (and name, when the list mixes workflows) and its status. */\nfunction RunPick({ run, withName }: { run: WorkflowRun; withName: boolean }) {\n const page = useCalendarPage();\n const { tr } = page;\n const layer = useWorkflowRunsLayer();\n const time = formatInstantTime(run.at, page.timeZone, page.format);\n const word = runStatusWord(tr, run.status);\n return (\n <li>\n <button\n type=\"button\"\n onClick={() => layer.showInPeek({ kind: 'run', run })}\n aria-label={\n withName\n ? tr('calendar.v2.runPickLabel', '{{name}}, {{time}}, {{status}}', {\n name: run.name,\n time,\n status: word,\n })\n : tr('calendar.v2.runPickTimeLabel', '{{time}}, {{status}}', { time, status: word })\n }\n className={cn(\n 'flex w-full min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5 text-start text-sm hover:bg-bg-sunken',\n FOCUS_RING\n )}\n >\n <span className=\"w-12 shrink-0 tabular-nums text-text-secondary\">{time}</span>\n <span className=\"min-w-0 flex-1 truncate font-medium text-text-primary\">\n {withName ? run.name : null}\n </span>\n <StatusChip status={RUN_STATUS_CHIP[run.status]} icon={RUN_STATUS_ICON[run.status]} quiet>\n {word}\n </StatusChip>\n </button>\n </li>\n );\n}\n\n/** A busy schedule's day in a list: its name, how often, how many, and how they went. */\nfunction GroupPick({ group }: { group: RunGroup }) {\n const page = useCalendarPage();\n const { tr } = page;\n const layer = useWorkflowRunsLayer();\n const status = group.summary.status;\n const sub = [\n runEveryWords(tr, group.everyMinutes, page.durationWords),\n runCountWords(tr, group.runs.length),\n ]\n .filter(Boolean)\n .join(' · ');\n return (\n <li>\n <button\n type=\"button\"\n onClick={() => layer.showInPeek({ kind: 'group', group })}\n className={cn(\n 'flex w-full min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5 text-start text-sm hover:bg-bg-sunken',\n FOCUS_RING\n )}\n >\n <span className=\"w-12 shrink-0 text-xs tabular-nums text-text-secondary\">\n {formatMinutes(group.firstMinute, page.format)}\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate font-medium text-text-primary\">{group.name}</span>\n <small className=\"truncate text-xs text-text-secondary\">{sub}</small>\n </span>\n <StatusChip status={RUN_STATUS_CHIP[status]} icon={RUN_STATUS_ICON[status]} quiet>\n {runStatusWord(tr, status)}\n </StatusChip>\n </button>\n </li>\n );\n}\n\nfunction PickList({ children }: { children: ReactNode }) {\n return (\n <ul className=\"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-2\">{children}</ul>\n );\n}\n\nfunction GroupList({ group, canGoBack }: { group: RunGroup; canGoBack: boolean }) {\n const page = useCalendarPage();\n const { tr } = page;\n const subtitle = [\n formatDay(group.day, page.format, 'mid'),\n runEveryWords(tr, group.everyMinutes, page.durationWords),\n runCountWords(tr, group.runs.length),\n ]\n .filter(Boolean)\n .join(' · ');\n return (\n <>\n <PeekHeader title={group.name} subtitle={subtitle} canGoBack={canGoBack} />\n <p className=\"px-4 pb-2 text-xs text-text-secondary\">{runSummaryWords(tr, group.summary)}</p>\n <PickList>\n {group.runs.map((run) => (\n <RunPick key={run.key} run={run} withName={false} />\n ))}\n </PickList>\n <PeekFooter />\n </>\n );\n}\n\nfunction ClusterList({ runs, canGoBack }: { runs: WorkflowRun[]; canGoBack: boolean }) {\n const page = useCalendarPage();\n const { tr } = page;\n const first = runs[0];\n const subtitle = first\n ? `${formatDay(instantToZoned(first.at, page.timeZone).date, page.format, 'mid')} · ${formatInstantTime(first.at, page.timeZone, page.format)}`\n : undefined;\n return (\n <>\n <PeekHeader\n title={tr('calendar.v2.runsTitleCount', '{{count}} workflow runs', { count: runs.length })}\n subtitle={subtitle}\n canGoBack={canGoBack}\n />\n <PickList>\n {runs.map((run) => (\n <RunPick key={run.key} run={run} withName />\n ))}\n </PickList>\n <PeekFooter />\n </>\n );\n}\n\nfunction DayList({ day, canGoBack }: { day: DayRuns; canGoBack: boolean }) {\n const page = useCalendarPage();\n const { tr } = page;\n return (\n <>\n <PeekHeader\n title={tr('calendar.v2.workflowRuns', 'Workflow runs')}\n subtitle={`${formatDay(day.day, page.format, 'mid')} · ${runCountWords(tr, day.total)}`}\n canGoBack={canGoBack}\n />\n <p className=\"px-4 pb-2 text-xs text-text-secondary\">{runSummaryWords(tr, day.summary)}</p>\n <PickList>\n {day.groups.map((group) => (\n <GroupPick key={group.key} group={group} />\n ))}\n {day.single.map((run) => (\n <RunPick key={run.key} run={run} withName />\n ))}\n </PickList>\n <PeekFooter />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA4DA,SAAgBE,IAAc;CAC5B,IAAMC,IAAOC,EAAgB,GACvBC,IAAQC,EAAqB,GAC7B,EAAE,YAASD,GACXE,IAASC,GAAM,UAAU,MACzBC,IAAaC,SACV,EACL,SAAS,EACP,6BACEH,GAAQ,cACJA,EAAO,sBAAsB,IAC7B,IAAI,QAAQ,OAAO,aAAa,GAAG,KAAK,GAAG,CAAC,EACpD,EACF,IACA,CAACA,CAAM,CACT,GACMI,IAAOH,GAAM,MAAMA,EAAK,MAAM,SAAS;CAC7C,IAAI,CAACA,KAAQ,CAACG,GAAM,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9F,EAAK,QAAQ,KAAK,EAAE,KAAKwF,EAAc5D,GAAIkE,EAAI,KAAK;GACzE;EACZ,CAAA;EACD,kBAAC,KAAD;GAAG,WAAU;GAAyC,UAAAH,EAAgB/D,GAAIkE,EAAI,OAAO;EAAK,CAAA;EAC1F,kBAACJ,GAAD,EAAA,UAAA,CACGI,EAAI,OAAO,KAAK,MACf,kBAACX,IAAD,EAAkC,SAAQ,GAA1BE,EAAM,GAAoB,CAC3C,GACAS,EAAI,OAAO,KAAK,MACf,kBAACf,GAAD;GAA4B;GAAK,UAAA;EAAU,GAA7BlC,EAAI,GAAyB,CAC5C,CACO,EAAA,CAAA;EACV,kBAACV,GAAD,CAAa,CAAA;CACb,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DateValue } from '@burdenoff/fe-libs/ui';
|
|
2
|
+
import { CalendarEventV2, PlacedSegment } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* A day's runs in its grid column: the runs of schedules that run a few times that day, as
|
|
5
|
+
* pills. Nothing while the layer is off.
|
|
6
|
+
*/
|
|
7
|
+
export declare function DayRunPills({ day, hourHeight, placed, }: {
|
|
8
|
+
day: DateValue;
|
|
9
|
+
hourHeight: number;
|
|
10
|
+
placed: readonly PlacedSegment<CalendarEventV2>[];
|
|
11
|
+
}): import('react').JSX.Element | null;
|
|
12
|
+
/**
|
|
13
|
+
* The time grid's runs row, under the all-day row: a chip a day for the schedules that run
|
|
14
|
+
* more than a few times that day ("Lead routing · 72"). Only while one of the shown days has
|
|
15
|
+
* one.
|
|
16
|
+
*/
|
|
17
|
+
export declare function RunsRow({ days, gutter }: {
|
|
18
|
+
days: readonly DateValue[];
|
|
19
|
+
gutter: number;
|
|
20
|
+
}): import('react').JSX.Element | null;
|
|
21
|
+
/** A month day's runs: a badge beside its date, the runs counted. */
|
|
22
|
+
export declare function MonthRunsBadge({ day }: {
|
|
23
|
+
day: DateValue;
|
|
24
|
+
}): import('react').JSX.Element | null;
|
|
25
|
+
/** Phones' month: a dot for the day's runs, after its events' (red when one failed). */
|
|
26
|
+
export declare function PhoneRunDot({ day }: {
|
|
27
|
+
day: DateValue;
|
|
28
|
+
}): import('react').JSX.Element | null;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { formatDay as e, formatMinutes as t } from "../format.js";
|
|
2
|
+
import { minBlockMinutes as n, minuteOffset as r } from "../grid/geometry.js";
|
|
3
|
+
import { useCalendarPage as i } from "../page/CalendarPageContext.js";
|
|
4
|
+
import { EVENT_SELECTED as a, FOCUS_RING as o } from "../styles.js";
|
|
5
|
+
import { isWeekendDay as s } from "../time/calendarTime.js";
|
|
6
|
+
import { clusterRuns as c, summarizeRuns as l } from "./runLayout.js";
|
|
7
|
+
import { RUN_STATUS_ICON as u, RUN_STATUS_TEXT as d, runCountWords as f, runSummaryWords as p } from "./runWords.js";
|
|
8
|
+
import { RUN_OPENER as m, openerKey as h } from "./runPeekState.js";
|
|
9
|
+
import { useRunGroupLabel as g, useRunLabel as _ } from "./useRunLabels.js";
|
|
10
|
+
import { useWorkflowRunsLayer as v } from "./runsLayerContext.js";
|
|
11
|
+
import { GitBranch as y } from "lucide-react";
|
|
12
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
13
|
+
import { cn as C } from "@burdenoff/fe-libs/utils";
|
|
14
|
+
// src/v2/runs/RunPills.tsx
|
|
15
|
+
var w = 20, T = 29, E = "flex h-5 min-w-0 items-center gap-1 overflow-hidden rounded-full border ps-[5px] pe-1.5 text-[11px] leading-none font-semibold whitespace-nowrap shadow-elevation-1", D = "border-border-strong bg-bg-elevated text-text-primary", O = "border-status-error-border bg-status-error-bg-subtle text-status-error-text", k = C(a, "z-[7]");
|
|
16
|
+
function A(e) {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
}
|
|
19
|
+
function j(e) {
|
|
20
|
+
let { peek: t } = v(), n = t?.stack[0];
|
|
21
|
+
return n && e ? h(n) === h(e) : !1;
|
|
22
|
+
}
|
|
23
|
+
function M({ status: e, failed: t, children: n }) {
|
|
24
|
+
let r = u[e];
|
|
25
|
+
return /* @__PURE__ */ S(b, { children: [
|
|
26
|
+
/* @__PURE__ */ x(y, {
|
|
27
|
+
className: C("size-3 shrink-0", t ? "text-current" : "text-text-link"),
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
}),
|
|
30
|
+
n,
|
|
31
|
+
/* @__PURE__ */ x(r, {
|
|
32
|
+
className: C("size-3 shrink-0", t ? "text-current" : d[e]),
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
})
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
function N(e, t, r, i) {
|
|
38
|
+
let a = n(i);
|
|
39
|
+
return e.some((e) => e.startMinute < r && Math.max(e.endMinute, e.startMinute + a) > t);
|
|
40
|
+
}
|
|
41
|
+
function P({ day: e, cluster: n, hourHeight: a, placed: s }) {
|
|
42
|
+
let { tr: c, format: l } = i(), u = v(), d = _(), h = n.runs.length === 1 ? n.runs[0] : void 0, g = h ? {
|
|
43
|
+
kind: "run",
|
|
44
|
+
run: h
|
|
45
|
+
} : {
|
|
46
|
+
kind: "cluster",
|
|
47
|
+
day: e,
|
|
48
|
+
runs: n.runs
|
|
49
|
+
}, y = j(g), b = n.summary.status, S = b === "failed", T = N(s, n.minute, n.minute + w / a * 60, a), P = h ? d(h) : c("calendar.v2.runsClusterLabel", "{{count}} workflow runs from {{time}}: {{summary}}", {
|
|
50
|
+
count: n.runs.length,
|
|
51
|
+
time: t(n.minute, l),
|
|
52
|
+
summary: p(c, n.summary)
|
|
53
|
+
}), F = { top: Math.min(r(n.minute, a), 24 * a - w) };
|
|
54
|
+
return /* @__PURE__ */ x("button", {
|
|
55
|
+
type: "button",
|
|
56
|
+
[m]: "",
|
|
57
|
+
"aria-haspopup": "dialog",
|
|
58
|
+
"aria-label": P,
|
|
59
|
+
title: P,
|
|
60
|
+
style: F,
|
|
61
|
+
onPointerDown: A,
|
|
62
|
+
onClick: (e) => u.openPeek(g, e.currentTarget),
|
|
63
|
+
className: C(E, "absolute end-0.5 z-[4] max-w-[calc(100%-4px)] hover:z-[6] focus-visible:z-[6]", S ? O : D, o, y && k),
|
|
64
|
+
children: /* @__PURE__ */ x(M, {
|
|
65
|
+
status: b,
|
|
66
|
+
failed: S,
|
|
67
|
+
children: T ? null : /* @__PURE__ */ x("span", {
|
|
68
|
+
className: "min-w-0 flex-1 truncate text-start",
|
|
69
|
+
children: h ? h.name : f(c, n.runs.length)
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function F({ day: e, hourHeight: t, placed: n }) {
|
|
75
|
+
let { timeZone: r } = i(), a = v().runsOn(e);
|
|
76
|
+
if (!a || a.single.length === 0) return null;
|
|
77
|
+
let o = 22 / t * 60;
|
|
78
|
+
return /* @__PURE__ */ x(b, { children: c(a.single, r, o).map((r) => /* @__PURE__ */ x(P, {
|
|
79
|
+
day: e,
|
|
80
|
+
cluster: r,
|
|
81
|
+
hourHeight: t,
|
|
82
|
+
placed: n
|
|
83
|
+
}, r.runs[0]?.key ?? r.minute)) });
|
|
84
|
+
}
|
|
85
|
+
function I({ runs: t, index: n, count: r }) {
|
|
86
|
+
let { tr: a, format: s } = i(), c = v(), u = g(), d = t.groups.length === 1 ? t.groups[0] : void 0, p = d ? {
|
|
87
|
+
kind: "group",
|
|
88
|
+
group: d
|
|
89
|
+
} : {
|
|
90
|
+
kind: "day",
|
|
91
|
+
day: t
|
|
92
|
+
}, h = j(p), _ = t.groups.flatMap((e) => e.runs), y = _.length, b = d ? d.summary.status : l(_).status, w = b === "failed", T = d ? u(d) : a("calendar.v2.runsBusyLabel", "{{count}} busy workflows on {{day}}: {{runs}}", {
|
|
93
|
+
count: t.groups.length,
|
|
94
|
+
day: e(t.day, s, "full"),
|
|
95
|
+
runs: f(a, y)
|
|
96
|
+
});
|
|
97
|
+
return /* @__PURE__ */ x("button", {
|
|
98
|
+
type: "button",
|
|
99
|
+
[m]: "",
|
|
100
|
+
"aria-haspopup": "dialog",
|
|
101
|
+
"aria-label": T,
|
|
102
|
+
title: T,
|
|
103
|
+
onClick: (e) => c.openPeek(p, e.currentTarget),
|
|
104
|
+
className: C(E, "absolute top-1 h-[21px] rounded-md", w ? O : D, o, h && k),
|
|
105
|
+
style: {
|
|
106
|
+
insetInlineStart: `calc(${n / r * 100}% + 3px)`,
|
|
107
|
+
width: `calc(${100 / r}% - 6px)`
|
|
108
|
+
},
|
|
109
|
+
children: /* @__PURE__ */ S(M, {
|
|
110
|
+
status: b,
|
|
111
|
+
failed: w,
|
|
112
|
+
children: [/* @__PURE__ */ x("span", {
|
|
113
|
+
className: "min-w-0 flex-1 truncate text-start",
|
|
114
|
+
children: d ? d.name : a("calendar.v2.runsBusyCount", "{{count}} workflows", { count: t.groups.length })
|
|
115
|
+
}), /* @__PURE__ */ x("span", {
|
|
116
|
+
className: C("shrink-0 tabular-nums", w ? "text-current" : "text-text-secondary"),
|
|
117
|
+
children: y
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function L({ days: e, gutter: t }) {
|
|
123
|
+
let { tr: n } = i(), r = v(), a = e.map((e) => r.runsOn(e));
|
|
124
|
+
return a.some((e) => e && e.groups.length > 0) ? /* @__PURE__ */ S("div", {
|
|
125
|
+
className: "grid border-b border-border-default",
|
|
126
|
+
style: { gridTemplateColumns: `${t}px minmax(0, 1fr)` },
|
|
127
|
+
children: [/* @__PURE__ */ x("div", {
|
|
128
|
+
className: "flex items-start justify-end pe-1.5 pt-[7px] text-[10.5px] whitespace-nowrap text-text-muted",
|
|
129
|
+
children: n("calendar.v2.runsRow", "Runs")
|
|
130
|
+
}), /* @__PURE__ */ S("div", {
|
|
131
|
+
className: "relative grid",
|
|
132
|
+
style: {
|
|
133
|
+
gridTemplateColumns: `repeat(${e.length}, minmax(0, 1fr))`,
|
|
134
|
+
height: T
|
|
135
|
+
},
|
|
136
|
+
children: [e.map((e) => /* @__PURE__ */ x("div", { className: C("border-s border-border-subtle", s(e) && "bg-bg-sunken/60") }, e)), a.map((t, n) => t && t.groups.length > 0 ? /* @__PURE__ */ x(I, {
|
|
137
|
+
runs: t,
|
|
138
|
+
index: n,
|
|
139
|
+
count: e.length
|
|
140
|
+
}, t.day) : null)]
|
|
141
|
+
})]
|
|
142
|
+
}) : null;
|
|
143
|
+
}
|
|
144
|
+
function R({ day: t }) {
|
|
145
|
+
let { tr: n, format: r } = i(), a = v(), s = a.runsOn(t), c = s ? {
|
|
146
|
+
kind: "day",
|
|
147
|
+
day: s
|
|
148
|
+
} : null, l = j(c);
|
|
149
|
+
if (!s || !c) return null;
|
|
150
|
+
let u = s.summary.status, d = u === "failed", h = n("calendar.v2.runsOnDay", "{{count}} on {{day}}: {{summary}}", {
|
|
151
|
+
count: f(n, s.total),
|
|
152
|
+
day: e(t, r, "full"),
|
|
153
|
+
summary: p(n, s.summary)
|
|
154
|
+
});
|
|
155
|
+
return /* @__PURE__ */ x("button", {
|
|
156
|
+
type: "button",
|
|
157
|
+
[m]: "",
|
|
158
|
+
"aria-haspopup": "dialog",
|
|
159
|
+
"aria-label": h,
|
|
160
|
+
title: h,
|
|
161
|
+
onClick: (e) => a.openPeek(c, e.currentTarget),
|
|
162
|
+
className: C(E, "absolute end-1 top-1 z-[2] max-w-[calc(100%-36px)] shadow-none", d ? O : "border-border-default bg-bg-elevated text-text-secondary", o, l && k),
|
|
163
|
+
children: /* @__PURE__ */ x(M, {
|
|
164
|
+
status: u,
|
|
165
|
+
failed: d,
|
|
166
|
+
children: /* @__PURE__ */ x("span", {
|
|
167
|
+
className: "tabular-nums",
|
|
168
|
+
children: s.total
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function z({ day: e }) {
|
|
174
|
+
let t = v().runsOn(e);
|
|
175
|
+
return t ? /* @__PURE__ */ x("i", { className: C("size-1.5 rounded-full", t.summary.status === "failed" ? "bg-status-error-text" : "bg-text-link") }) : null;
|
|
176
|
+
}
|
|
177
|
+
export { F as DayRunPills, R as MonthRunsBadge, z as PhoneRunDot, L as RunsRow };
|
|
178
|
+
|
|
179
|
+
//# sourceMappingURL=RunPills.js.map
|