@burdenoff/microfe-semanticfed 2026.1109.13 → 2026.1109.15
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/semanticfed/components/AskQuestionPanel.d.ts +0 -14
- package/dist/semanticfed/components/AskQuestionPanel.js +198 -160
- package/dist/semanticfed/components/AskQuestionPanel.js.map +1 -1
- package/dist/semanticfed/components/OnboardingChecklist.js +172 -128
- package/dist/semanticfed/components/OnboardingChecklist.js.map +1 -1
- package/dist/semanticfed/components/PageHeader.d.ts +11 -0
- package/dist/semanticfed/components/PageHeader.js +21 -0
- package/dist/semanticfed/components/PageHeader.js.map +1 -0
- package/dist/semanticfed/components/SavedQueryRunsPanel.js +217 -193
- package/dist/semanticfed/components/SavedQueryRunsPanel.js.map +1 -1
- package/dist/semanticfed/components/SummaryCard.d.ts +10 -0
- package/dist/semanticfed/components/SummaryCard.js +21 -0
- package/dist/semanticfed/components/SummaryCard.js.map +1 -0
- package/dist/semanticfed/components/TableHeaders.d.ts +16 -0
- package/dist/semanticfed/components/TableHeaders.js +21 -0
- package/dist/semanticfed/components/TableHeaders.js.map +1 -0
- package/dist/semanticfed/components/askConversation.d.ts +16 -0
- package/dist/semanticfed/components/askConversation.js +7 -0
- package/dist/semanticfed/components/askConversation.js.map +1 -0
- package/dist/semanticfed/components/lineage/LineageDetails.d.ts +14 -0
- package/dist/semanticfed/components/lineage/LineageDetails.js +151 -0
- package/dist/semanticfed/components/lineage/LineageDetails.js.map +1 -0
- package/dist/semanticfed/components/lineage/LineageLanes.d.ts +11 -0
- package/dist/semanticfed/components/lineage/LineageLanes.js +78 -0
- package/dist/semanticfed/components/lineage/LineageLanes.js.map +1 -0
- package/dist/semanticfed/components/lineage/LineageToolbar.d.ts +14 -0
- package/dist/semanticfed/components/lineage/LineageToolbar.js +69 -0
- package/dist/semanticfed/components/lineage/LineageToolbar.js.map +1 -0
- package/dist/semanticfed/components/lineage/LineageWarnings.d.ts +13 -0
- package/dist/semanticfed/components/lineage/LineageWarnings.js +43 -0
- package/dist/semanticfed/components/lineage/LineageWarnings.js.map +1 -0
- package/dist/semanticfed/components/lineage/lineageModel.d.ts +26 -0
- package/dist/semanticfed/components/lineage/lineageModel.js +104 -0
- package/dist/semanticfed/components/lineage/lineageModel.js.map +1 -0
- package/dist/semanticfed/components/lineage/useLineageTrace.d.ts +17 -0
- package/dist/semanticfed/components/lineage/useLineageTrace.js +34 -0
- package/dist/semanticfed/components/lineage/useLineageTrace.js.map +1 -0
- package/dist/semanticfed/components/queryConsole/QueryHistoryCard.d.ts +10 -0
- package/dist/semanticfed/components/queryConsole/QueryHistoryCard.js +47 -0
- package/dist/semanticfed/components/queryConsole/QueryHistoryCard.js.map +1 -0
- package/dist/semanticfed/components/queryConsole/SchemaBrowser.d.ts +13 -0
- package/dist/semanticfed/components/queryConsole/SchemaBrowser.js +89 -0
- package/dist/semanticfed/components/queryConsole/SchemaBrowser.js.map +1 -0
- package/dist/semanticfed/components/queryConsole/SqlEditorCard.d.ts +14 -0
- package/dist/semanticfed/components/queryConsole/SqlEditorCard.js +69 -0
- package/dist/semanticfed/components/queryConsole/SqlEditorCard.js.map +1 -0
- package/dist/semanticfed/components/queryConsole/SqlResultCard.d.ts +14 -0
- package/dist/semanticfed/components/queryConsole/SqlResultCard.js +71 -0
- package/dist/semanticfed/components/queryConsole/SqlResultCard.js.map +1 -0
- package/dist/semanticfed/components/queryConsole/consoleHistory.d.ts +23 -0
- package/dist/semanticfed/components/queryConsole/consoleHistory.js +19 -0
- package/dist/semanticfed/components/queryConsole/consoleHistory.js.map +1 -0
- package/dist/semanticfed/hooks/useNlQuery.js +13 -10
- package/dist/semanticfed/hooks/useNlQuery.js.map +1 -1
- package/dist/semanticfed/pages/AgentsPage.js +113 -142
- package/dist/semanticfed/pages/AgentsPage.js.map +1 -1
- package/dist/semanticfed/pages/AuditPage.js +94 -75
- package/dist/semanticfed/pages/AuditPage.js.map +1 -1
- package/dist/semanticfed/pages/CollaborationPage.js +60 -64
- package/dist/semanticfed/pages/CollaborationPage.js.map +1 -1
- package/dist/semanticfed/pages/ConfigurationPage.js +82 -63
- package/dist/semanticfed/pages/ConfigurationPage.js.map +1 -1
- package/dist/semanticfed/pages/KnowledgeGraphPage.js +120 -119
- package/dist/semanticfed/pages/KnowledgeGraphPage.js.map +1 -1
- package/dist/semanticfed/pages/LineagePage.js +108 -424
- package/dist/semanticfed/pages/LineagePage.js.map +1 -1
- package/dist/semanticfed/pages/OntologyPage.js +70 -97
- package/dist/semanticfed/pages/OntologyPage.js.map +1 -1
- package/dist/semanticfed/pages/PoliciesPage.js +104 -133
- package/dist/semanticfed/pages/PoliciesPage.js.map +1 -1
- package/dist/semanticfed/pages/ProtocolPage.js +70 -74
- package/dist/semanticfed/pages/ProtocolPage.js.map +1 -1
- package/dist/semanticfed/pages/QueryConsolePage.js +160 -327
- package/dist/semanticfed/pages/QueryConsolePage.js.map +1 -1
- package/dist/semanticfed/pages/RegistryPage.js +90 -101
- package/dist/semanticfed/pages/RegistryPage.js.map +1 -1
- package/dist/semanticfed/pages/TopologyPage.js +68 -99
- package/dist/semanticfed/pages/TopologyPage.js.map +1 -1
- package/dist/semanticfed/utils/contentKeys.d.ts +16 -0
- package/dist/semanticfed/utils/contentKeys.js +14 -0
- package/dist/semanticfed/utils/contentKeys.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { isRunPollExpired as e, isTerminalRunStatus as t, restrictiveDecisions as n, runGovernance as r, useSemQueryRun as i, useSemQueryRunResult as a, useSemQueryRuns as o, useSemRunSavedQuery as s, useSemSavedQueries as c } from "../hooks/useQueryRuns.js";
|
|
2
2
|
import { sqlErrorMessage as l } from "../hooks/useSqlConsole.js";
|
|
3
3
|
import { useTr as u } from "../hooks/useTr.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { withContentKeys as d } from "../utils/contentKeys.js";
|
|
5
|
+
import { formatCell as f } from "../utils/format.js";
|
|
6
|
+
import { useState as p } from "react";
|
|
7
|
+
import { AlertTriangle as m, BookMarked as h, CheckCircle2 as g, ChevronLeft as _, ChevronRight as v, Clock as y, EyeOff as b, History as x, Loader2 as S, Play as C, ShieldAlert as w, XCircle as T } from "lucide-react";
|
|
8
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
9
|
+
import { Badge as k, Button as A, Card as j, CardContent as M, CardHeader as N, CardTitle as P } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
// src/semanticfed/components/SavedQueryRunsPanel.tsx
|
|
10
|
-
function
|
|
11
|
+
function F(e) {
|
|
11
12
|
if (!e) return "";
|
|
12
13
|
let t = new Date(e);
|
|
13
14
|
return Number.isNaN(t.getTime()) ? e : t.toLocaleString();
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function I(e, t) {
|
|
16
17
|
switch (t) {
|
|
17
18
|
case "QUEUED": return e("semanticfed.queryConsole.saved.status.queued", "Queued");
|
|
18
19
|
case "PLANNING": return e("semanticfed.queryConsole.saved.status.planning", "Planning");
|
|
@@ -22,10 +23,10 @@ function F(e, t) {
|
|
|
22
23
|
case "CANCELLED": return e("semanticfed.queryConsole.saved.status.cancelled", "Cancelled");
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return e === "SUCCEEDED" ? /* @__PURE__ */
|
|
26
|
+
function L({ status: e }) {
|
|
27
|
+
return e === "SUCCEEDED" ? /* @__PURE__ */ D(g, { className: "h-4 w-4 shrink-0 text-primary" }) : e === "FAILED" || e === "CANCELLED" ? /* @__PURE__ */ D(T, { className: "h-4 w-4 shrink-0 text-destructive" }) : /* @__PURE__ */ D(S, { className: "h-4 w-4 shrink-0 animate-spin text-muted-foreground" });
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function R(e, t) {
|
|
29
30
|
switch (t) {
|
|
30
31
|
case "NULL": return e("semanticfed.queryConsole.saved.mask.null", "Hidden (NULL)");
|
|
31
32
|
case "REDACT": return e("semanticfed.queryConsole.saved.mask.redact", "Redacted");
|
|
@@ -33,131 +34,131 @@ function L(e, t) {
|
|
|
33
34
|
default: return e("semanticfed.queryConsole.saved.mask.other", "Masked");
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function z({ run: e, tr: t }) {
|
|
37
38
|
let i = r(e.planSummary), a = i?.outcome === "DENIED", o = i ? n(i) : [];
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ O("div", {
|
|
39
40
|
className: "space-y-2 rounded border border-destructive/40 p-3 text-sm",
|
|
40
41
|
"data-testid": "saved-query-run-error",
|
|
41
42
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ O("div", {
|
|
43
44
|
className: "flex items-start gap-2 text-destructive",
|
|
44
|
-
children: [
|
|
45
|
+
children: [D(a ? w : T, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ O("span", {
|
|
45
46
|
className: "break-words",
|
|
46
47
|
children: [a ? t("semanticfed.queryConsole.saved.denied", "Denied by access policy") : t("semanticfed.queryConsole.saved.failed", "The run failed"), e.errorMessage ? `: ${e.errorMessage}` : ""]
|
|
47
48
|
})]
|
|
48
49
|
}),
|
|
49
|
-
a && i?.reason && i.reason !== e.errorMessage && /* @__PURE__ */
|
|
50
|
+
a && i?.reason && i.reason !== e.errorMessage && /* @__PURE__ */ D("p", {
|
|
50
51
|
className: "text-xs text-muted-foreground",
|
|
51
52
|
children: i.reason
|
|
52
53
|
}),
|
|
53
|
-
o.length > 0 && /* @__PURE__ */
|
|
54
|
+
o.length > 0 && /* @__PURE__ */ D("ul", {
|
|
54
55
|
className: "space-y-1 text-xs text-muted-foreground",
|
|
55
56
|
"data-testid": "saved-query-denials",
|
|
56
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
children: d(o, (e) => `${e.action}:${e.entity}:${e.field ?? ""}:${e.policyName ?? ""}:${e.detail ?? ""}`).map(({ key: e, item: t }) => /* @__PURE__ */ O("li", { children: [
|
|
58
|
+
/* @__PURE__ */ O("span", {
|
|
58
59
|
className: "font-mono",
|
|
59
|
-
children: [
|
|
60
|
+
children: [t.entity, t.field ? `.${t.field}` : ""]
|
|
60
61
|
}),
|
|
61
62
|
" ",
|
|
62
63
|
"— ",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
] },
|
|
64
|
+
t.action,
|
|
65
|
+
t.policyName ? ` (${t.policyName})` : "",
|
|
66
|
+
t.detail ? `: ${t.detail}` : ""
|
|
67
|
+
] }, e))
|
|
67
68
|
})
|
|
68
69
|
]
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
let [n, r] =
|
|
73
|
-
if (o.isLoading) return /* @__PURE__ */
|
|
74
|
-
if (o.isError) return /* @__PURE__ */
|
|
72
|
+
function B({ runId: e, tr: t }) {
|
|
73
|
+
let [n, r] = p([0]), i = n[n.length - 1] ?? 0, o = a(e, i);
|
|
74
|
+
if (o.isLoading) return /* @__PURE__ */ D(S, { className: "h-4 w-4 animate-spin text-muted-foreground" });
|
|
75
|
+
if (o.isError) return /* @__PURE__ */ D("p", {
|
|
75
76
|
className: "text-sm text-destructive",
|
|
76
77
|
"data-testid": "saved-query-result-error",
|
|
77
78
|
children: t("semanticfed.queryConsole.saved.resultUnavailable", "The rows of this run are not available: {message}. Results are kept for a limited time and only for the person who ran the query; run it again to see current rows.", { message: l(o.error) })
|
|
78
79
|
});
|
|
79
80
|
let s = o.data;
|
|
80
81
|
if (!s) return null;
|
|
81
|
-
let c = s.columns.filter((e) => e.masked), u = s.rows.length === 0 ? 0 : s.offset + 1,
|
|
82
|
-
return /* @__PURE__ */
|
|
82
|
+
let c = s.columns.filter((e) => e.masked), u = s.rows.length === 0 ? 0 : s.offset + 1, d = s.offset + s.rows.length;
|
|
83
|
+
return /* @__PURE__ */ O("div", {
|
|
83
84
|
className: "space-y-2",
|
|
84
85
|
"data-testid": "saved-query-result",
|
|
85
86
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ O("div", {
|
|
87
88
|
className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground",
|
|
88
89
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ D("span", {
|
|
90
91
|
className: "font-medium text-foreground",
|
|
91
92
|
"data-testid": "saved-query-result-range",
|
|
92
93
|
children: t("semanticfed.queryConsole.saved.rowsRange", "Rows {first}–{last} of {count}", {
|
|
93
94
|
first: u.toLocaleString(),
|
|
94
|
-
last:
|
|
95
|
+
last: d.toLocaleString(),
|
|
95
96
|
count: s.rowCount.toLocaleString()
|
|
96
97
|
})
|
|
97
98
|
}),
|
|
98
|
-
s.truncated && /* @__PURE__ */
|
|
99
|
+
s.truncated && /* @__PURE__ */ O(k, {
|
|
99
100
|
variant: "outline",
|
|
100
101
|
className: "gap-1",
|
|
101
102
|
"data-testid": "saved-query-truncated",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ D(m, { className: "h-3 w-3" }), t("semanticfed.queryConsole.saved.truncated", "Stored the first {count} of {total} rows", {
|
|
103
104
|
count: s.rowCount.toLocaleString(),
|
|
104
105
|
total: s.totalRowCount.toLocaleString()
|
|
105
106
|
})]
|
|
106
107
|
}),
|
|
107
|
-
c.length > 0 && /* @__PURE__ */
|
|
108
|
+
c.length > 0 && /* @__PURE__ */ O(k, {
|
|
108
109
|
variant: "outline",
|
|
109
110
|
className: "gap-1",
|
|
110
111
|
"data-testid": "saved-query-masked-note",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3" }), t("semanticfed.queryConsole.saved.maskedNote", "{count} column(s) masked by access policy", { count: c.length })]
|
|
112
113
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ D("span", { children: t("semanticfed.queryConsole.saved.expires", "Result kept until {time}", { time: F(s.expiresAt) }) })
|
|
114
115
|
]
|
|
115
116
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ D("div", {
|
|
117
118
|
className: "max-h-[28rem] overflow-auto rounded border",
|
|
118
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ O("table", {
|
|
119
120
|
className: "w-max min-w-full max-w-none table-auto text-left text-xs",
|
|
120
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ D("thead", {
|
|
121
122
|
className: "sticky top-0 bg-muted",
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ D("tr", { children: s.columns.map((e) => /* @__PURE__ */ O("th", {
|
|
123
124
|
className: "whitespace-nowrap px-3 py-2 font-medium",
|
|
124
125
|
"data-masked": e.masked ? e.mask ?? "MASKED" : void 0,
|
|
125
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ O("span", {
|
|
126
127
|
className: "inline-flex items-center gap-1",
|
|
127
|
-
children: [e.name, e.masked && /* @__PURE__ */
|
|
128
|
+
children: [e.name, e.masked && /* @__PURE__ */ O(k, {
|
|
128
129
|
variant: "outline",
|
|
129
130
|
className: "gap-1 px-1 py-0 text-[10px] font-normal",
|
|
130
131
|
title: t("semanticfed.queryConsole.saved.maskedTitle", "Masked by access policy ({mask})", { mask: e.mask ?? "" }),
|
|
131
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ D(b, { className: "h-3 w-3" }), R(t, e.mask)]
|
|
132
133
|
})]
|
|
133
|
-
}), /* @__PURE__ */
|
|
134
|
+
}), /* @__PURE__ */ D("span", {
|
|
134
135
|
className: "block text-[10px] font-normal text-muted-foreground",
|
|
135
136
|
children: e.aggregation ? `${e.aggregation}(${e.entity}.${e.field})` : `${e.entity}.${e.field}`
|
|
136
137
|
})]
|
|
137
138
|
}, e.name)) })
|
|
138
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ O("tbody", { children: [s.rows.map((e, t) => /* @__PURE__ */ D("tr", {
|
|
139
140
|
className: "border-t",
|
|
140
|
-
children: s.columns.map((t) => /* @__PURE__ */
|
|
141
|
+
children: s.columns.map((t) => /* @__PURE__ */ D("td", {
|
|
141
142
|
className: t.masked ? "whitespace-nowrap bg-muted/40 px-3 py-1.5 font-mono text-muted-foreground" : "whitespace-nowrap px-3 py-1.5 font-mono",
|
|
142
|
-
children:
|
|
143
|
+
children: f(e[t.name])
|
|
143
144
|
}, t.name))
|
|
144
|
-
}, s.offset + t)), s.rows.length === 0 && /* @__PURE__ */
|
|
145
|
+
}, s.offset + t)), s.rows.length === 0 && /* @__PURE__ */ D("tr", { children: /* @__PURE__ */ D("td", {
|
|
145
146
|
colSpan: Math.max(s.columns.length, 1),
|
|
146
147
|
className: "px-3 py-4 text-center text-muted-foreground",
|
|
147
148
|
children: t("semanticfed.queryConsole.saved.noRows", "No rows matched, or none you are allowed to see")
|
|
148
149
|
}) })] })]
|
|
149
150
|
})
|
|
150
151
|
}),
|
|
151
|
-
(n.length > 1 || s.nextOffset !== null) && /* @__PURE__ */
|
|
152
|
+
(n.length > 1 || s.nextOffset !== null) && /* @__PURE__ */ O("div", {
|
|
152
153
|
className: "flex items-center justify-end gap-2",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ O(A, {
|
|
154
155
|
size: "sm",
|
|
155
156
|
variant: "outline",
|
|
156
157
|
disabled: n.length <= 1 || o.isFetching,
|
|
157
158
|
onClick: () => r((e) => e.slice(0, -1)),
|
|
158
159
|
"data-testid": "saved-query-prev-page",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
160
|
-
}), /* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ D(_, { className: "mr-1 h-4 w-4" }), t("semanticfed.queryConsole.saved.previous", "Previous")]
|
|
161
|
+
}), /* @__PURE__ */ O(A, {
|
|
161
162
|
size: "sm",
|
|
162
163
|
variant: "outline",
|
|
163
164
|
disabled: s.nextOffset === null || o.isFetching,
|
|
@@ -166,131 +167,142 @@ function z({ runId: e, tr: t }) {
|
|
|
166
167
|
e !== null && r((t) => [...t, e]);
|
|
167
168
|
},
|
|
168
169
|
"data-testid": "saved-query-next-page",
|
|
169
|
-
children: [t("semanticfed.queryConsole.saved.next", "Next {count}", { count: 100 }), /* @__PURE__ */
|
|
170
|
+
children: [t("semanticfed.queryConsole.saved.next", "Next {count}", { count: 100 }), /* @__PURE__ */ D(v, { className: "ml-1 h-4 w-4" })]
|
|
170
171
|
})]
|
|
171
172
|
})
|
|
172
173
|
]
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
-
let
|
|
177
|
-
|
|
178
|
-
className: "
|
|
179
|
-
children:
|
|
176
|
+
function V({ run: e, tr: n }) {
|
|
177
|
+
let i = r(e.planSummary);
|
|
178
|
+
return /* @__PURE__ */ O("div", {
|
|
179
|
+
className: "flex flex-wrap items-center gap-3 text-sm",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ D(L, { status: e.status }),
|
|
182
|
+
/* @__PURE__ */ D("span", {
|
|
183
|
+
className: "font-medium",
|
|
184
|
+
"data-testid": "saved-query-run-status",
|
|
185
|
+
children: I(n, e.status)
|
|
186
|
+
}),
|
|
187
|
+
e.durationMs !== null && /* @__PURE__ */ O("span", {
|
|
188
|
+
className: "text-muted-foreground",
|
|
189
|
+
children: [e.durationMs, "ms"]
|
|
190
|
+
}),
|
|
191
|
+
t(e.status) && /* @__PURE__ */ D("span", {
|
|
192
|
+
className: "text-muted-foreground",
|
|
193
|
+
children: n("semanticfed.queryConsole.result.sources", "{count} sources", { count: e.sourcesTouched })
|
|
194
|
+
}),
|
|
195
|
+
e.fromCache && /* @__PURE__ */ D(k, {
|
|
196
|
+
variant: "outline",
|
|
197
|
+
children: n("semanticfed.queryConsole.saved.fromCache", "From cache")
|
|
198
|
+
}),
|
|
199
|
+
i && i.policiesEvaluated > 0 && /* @__PURE__ */ O(k, {
|
|
200
|
+
variant: "outline",
|
|
201
|
+
className: "gap-1",
|
|
202
|
+
children: [/* @__PURE__ */ D(w, { className: "h-3 w-3" }), n("semanticfed.queryConsole.saved.policies", "{count} access policies applied", { count: i.policiesEvaluated })]
|
|
203
|
+
})
|
|
204
|
+
]
|
|
180
205
|
});
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
206
|
+
}
|
|
207
|
+
function H({ run: t, checking: n, onCheckAgain: r, tr: i }) {
|
|
208
|
+
return e(t) ? /* @__PURE__ */ O("div", {
|
|
209
|
+
className: "flex flex-wrap items-center gap-2 text-xs text-muted-foreground",
|
|
210
|
+
"data-testid": "saved-query-run-stalled",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ D(m, { className: "h-3 w-3" }),
|
|
213
|
+
/* @__PURE__ */ D("span", { children: i("semanticfed.queryConsole.saved.stalled", "This run is taking longer than expected, so it is no longer checked automatically.") }),
|
|
214
|
+
/* @__PURE__ */ D(A, {
|
|
215
|
+
size: "sm",
|
|
216
|
+
variant: "outline",
|
|
217
|
+
disabled: n,
|
|
218
|
+
onClick: r,
|
|
219
|
+
children: i("semanticfed.queryConsole.saved.checkAgain", "Check again")
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
}) : /* @__PURE__ */ D("p", {
|
|
223
|
+
className: "text-xs text-muted-foreground",
|
|
224
|
+
children: i("semanticfed.queryConsole.saved.waiting", "The query runs in the background across its data sources; this updates when it finishes.")
|
|
184
225
|
});
|
|
185
|
-
|
|
186
|
-
|
|
226
|
+
}
|
|
227
|
+
function U({ runId: e, tr: n }) {
|
|
228
|
+
let r = i(e), a = r.data;
|
|
229
|
+
return r.isError ? /* @__PURE__ */ D("p", {
|
|
230
|
+
className: "text-sm text-destructive",
|
|
231
|
+
children: l(r.error)
|
|
232
|
+
}) : a ? /* @__PURE__ */ O("div", {
|
|
187
233
|
className: "space-y-3",
|
|
188
234
|
"data-testid": "saved-query-run",
|
|
189
|
-
"data-status":
|
|
235
|
+
"data-status": a.status,
|
|
190
236
|
children: [
|
|
191
|
-
/* @__PURE__ */ D(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/* @__PURE__ */ E(I, { status: s.status }),
|
|
195
|
-
/* @__PURE__ */ E("span", {
|
|
196
|
-
className: "font-medium",
|
|
197
|
-
"data-testid": "saved-query-run-status",
|
|
198
|
-
children: F(a, s.status)
|
|
199
|
-
}),
|
|
200
|
-
s.durationMs !== null && /* @__PURE__ */ D("span", {
|
|
201
|
-
className: "text-muted-foreground",
|
|
202
|
-
children: [s.durationMs, "ms"]
|
|
203
|
-
}),
|
|
204
|
-
t(s.status) && /* @__PURE__ */ E("span", {
|
|
205
|
-
className: "text-muted-foreground",
|
|
206
|
-
children: a("semanticfed.queryConsole.result.sources", "{count} sources", { count: s.sourcesTouched })
|
|
207
|
-
}),
|
|
208
|
-
s.fromCache && /* @__PURE__ */ E(O, {
|
|
209
|
-
variant: "outline",
|
|
210
|
-
children: a("semanticfed.queryConsole.saved.fromCache", "From cache")
|
|
211
|
-
}),
|
|
212
|
-
c && c.policiesEvaluated > 0 && /* @__PURE__ */ D(O, {
|
|
213
|
-
variant: "outline",
|
|
214
|
-
className: "gap-1",
|
|
215
|
-
children: [/* @__PURE__ */ E(C, { className: "h-3 w-3" }), a("semanticfed.queryConsole.saved.policies", "{count} access policies applied", { count: c.policiesEvaluated })]
|
|
216
|
-
})
|
|
217
|
-
]
|
|
237
|
+
/* @__PURE__ */ D(V, {
|
|
238
|
+
run: a,
|
|
239
|
+
tr: n
|
|
218
240
|
}),
|
|
219
|
-
!t(
|
|
220
|
-
|
|
221
|
-
|
|
241
|
+
!t(a.status) && /* @__PURE__ */ D(H, {
|
|
242
|
+
run: a,
|
|
243
|
+
checking: r.isFetching,
|
|
244
|
+
onCheckAgain: () => void r.refetch(),
|
|
245
|
+
tr: n
|
|
222
246
|
}),
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
size: "sm",
|
|
231
|
-
variant: "outline",
|
|
232
|
-
disabled: o.isFetching,
|
|
233
|
-
onClick: () => void o.refetch(),
|
|
234
|
-
children: a("semanticfed.queryConsole.saved.checkAgain", "Check again")
|
|
235
|
-
})
|
|
236
|
-
]
|
|
237
|
-
}),
|
|
238
|
-
s.status === "SUCCEEDED" && /* @__PURE__ */ E(z, {
|
|
239
|
-
runId: s.id,
|
|
240
|
-
tr: a
|
|
241
|
-
}, s.id),
|
|
242
|
-
(s.status === "FAILED" || s.status === "CANCELLED") && /* @__PURE__ */ E(R, {
|
|
243
|
-
run: s,
|
|
244
|
-
tr: a
|
|
247
|
+
a.status === "SUCCEEDED" && /* @__PURE__ */ D(B, {
|
|
248
|
+
runId: a.id,
|
|
249
|
+
tr: n
|
|
250
|
+
}, a.id),
|
|
251
|
+
(a.status === "FAILED" || a.status === "CANCELLED") && /* @__PURE__ */ D(z, {
|
|
252
|
+
run: a,
|
|
253
|
+
tr: n
|
|
245
254
|
})
|
|
246
255
|
]
|
|
256
|
+
}) : r.isLoading ? /* @__PURE__ */ D(S, { className: "h-4 w-4 animate-spin text-muted-foreground" }) : /* @__PURE__ */ D("p", {
|
|
257
|
+
className: "text-sm text-muted-foreground",
|
|
258
|
+
children: n("semanticfed.queryConsole.saved.runMissing", "This run no longer exists.")
|
|
247
259
|
});
|
|
248
260
|
}
|
|
249
|
-
function
|
|
261
|
+
function W({ queryId: e, selectedRunId: t, onSelect: n, tr: r }) {
|
|
250
262
|
let i = o(e);
|
|
251
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ O("div", {
|
|
252
264
|
className: "space-y-2",
|
|
253
265
|
children: [
|
|
254
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ O("h3", {
|
|
255
267
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ D(x, { className: "h-4 w-4" }), r("semanticfed.queryConsole.saved.history", "Run history")]
|
|
257
269
|
}),
|
|
258
|
-
i.isLoading && /* @__PURE__ */
|
|
259
|
-
i.isError && /* @__PURE__ */
|
|
270
|
+
i.isLoading && /* @__PURE__ */ D(S, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
|
|
271
|
+
i.isError && /* @__PURE__ */ D("p", {
|
|
260
272
|
className: "text-xs text-destructive",
|
|
261
273
|
children: l(i.error)
|
|
262
274
|
}),
|
|
263
|
-
i.isSuccess && i.data.length === 0 && /* @__PURE__ */
|
|
275
|
+
i.isSuccess && i.data.length === 0 && /* @__PURE__ */ D("p", {
|
|
264
276
|
className: "text-xs text-muted-foreground",
|
|
265
277
|
children: r("semanticfed.queryConsole.saved.noRuns", "This query has not been run yet.")
|
|
266
278
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ D("div", {
|
|
268
280
|
className: "space-y-1",
|
|
269
281
|
"data-testid": "saved-query-history",
|
|
270
|
-
children: (i.data ?? []).map((e) => /* @__PURE__ */
|
|
282
|
+
children: (i.data ?? []).map((e) => /* @__PURE__ */ O("button", {
|
|
271
283
|
type: "button",
|
|
272
284
|
onClick: () => n(e.id),
|
|
273
285
|
"aria-pressed": e.id === t,
|
|
274
286
|
className: e.id === t ? "flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-1 rounded border border-primary bg-muted p-2 text-left text-xs" : "flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-1 rounded border p-2 text-left text-xs hover:bg-muted",
|
|
275
287
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ D(L, { status: e.status }),
|
|
289
|
+
/* @__PURE__ */ D("span", {
|
|
278
290
|
className: "font-medium",
|
|
279
|
-
children:
|
|
291
|
+
children: I(r, e.status)
|
|
280
292
|
}),
|
|
281
|
-
e.rowCount !== null && /* @__PURE__ */
|
|
293
|
+
e.rowCount !== null && /* @__PURE__ */ D("span", {
|
|
282
294
|
className: "text-muted-foreground",
|
|
283
295
|
children: r("semanticfed.queryConsole.history.results", "{count} results", { count: e.rowCount.toLocaleString() })
|
|
284
296
|
}),
|
|
285
|
-
e.durationMs !== null && /* @__PURE__ */
|
|
297
|
+
e.durationMs !== null && /* @__PURE__ */ O("span", {
|
|
286
298
|
className: "text-muted-foreground",
|
|
287
299
|
children: [e.durationMs, "ms"]
|
|
288
300
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ O("span", {
|
|
290
302
|
className: "ml-auto flex max-w-full min-w-0 items-center gap-1 text-muted-foreground",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ D(y, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ D("span", {
|
|
292
304
|
className: "min-w-0 break-words text-right",
|
|
293
|
-
children:
|
|
305
|
+
children: F(e.createdAt)
|
|
294
306
|
})]
|
|
295
307
|
})
|
|
296
308
|
]
|
|
@@ -299,12 +311,56 @@ function V({ queryId: e, selectedRunId: t, onSelect: n, tr: r }) {
|
|
|
299
311
|
]
|
|
300
312
|
});
|
|
301
313
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
304
|
-
|
|
314
|
+
function G({ queries: e, query: t, running: n, onChoose: r, onRun: i, tr: a }) {
|
|
315
|
+
return /* @__PURE__ */ O(E, { children: [
|
|
316
|
+
/* @__PURE__ */ O("div", {
|
|
317
|
+
className: "flex flex-wrap items-end gap-2",
|
|
318
|
+
children: [/* @__PURE__ */ O("div", {
|
|
319
|
+
className: "min-w-0 flex-1",
|
|
320
|
+
children: [/* @__PURE__ */ D("label", {
|
|
321
|
+
className: "mb-1 block text-xs font-medium text-muted-foreground",
|
|
322
|
+
htmlFor: "saved-query-select",
|
|
323
|
+
children: a("semanticfed.queryConsole.saved.pick", "Saved query")
|
|
324
|
+
}), /* @__PURE__ */ D("select", {
|
|
325
|
+
id: "saved-query-select",
|
|
326
|
+
"data-testid": "saved-query-select",
|
|
327
|
+
className: "w-full rounded border bg-background p-2 text-sm",
|
|
328
|
+
value: t.id,
|
|
329
|
+
onChange: (e) => r(e.target.value),
|
|
330
|
+
children: e.map((e) => /* @__PURE__ */ D("option", {
|
|
331
|
+
value: e.id,
|
|
332
|
+
children: e.status === "DRAFT" ? a("semanticfed.queryConsole.saved.draftOption", "{name} (draft)", { name: e.name }) : e.name
|
|
333
|
+
}, e.id))
|
|
334
|
+
})]
|
|
335
|
+
}), /* @__PURE__ */ O(A, {
|
|
336
|
+
size: "sm",
|
|
337
|
+
onClick: i,
|
|
338
|
+
disabled: n || !t.modelId,
|
|
339
|
+
"data-testid": "saved-query-run-button",
|
|
340
|
+
children: [n ? /* @__PURE__ */ D(S, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ D(C, { className: "mr-2 h-4 w-4" }), a("semanticfed.queryConsole.saved.run", "Run query")]
|
|
341
|
+
})]
|
|
342
|
+
}),
|
|
343
|
+
t.description && /* @__PURE__ */ D("p", {
|
|
344
|
+
className: "text-xs text-muted-foreground",
|
|
345
|
+
children: t.description
|
|
346
|
+
}),
|
|
347
|
+
!t.modelId && /* @__PURE__ */ D("p", {
|
|
348
|
+
className: "text-xs text-destructive",
|
|
349
|
+
children: a("semanticfed.queryConsole.saved.noModel", "This query is not linked to a semantic model, so it cannot run.")
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ D("pre", {
|
|
352
|
+
className: "max-h-40 overflow-auto rounded bg-muted p-3 font-mono text-[11px] text-foreground",
|
|
353
|
+
"data-testid": "saved-query-text",
|
|
354
|
+
children: t.queryText
|
|
355
|
+
})
|
|
356
|
+
] });
|
|
357
|
+
}
|
|
358
|
+
function K({ modelId: e }) {
|
|
359
|
+
let t = u(), n = c(e), r = s(), [i, a] = p(null), [o, d] = p(null), [f, m] = p(null), g = n.data ?? [], _ = g.find((e) => e.id === i) ?? g[0] ?? null, v = _ && o?.queryId === _.id ? o.runId : null, y = (e) => {
|
|
360
|
+
a(e || null), d(null), m(null);
|
|
305
361
|
}, b = async () => {
|
|
306
362
|
if (_ && !r.isPending) {
|
|
307
|
-
|
|
363
|
+
m(null);
|
|
308
364
|
try {
|
|
309
365
|
let e = await r.mutateAsync(_.id);
|
|
310
366
|
d({
|
|
@@ -312,85 +368,53 @@ function H({ modelId: e }) {
|
|
|
312
368
|
runId: e.id
|
|
313
369
|
});
|
|
314
370
|
} catch (e) {
|
|
315
|
-
|
|
371
|
+
m(l(e));
|
|
316
372
|
}
|
|
317
373
|
}
|
|
318
374
|
};
|
|
319
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ O(j, {
|
|
320
376
|
"data-testid": "saved-queries-panel",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ O(N, {
|
|
322
378
|
className: "pb-3",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ O(P, {
|
|
324
380
|
className: "flex items-center gap-2 text-base",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
326
|
-
}), /* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ D(h, { className: "h-4 w-4" }), t("semanticfed.queryConsole.saved.title", "Saved queries")]
|
|
382
|
+
}), /* @__PURE__ */ D("p", {
|
|
327
383
|
className: "text-xs text-muted-foreground",
|
|
328
384
|
children: t("semanticfed.queryConsole.saved.description", "Run a saved federated query in the background and read its governed result: only the rows you may see, with masked columns marked.")
|
|
329
385
|
})]
|
|
330
|
-
}), /* @__PURE__ */
|
|
386
|
+
}), /* @__PURE__ */ O(M, {
|
|
331
387
|
className: "space-y-4",
|
|
332
388
|
children: [
|
|
333
|
-
n.isLoading && /* @__PURE__ */
|
|
334
|
-
n.isError && /* @__PURE__ */
|
|
389
|
+
n.isLoading && /* @__PURE__ */ D(S, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
|
|
390
|
+
n.isError && /* @__PURE__ */ D("p", {
|
|
335
391
|
className: "text-sm text-destructive",
|
|
336
392
|
children: l(n.error)
|
|
337
393
|
}),
|
|
338
|
-
n.isSuccess && g.length === 0 && /* @__PURE__ */
|
|
394
|
+
n.isSuccess && g.length === 0 && /* @__PURE__ */ D("p", {
|
|
339
395
|
className: "text-sm text-muted-foreground",
|
|
340
396
|
"data-testid": "saved-queries-empty",
|
|
341
397
|
children: t("semanticfed.queryConsole.saved.empty", "No saved queries for this model yet. Save a federated query with the API, SDK or CLI and it appears here.")
|
|
342
398
|
}),
|
|
343
|
-
_ && /* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */ D(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
children: t("semanticfed.queryConsole.saved.pick", "Saved query")
|
|
352
|
-
}), /* @__PURE__ */ E("select", {
|
|
353
|
-
id: "saved-query-select",
|
|
354
|
-
"data-testid": "saved-query-select",
|
|
355
|
-
className: "w-full rounded border bg-background p-2 text-sm",
|
|
356
|
-
value: _.id,
|
|
357
|
-
onChange: (e) => y(e.target.value),
|
|
358
|
-
children: g.map((e) => /* @__PURE__ */ E("option", {
|
|
359
|
-
value: e.id,
|
|
360
|
-
children: e.status === "DRAFT" ? t("semanticfed.queryConsole.saved.draftOption", "{name} (draft)", { name: e.name }) : e.name
|
|
361
|
-
}, e.id))
|
|
362
|
-
})]
|
|
363
|
-
}), /* @__PURE__ */ D(k, {
|
|
364
|
-
size: "sm",
|
|
365
|
-
onClick: () => void b(),
|
|
366
|
-
disabled: r.isPending || !_.modelId,
|
|
367
|
-
"data-testid": "saved-query-run-button",
|
|
368
|
-
children: [r.isPending ? /* @__PURE__ */ E(x, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ E(S, { className: "mr-2 h-4 w-4" }), t("semanticfed.queryConsole.saved.run", "Run query")]
|
|
369
|
-
})]
|
|
370
|
-
}),
|
|
371
|
-
_.description && /* @__PURE__ */ E("p", {
|
|
372
|
-
className: "text-xs text-muted-foreground",
|
|
373
|
-
children: _.description
|
|
374
|
-
}),
|
|
375
|
-
!_.modelId && /* @__PURE__ */ E("p", {
|
|
376
|
-
className: "text-xs text-destructive",
|
|
377
|
-
children: t("semanticfed.queryConsole.saved.noModel", "This query is not linked to a semantic model, so it cannot run.")
|
|
378
|
-
}),
|
|
379
|
-
/* @__PURE__ */ E("pre", {
|
|
380
|
-
className: "max-h-40 overflow-auto rounded bg-muted p-3 font-mono text-[11px] text-foreground",
|
|
381
|
-
"data-testid": "saved-query-text",
|
|
382
|
-
children: _.queryText
|
|
399
|
+
_ && /* @__PURE__ */ O(E, { children: [
|
|
400
|
+
/* @__PURE__ */ D(G, {
|
|
401
|
+
queries: g,
|
|
402
|
+
query: _,
|
|
403
|
+
running: r.isPending,
|
|
404
|
+
onChoose: y,
|
|
405
|
+
onRun: () => void b(),
|
|
406
|
+
tr: t
|
|
383
407
|
}),
|
|
384
|
-
|
|
408
|
+
f && /* @__PURE__ */ D("p", {
|
|
385
409
|
className: "text-sm text-destructive",
|
|
386
410
|
"data-testid": "saved-query-run-start-error",
|
|
387
|
-
children:
|
|
411
|
+
children: f
|
|
388
412
|
}),
|
|
389
|
-
v && /* @__PURE__ */
|
|
413
|
+
v && /* @__PURE__ */ D(U, {
|
|
390
414
|
runId: v,
|
|
391
415
|
tr: t
|
|
392
416
|
}, v),
|
|
393
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ D(W, {
|
|
394
418
|
queryId: _.id,
|
|
395
419
|
selectedRunId: v,
|
|
396
420
|
onSelect: (e) => d({
|
|
@@ -404,6 +428,6 @@ function H({ modelId: e }) {
|
|
|
404
428
|
})]
|
|
405
429
|
});
|
|
406
430
|
}
|
|
407
|
-
export {
|
|
431
|
+
export { K as SavedQueryRunsPanel };
|
|
408
432
|
|
|
409
433
|
//# sourceMappingURL=SavedQueryRunsPanel.js.map
|