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