@burdenoff/microfe-bigconsole 2026.1121.2 → 2026.1121.4
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/bigconsole/components/ask/AskYourData.js +116 -116
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +102 -102
- package/dist/bigconsole/components/explore/SqlDraftEditor.js +135 -135
- package/dist/bigconsole/components/explore/exploreErrors.d.ts +10 -0
- package/dist/bigconsole/components/explore/exploreErrors.js +5 -1
- package/dist/bigconsole/components/explore/useExploreRun.js +37 -37
- package/package.json +4 -4
|
@@ -1,211 +1,211 @@
|
|
|
1
1
|
import { BigConsoleAskAddToDashboardDocument as e, CreateExploreWidgetDocument as t, ExploreDashboardsDocument as n, ExplorePagesDocument as r } from "../../../generated/wspace-operations.js";
|
|
2
2
|
import { workspaceRequest as i } from "./useExploreRun.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { SavedQueryWidget as
|
|
3
|
+
import { exploreErrorMessage as a, withoutError as o } from "./exploreErrors.js";
|
|
4
|
+
import { Control as s, controlClass as c } from "./VisualBuilder.js";
|
|
5
|
+
import { useOptionalBigConsole as l } from "../../context/BigConsoleContext.js";
|
|
6
|
+
import { SavedQueryWidget as u } from "./SavedQueryWidget.js";
|
|
7
7
|
import "../../hooks/useActivePage.js";
|
|
8
|
-
import { useOptionalTr as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { useApolloClient as
|
|
11
|
-
import { jsx as
|
|
8
|
+
import { useOptionalTr as d } from "../../../shared/hooks/useTr.js";
|
|
9
|
+
import { useEffect as f, useRef as p, useState as m } from "react";
|
|
10
|
+
import { useApolloClient as h } from "@apollo/client/react";
|
|
11
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
12
|
// src/bigconsole/components/explore/CreateQueryWidget.tsx
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
]),
|
|
19
|
-
|
|
20
|
-
let e = new AbortController(), t = i(
|
|
21
|
-
return
|
|
13
|
+
function v({ savedId: v, askSpec: y, name: b, workspaceId: x }) {
|
|
14
|
+
let S = h(), C = d(), w = l(), [T, E] = m(""), [D, O] = m(""), [k, A] = m([]), [j, M] = m([]), [N, P] = m(b), [F, I] = m(""), [L, R] = m(""), [z, B] = m(""), [V, H] = m(null), [U, W] = m(null), [G, K] = m(null), [q, J] = m(null), Y = JSON.stringify([
|
|
15
|
+
T,
|
|
16
|
+
G,
|
|
17
|
+
q
|
|
18
|
+
]), X = Y !== L, [Z, Q] = m(!1);
|
|
19
|
+
f(() => {
|
|
20
|
+
let e = new AbortController(), t = i(x, e.signal);
|
|
21
|
+
return T ? S.query({
|
|
22
22
|
query: r,
|
|
23
23
|
variables: {
|
|
24
|
-
dashboardId:
|
|
25
|
-
after:
|
|
24
|
+
dashboardId: T,
|
|
25
|
+
after: q
|
|
26
26
|
},
|
|
27
27
|
fetchPolicy: "no-cache",
|
|
28
28
|
context: t
|
|
29
|
-
}).then(({ data: t }) => {
|
|
29
|
+
}).then(o).then(({ data: t }) => {
|
|
30
30
|
if (e.signal.aborted) return;
|
|
31
31
|
let n = t?.getDashboard?.pages;
|
|
32
32
|
if (!n) throw Error("Missing pages");
|
|
33
|
-
|
|
33
|
+
I(""), M((e) => [...q ? e : [], ...n.edges.map((e) => e.node)]), W(n.pageInfo.hasNextPage ? n.pageInfo.endCursor ?? null : null);
|
|
34
34
|
}).catch((t) => {
|
|
35
|
-
e.signal.aborted ||
|
|
35
|
+
e.signal.aborted || I(a(t, C));
|
|
36
36
|
}).finally(() => {
|
|
37
|
-
e.signal.aborted ||
|
|
38
|
-
}) :
|
|
37
|
+
e.signal.aborted || R(Y);
|
|
38
|
+
}) : S.query({
|
|
39
39
|
query: n,
|
|
40
|
-
variables: { after:
|
|
40
|
+
variables: { after: G },
|
|
41
41
|
fetchPolicy: "no-cache",
|
|
42
42
|
context: t
|
|
43
|
-
}).then(({ data: t }) => {
|
|
43
|
+
}).then(o).then(({ data: t }) => {
|
|
44
44
|
if (e.signal.aborted) return;
|
|
45
45
|
if (!t?.listDashboards) throw Error("Missing dashboards");
|
|
46
46
|
let n = t.listDashboards;
|
|
47
|
-
|
|
47
|
+
I(""), A((e) => [...G ? e : [], ...n.edges.map((e) => e.node)]), H(n.pageInfo.hasNextPage ? n.pageInfo.endCursor ?? null : null);
|
|
48
48
|
}).catch((t) => {
|
|
49
|
-
e.signal.aborted ||
|
|
49
|
+
e.signal.aborted || I(a(t, C));
|
|
50
50
|
}).finally(() => {
|
|
51
|
-
e.signal.aborted ||
|
|
51
|
+
e.signal.aborted || R(Y);
|
|
52
52
|
}), () => e.abort();
|
|
53
53
|
}, [
|
|
54
|
+
S,
|
|
54
55
|
x,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
S
|
|
56
|
+
T,
|
|
57
|
+
G,
|
|
58
|
+
q,
|
|
59
|
+
Y,
|
|
60
|
+
C
|
|
61
61
|
]);
|
|
62
|
-
let
|
|
63
|
-
|
|
62
|
+
let $ = p(null);
|
|
63
|
+
f(() => {
|
|
64
64
|
let e = new AbortController();
|
|
65
|
-
return
|
|
65
|
+
return $.current = e, () => e.abort();
|
|
66
66
|
}, []);
|
|
67
|
-
async function
|
|
68
|
-
let n =
|
|
69
|
-
if (n && !n.signal.aborted && !
|
|
70
|
-
|
|
67
|
+
async function ee() {
|
|
68
|
+
let n = $.current;
|
|
69
|
+
if (n && !n.signal.aborted && !Z && N.trim() && D) {
|
|
70
|
+
Q(!0), I("");
|
|
71
71
|
try {
|
|
72
|
-
let r = i(
|
|
73
|
-
if (
|
|
74
|
-
let { data: t } = await
|
|
72
|
+
let r = i(x, n.signal), a;
|
|
73
|
+
if (y !== void 0) {
|
|
74
|
+
let { data: t } = o(await S.mutate({
|
|
75
75
|
mutation: e,
|
|
76
76
|
variables: {
|
|
77
|
-
spec:
|
|
78
|
-
title:
|
|
79
|
-
pageId:
|
|
77
|
+
spec: y,
|
|
78
|
+
title: N.trim(),
|
|
79
|
+
pageId: D
|
|
80
80
|
},
|
|
81
81
|
fetchPolicy: "no-cache",
|
|
82
82
|
context: r
|
|
83
|
-
});
|
|
83
|
+
}));
|
|
84
84
|
a = t?.bigconsoleAskAddToDashboard;
|
|
85
85
|
} else {
|
|
86
|
-
let { data: e } = await
|
|
86
|
+
let { data: e } = o(await S.mutate({
|
|
87
87
|
mutation: t,
|
|
88
88
|
variables: {
|
|
89
|
-
savedQueryId:
|
|
90
|
-
title:
|
|
91
|
-
pageId:
|
|
89
|
+
savedQueryId: v ?? "",
|
|
90
|
+
title: N.trim(),
|
|
91
|
+
pageId: D
|
|
92
92
|
},
|
|
93
93
|
fetchPolicy: "no-cache",
|
|
94
94
|
context: r
|
|
95
|
-
});
|
|
95
|
+
}));
|
|
96
96
|
a = e?.bigconsoleCreateExploreWidget;
|
|
97
97
|
}
|
|
98
98
|
if (n.signal.aborted) return;
|
|
99
99
|
if (!a) throw Error("Missing widget");
|
|
100
|
-
|
|
100
|
+
B(a);
|
|
101
101
|
} catch (e) {
|
|
102
|
-
n.signal.aborted ||
|
|
102
|
+
n.signal.aborted || I(a(e, C));
|
|
103
103
|
} finally {
|
|
104
|
-
n.signal.aborted ||
|
|
104
|
+
n.signal.aborted || Q(!1);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
return
|
|
108
|
+
return z ? /* @__PURE__ */ _("div", {
|
|
109
109
|
className: "space-y-2",
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ g("p", {
|
|
112
112
|
role: "status",
|
|
113
113
|
children: "Widget created."
|
|
114
114
|
}),
|
|
115
|
-
|
|
115
|
+
w && /* @__PURE__ */ g("button", {
|
|
116
116
|
type: "button",
|
|
117
117
|
className: "underline",
|
|
118
|
-
onClick: () =>
|
|
118
|
+
onClick: () => w.navigate(`/dashboards/${encodeURIComponent(T)}?page=${encodeURIComponent(D)}`),
|
|
119
119
|
children: "Open dashboard"
|
|
120
120
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
id:
|
|
123
|
-
title:
|
|
121
|
+
/* @__PURE__ */ g(u, {
|
|
122
|
+
id: z,
|
|
123
|
+
title: N
|
|
124
124
|
})
|
|
125
125
|
]
|
|
126
|
-
}) : /* @__PURE__ */
|
|
126
|
+
}) : /* @__PURE__ */ _("fieldset", {
|
|
127
127
|
className: "space-y-2",
|
|
128
128
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ g("legend", {
|
|
130
130
|
className: "font-medium",
|
|
131
131
|
children: "Create a dashboard widget"
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ _("div", {
|
|
134
134
|
className: "flex flex-wrap items-end gap-2",
|
|
135
135
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ g(s, {
|
|
137
137
|
label: "Dashboard",
|
|
138
|
-
children: /* @__PURE__ */
|
|
139
|
-
className:
|
|
140
|
-
value:
|
|
141
|
-
disabled:
|
|
138
|
+
children: /* @__PURE__ */ _("select", {
|
|
139
|
+
className: c,
|
|
140
|
+
value: T,
|
|
141
|
+
disabled: Z,
|
|
142
142
|
onChange: (e) => {
|
|
143
|
-
|
|
143
|
+
E(e.target.value), O(""), M([]), J(null), W(null);
|
|
144
144
|
},
|
|
145
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ g("option", {
|
|
146
146
|
value: "",
|
|
147
147
|
children: "Choose dashboard"
|
|
148
|
-
}),
|
|
148
|
+
}), k.map((e) => /* @__PURE__ */ g("option", {
|
|
149
149
|
value: e.id,
|
|
150
150
|
children: e.name
|
|
151
151
|
}, e.id))]
|
|
152
152
|
})
|
|
153
153
|
}),
|
|
154
|
-
!
|
|
154
|
+
!T && V && /* @__PURE__ */ g("button", {
|
|
155
155
|
type: "button",
|
|
156
|
-
disabled:
|
|
157
|
-
onClick: () =>
|
|
156
|
+
disabled: X,
|
|
157
|
+
onClick: () => K(V),
|
|
158
158
|
children: "More dashboards"
|
|
159
159
|
}),
|
|
160
|
-
|
|
160
|
+
T && /* @__PURE__ */ g(s, {
|
|
161
161
|
label: "Dashboard page",
|
|
162
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ _("select", {
|
|
163
163
|
className: "rounded border border-border-default bg-bg-surface px-2 py-1 text-sm text-text-primary",
|
|
164
|
-
value:
|
|
165
|
-
disabled:
|
|
166
|
-
onChange: (e) =>
|
|
167
|
-
children: [/* @__PURE__ */
|
|
164
|
+
value: D,
|
|
165
|
+
disabled: Z,
|
|
166
|
+
onChange: (e) => O(e.target.value),
|
|
167
|
+
children: [/* @__PURE__ */ g("option", {
|
|
168
168
|
value: "",
|
|
169
169
|
children: "Choose page"
|
|
170
|
-
}),
|
|
170
|
+
}), j.map((e) => /* @__PURE__ */ g("option", {
|
|
171
171
|
value: e.id,
|
|
172
172
|
children: e.name
|
|
173
173
|
}, e.id))]
|
|
174
174
|
})
|
|
175
175
|
}),
|
|
176
|
-
|
|
176
|
+
T && U && /* @__PURE__ */ g("button", {
|
|
177
177
|
type: "button",
|
|
178
|
-
disabled:
|
|
179
|
-
onClick: () =>
|
|
178
|
+
disabled: X,
|
|
179
|
+
onClick: () => J(U),
|
|
180
180
|
children: "More pages"
|
|
181
181
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ g(s, {
|
|
183
183
|
label: "Widget title",
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
className:
|
|
186
|
-
value:
|
|
187
|
-
disabled:
|
|
188
|
-
onChange: (e) =>
|
|
184
|
+
children: /* @__PURE__ */ g("input", {
|
|
185
|
+
className: c,
|
|
186
|
+
value: N,
|
|
187
|
+
disabled: Z,
|
|
188
|
+
onChange: (e) => P(e.target.value)
|
|
189
189
|
})
|
|
190
190
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ g("button", {
|
|
192
192
|
type: "button",
|
|
193
|
-
className:
|
|
194
|
-
onClick: () => void
|
|
195
|
-
disabled:
|
|
193
|
+
className: c,
|
|
194
|
+
onClick: () => void ee(),
|
|
195
|
+
disabled: Z || !D || !N.trim(),
|
|
196
196
|
children: "Create widget"
|
|
197
197
|
})
|
|
198
198
|
]
|
|
199
199
|
}),
|
|
200
|
-
|
|
200
|
+
X && /* @__PURE__ */ g("p", {
|
|
201
201
|
role: "status",
|
|
202
202
|
children: "Loading destinations…"
|
|
203
203
|
}),
|
|
204
|
-
|
|
204
|
+
F && /* @__PURE__ */ g("p", {
|
|
205
205
|
role: "alert",
|
|
206
|
-
children:
|
|
206
|
+
children: F
|
|
207
207
|
})
|
|
208
208
|
]
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
-
export {
|
|
211
|
+
export { v as CreateQueryWidget };
|