@ekanos/harness 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/internal/components/approvals-tray.d.ts +44 -6
- package/dist/internal/components/approvals-tray.js +252 -30
- package/dist/internal/components/ask-assistant-bridge.js +7 -1
- package/dist/internal/components/connect-controls.js +4 -2
- package/dist/internal/components/connect-dialog.d.ts +8 -1
- package/dist/internal/components/connect-dialog.js +23 -10
- package/dist/internal/components/connect-panel.d.ts +3 -2
- package/dist/internal/components/connect-panel.js +680 -340
- package/dist/internal/components/connect-steps.d.ts +72 -0
- package/dist/internal/components/connect-steps.js +341 -0
- package/dist/internal/components/console-not-found.d.ts +14 -0
- package/dist/internal/components/console-not-found.js +57 -0
- package/dist/internal/components/dashboard-grid.d.ts +10 -5
- package/dist/internal/components/dashboard-grid.js +8 -9
- package/dist/internal/components/dev-toolbar.d.ts +27 -5
- package/dist/internal/components/dev-toolbar.js +214 -176
- package/dist/internal/components/ekanos-logo.d.ts +18 -0
- package/dist/internal/components/ekanos-logo.js +74 -0
- package/dist/internal/components/events-panel.d.ts +13 -4
- package/dist/internal/components/events-panel.js +478 -81
- package/dist/internal/components/harness-widget-provider.d.ts +6 -8
- package/dist/internal/components/harness-widget-provider.js +5 -19
- package/dist/internal/components/health-panel.d.ts +8 -1
- package/dist/internal/components/health-panel.js +328 -31
- package/dist/internal/components/integration-badge.js +4 -2
- package/dist/internal/components/integration-tab-skeletons.d.ts +8 -0
- package/dist/internal/components/integration-tab-skeletons.js +76 -0
- package/dist/internal/components/not-found-state.d.ts +39 -0
- package/dist/internal/components/not-found-state.js +127 -0
- package/dist/internal/components/operation-runner-panel.d.ts +1 -1
- package/dist/internal/components/operation-runner-panel.js +624 -189
- package/dist/internal/components/operation-scope.d.ts +13 -0
- package/dist/internal/components/operation-scope.js +79 -0
- package/dist/internal/components/page-skeletons.d.ts +11 -0
- package/dist/internal/components/page-skeletons.js +61 -0
- package/dist/internal/components/provenance-banner.d.ts +13 -4
- package/dist/internal/components/provenance-banner.js +35 -10
- package/dist/internal/components/run-log-copy.d.ts +17 -0
- package/dist/internal/components/run-log-copy.js +67 -0
- package/dist/internal/components/run-log-detail.d.ts +22 -0
- package/dist/internal/components/run-log-detail.js +295 -0
- package/dist/internal/components/run-log-empty.d.ts +13 -0
- package/dist/internal/components/run-log-empty.js +46 -0
- package/dist/internal/components/run-log.d.ts +23 -3
- package/dist/internal/components/run-log.js +384 -130
- package/dist/internal/components/runtime-strip.d.ts +5 -1
- package/dist/internal/components/runtime-strip.js +82 -5
- package/dist/internal/components/schema-form.d.ts +2 -1
- package/dist/internal/components/schema-form.js +212 -79
- package/dist/internal/components/scrollable-nav.js +14 -2
- package/dist/internal/components/segmented-control.d.ts +19 -0
- package/dist/internal/components/segmented-control.js +46 -0
- package/dist/internal/components/shell-header.d.ts +25 -0
- package/dist/internal/components/shell-header.js +126 -0
- package/dist/internal/components/surface-nav.d.ts +12 -4
- package/dist/internal/components/surface-nav.js +79 -80
- package/dist/internal/components/widget-surface.d.ts +5 -1
- package/dist/internal/components/widget-surface.js +86 -14
- package/dist/internal/components/workflow-runner.d.ts +23 -10
- package/dist/internal/components/workflow-runner.js +451 -69
- package/dist/internal/lib/connect-model.d.ts +134 -0
- package/dist/internal/lib/connect-model.js +282 -0
- package/dist/internal/lib/connection-facts.js +2 -1
- package/dist/internal/lib/console-client.js +5 -2
- package/dist/internal/lib/console-hooks.d.ts +4 -1
- package/dist/internal/lib/console-hooks.js +3 -2
- package/dist/internal/lib/console-types.d.ts +6 -0
- package/dist/internal/lib/docs-links.d.ts +27 -0
- package/dist/internal/lib/docs-links.js +55 -1
- package/dist/internal/lib/event-delivery.d.ts +33 -0
- package/dist/internal/lib/event-delivery.js +66 -0
- package/dist/internal/lib/font-files/OFL-BricolageGrotesque.txt +93 -0
- package/dist/internal/lib/font-files/OFL-Figtree.txt +93 -0
- package/dist/internal/lib/font-files/bricolage-grotesque-latin-variable.woff2 +0 -0
- package/dist/internal/lib/font-files/figtree-latin-variable.woff2 +0 -0
- package/dist/internal/lib/fonts.js +13 -12
- package/dist/internal/lib/health-model.d.ts +58 -0
- package/dist/internal/lib/health-model.js +140 -0
- package/dist/internal/lib/integration-console-href.d.ts +5 -0
- package/dist/internal/lib/integration-console-href.js +7 -1
- package/dist/internal/lib/oauth-setup-guide.d.ts +28 -0
- package/dist/internal/lib/oauth-setup-guide.js +35 -1
- package/dist/internal/lib/operation-catalog.d.ts +70 -0
- package/dist/internal/lib/operation-catalog.js +261 -0
- package/dist/internal/lib/overview-model.d.ts +34 -0
- package/dist/internal/lib/overview-model.js +91 -0
- package/dist/internal/lib/registry-entry.d.ts +8 -0
- package/dist/internal/lib/registry-entry.js +11 -0
- package/dist/internal/lib/repo-name.d.ts +9 -0
- package/dist/internal/lib/repo-name.js +21 -0
- package/dist/internal/lib/run-log-view.d.ts +66 -1
- package/dist/internal/lib/run-log-view.js +183 -4
- package/dist/internal/lib/runner-view.d.ts +15 -0
- package/dist/internal/lib/runner-view.js +18 -0
- package/dist/internal/lib/schema-form-model.d.ts +17 -0
- package/dist/internal/lib/schema-form-model.js +50 -0
- package/dist/internal/lib/setup-checklist.d.ts +34 -0
- package/dist/internal/lib/setup-checklist.js +79 -0
- package/dist/internal/lib/toolbar-context.d.ts +0 -1
- package/dist/internal/lib/toolbar-context.js +0 -2
- package/dist/internal/lib/toolbar-visibility.d.ts +9 -2
- package/dist/internal/lib/toolbar-visibility.js +5 -0
- package/dist/internal/lib/use-operation-effects.d.ts +7 -0
- package/dist/internal/lib/use-operation-effects.js +28 -0
- package/dist/internal/lib/use-run-log-query.d.ts +9 -0
- package/dist/internal/lib/use-run-log-query.js +35 -0
- package/dist/internal/lib/widget-grid-gaps.d.ts +18 -0
- package/dist/internal/lib/widget-grid-gaps.js +41 -0
- package/dist/internal/lib/workflow-summary.d.ts +54 -0
- package/dist/internal/lib/workflow-summary.js +147 -0
- package/dist/internal/routes/console-home-page.js +2 -1
- package/dist/internal/routes/experience-connect-page.js +46 -17
- package/dist/internal/routes/experience-layout-page.d.ts +6 -6
- package/dist/internal/routes/experience-layout-page.js +3 -119
- package/dist/internal/routes/experience-page-host.js +61 -5
- package/dist/internal/routes/experience-pages-page.d.ts +5 -0
- package/dist/internal/routes/experience-pages-page.js +118 -0
- package/dist/internal/routes/experience-review-queue-page.d.ts +4 -1
- package/dist/internal/routes/experience-review-queue-page.js +108 -12
- package/dist/internal/routes/experience-runs-page.js +57 -4
- package/dist/internal/routes/experience-summary-page.d.ts +19 -0
- package/dist/internal/routes/experience-summary-page.js +212 -52
- package/dist/internal/routes/experience-widget-page.js +58 -7
- package/dist/internal/routes/experience-widgets-page.d.ts +2 -3
- package/dist/internal/routes/experience-widgets-page.js +29 -4
- package/dist/internal/routes/experience-workflow-page.js +81 -9
- package/dist/internal/routes/experience-workflows-page.js +85 -21
- package/dist/internal/routes/integration-layout.js +28 -3
- package/dist/internal/routes/integrations-connect-page.js +16 -6
- package/dist/internal/routes/integrations-events-page.js +22 -1
- package/dist/internal/routes/integrations-health-page.js +16 -1
- package/dist/internal/routes/integrations-layout.js +28 -4
- package/dist/internal/routes/integrations-list-page.d.ts +0 -1
- package/dist/internal/routes/integrations-list-page.js +11 -9
- package/dist/internal/routes/integrations-operation-page.js +53 -17
- package/dist/internal/routes/integrations-operations-page.js +539 -49
- package/dist/internal/routes/integrations-overview-page.js +332 -69
- package/dist/internal/routes/integrations-runs-page.js +53 -3
- package/dist/internal/routes/integrations-scope.d.ts +15 -2
- package/dist/internal/routes/integrations-scope.js +66 -18
- package/dist/internal/routes/preview-index-page.js +2 -2
- package/dist/internal/routes/repo-home-page.d.ts +2 -2
- package/dist/internal/routes/repo-home-page.js +429 -236
- package/dist/internal/routes/repo-layout.d.ts +12 -0
- package/dist/internal/routes/repo-layout.js +50 -38
- package/dist/internal/routes/repo-package-layouts.js +22 -8
- package/dist/internal/routes/single-widget-page.d.ts +1 -1
- package/dist/internal/routes/single-widget-page.js +28 -5
- package/dist/internal/routes/tile-page.d.ts +1 -1
- package/dist/internal/routes/tile-page.js +1 -2
- package/dist/internal/routes/widgets-page.d.ts +1 -1
- package/dist/internal/routes/widgets-page.js +5 -3
- package/dist/registry.d.ts +4 -5
- package/dist/registry.js +0 -1
- package/dist/routes.d.ts +8 -1
- package/dist/routes.js +4 -0
- package/package.json +14 -14
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { Card } from "@ekanos/ui/card";
|
|
5
|
+
import {
|
|
6
|
+
EmptyMedia,
|
|
7
|
+
EmptyState,
|
|
8
|
+
EmptyStateHeading,
|
|
9
|
+
EmptyStateText
|
|
10
|
+
} from "@ekanos/ui/empty-state";
|
|
11
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
12
|
+
import { StatusBadge } from "@ekanos/ui/status-badge";
|
|
13
|
+
import { DocsLink } from "../components/docs-link.js";
|
|
14
|
+
import {
|
|
15
|
+
useConsoleLinks,
|
|
16
|
+
useExperienceSurfaces
|
|
17
|
+
} from "../lib/console-context.js";
|
|
18
|
+
import { DOCS } from "../lib/docs-links.js";
|
|
19
|
+
const PAGE_HINT = `pages: [
|
|
20
|
+
{
|
|
21
|
+
id: 'desk',
|
|
22
|
+
title: 'Desk',
|
|
23
|
+
path: 'desk',
|
|
24
|
+
component: DeskPage,
|
|
25
|
+
},
|
|
26
|
+
],`;
|
|
27
|
+
const KIND_LABELS = {
|
|
28
|
+
custom: "Page",
|
|
29
|
+
canvas: "Widget page",
|
|
30
|
+
overview: "Overview page"
|
|
31
|
+
};
|
|
32
|
+
function pageKindLabel(kind) {
|
|
33
|
+
return KIND_LABELS[kind ?? "custom"] ?? "Page";
|
|
34
|
+
}
|
|
35
|
+
function pageDetail(page) {
|
|
36
|
+
if (page.kind === "canvas") {
|
|
37
|
+
const count = page.widgets?.length ?? 0;
|
|
38
|
+
return `${count} widget${count === 1 ? "" : "s"}`;
|
|
39
|
+
}
|
|
40
|
+
const sections = page.routes?.length ?? 0;
|
|
41
|
+
if (sections > 0) {
|
|
42
|
+
return `${sections + 1} sections`;
|
|
43
|
+
}
|
|
44
|
+
return page.kind === "overview" && !page.component ? "Shows every widget in the experience" : null;
|
|
45
|
+
}
|
|
46
|
+
function ExperiencePagesPage() {
|
|
47
|
+
const links = useConsoleLinks();
|
|
48
|
+
const { pages } = useExperienceSurfaces();
|
|
49
|
+
if (pages.length === 0) {
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
51
|
+
EmptyState,
|
|
52
|
+
{
|
|
53
|
+
className: "min-w-0 py-12 *:max-w-full *:min-w-0",
|
|
54
|
+
"data-test": "pages-empty",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(EmptyMedia, { variant: "icon", children: /* @__PURE__ */ jsx(Icon, { name: "browser" }) }),
|
|
57
|
+
/* @__PURE__ */ jsx(EmptyStateHeading, { children: "No pages yet" }),
|
|
58
|
+
/* @__PURE__ */ jsxs(EmptyStateText, { className: "max-w-md", children: [
|
|
59
|
+
"A page is a full screen this experience ships, such as a desk or a detail view. Add ",
|
|
60
|
+
/* @__PURE__ */ jsx("code", { children: "pages" }),
|
|
61
|
+
" to ",
|
|
62
|
+
/* @__PURE__ */ jsx("code", { children: "defineExperience" }),
|
|
63
|
+
" ",
|
|
64
|
+
"and each one opens here."
|
|
65
|
+
] }),
|
|
66
|
+
/* @__PURE__ */ jsx("pre", { className: "bg-muted mt-3 w-full max-w-md min-w-0 overflow-x-auto rounded-md px-3 py-2 text-left text-xs", children: PAGE_HINT }),
|
|
67
|
+
/* @__PURE__ */ jsx(DocsLink, { href: DOCS.pageKinds, className: "mt-3", children: "Pages" })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-pages", children: [
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
74
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Pages" }),
|
|
75
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Every page this experience ships. Where each one appears is set by whoever arranges the workspaces." })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Card,
|
|
79
|
+
{
|
|
80
|
+
layout: "bleed",
|
|
81
|
+
render: /* @__PURE__ */ jsx("ul", {}),
|
|
82
|
+
className: "gap-0 divide-y overflow-hidden py-0",
|
|
83
|
+
children: pages.map((page) => {
|
|
84
|
+
const detail = pageDetail(page);
|
|
85
|
+
return /* @__PURE__ */ jsx("li", { "data-test": `page-row-${page.id}`, children: /* @__PURE__ */ jsxs(
|
|
86
|
+
Link,
|
|
87
|
+
{
|
|
88
|
+
href: `${links.experience}/pages/${page.id}`,
|
|
89
|
+
className: "hover:bg-muted focus-visible:ring-ring flex items-center gap-3 px-4 py-3 text-sm focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
92
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: page.title }),
|
|
93
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground flex min-w-0 gap-2 text-xs", children: [
|
|
94
|
+
/* @__PURE__ */ jsx("code", { className: "truncate font-mono", children: page.id }),
|
|
95
|
+
detail ? /* @__PURE__ */ jsx("span", { children: detail }) : null
|
|
96
|
+
] })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: "neutral", className: "ml-auto shrink-0", children: pageKindLabel(page.kind) }),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
Icon,
|
|
101
|
+
{
|
|
102
|
+
name: "caret-right",
|
|
103
|
+
className: "text-muted-foreground size-4 shrink-0",
|
|
104
|
+
"aria-hidden": true
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) }, page.id);
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] });
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
ExperiencePagesPage,
|
|
117
|
+
pageKindLabel
|
|
118
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* What needs a person: approvals waiting on a decision (workflow gates and
|
|
3
|
+
* held writes), then the read-only lists the experience declares for review.
|
|
4
|
+
*/
|
|
2
5
|
export declare function ExperienceReviewQueuePage(): import("react").JSX.Element;
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "next/link";
|
|
3
4
|
import { Alert, AlertDescription } from "@ekanos/ui/alert";
|
|
5
|
+
import { Button } from "@ekanos/ui/button";
|
|
4
6
|
import { Card } from "@ekanos/ui/card";
|
|
7
|
+
import { EmptyNote } from "@ekanos/ui/empty-note";
|
|
8
|
+
import {
|
|
9
|
+
EmptyMedia,
|
|
10
|
+
EmptyState,
|
|
11
|
+
EmptyStateHeading,
|
|
12
|
+
EmptyStateText
|
|
13
|
+
} from "@ekanos/ui/empty-state";
|
|
14
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
15
|
+
import { Skeleton } from "@ekanos/ui/skeleton";
|
|
5
16
|
import { StatusBadge } from "@ekanos/ui/status-badge";
|
|
6
17
|
import { useQuery } from "@tanstack/react-query";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
18
|
+
import { ApprovalList, DecisionLog } from "../components/approvals-tray.js";
|
|
19
|
+
import { DocsLink } from "../components/docs-link.js";
|
|
20
|
+
import { PageSkeleton } from "../components/page-skeletons.js";
|
|
21
|
+
import { useConsoleClient, useConsoleLinks } from "../lib/console-context.js";
|
|
22
|
+
import { useApprovals, useExperience } from "../lib/console-hooks.js";
|
|
23
|
+
import { DOCS } from "../lib/docs-links.js";
|
|
24
|
+
import { shortName } from "../lib/setup-checklist.js";
|
|
25
|
+
import { hasApprovalGate, splitOpKey } from "../lib/workflow-summary.js";
|
|
9
26
|
function Section({ section }) {
|
|
10
27
|
const client = useConsoleClient();
|
|
11
28
|
const result = useQuery({
|
|
@@ -29,30 +46,109 @@ function Section({ section }) {
|
|
|
29
46
|
children: [
|
|
30
47
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
31
48
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-medium", children: section.title }),
|
|
32
|
-
/* @__PURE__ */ jsxs("
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
49
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground text-xs", children: [
|
|
50
|
+
"reads ",
|
|
51
|
+
shortName(section.integration),
|
|
52
|
+
" ",
|
|
53
|
+
/* @__PURE__ */ jsx("code", { children: splitOpKey(section.opKey)?.name ?? section.opKey })
|
|
36
54
|
] })
|
|
37
55
|
] }),
|
|
38
|
-
result.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */
|
|
56
|
+
result.isError ? /* @__PURE__ */ jsx(Alert, { variant: "destructive", children: /* @__PURE__ */ jsxs(AlertDescription, { children: [
|
|
57
|
+
"The read failed: ",
|
|
58
|
+
result.error.message
|
|
59
|
+
] }) }) : result.data?.status === "ok" ? /* @__PURE__ */ jsx("pre", { className: "bg-muted max-h-72 overflow-auto rounded-md p-3 text-xs", children: JSON.stringify(result.data.output, null, 2) }) : result.data?.status === "refused" ? /* @__PURE__ */ jsxs(StatusBadge, { tone: "destructive", children: [
|
|
39
60
|
result.data.reason,
|
|
40
61
|
": ",
|
|
41
62
|
result.data.message
|
|
42
|
-
] }) : /* @__PURE__ */ jsx(
|
|
63
|
+
] }) : /* @__PURE__ */ jsx(Skeleton, { className: "h-24 w-full" })
|
|
43
64
|
]
|
|
44
65
|
}
|
|
45
66
|
);
|
|
46
67
|
}
|
|
68
|
+
function NothingWaiting({
|
|
69
|
+
workflows
|
|
70
|
+
}) {
|
|
71
|
+
const links = useConsoleLinks();
|
|
72
|
+
const gated = workflows.find(hasApprovalGate);
|
|
73
|
+
return /* @__PURE__ */ jsxs(EmptyState, { className: "py-12", "data-test": "review-queue-empty", children: [
|
|
74
|
+
/* @__PURE__ */ jsx(EmptyMedia, { variant: "icon", children: /* @__PURE__ */ jsx(Icon, { name: "tray" }) }),
|
|
75
|
+
/* @__PURE__ */ jsx(EmptyStateHeading, { children: "Nothing waiting for approval" }),
|
|
76
|
+
/* @__PURE__ */ jsxs(EmptyStateText, { className: "max-w-md", children: [
|
|
77
|
+
"When a workflow reaches an approval gate, it stops here until you approve or reject it.",
|
|
78
|
+
" ",
|
|
79
|
+
gated ? `Run ${gated.title} to see one.` : "None of this experience\u2019s workflows has an approval gate yet."
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Button,
|
|
83
|
+
{
|
|
84
|
+
className: "mt-4",
|
|
85
|
+
nativeButton: false,
|
|
86
|
+
render: /* @__PURE__ */ jsx(
|
|
87
|
+
Link,
|
|
88
|
+
{
|
|
89
|
+
href: gated ? `${links.experience}/workflows/${gated.id}` : `${links.experience}/workflows`
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
"data-test": "review-queue-empty-action",
|
|
93
|
+
children: gated ? `Open ${gated.title}` : "Open workflows"
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
47
98
|
function ExperienceReviewQueuePage() {
|
|
48
99
|
const experience = useExperience();
|
|
100
|
+
const approvals = useApprovals();
|
|
49
101
|
const sections = experience.data?.reviewQueue ?? [];
|
|
102
|
+
const workflows = experience.data?.workflows ?? [];
|
|
103
|
+
const waiting = approvals.data ?? [];
|
|
50
104
|
if (experience.isPending) {
|
|
51
|
-
return /* @__PURE__ */ jsx(
|
|
105
|
+
return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the review queue" });
|
|
52
106
|
}
|
|
53
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
107
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", "data-test": "experience-review-queue", children: [
|
|
108
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "review-approvals", children: [
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
110
|
+
/* @__PURE__ */ jsxs("h2", { className: "font-heading text-xl font-normal", children: [
|
|
111
|
+
"Waiting for approval",
|
|
112
|
+
waiting.length > 0 ? /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
113
|
+
" (",
|
|
114
|
+
waiting.length,
|
|
115
|
+
")"
|
|
116
|
+
] }) : null
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Workflow approval gates and held writes. Approving lets the run continue; rejecting stops it." })
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ jsx(DecisionLog, {}),
|
|
121
|
+
approvals.isPending ? /* @__PURE__ */ jsx(Skeleton, { className: "h-28 w-full" }) : waiting.length === 0 ? /* @__PURE__ */ jsx(NothingWaiting, { workflows }) : /* @__PURE__ */ jsx(
|
|
122
|
+
ApprovalList,
|
|
123
|
+
{
|
|
124
|
+
approvals: waiting,
|
|
125
|
+
workflowTitles: Object.fromEntries(
|
|
126
|
+
workflows.map((template) => [template.id, template.title])
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] }),
|
|
131
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "review-sections", children: [
|
|
132
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
133
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Review lists" }),
|
|
134
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Read-only lists this experience declares for a person to look over, each filled by one read operation." })
|
|
135
|
+
] }),
|
|
136
|
+
sections.length === 0 ? /* @__PURE__ */ jsxs(
|
|
137
|
+
EmptyNote,
|
|
138
|
+
{
|
|
139
|
+
icon: "list-checks",
|
|
140
|
+
title: "No review lists",
|
|
141
|
+
action: /* @__PURE__ */ jsx(DocsLink, { href: DOCS.experiences, children: "defineExperience reference" }),
|
|
142
|
+
children: [
|
|
143
|
+
"Add ",
|
|
144
|
+
/* @__PURE__ */ jsx("code", { children: "reviewQueue" }),
|
|
145
|
+
" to ",
|
|
146
|
+
/* @__PURE__ */ jsx("code", { children: "defineExperience" }),
|
|
147
|
+
", each section naming one read operation, and its results show here."
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: sections.map((section) => /* @__PURE__ */ jsx(Section, { section }, section.id)) })
|
|
151
|
+
] })
|
|
56
152
|
] });
|
|
57
153
|
}
|
|
58
154
|
export {
|
|
@@ -1,11 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { RunLog } from "../components/run-log.js";
|
|
4
|
+
import { RunLogEmpty } from "../components/run-log-empty.js";
|
|
5
|
+
import { useConsoleLinks } from "../lib/console-context.js";
|
|
6
|
+
import { useProject } from "../lib/console-hooks.js";
|
|
7
|
+
import { integrationConsoleHref } from "../lib/integration-console-href.js";
|
|
8
|
+
import { runTargetHref } from "../lib/run-log-view.js";
|
|
9
|
+
import { useRunLogQuery } from "../lib/use-run-log-query.js";
|
|
4
10
|
function ExperienceRunsPage() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
const links = useConsoleLinks();
|
|
12
|
+
const project = useProject();
|
|
13
|
+
const [query, setQuery] = useRunLogQuery();
|
|
14
|
+
const consoles = new Map(
|
|
15
|
+
(project.data?.integrations ?? []).map((integration) => [
|
|
16
|
+
integration.integration,
|
|
17
|
+
integrationConsoleHref(integration)
|
|
18
|
+
])
|
|
19
|
+
);
|
|
20
|
+
const firstConsole = [...consoles.values()].find(
|
|
21
|
+
(href) => href !== null
|
|
22
|
+
);
|
|
23
|
+
const emptyLinks = [
|
|
24
|
+
{
|
|
25
|
+
href: `${links.experience}/workflows`,
|
|
26
|
+
label: "Run a workflow",
|
|
27
|
+
testId: "run-log-empty-workflows"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
href: `${links.experience}/widgets`,
|
|
31
|
+
label: "Open the widgets",
|
|
32
|
+
testId: "run-log-empty-widgets"
|
|
33
|
+
},
|
|
34
|
+
...firstConsole ? [
|
|
35
|
+
{
|
|
36
|
+
href: `${firstConsole}/operations`,
|
|
37
|
+
label: "Run an operation",
|
|
38
|
+
testId: "run-log-empty-operations"
|
|
39
|
+
}
|
|
40
|
+
] : []
|
|
41
|
+
];
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", "data-test": "experience-runs", children: [
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
44
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Run log" }),
|
|
45
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Every operation this experience calls, from its widgets, pages, workflows and review queue, newest first. Open a run to see its status, timing and where it came from." })
|
|
46
|
+
] }),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
RunLog,
|
|
49
|
+
{
|
|
50
|
+
query,
|
|
51
|
+
onQueryChange: setQuery,
|
|
52
|
+
targetHrefFor: (run) => runTargetHref(consoles.get(run.integration) ?? null, run.opKey),
|
|
53
|
+
empty: /* @__PURE__ */ jsx(
|
|
54
|
+
RunLogEmpty,
|
|
55
|
+
{
|
|
56
|
+
text: "Each call the experience makes lands here as it happens: a widget loading, a workflow step, a review-queue action. Run a workflow or open a widget to see one.",
|
|
57
|
+
links: emptyLinks
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
)
|
|
9
62
|
] });
|
|
10
63
|
}
|
|
11
64
|
export {
|
|
@@ -1 +1,20 @@
|
|
|
1
|
+
import { type StatusTone } from '@ekanos/ui/status-badge';
|
|
2
|
+
import type { CheckStatus } from '../lib/console-types.js';
|
|
3
|
+
interface CheckLine {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
tone: StatusTone;
|
|
7
|
+
status: string;
|
|
8
|
+
text: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** The three checks, each in plain words: what it means and what to do. */
|
|
11
|
+
export declare function summaryChecks(input: {
|
|
12
|
+
overrides: number;
|
|
13
|
+
checks?: {
|
|
14
|
+
pins: CheckStatus;
|
|
15
|
+
boundary: CheckStatus;
|
|
16
|
+
} | undefined;
|
|
17
|
+
}): CheckLine[];
|
|
18
|
+
/** What this experience is, whether it is ready, and what there is to look at. */
|
|
1
19
|
export declare function ExperienceSummaryPage(): import("react").JSX.Element;
|
|
20
|
+
export {};
|