@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
|
@@ -1,98 +1,258 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Link from "next/link";
|
|
4
|
+
import { Card } from "@ekanos/ui/card";
|
|
5
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
4
6
|
import { StatusBadge } from "@ekanos/ui/status-badge";
|
|
5
|
-
import {
|
|
6
|
-
Table,
|
|
7
|
-
TableBody,
|
|
8
|
-
TableCell,
|
|
9
|
-
TableHead,
|
|
10
|
-
TableHeader,
|
|
11
|
-
TableRow
|
|
12
|
-
} from "@ekanos/ui/table";
|
|
7
|
+
import { cn } from "@ekanos/ui/utils";
|
|
13
8
|
import {
|
|
14
9
|
ProvenanceBadge,
|
|
15
|
-
RunModeBadge,
|
|
16
10
|
describeProvenance,
|
|
17
11
|
provenanceDisplayPath,
|
|
18
12
|
provenanceTitle
|
|
19
13
|
} from "../components/integration-badge.js";
|
|
14
|
+
import { PageSkeleton } from "../components/page-skeletons.js";
|
|
20
15
|
import { localIntegrations } from "../components/provenance-banner.js";
|
|
21
|
-
import {
|
|
16
|
+
import { RuntimeStrip } from "../components/runtime-strip.js";
|
|
17
|
+
import { FOCUS_RING } from "../components/scrollable-nav.js";
|
|
18
|
+
import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
|
|
19
|
+
import { useExperience, useProject } from "../lib/console-hooks.js";
|
|
22
20
|
import { integrationConsoleHref } from "../lib/integration-console-href.js";
|
|
23
21
|
const CHECK_TONES = {
|
|
24
22
|
ok: "success",
|
|
25
23
|
failed: "destructive",
|
|
26
24
|
unknown: "neutral"
|
|
27
25
|
};
|
|
26
|
+
const BINDING_TEXT = {
|
|
27
|
+
team: "Uses the team's connection",
|
|
28
|
+
invoker: "Uses each person's own connection",
|
|
29
|
+
user: "Uses one named person's connection"
|
|
30
|
+
};
|
|
31
|
+
function summaryChecks(input) {
|
|
32
|
+
const lines = [
|
|
33
|
+
input.overrides > 0 ? {
|
|
34
|
+
id: "overrides",
|
|
35
|
+
label: "Local overrides",
|
|
36
|
+
tone: "warning",
|
|
37
|
+
status: `${input.overrides} active`,
|
|
38
|
+
text: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
input.overrides,
|
|
40
|
+
" integration",
|
|
41
|
+
input.overrides === 1 ? " is" : "s are",
|
|
42
|
+
" replaced by a local copy from ",
|
|
43
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos.local.json" }),
|
|
44
|
+
". Publishing is blocked until you delete that file."
|
|
45
|
+
] })
|
|
46
|
+
} : {
|
|
47
|
+
id: "overrides",
|
|
48
|
+
label: "Local overrides",
|
|
49
|
+
tone: "success",
|
|
50
|
+
status: "None",
|
|
51
|
+
text: "Every integration resolves the way it will once published."
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
if (input.checks) {
|
|
55
|
+
const { pins, boundary } = input.checks;
|
|
56
|
+
lines.push({
|
|
57
|
+
id: "pins",
|
|
58
|
+
label: "Integration versions",
|
|
59
|
+
tone: CHECK_TONES[pins],
|
|
60
|
+
status: pins === "ok" ? "Match" : pins === "failed" ? "Mismatch" : "Not checked",
|
|
61
|
+
text: pins === "ok" ? "Every integration version pinned in ekanos.json resolved to a contract." : pins === "failed" ? "A pinned integration version did not resolve. The errors at the top of the page say which; fix the version in ekanos.json or run ekanos sync." : "The harness did not check the pinned versions."
|
|
62
|
+
});
|
|
63
|
+
lines.push({
|
|
64
|
+
id: "boundary",
|
|
65
|
+
label: "Experience boundary",
|
|
66
|
+
tone: CHECK_TONES[boundary],
|
|
67
|
+
status: boundary === "ok" ? "Passed" : boundary === "failed" ? "Failed" : "Not checked here",
|
|
68
|
+
text: boundary === "unknown" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
"Whether the code reaches integrations only through their contracts (no direct imports of an integration package). Run",
|
|
70
|
+
" ",
|
|
71
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos check" }),
|
|
72
|
+
" to check it."
|
|
73
|
+
] }) : boundary === "ok" ? "The code reaches integrations only through their contracts." : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74
|
+
"The code imports an integration package directly. Run",
|
|
75
|
+
" ",
|
|
76
|
+
/* @__PURE__ */ jsx("code", { children: "ekanos check" }),
|
|
77
|
+
" for the file and line."
|
|
78
|
+
] })
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return lines;
|
|
82
|
+
}
|
|
28
83
|
function IntegrationConsoleLink({
|
|
29
84
|
integration
|
|
30
85
|
}) {
|
|
31
86
|
const href = integrationConsoleHref(integration);
|
|
32
87
|
const label = `${integration.integration}@${integration.version}`;
|
|
33
|
-
return href ? /* @__PURE__ */ jsx(
|
|
88
|
+
return href ? /* @__PURE__ */ jsx(
|
|
89
|
+
Link,
|
|
90
|
+
{
|
|
91
|
+
href,
|
|
92
|
+
className: cn("rounded-sm font-mono text-sm hover:underline", FOCUS_RING),
|
|
93
|
+
children: label
|
|
94
|
+
}
|
|
95
|
+
) : /* @__PURE__ */ jsx("span", { className: "font-mono text-sm", children: label });
|
|
96
|
+
}
|
|
97
|
+
function SurfaceCard({
|
|
98
|
+
href,
|
|
99
|
+
icon,
|
|
100
|
+
title,
|
|
101
|
+
count: count2,
|
|
102
|
+
text,
|
|
103
|
+
testId
|
|
104
|
+
}) {
|
|
105
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
106
|
+
Card,
|
|
107
|
+
{
|
|
108
|
+
layout: "bleed",
|
|
109
|
+
render: /* @__PURE__ */ jsx(Link, { href }),
|
|
110
|
+
className: cn(
|
|
111
|
+
"hover:bg-muted group flex h-full flex-col gap-2 p-4 transition-colors",
|
|
112
|
+
FOCUS_RING
|
|
113
|
+
),
|
|
114
|
+
"data-test": testId,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Icon, { name: icon, className: "text-muted-foreground h-4 w-4" }),
|
|
118
|
+
/* @__PURE__ */ jsx("span", { className: "group-hover:underline", children: title }),
|
|
119
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground ml-auto text-xs font-normal", children: count2 })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: text })
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
) });
|
|
125
|
+
}
|
|
126
|
+
function count(value, noun) {
|
|
127
|
+
return `${value} ${noun}${value === 1 ? "" : "s"}`;
|
|
34
128
|
}
|
|
35
129
|
function ExperienceSummaryPage() {
|
|
36
130
|
const project = useProject();
|
|
131
|
+
const experience = useExperience();
|
|
132
|
+
const links = useConsoleLinks();
|
|
133
|
+
const { widgets, pages } = useExperienceSurfaces();
|
|
37
134
|
if (!project.data) {
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
135
|
+
return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading the experience" });
|
|
39
136
|
}
|
|
40
|
-
const { integrations
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
137
|
+
const { integrations } = project.data;
|
|
138
|
+
const checks = experience.data?.checks ?? project.data.checks;
|
|
139
|
+
const workflows = experience.data?.workflows ?? [];
|
|
140
|
+
const reviewSections = experience.data?.reviewQueue ?? [];
|
|
141
|
+
const lines = summaryChecks({
|
|
142
|
+
overrides: localIntegrations(integrations).length,
|
|
143
|
+
checks
|
|
144
|
+
});
|
|
145
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", "data-test": "experience-summary", children: [
|
|
146
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", children: [
|
|
147
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
148
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Is it ready?" }),
|
|
149
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Each integration answers from fixtures until it is connected. Widgets and workflows work either way." })
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsx(RuntimeStrip, {})
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", children: [
|
|
154
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "What it ships" }),
|
|
155
|
+
/* @__PURE__ */ jsxs("ul", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4", children: [
|
|
156
|
+
/* @__PURE__ */ jsx(
|
|
157
|
+
SurfaceCard,
|
|
158
|
+
{
|
|
159
|
+
href: `${links.experience}/widgets`,
|
|
160
|
+
icon: "grid-four",
|
|
161
|
+
title: "Widgets",
|
|
162
|
+
count: count(widgets.length, "widget"),
|
|
163
|
+
text: "Every widget rendered with the experience's data.",
|
|
164
|
+
testId: "summary-widgets"
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
SurfaceCard,
|
|
169
|
+
{
|
|
170
|
+
href: `${links.experience}/pages`,
|
|
171
|
+
icon: "browser",
|
|
172
|
+
title: "Pages",
|
|
173
|
+
count: count(pages.length, "page"),
|
|
174
|
+
text: "Every full screen the experience ships, opened as the host shows it.",
|
|
175
|
+
testId: "summary-pages"
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
/* @__PURE__ */ jsx(
|
|
179
|
+
SurfaceCard,
|
|
180
|
+
{
|
|
181
|
+
href: `${links.experience}/workflows`,
|
|
182
|
+
icon: "flow-arrow",
|
|
183
|
+
title: "Workflows",
|
|
184
|
+
count: count(workflows.length, "workflow"),
|
|
185
|
+
text: "Step through each workflow and run it here.",
|
|
186
|
+
testId: "summary-workflows"
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ jsx(
|
|
190
|
+
SurfaceCard,
|
|
191
|
+
{
|
|
192
|
+
href: `${links.experience}/review-queue`,
|
|
193
|
+
icon: "tray",
|
|
194
|
+
title: "Review queue",
|
|
195
|
+
count: count(reviewSections.length, "list"),
|
|
196
|
+
text: "Approvals waiting for you and the lists to review.",
|
|
197
|
+
testId: "summary-review-queue"
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] })
|
|
56
201
|
] }),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */ jsx(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */ jsx(TableHead, { children: "Run modes" }),
|
|
62
|
-
/* @__PURE__ */ jsx(TableHead, { children: "Binding" })
|
|
63
|
-
] }) }),
|
|
64
|
-
/* @__PURE__ */ jsx(TableBody, { children: integrations.map((integration) => /* @__PURE__ */ jsxs(
|
|
65
|
-
TableRow,
|
|
202
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-test": "summary-checks", children: [
|
|
203
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Checks" }),
|
|
204
|
+
/* @__PURE__ */ jsx(Card, { layout: "bleed", className: "divide-y", children: lines.map((line) => /* @__PURE__ */ jsxs(
|
|
205
|
+
"div",
|
|
66
206
|
{
|
|
207
|
+
className: "flex flex-col gap-1 px-4 py-3 sm:flex-row sm:items-start sm:gap-4",
|
|
208
|
+
"data-test": `check-${line.id}`,
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ jsx("span", { className: "flex items-center gap-2 text-sm font-medium sm:w-48 sm:shrink-0", children: line.label }),
|
|
211
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground flex-1 text-sm", children: line.text }),
|
|
212
|
+
/* @__PURE__ */ jsx(StatusBadge, { tone: line.tone, className: "self-start", children: line.status })
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
line.id
|
|
216
|
+
)) })
|
|
217
|
+
] }),
|
|
218
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", children: [
|
|
219
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
220
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Integrations" }),
|
|
221
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Where each one is loaded from, and whose connection it uses." })
|
|
222
|
+
] }),
|
|
223
|
+
/* @__PURE__ */ jsx(Card, { layout: "bleed", render: /* @__PURE__ */ jsx("ul", {}), className: "divide-y", children: integrations.map((integration) => /* @__PURE__ */ jsxs(
|
|
224
|
+
"li",
|
|
225
|
+
{
|
|
226
|
+
className: "flex flex-col gap-2 px-4 py-3 sm:flex-row sm:items-center sm:gap-4",
|
|
67
227
|
"data-test": "integration-row",
|
|
68
228
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
72
|
-
ProvenanceBadge,
|
|
73
|
-
{
|
|
74
|
-
provenance: integration.provenance,
|
|
75
|
-
own: integration.own === true
|
|
76
|
-
}
|
|
77
|
-
),
|
|
229
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
230
|
+
/* @__PURE__ */ jsx(IntegrationConsoleLink, { integration }),
|
|
78
231
|
/* @__PURE__ */ jsx(
|
|
79
232
|
"span",
|
|
80
233
|
{
|
|
81
|
-
className: "text-muted-foreground text-xs",
|
|
234
|
+
className: "text-muted-foreground truncate text-xs",
|
|
82
235
|
title: provenanceTitle(integration.provenance),
|
|
83
236
|
children: provenanceDisplayPath(integration.provenance) || describeProvenance(integration.provenance)
|
|
84
237
|
}
|
|
85
238
|
)
|
|
86
|
-
] })
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
88
|
-
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ jsx(
|
|
241
|
+
ProvenanceBadge,
|
|
242
|
+
{
|
|
243
|
+
provenance: integration.provenance,
|
|
244
|
+
own: integration.own === true
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: BINDING_TEXT[integration.bindingMode ?? "team"] ?? `Binding: ${integration.bindingMode}` })
|
|
89
248
|
]
|
|
90
249
|
},
|
|
91
250
|
integration.integration
|
|
92
251
|
)) })
|
|
93
|
-
] })
|
|
252
|
+
] })
|
|
94
253
|
] });
|
|
95
254
|
}
|
|
96
255
|
export {
|
|
97
|
-
ExperienceSummaryPage
|
|
256
|
+
ExperienceSummaryPage,
|
|
257
|
+
summaryChecks
|
|
98
258
|
};
|
|
@@ -1,25 +1,76 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { useParams } from "next/navigation";
|
|
5
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
6
|
+
import { cn } from "@ekanos/ui/utils";
|
|
7
|
+
import { NotFoundState } from "../components/not-found-state.js";
|
|
8
|
+
import { FOCUS_RING } from "../components/scrollable-nav.js";
|
|
4
9
|
import {
|
|
5
10
|
WidgetSurface,
|
|
6
11
|
withFocusedDefault
|
|
7
12
|
} from "../components/widget-surface.js";
|
|
8
|
-
import { useExperienceSurfaces } from "../lib/console-context.js";
|
|
13
|
+
import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
|
|
9
14
|
import { useProject } from "../lib/console-hooks.js";
|
|
15
|
+
import { declaredWidthLabel } from "../lib/widget-grid-gaps.js";
|
|
10
16
|
function ExperienceWidgetPage() {
|
|
11
17
|
const { id } = useParams();
|
|
12
18
|
const project = useProject();
|
|
19
|
+
const links = useConsoleLinks();
|
|
13
20
|
const { widgets } = useExperienceSurfaces();
|
|
14
|
-
const
|
|
15
|
-
|
|
21
|
+
const widgetId = decodeURIComponent(id);
|
|
22
|
+
const widget = widgets.find((entry) => entry.id === widgetId);
|
|
23
|
+
const allHref = `${links.experience}/widgets`;
|
|
24
|
+
if (!widget) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
NotFoundState,
|
|
27
|
+
{
|
|
28
|
+
testId: "widget-not-found",
|
|
29
|
+
title: `No widget called \u201C${widgetId}\u201D`,
|
|
30
|
+
description: "This experience registers no widget with that id. Pick one it does register.",
|
|
31
|
+
options: widgets.map((entry) => ({
|
|
32
|
+
label: entry.id,
|
|
33
|
+
href: `${allHref}/${encodeURIComponent(entry.id)}`,
|
|
34
|
+
hint: entry.title
|
|
35
|
+
})),
|
|
36
|
+
...widgets.length > 0 ? { optionsLabel: "The widgets in this experience" } : {},
|
|
37
|
+
action: { label: "All widgets", href: allHref }
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const focused = withFocusedDefault(widget);
|
|
16
42
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widget", children: [
|
|
17
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ jsxs(
|
|
44
|
+
Link,
|
|
45
|
+
{
|
|
46
|
+
href: allHref,
|
|
47
|
+
className: cn(
|
|
48
|
+
"text-muted-foreground hover:text-foreground flex w-fit items-center gap-1.5 rounded-sm text-sm",
|
|
49
|
+
FOCUS_RING
|
|
50
|
+
),
|
|
51
|
+
"data-test": "widget-back",
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrow-left", className: "h-4 w-4" }),
|
|
54
|
+
"All widgets"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: widget.title }),
|
|
60
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("code", { children: widget.id }),
|
|
62
|
+
" \xB7 declared ",
|
|
63
|
+
declaredWidthLabel(widget),
|
|
64
|
+
focused === widget ? "" : ", shown full width here",
|
|
65
|
+
". The same grid and controls as the Widgets tab, with this widget alone."
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
18
68
|
/* @__PURE__ */ jsx(
|
|
19
69
|
WidgetSurface,
|
|
20
70
|
{
|
|
21
|
-
widgets: [
|
|
22
|
-
productSlug: project.data?.name ?? "experience"
|
|
71
|
+
widgets: [focused],
|
|
72
|
+
productSlug: project.data?.name ?? "experience",
|
|
73
|
+
controls: true
|
|
23
74
|
}
|
|
24
75
|
)
|
|
25
76
|
] });
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The experience's widgets in the dashboard grid
|
|
3
|
-
* (
|
|
4
|
-
* fixtures the runtime answers from.
|
|
2
|
+
* The experience's widgets in the dashboard grid, with the preview controls
|
|
3
|
+
* (render state, fixture scenario, viewport, unhealthy) directly above it.
|
|
5
4
|
*/
|
|
6
5
|
export declare function ExperienceWidgetsPage(): import("react").JSX.Element;
|
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { EmptyNote } from "@ekanos/ui/empty-note";
|
|
4
|
+
import { DocsLink } from "../components/docs-link.js";
|
|
3
5
|
import { WidgetSurface } from "../components/widget-surface.js";
|
|
4
|
-
import { useExperienceSurfaces } from "../lib/console-context.js";
|
|
6
|
+
import { useConsoleLinks, useExperienceSurfaces } from "../lib/console-context.js";
|
|
5
7
|
import { useProject } from "../lib/console-hooks.js";
|
|
8
|
+
import { DOCS } from "../lib/docs-links.js";
|
|
6
9
|
function ExperienceWidgetsPage() {
|
|
7
10
|
const project = useProject();
|
|
11
|
+
const links = useConsoleLinks();
|
|
8
12
|
const { widgets } = useExperienceSurfaces();
|
|
9
13
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", "data-test": "experience-widgets", children: [
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
15
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: "Widgets" }),
|
|
16
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Every widget this experience registers, in the dashboard grid the product uses, answering from fixtures until its integration is connected. Open one on its own from its caption." })
|
|
17
|
+
] }),
|
|
18
|
+
widgets.length === 0 ? /* @__PURE__ */ jsxs(
|
|
19
|
+
EmptyNote,
|
|
20
|
+
{
|
|
21
|
+
icon: "grid-four",
|
|
22
|
+
title: "No widgets",
|
|
23
|
+
action: /* @__PURE__ */ jsx(DocsLink, { href: DOCS.widgets, children: "Widgets reference" }),
|
|
24
|
+
"data-test": "widgets-empty",
|
|
25
|
+
children: [
|
|
26
|
+
"This experience registers no widgets. Add them to ",
|
|
27
|
+
/* @__PURE__ */ jsx("code", { children: "widgets" }),
|
|
28
|
+
" ",
|
|
29
|
+
"in ",
|
|
30
|
+
/* @__PURE__ */ jsx("code", { children: "defineExperience" }),
|
|
31
|
+
" and they render here."
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
) : /* @__PURE__ */ jsx(
|
|
12
35
|
WidgetSurface,
|
|
13
36
|
{
|
|
14
37
|
widgets,
|
|
15
|
-
productSlug: project.data?.name ?? "experience"
|
|
38
|
+
productSlug: project.data?.name ?? "experience",
|
|
39
|
+
controls: true,
|
|
40
|
+
widgetHref: (id) => `${links.experience}/widgets/${encodeURIComponent(id)}`
|
|
16
41
|
}
|
|
17
42
|
)
|
|
18
43
|
] });
|
|
@@ -1,22 +1,94 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { useParams } from "next/navigation";
|
|
5
|
+
import { Icon } from "@ekanos/ui/icon";
|
|
6
|
+
import { cn } from "@ekanos/ui/utils";
|
|
7
|
+
import { NotFoundState } from "../components/not-found-state.js";
|
|
8
|
+
import { PageSkeleton } from "../components/page-skeletons.js";
|
|
9
|
+
import { FOCUS_RING } from "../components/scrollable-nav.js";
|
|
4
10
|
import { WorkflowRunner } from "../components/workflow-runner.js";
|
|
11
|
+
import { useConsoleLinks } from "../lib/console-context.js";
|
|
5
12
|
import { useExperience } from "../lib/console-hooks.js";
|
|
13
|
+
import { useOperationEffects } from "../lib/use-operation-effects.js";
|
|
14
|
+
import { workflowIntegrations, workflowSummary } from "../lib/workflow-summary.js";
|
|
6
15
|
function ExperienceWorkflowPage() {
|
|
7
16
|
const { id } = useParams();
|
|
8
17
|
const experience = useExperience();
|
|
9
|
-
|
|
10
|
-
return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Loading\u2026" });
|
|
11
|
-
}
|
|
18
|
+
const links = useConsoleLinks();
|
|
12
19
|
const template = (experience.data?.workflows ?? []).find(
|
|
13
20
|
(entry) => entry.id === id
|
|
14
21
|
);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */ jsx(
|
|
22
|
+
const effectOf = useOperationEffects(
|
|
23
|
+
template ? workflowIntegrations(template) : []
|
|
24
|
+
);
|
|
25
|
+
if (experience.isPending) {
|
|
26
|
+
return /* @__PURE__ */ jsx(PageSkeleton, { label: "Loading workflow" });
|
|
27
|
+
}
|
|
28
|
+
if (!template) {
|
|
29
|
+
const workflows = experience.data?.workflows ?? [];
|
|
30
|
+
const name = decodeURIComponent(id);
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
NotFoundState,
|
|
33
|
+
{
|
|
34
|
+
testId: "workflow-not-found",
|
|
35
|
+
title: `No workflow called \u201C${name}\u201D`,
|
|
36
|
+
description: workflows.length > 0 ? "This experience has no workflow with that id. Pick one it does have." : "This experience has no workflows yet.",
|
|
37
|
+
options: workflows.map((entry) => ({
|
|
38
|
+
label: entry.id,
|
|
39
|
+
href: `${links.experience}/workflows/${entry.id}`,
|
|
40
|
+
hint: entry.title
|
|
41
|
+
})),
|
|
42
|
+
...workflows.length > 0 ? { optionsLabel: "The workflows in this experience" } : {},
|
|
43
|
+
action: {
|
|
44
|
+
label: "All workflows",
|
|
45
|
+
href: `${links.experience}/workflows`
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", "data-test": "experience-workflow", children: [
|
|
51
|
+
/* @__PURE__ */ jsxs(
|
|
52
|
+
Link,
|
|
53
|
+
{
|
|
54
|
+
href: `${links.experience}/workflows`,
|
|
55
|
+
className: cn(
|
|
56
|
+
"text-muted-foreground hover:text-foreground flex w-fit items-center gap-1.5 rounded-sm text-sm",
|
|
57
|
+
FOCUS_RING
|
|
58
|
+
),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx(Icon, { name: "arrow-left", className: "h-4 w-4" }),
|
|
61
|
+
"All workflows"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
66
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-normal", children: template.title }),
|
|
67
|
+
template.description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: template.description }) : null,
|
|
68
|
+
/* @__PURE__ */ jsxs(
|
|
69
|
+
"p",
|
|
70
|
+
{
|
|
71
|
+
className: "text-muted-foreground text-sm",
|
|
72
|
+
"data-test": "workflow-summary",
|
|
73
|
+
children: [
|
|
74
|
+
template.steps.length,
|
|
75
|
+
" step",
|
|
76
|
+
template.steps.length === 1 ? "" : "s",
|
|
77
|
+
":",
|
|
78
|
+
" ",
|
|
79
|
+
workflowSummary(template, effectOf)
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
WorkflowRunner,
|
|
86
|
+
{
|
|
87
|
+
template,
|
|
88
|
+
effectOf
|
|
89
|
+
},
|
|
90
|
+
template.id
|
|
91
|
+
)
|
|
20
92
|
] });
|
|
21
93
|
}
|
|
22
94
|
export {
|