@burdenoff/microfe-bigconsole 2026.1119.4 → 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/dashboard/PublishToStoreDialog.js +126 -80
- package/dist/bigconsole/components/explore/CreateQueryWidget.d.ts +4 -2
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +118 -102
- package/dist/bigconsole/graphql/storeTemplates.d.ts +1 -1
- package/dist/bigconsole/graphql/storeTemplates.js +5 -5
- package/dist/bigconsole/hooks/usePublishOwnerOptions.d.ts +10 -0
- package/dist/bigconsole/hooks/usePublishOwnerOptions.js +48 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts +8 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.js +3 -1
- package/dist/bigconsole/pages/InsightsPage.js +507 -505
- package/dist/bigconsole/utils/publishOwner.d.ts +100 -0
- package/dist/bigconsole/utils/publishOwner.js +71 -0
- package/dist/bigconsole/utils/quota.js +2 -1
- package/dist/generated/global-operations.d.ts +19 -0
- package/dist/generated/global-operations.js +80 -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,149 +1,195 @@
|
|
|
1
|
-
import e from "../../hooks/
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { usePublishOwnerOptions as e } from "../../hooks/usePublishOwnerOptions.js";
|
|
2
|
+
import t from "../../hooks/useStoreDashboardTemplates.js";
|
|
3
|
+
import { publishOwnerName as n } from "../../utils/publishOwner.js";
|
|
4
|
+
import { memo as r, useCallback as i, useEffect as a, useState as o } from "react";
|
|
5
|
+
import { Button as s, Dialog as c, DialogContent as l, DialogDescription as u, DialogFooter as ee, DialogHeader as d, DialogTitle as f, Input as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v, Spinner as y, Textarea as b } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
6
8
|
// src/bigconsole/components/dashboard/PublishToStoreDialog.tsx
|
|
7
|
-
|
|
9
|
+
var C = "__personal__";
|
|
10
|
+
function w(e) {
|
|
8
11
|
return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-").slice(0, 60);
|
|
9
12
|
}
|
|
10
|
-
var
|
|
11
|
-
let { t:
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
var T = r(function({ isOpen: r, dashboardId: T, dashboardName: E, dashboardDescription: D, onClose: O, onPublished: k }) {
|
|
14
|
+
let { t: A } = te(), { publishToStore: j } = t({ autoLoad: !1 }), [M, N] = o(E), [P, F] = o(w(E)), [I, L] = o(D ?? ""), [R, z] = o(!1), [B, V] = o(!1), [H, U] = o(null), [W, G] = o(null), K = e(r), [q, J] = o(null), [Y, X] = o(!1);
|
|
15
|
+
a(() => {
|
|
16
|
+
Y || J(K.defaultOrganizationId);
|
|
17
|
+
}, [K.defaultOrganizationId, Y]), a(() => {
|
|
18
|
+
r && (N(E), F(w(E)), L(D ?? ""), z(!1), U(null), G(null), X(!1));
|
|
14
19
|
}, [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
r,
|
|
21
|
+
E,
|
|
22
|
+
D
|
|
18
23
|
]);
|
|
19
|
-
let
|
|
20
|
-
if (!
|
|
21
|
-
else if (!
|
|
22
|
-
else if (!
|
|
24
|
+
let Z = i(async () => {
|
|
25
|
+
if (!M.trim()) U(A("bigconsole.dashboards.publishStore.error.nameRequired", "A template name is required"));
|
|
26
|
+
else if (!P.trim()) U(A("bigconsole.dashboards.publishStore.error.slugRequired", "A slug is required"));
|
|
27
|
+
else if (!I.trim()) U(A("bigconsole.dashboards.publishStore.error.descriptionRequired", "A description is required — it is what people see in the gallery"));
|
|
23
28
|
else {
|
|
24
|
-
|
|
29
|
+
U(null), V(!0);
|
|
25
30
|
try {
|
|
26
|
-
let e = await
|
|
27
|
-
dashboardId:
|
|
28
|
-
name:
|
|
29
|
-
slug:
|
|
30
|
-
description:
|
|
31
|
-
includeSampleData:
|
|
31
|
+
let e = await j({
|
|
32
|
+
dashboardId: T,
|
|
33
|
+
name: M.trim(),
|
|
34
|
+
slug: P.trim(),
|
|
35
|
+
description: I.trim(),
|
|
36
|
+
includeSampleData: R,
|
|
37
|
+
developerOrganizationId: q
|
|
32
38
|
});
|
|
33
39
|
if (!e.success) {
|
|
34
|
-
|
|
40
|
+
U(e.errorMessage ?? A("bigconsole.dashboards.publishStore.error.publishFailed", "Failed to publish to the store"));
|
|
35
41
|
return;
|
|
36
42
|
}
|
|
37
|
-
|
|
43
|
+
G(e), k?.(e);
|
|
38
44
|
} finally {
|
|
39
|
-
|
|
45
|
+
V(!1);
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
}, [
|
|
43
|
-
E,
|
|
44
|
-
O,
|
|
45
|
-
A,
|
|
46
49
|
M,
|
|
47
|
-
|
|
50
|
+
P,
|
|
51
|
+
I,
|
|
52
|
+
R,
|
|
53
|
+
q,
|
|
48
54
|
T,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
j,
|
|
56
|
+
k,
|
|
57
|
+
A
|
|
58
|
+
]), ne = A("bigconsole.dashboards.publishStore.owner.personal", "Personal (only you)"), re = A("bigconsole.dashboards.publishStore.owner.viewerSuffix", "viewer — cannot publish"), ie = A("bigconsole.dashboards.publishStore.owner.inactiveSuffix", "inactive member — cannot publish"), ae = (e) => e.organizationId === null ? ne : e.disabledReason === "inactive" ? `${e.name} (${ie})` : e.disabledReason === "viewer" ? `${e.name} (${re})` : e.name, Q = W ? n(K.options, W.developerOrganizationId ?? null) : null, $ = {
|
|
52
59
|
display: "block",
|
|
53
60
|
marginBottom: "var(--space-2xs)",
|
|
54
61
|
fontSize: "var(--font-size-sm)"
|
|
55
62
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
open:
|
|
58
|
-
onOpenChange: (e) => !e && !
|
|
59
|
-
children: /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ x(c, {
|
|
64
|
+
open: r,
|
|
65
|
+
onOpenChange: (e) => !e && !B && O(),
|
|
66
|
+
children: /* @__PURE__ */ S(l, {
|
|
60
67
|
style: { maxWidth: "520px" },
|
|
61
68
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
69
|
+
/* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(f, { children: A("bigconsole.dashboards.publishStore.title", "Publish as Template") }), /* @__PURE__ */ x(u, { children: A("bigconsole.dashboards.publishStore.subtitle", "Share this dashboard as a reusable template. Your data sources are replaced with named slots, so nothing from this workspace is published.") })] }),
|
|
70
|
+
W ? /* @__PURE__ */ S("div", {
|
|
64
71
|
style: { padding: "var(--space-md) 0" },
|
|
65
72
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ x("p", {
|
|
67
74
|
style: { fontWeight: "var(--font-weight-medium)" },
|
|
68
|
-
children:
|
|
75
|
+
children: A("bigconsole.dashboards.publishStore.result.title", "Draft template created")
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ x("p", {
|
|
78
|
+
style: {
|
|
79
|
+
fontSize: "var(--font-size-sm)",
|
|
80
|
+
color: "var(--color-text-muted)"
|
|
81
|
+
},
|
|
82
|
+
children: W.sinkCount === 1 ? A("bigconsole.dashboards.publishStore.result.sinksOne", "{{count}} data source turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: W.sinkCount ?? "" }) : A("bigconsole.dashboards.publishStore.result.sinksMany", "{{count}} data sources turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: W.sinkCount ?? "" })
|
|
69
83
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ x("p", {
|
|
85
|
+
"data-testid": "publish-store-owner-result",
|
|
71
86
|
style: {
|
|
72
87
|
fontSize: "var(--font-size-sm)",
|
|
73
88
|
color: "var(--color-text-muted)"
|
|
74
89
|
},
|
|
75
|
-
children:
|
|
90
|
+
children: Q ? A("bigconsole.dashboards.publishStore.result.ownerOrg", "Saved as a draft owned by {{owner}}. In the Developer Portal, open My Applications with {{owner}} selected in the organization switcher to find it.", { owner: Q }) : A("bigconsole.dashboards.publishStore.result.ownerPersonal", "Saved as your personal draft. In the Developer Portal, open My Applications and choose Personal (or All) in the organization switcher to find it.")
|
|
76
91
|
}),
|
|
77
|
-
|
|
92
|
+
W.unknownSinkIds.length > 0 && /* @__PURE__ */ x("p", {
|
|
78
93
|
style: {
|
|
79
94
|
fontSize: "var(--font-size-sm)",
|
|
80
95
|
color: "var(--color-text-warning)"
|
|
81
96
|
},
|
|
82
|
-
children:
|
|
97
|
+
children: W.unknownSinkIds.length === 1 ? A("bigconsole.dashboards.publishStore.result.unknownOne", "{{count}} data source could not be named — those slots use generic labels.", { count: W.unknownSinkIds.length ?? "" }) : A("bigconsole.dashboards.publishStore.result.unknownMany", "{{count}} data sources could not be named — those slots use generic labels.", { count: W.unknownSinkIds.length ?? "" })
|
|
83
98
|
})
|
|
84
99
|
]
|
|
85
|
-
}) : /* @__PURE__ */
|
|
100
|
+
}) : /* @__PURE__ */ S("div", {
|
|
86
101
|
style: {
|
|
87
102
|
display: "flex",
|
|
88
103
|
flexDirection: "column",
|
|
89
104
|
gap: "var(--space-sm)"
|
|
90
105
|
},
|
|
91
106
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
93
108
|
htmlFor: "tpl-name",
|
|
94
|
-
style:
|
|
95
|
-
children:
|
|
96
|
-
}), /* @__PURE__ */
|
|
109
|
+
style: $,
|
|
110
|
+
children: A("bigconsole.dashboards.publishStore.field.name", "Template name")
|
|
111
|
+
}), /* @__PURE__ */ x(p, {
|
|
97
112
|
id: "tpl-name",
|
|
98
|
-
value:
|
|
99
|
-
disabled:
|
|
113
|
+
value: M,
|
|
114
|
+
disabled: B,
|
|
100
115
|
onChange: (e) => {
|
|
101
|
-
|
|
116
|
+
N(e.target.value), F(w(e.target.value));
|
|
102
117
|
}
|
|
103
118
|
})] }),
|
|
104
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
105
120
|
htmlFor: "tpl-slug",
|
|
106
|
-
style:
|
|
107
|
-
children:
|
|
108
|
-
}), /* @__PURE__ */
|
|
121
|
+
style: $,
|
|
122
|
+
children: A("bigconsole.dashboards.publishStore.field.slug", "Slug")
|
|
123
|
+
}), /* @__PURE__ */ x(p, {
|
|
109
124
|
id: "tpl-slug",
|
|
110
|
-
value:
|
|
111
|
-
disabled:
|
|
112
|
-
onChange: (e) =>
|
|
125
|
+
value: P,
|
|
126
|
+
disabled: B,
|
|
127
|
+
onChange: (e) => F(w(e.target.value))
|
|
113
128
|
})] }),
|
|
114
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ S("div", { children: [
|
|
130
|
+
/* @__PURE__ */ x("label", {
|
|
131
|
+
htmlFor: "tpl-owner",
|
|
132
|
+
style: $,
|
|
133
|
+
children: A("bigconsole.dashboards.publishStore.field.owner", "Publish as")
|
|
134
|
+
}),
|
|
135
|
+
/* @__PURE__ */ S(m, {
|
|
136
|
+
value: q ?? C,
|
|
137
|
+
disabled: B || K.loading,
|
|
138
|
+
onValueChange: (e) => {
|
|
139
|
+
X(!0), J(e === C ? null : e);
|
|
140
|
+
},
|
|
141
|
+
children: [/* @__PURE__ */ x(_, {
|
|
142
|
+
id: "tpl-owner",
|
|
143
|
+
"data-testid": "publish-store-owner",
|
|
144
|
+
children: /* @__PURE__ */ x(v, {})
|
|
145
|
+
}), /* @__PURE__ */ x(h, { children: K.options.map((e) => /* @__PURE__ */ x(g, {
|
|
146
|
+
value: e.organizationId ?? C,
|
|
147
|
+
disabled: e.disabled,
|
|
148
|
+
children: ae(e)
|
|
149
|
+
}, e.organizationId ?? C)) })]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ x("p", {
|
|
152
|
+
style: {
|
|
153
|
+
marginTop: "var(--space-2xs)",
|
|
154
|
+
fontSize: "var(--font-size-xs)",
|
|
155
|
+
color: "var(--color-text-muted)"
|
|
156
|
+
},
|
|
157
|
+
children: K.loading ? A("bigconsole.dashboards.publishStore.owner.loading", "Loading your developer organizations…") : K.error ? A("bigconsole.dashboards.publishStore.owner.loadFailed", "Could not load your developer organizations, so this template can only be published as personal.") : A("bigconsole.dashboards.publishStore.owner.hint", "The draft appears under this owner in the Developer Portal.")
|
|
158
|
+
})
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
115
161
|
htmlFor: "tpl-desc",
|
|
116
|
-
style:
|
|
117
|
-
children:
|
|
118
|
-
}), /* @__PURE__ */
|
|
162
|
+
style: $,
|
|
163
|
+
children: A("bigconsole.dashboards.publishStore.field.description", "Description")
|
|
164
|
+
}), /* @__PURE__ */ x(b, {
|
|
119
165
|
id: "tpl-desc",
|
|
120
166
|
rows: 3,
|
|
121
|
-
value:
|
|
122
|
-
disabled:
|
|
123
|
-
placeholder:
|
|
124
|
-
onChange: (e) =>
|
|
167
|
+
value: I,
|
|
168
|
+
disabled: B,
|
|
169
|
+
placeholder: A("bigconsole.dashboards.publishStore.field.descriptionPlaceholder", "What is this dashboard for, and what data does it need?"),
|
|
170
|
+
onChange: (e) => L(e.target.value)
|
|
125
171
|
})] }),
|
|
126
|
-
|
|
172
|
+
H && /* @__PURE__ */ x("p", {
|
|
127
173
|
style: {
|
|
128
174
|
color: "var(--color-text-danger)",
|
|
129
175
|
fontSize: "var(--font-size-sm)"
|
|
130
176
|
},
|
|
131
|
-
children:
|
|
177
|
+
children: H
|
|
132
178
|
})
|
|
133
179
|
]
|
|
134
180
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(s, {
|
|
136
182
|
variant: "outline",
|
|
137
|
-
onClick:
|
|
138
|
-
disabled:
|
|
139
|
-
children:
|
|
140
|
-
}), !
|
|
141
|
-
onClick:
|
|
142
|
-
disabled:
|
|
143
|
-
children:
|
|
183
|
+
onClick: O,
|
|
184
|
+
disabled: B,
|
|
185
|
+
children: W ? A("bigconsole.dashboards.publishStore.action.done", "Done") : A("bigconsole.dashboards.publishStore.action.cancel", "Cancel")
|
|
186
|
+
}), !W && /* @__PURE__ */ x(s, {
|
|
187
|
+
onClick: Z,
|
|
188
|
+
disabled: B || K.loading,
|
|
189
|
+
children: B ? /* @__PURE__ */ x(y, {}) : A("bigconsole.dashboards.publishStore.action.publish", "Publish")
|
|
144
190
|
})] })
|
|
145
191
|
]
|
|
146
192
|
})
|
|
147
193
|
});
|
|
148
194
|
});
|
|
149
|
-
export {
|
|
195
|
+
export { T as PublishToStoreDialog, T as default };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** Either a saved query, or a typed Ask plan that the server revalidates and re-runs before saving. */
|
|
2
|
+
export declare function CreateQueryWidget({ savedId, askSpec, name, workspaceId, }: {
|
|
3
|
+
savedId?: string;
|
|
4
|
+
askSpec?: unknown;
|
|
3
5
|
name: string;
|
|
4
6
|
workspaceId: string;
|
|
5
7
|
}): import('react').JSX.Element;
|
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BrowseDashboardTemplatesDocument as BROWSE_DASHBOARD_TEMPLATES, GetDashboardTemplateDetailDocument as GET_DASHBOARD_TEMPLATE_DETAIL, CreateDashboardTemplateAppDocument as CREATE_TEMPLATE_APP, CreateDashboardTemplateVersionDocument as CREATE_TEMPLATE_VERSION, } from '../../generated/global-operations';
|
|
1
|
+
export { BrowseDashboardTemplatesDocument as BROWSE_DASHBOARD_TEMPLATES, GetDashboardTemplateDetailDocument as GET_DASHBOARD_TEMPLATE_DETAIL, CreateDashboardTemplateAppDocument as CREATE_TEMPLATE_APP, CreateDashboardTemplateVersionDocument as CREATE_TEMPLATE_VERSION, GetPublishOwnerOrganizationsDocument as GET_PUBLISH_OWNER_ORGANIZATIONS, } from '../../generated/global-operations';
|
|
2
2
|
export declare const IMPORT_DASHBOARD_TEMPLATE: import('graphql').DocumentNode;
|
|
3
3
|
/**
|
|
4
4
|
* Same interim treatment as IMPORT_DASHBOARD_TEMPLATE, and for the same reason:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BrowseDashboardTemplatesDocument as e, CreateDashboardTemplateAppDocument as t, CreateDashboardTemplateVersionDocument as n, GetDashboardTemplateDetailDocument as r } from "../../generated/global-operations.js";
|
|
2
|
-
import { gql as
|
|
1
|
+
import { BrowseDashboardTemplatesDocument as e, CreateDashboardTemplateAppDocument as t, CreateDashboardTemplateVersionDocument as n, GetDashboardTemplateDetailDocument as r, GetPublishOwnerOrganizationsDocument as i } from "../../generated/global-operations.js";
|
|
2
|
+
import { gql as a } from "@apollo/client";
|
|
3
3
|
// src/bigconsole/graphql/storeTemplates.ts
|
|
4
|
-
var
|
|
4
|
+
var o = a`
|
|
5
5
|
mutation ImportDashboardTemplate($input: BigConsoleImportDashboardTemplateInput!) {
|
|
6
6
|
importDashboardTemplate(input: $input) {
|
|
7
7
|
success
|
|
@@ -20,7 +20,7 @@ var a = i`
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`, s = a`
|
|
24
24
|
query BuildDashboardTemplateContent(
|
|
25
25
|
$dashboardId: ID!
|
|
26
26
|
$defaultDashboardName: String
|
|
@@ -42,4 +42,4 @@ var a = i`
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
|
-
export { e as BROWSE_DASHBOARD_TEMPLATES,
|
|
45
|
+
export { e as BROWSE_DASHBOARD_TEMPLATES, s as BUILD_DASHBOARD_TEMPLATE_CONTENT, t as CREATE_TEMPLATE_APP, n as CREATE_TEMPLATE_VERSION, r as GET_DASHBOARD_TEMPLATE_DETAIL, i as GET_PUBLISH_OWNER_ORGANIZATIONS, o as IMPORT_DASHBOARD_TEMPLATE };
|