@burdenoff/microfe-bigconsole 2026.1012.2 → 2026.1012.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/assistant/assistantApi.js +5 -5
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +33 -18
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +123 -121
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +241 -267
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +154 -150
- package/dist/bigconsole/components/embed/renderer-manifest.js +12 -0
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +122 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -224
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +113 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.js +186 -0
- package/dist/bigconsole/components/widgets/advanced/data.d.ts +36 -0
- package/dist/bigconsole/components/widgets/advanced/data.js +113 -0
- package/dist/bigconsole/components/widgets/advanced/mapData.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/mapData.js +22 -0
- package/dist/bigconsole/components/widgets/advanced/waterfallData.d.ts +15 -0
- package/dist/bigconsole/components/widgets/advanced/waterfallData.js +28 -0
- package/dist/bigconsole/components/widgets/chart/charts/WaterfallChart.js +34 -37
- package/dist/bigconsole/components/widgets/index.js +1 -1
- package/dist/bigconsole/components/widgets/map-widget/MapWidget.d.ts +2 -0
- package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +64 -63
- package/dist/bigconsole/graphql/widgetCapabilities.d.ts +7 -0
- package/dist/bigconsole/graphql/widgetCapabilities.js +37 -0
- package/dist/bigconsole/hooks/useExportDashboard.js +62 -38
- package/dist/bigconsole/hooks/useImportDashboard.d.ts +2 -12
- package/dist/bigconsole/hooks/useImportDashboard.js +95 -126
- package/dist/bigconsole/hooks/useWidgetCatalog.js +46 -41
- package/dist/bigconsole/hooks/useWidgetOperations.js +113 -88
- package/dist/bigconsole/renderers/adapters/BigConsoleRenderer.js +8 -5
- package/dist/bigconsole/types/index.d.ts +1 -1
- package/dist/bigconsole/utils/advancedWidgetCapabilities.d.ts +14 -0
- package/dist/bigconsole/utils/advancedWidgetCapabilities.js +36 -0
- package/dist/bigconsole/utils/widgetTypeMapping.d.ts +1 -1
- package/dist/bigconsole/utils/widgetTypeMapping.js +13 -2
- package/dist/generated/wspace-operations.d.ts +61 -2
- package/dist/generated/wspace-operations.js +44 -18
- package/dist/generated/wspace-types.d.ts +34 -3
- package/package.json +1 -1
|
@@ -1,136 +1,148 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useBigConsole as e } from "../../context/BigConsoleContext.js";
|
|
2
|
+
import "../../context/index.js";
|
|
3
|
+
import { reportBigConsoleQuotaError as t } from "../../utils/quota.js";
|
|
4
|
+
import { Section as n } from "../common/Section.js";
|
|
3
5
|
import "../common/index.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
+
import r from "../../hooks/useBigConsoleAnalytics.js";
|
|
7
|
+
import i from "../../hooks/useImportDashboard.js";
|
|
6
8
|
import "../../hooks/index.js";
|
|
7
|
-
import { memo as
|
|
8
|
-
import { AlertTriangle as
|
|
9
|
-
import { Badge as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { useI18n as
|
|
9
|
+
import { memo as a, useCallback as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
|
|
10
|
+
import { AlertTriangle as ee, ArrowLeft as te, Check as ne, FileJson as re, Info as u, Upload as d, XCircle as ie } from "lucide-react";
|
|
11
|
+
import { Badge as f, Button as p, Card as ae, CardContent as m, Checkbox as h, Dialog as g, DialogContent as _, DialogDescription as oe, DialogFooter as se, DialogHeader as ce, DialogTitle as le, Input as v, Label as y, Spinner as b } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
13
|
+
import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
14
|
//#region src/bigconsole/components/dashboard/ImportDashboardDialog.tsx
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let { t: M } = O(), [N, P] = c("select"), [, F] = c(null), [I, L] = c(null), [R, z] = c(""), [B, V] = c("PRIVATE"), [H, U] = c(!1), W = s(null), { loading: G, error: K, validationResult: q, importResult: J, validateImport: Y, importDashboard: X, clearState: Z } = r(), Q = n();
|
|
24
|
-
o(() => {
|
|
25
|
-
i && (P("select"), F(null), L(null), z(""), V("PRIVATE"), U(!1), Z());
|
|
26
|
-
}, [i, Z]);
|
|
27
|
-
let oe = a(async (e) => {
|
|
15
|
+
var T = a(function({ isOpen: a, onClose: T, onSuccess: E }) {
|
|
16
|
+
let { t: D } = w(), [O, k] = l("select"), [A, j] = l(null), M = c(0), { currentUser: N, workspaceId: P } = e(), F = `${N?.id ?? ""}|${P ?? ""}`, [I, L] = l(null), [R, z] = l(""), [B, V] = l("PRIVATE"), [H, U] = l(!1), W = c(null), { loading: G, error: K, validationResult: q, importResult: J, validateImport: Y, importDashboard: X, clearState: Z } = i(), Q = r();
|
|
17
|
+
s(() => (M.current++, Z(), a && (k("select"), j(null), L(null), z(""), V("PRIVATE"), U(!1)), () => {
|
|
18
|
+
M.current++;
|
|
19
|
+
}), [
|
|
20
|
+
a,
|
|
21
|
+
F,
|
|
22
|
+
Z
|
|
23
|
+
]);
|
|
24
|
+
let ue = o((e) => {
|
|
28
25
|
let t = e.target.files?.[0];
|
|
29
26
|
if (!t) return;
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
let n = ++M.current, r = () => M.current === n;
|
|
28
|
+
if (Z(), k("select"), j(null), L(null), z(""), V("PRIVATE"), U(!1), !t.name.toLowerCase().endsWith(".json")) {
|
|
29
|
+
j(D("bigconsole.dashboards.import.selectJsonFile", "Please select a JSON file"));
|
|
32
30
|
return;
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
let i = new FileReader();
|
|
33
|
+
i.onload = async (e) => {
|
|
34
|
+
if (!r()) return;
|
|
37
35
|
let t = e.target?.result;
|
|
36
|
+
if (typeof t != "string") {
|
|
37
|
+
j(D("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
38
40
|
L(t);
|
|
39
41
|
let n = await Y(t);
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
}, [
|
|
42
|
+
r() && (n ? (k("preview"), z(n.dashboardInfo?.name ?? "")) : W.current && (W.current.value = ""));
|
|
43
|
+
}, i.onerror = () => {
|
|
44
|
+
r() && j(D("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
|
|
45
|
+
}, i.readAsText(t);
|
|
46
|
+
}, [
|
|
47
|
+
Z,
|
|
48
|
+
Y,
|
|
49
|
+
D
|
|
50
|
+
]), de = o((e) => {
|
|
45
51
|
e.preventDefault();
|
|
46
52
|
let t = e.dataTransfer.files?.[0];
|
|
47
53
|
if (t) {
|
|
48
54
|
let e = new DataTransfer();
|
|
49
55
|
e.items.add(t), W.current && (W.current.files = e.files, W.current.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
50
56
|
}
|
|
51
|
-
}, []),
|
|
57
|
+
}, []), fe = o(async () => {
|
|
52
58
|
if (!I) return;
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
let e = M.current;
|
|
60
|
+
k("importing");
|
|
61
|
+
let n = {
|
|
55
62
|
name: R.trim() || void 0,
|
|
56
63
|
visibility: B,
|
|
57
64
|
skipWarnings: H
|
|
58
65
|
};
|
|
59
66
|
Q("bigconsole.dashboard.import_clicked", { source: "import" });
|
|
60
67
|
try {
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
let t = await X(I, n);
|
|
69
|
+
if (M.current !== e) return;
|
|
70
|
+
t?.success && t.dashboard ? (k("complete"), Q("bigconsole.dashboard.imported", {
|
|
71
|
+
dashboardId: t.dashboard.id,
|
|
64
72
|
source: "import",
|
|
65
|
-
originalUpdated:
|
|
66
|
-
}),
|
|
67
|
-
} catch (
|
|
68
|
-
if (e
|
|
69
|
-
|
|
73
|
+
originalUpdated: !1
|
|
74
|
+
}), E?.(t.dashboard.id, t.dashboard.name, !1)) : k("preview");
|
|
75
|
+
} catch (n) {
|
|
76
|
+
if (M.current !== e) return;
|
|
77
|
+
if (t(n, "project")) {
|
|
78
|
+
T();
|
|
70
79
|
return;
|
|
71
80
|
}
|
|
72
|
-
|
|
81
|
+
k("preview");
|
|
73
82
|
}
|
|
74
83
|
}, [
|
|
75
84
|
Q,
|
|
76
85
|
I,
|
|
77
86
|
X,
|
|
78
87
|
R,
|
|
79
|
-
|
|
80
|
-
|
|
88
|
+
T,
|
|
89
|
+
E,
|
|
81
90
|
H,
|
|
82
91
|
B
|
|
83
|
-
]), $ = !G &&
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
open:
|
|
86
|
-
onOpenChange: (e) => !e && $ &&
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
className: "sm:max-w-lg max-h-[
|
|
92
|
+
]), $ = !G && O !== "importing";
|
|
93
|
+
return /* @__PURE__ */ S(g, {
|
|
94
|
+
open: a,
|
|
95
|
+
onOpenChange: (e) => !e && $ && T(),
|
|
96
|
+
children: /* @__PURE__ */ C(_, {
|
|
97
|
+
className: "sm:max-w-lg flex max-h-[calc(100dvh-3rem)] flex-col overflow-hidden",
|
|
89
98
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
className: "
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
-
className: "flex
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
/* @__PURE__ */ C(ce, {
|
|
100
|
+
className: "shrink-0",
|
|
101
|
+
children: [/* @__PURE__ */ C("div", {
|
|
102
|
+
className: "flex items-center gap-3",
|
|
103
|
+
children: [/* @__PURE__ */ S("div", {
|
|
104
|
+
className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10",
|
|
105
|
+
children: /* @__PURE__ */ S(d, { className: "size-5 text-primary" })
|
|
106
|
+
}), /* @__PURE__ */ S(le, { children: D("bigconsole.dashboards.import.title", "Import Dashboard") })]
|
|
107
|
+
}), /* @__PURE__ */ S(oe, { children: D("bigconsole.dashboards.import.description", "Upload a Dashboard export file to create a new copy in this workspace.") })]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ C("div", {
|
|
110
|
+
className: "min-h-0 flex-1 overflow-y-auto py-4 space-y-4",
|
|
99
111
|
children: [
|
|
100
|
-
|
|
112
|
+
O === "select" && /* @__PURE__ */ C("div", {
|
|
101
113
|
onDragOver: (e) => e.preventDefault(),
|
|
102
|
-
onDrop:
|
|
114
|
+
onDrop: de,
|
|
103
115
|
className: "border-2 border-dashed rounded-lg p-8 text-center hover:border-primary transition-colors",
|
|
104
116
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ S(re, { className: "size-12 mx-auto text-text-secondary mb-4" }),
|
|
118
|
+
/* @__PURE__ */ S("p", {
|
|
107
119
|
className: "text-sm mb-2",
|
|
108
|
-
children:
|
|
120
|
+
children: D("bigconsole.dashboards.import.dropzoneTitle", "Drag and drop a dashboard export file here")
|
|
109
121
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ S("p", {
|
|
111
123
|
className: "text-xs text-text-secondary mb-4",
|
|
112
|
-
children:
|
|
124
|
+
children: D("bigconsole.dashboards.import.or", "or")
|
|
113
125
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ S("input", {
|
|
115
127
|
ref: W,
|
|
116
128
|
type: "file",
|
|
117
129
|
accept: ".json",
|
|
118
|
-
onChange:
|
|
130
|
+
onChange: ue,
|
|
119
131
|
className: "hidden"
|
|
120
132
|
}),
|
|
121
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ S(p, {
|
|
122
134
|
onClick: () => W.current?.click(),
|
|
123
135
|
disabled: G,
|
|
124
|
-
children:
|
|
136
|
+
children: D("bigconsole.dashboards.import.browseFiles", "Browse Files")
|
|
125
137
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ S("p", {
|
|
127
139
|
className: "text-xs text-text-secondary mt-4",
|
|
128
|
-
children:
|
|
140
|
+
children: D("bigconsole.dashboards.import.supportedFilesHint", "Only .json files exported from BigConsole are supported")
|
|
129
141
|
})
|
|
130
142
|
]
|
|
131
143
|
}),
|
|
132
|
-
(
|
|
133
|
-
/* @__PURE__ */
|
|
144
|
+
(O === "preview" || O === "importing") && q && /* @__PURE__ */ C(x, { children: [
|
|
145
|
+
/* @__PURE__ */ C(n, {
|
|
134
146
|
headingLevel: 3,
|
|
135
147
|
emphasis: "muted",
|
|
136
148
|
padding: "compact",
|
|
@@ -138,80 +150,80 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
|
|
|
138
150
|
"data-testid": "import-summary",
|
|
139
151
|
bodyClassName: "space-y-2",
|
|
140
152
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ C("div", {
|
|
142
154
|
className: "flex items-center justify-between",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ S("span", {
|
|
144
156
|
className: "text-sm text-text-secondary",
|
|
145
|
-
children:
|
|
146
|
-
}), /* @__PURE__ */
|
|
157
|
+
children: D("bigconsole.dashboards.import.fieldDashboard", "Dashboard")
|
|
158
|
+
}), /* @__PURE__ */ S("span", {
|
|
147
159
|
className: "text-sm font-medium",
|
|
148
160
|
children: q.dashboardInfo.name
|
|
149
161
|
})]
|
|
150
162
|
}),
|
|
151
|
-
q.dashboardInfo.description && /* @__PURE__ */
|
|
163
|
+
q.dashboardInfo.description && /* @__PURE__ */ C("div", {
|
|
152
164
|
className: "flex items-start justify-between",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ S("span", {
|
|
154
166
|
className: "text-sm text-text-secondary",
|
|
155
|
-
children:
|
|
156
|
-
}), /* @__PURE__ */
|
|
167
|
+
children: D("bigconsole.dashboards.import.fieldDescription", "Description")
|
|
168
|
+
}), /* @__PURE__ */ S("span", {
|
|
157
169
|
className: "text-sm text-right max-w-[60%] truncate",
|
|
158
170
|
children: q.dashboardInfo.description
|
|
159
171
|
})]
|
|
160
172
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ C("div", {
|
|
162
174
|
className: "flex items-center justify-between",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ S("span", {
|
|
164
176
|
className: "text-sm text-text-secondary",
|
|
165
|
-
children:
|
|
166
|
-
}), /* @__PURE__ */
|
|
177
|
+
children: D("bigconsole.dashboards.import.fieldPages", "Pages")
|
|
178
|
+
}), /* @__PURE__ */ S(f, {
|
|
167
179
|
variant: "secondary",
|
|
168
180
|
children: q.dashboardInfo.pageCount
|
|
169
181
|
})]
|
|
170
182
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ C("div", {
|
|
172
184
|
className: "flex items-center justify-between",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ S("span", {
|
|
174
186
|
className: "text-sm text-text-secondary",
|
|
175
|
-
children:
|
|
176
|
-
}), /* @__PURE__ */
|
|
187
|
+
children: D("bigconsole.dashboards.import.fieldWidgets", "Widgets")
|
|
188
|
+
}), /* @__PURE__ */ S(f, {
|
|
177
189
|
variant: "secondary",
|
|
178
190
|
children: q.dashboardInfo.widgetCount
|
|
179
191
|
})]
|
|
180
192
|
}),
|
|
181
|
-
q.dashboardInfo.exportedFrom && /* @__PURE__ */
|
|
193
|
+
q.dashboardInfo.exportedFrom && /* @__PURE__ */ C("div", {
|
|
182
194
|
className: "flex items-center justify-between",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ S("span", {
|
|
184
196
|
className: "text-sm text-text-secondary",
|
|
185
|
-
children:
|
|
186
|
-
}), /* @__PURE__ */
|
|
197
|
+
children: D("bigconsole.dashboards.import.fieldSourceId", "Source ID")
|
|
198
|
+
}), /* @__PURE__ */ S("span", {
|
|
187
199
|
className: "text-xs text-text-secondary font-mono truncate max-w-[180px]",
|
|
188
200
|
children: q.dashboardInfo.exportedFrom
|
|
189
201
|
})]
|
|
190
202
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ C("div", {
|
|
192
204
|
className: "flex flex-wrap items-center justify-between gap-x-4",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ S("span", {
|
|
194
206
|
className: "text-sm text-text-secondary",
|
|
195
|
-
children:
|
|
196
|
-
}), /* @__PURE__ */
|
|
207
|
+
children: D("bigconsole.dashboards.import.fieldSchemaVersion", "Schema Version")
|
|
208
|
+
}), /* @__PURE__ */ S("span", {
|
|
197
209
|
className: "text-xs text-text-secondary",
|
|
198
210
|
children: q.dashboardInfo.schemaVersion
|
|
199
211
|
})]
|
|
200
212
|
})
|
|
201
213
|
]
|
|
202
214
|
}),
|
|
203
|
-
q.errors.length > 0 && /* @__PURE__ */
|
|
215
|
+
q.errors.length > 0 && /* @__PURE__ */ S(n, {
|
|
204
216
|
headingLevel: 3,
|
|
205
217
|
tone: "danger",
|
|
206
218
|
padding: "compact",
|
|
207
|
-
icon: /* @__PURE__ */
|
|
208
|
-
title:
|
|
219
|
+
icon: /* @__PURE__ */ S(ie, { className: "size-4" }),
|
|
220
|
+
title: D("bigconsole.dashboards.import.errorsCount", "Errors ({{count}})", { count: q.errors.length }),
|
|
209
221
|
description: "These must be fixed in the export file before it can be imported.",
|
|
210
222
|
"data-testid": "import-errors",
|
|
211
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ S("ul", {
|
|
212
224
|
className: "space-y-1 text-xs text-status-error-text",
|
|
213
|
-
children: q.errors.map((e) => /* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
225
|
+
children: q.errors.map((e) => /* @__PURE__ */ C("li", { children: [
|
|
226
|
+
/* @__PURE__ */ C("span", {
|
|
215
227
|
className: "font-mono",
|
|
216
228
|
children: [
|
|
217
229
|
"[",
|
|
@@ -224,211 +236,173 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
|
|
|
224
236
|
] }, `${e.code}-${e.message}`))
|
|
225
237
|
})
|
|
226
238
|
}),
|
|
227
|
-
q.warnings.length > 0 && /* @__PURE__ */
|
|
239
|
+
q.warnings.length > 0 && /* @__PURE__ */ S(n, {
|
|
228
240
|
headingLevel: 3,
|
|
229
241
|
tone: "warning",
|
|
230
242
|
padding: "compact",
|
|
231
|
-
icon: /* @__PURE__ */
|
|
232
|
-
title:
|
|
243
|
+
icon: /* @__PURE__ */ S(ee, { className: "size-4" }),
|
|
244
|
+
title: D("bigconsole.dashboards.import.warningsCount", "Warnings ({{count}})", { count: q.warnings.length }),
|
|
233
245
|
description: "Advisory only — acknowledge them below to continue.",
|
|
234
246
|
"data-testid": "import-warnings",
|
|
235
|
-
children: /* @__PURE__ */
|
|
247
|
+
children: /* @__PURE__ */ S("ul", {
|
|
236
248
|
className: "space-y-1 text-xs text-[var(--color-status-warning-text)]",
|
|
237
|
-
children: q.warnings.map((e) => /* @__PURE__ */
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
children: q.warnings.map((e) => /* @__PURE__ */ C("li", {
|
|
250
|
+
className: "break-words",
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ C("span", {
|
|
253
|
+
className: "font-mono",
|
|
254
|
+
children: [
|
|
255
|
+
"[",
|
|
256
|
+
e.code,
|
|
257
|
+
"]"
|
|
258
|
+
]
|
|
259
|
+
}),
|
|
260
|
+
" ",
|
|
261
|
+
e.message,
|
|
262
|
+
e.suggestion && /* @__PURE__ */ S("p", {
|
|
263
|
+
className: "mt-1",
|
|
264
|
+
children: e.suggestion
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
}, `${e.code}-${e.message}`))
|
|
249
268
|
})
|
|
250
269
|
}),
|
|
251
|
-
q.isValid && /* @__PURE__ */
|
|
270
|
+
q.isValid && /* @__PURE__ */ C(n, {
|
|
252
271
|
headingLevel: 3,
|
|
253
|
-
title:
|
|
272
|
+
title: D("bigconsole.dashboards.import.optionsTitle", "Import Options"),
|
|
254
273
|
description: "How this file lands in the workspace.",
|
|
255
274
|
"data-testid": "import-options",
|
|
256
275
|
bodyClassName: "space-y-4",
|
|
257
276
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ S(n, {
|
|
259
278
|
headingLevel: 4,
|
|
260
279
|
tone: "info",
|
|
261
|
-
"aria-label":
|
|
280
|
+
"aria-label": D("bigconsole.dashboards.import.infoRegionLabel", "What this import will do"),
|
|
262
281
|
padding: "compact",
|
|
263
282
|
"data-testid": "import-info",
|
|
264
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ C("div", {
|
|
265
284
|
className: "flex items-start gap-2",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ S(u, { className: "size-4 mt-0.5 shrink-0 text-[var(--color-status-info-text)]" }), /* @__PURE__ */ C("div", {
|
|
267
286
|
className: "text-xs text-[var(--color-status-info-text)]",
|
|
268
|
-
children:
|
|
269
|
-
/* @__PURE__ */ E("p", {
|
|
270
|
-
className: "font-medium mb-1",
|
|
271
|
-
children: M("bigconsole.dashboards.import.checkExistingTitle", "Import will check for existing dashboard")
|
|
272
|
-
}),
|
|
273
|
-
/* @__PURE__ */ D("p", { children: [
|
|
274
|
-
M("bigconsole.dashboards.import.checkExistingIdPrefix", "If the original dashboard (ID:"),
|
|
275
|
-
" ",
|
|
276
|
-
/* @__PURE__ */ D("code", {
|
|
277
|
-
className: "rounded bg-bg-surface px-1 font-mono",
|
|
278
|
-
children: [k(I)?.slice(0, 8), "..."]
|
|
279
|
-
}),
|
|
280
|
-
M("bigconsole.dashboards.import.checkExistingIdSuffix", ") exists:")
|
|
281
|
-
] }),
|
|
282
|
-
/* @__PURE__ */ D("ul", {
|
|
283
|
-
className: "list-disc list-inside mt-1 space-y-0.5",
|
|
284
|
-
children: [/* @__PURE__ */ E("li", { children: M("bigconsole.dashboards.import.checkExistingWithChanges", "With changes → Update the existing dashboard") }), /* @__PURE__ */ E("li", { children: M("bigconsole.dashboards.import.checkExistingNoChanges", "No changes → Show \"already exists\" message") })]
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ E("p", {
|
|
287
|
-
className: "mt-1",
|
|
288
|
-
children: M("bigconsole.dashboards.import.checkExistingNotFound", "If original doesn't exist → Create a new dashboard")
|
|
289
|
-
})
|
|
290
|
-
] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("p", {
|
|
287
|
+
children: [/* @__PURE__ */ S("p", {
|
|
291
288
|
className: "font-medium mb-1",
|
|
292
|
-
children:
|
|
293
|
-
}), /* @__PURE__ */
|
|
289
|
+
children: D("bigconsole.dashboards.import.newDashboardTitle", "A new dashboard will be created")
|
|
290
|
+
}), /* @__PURE__ */ S("p", { children: D("bigconsole.dashboards.import.newDashboardBody", "Import as a new dashboard with the specified configuration.") })]
|
|
294
291
|
})]
|
|
295
292
|
})
|
|
296
293
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ C("div", {
|
|
298
295
|
className: "space-y-2",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ S(y, {
|
|
300
297
|
htmlFor: "import-name",
|
|
301
|
-
children:
|
|
302
|
-
}), /* @__PURE__ */
|
|
298
|
+
children: D("bigconsole.dashboards.import.dashboardNameLabel", "Dashboard Name")
|
|
299
|
+
}), /* @__PURE__ */ S(v, {
|
|
303
300
|
id: "import-name",
|
|
304
301
|
type: "text",
|
|
305
302
|
value: R,
|
|
306
303
|
onChange: (e) => z(e.target.value),
|
|
307
304
|
placeholder: q.dashboardInfo.name,
|
|
308
|
-
disabled:
|
|
305
|
+
disabled: O === "importing"
|
|
309
306
|
})]
|
|
310
307
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ C("div", {
|
|
312
309
|
className: "space-y-2",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
314
|
-
className: "flex gap-2",
|
|
310
|
+
children: [/* @__PURE__ */ S(y, { children: D("bigconsole.dashboards.import.visibilityLabel", "Visibility") }), /* @__PURE__ */ S("div", {
|
|
311
|
+
className: "flex flex-wrap gap-2",
|
|
315
312
|
children: [
|
|
316
313
|
"PRIVATE",
|
|
317
|
-
"
|
|
314
|
+
"WORKSPACE",
|
|
318
315
|
"PUBLIC"
|
|
319
|
-
].map((e) => /* @__PURE__ */
|
|
316
|
+
].map((e) => /* @__PURE__ */ S(p, {
|
|
320
317
|
type: "button",
|
|
321
318
|
variant: B === e ? "default" : "outline",
|
|
322
319
|
size: "sm",
|
|
323
320
|
onClick: () => V(e),
|
|
324
|
-
disabled:
|
|
325
|
-
children: e === "PRIVATE" ?
|
|
321
|
+
disabled: O === "importing",
|
|
322
|
+
children: e === "PRIVATE" ? D("bigconsole.dashboards.import.visibilityPrivate", "Private") : e === "WORKSPACE" ? D("bigconsole.dashboards.import.visibilityWorkspace", "Workspace") : D("bigconsole.dashboards.import.visibilityPublic", "Public")
|
|
326
323
|
}, e))
|
|
327
324
|
})]
|
|
328
325
|
}),
|
|
329
|
-
q.warnings.length > 0 && /* @__PURE__ */
|
|
326
|
+
q.warnings.length > 0 && /* @__PURE__ */ C("div", {
|
|
330
327
|
className: "flex items-start space-x-3",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ S(h, {
|
|
332
329
|
id: "skipWarnings",
|
|
333
330
|
checked: H,
|
|
334
331
|
onCheckedChange: (e) => U(e === !0),
|
|
335
|
-
disabled:
|
|
336
|
-
}), /* @__PURE__ */
|
|
332
|
+
disabled: O === "importing"
|
|
333
|
+
}), /* @__PURE__ */ S("div", {
|
|
337
334
|
className: "grid gap-1.5 leading-none",
|
|
338
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ S(y, {
|
|
339
336
|
htmlFor: "skipWarnings",
|
|
340
337
|
className: "cursor-pointer",
|
|
341
|
-
children:
|
|
338
|
+
children: D("bigconsole.dashboards.import.acknowledgeWarnings", "Acknowledge warnings and proceed")
|
|
342
339
|
})
|
|
343
340
|
})]
|
|
344
341
|
})
|
|
345
342
|
]
|
|
346
343
|
})
|
|
347
344
|
] }),
|
|
348
|
-
|
|
345
|
+
O === "complete" && J?.success && /* @__PURE__ */ S("div", {
|
|
349
346
|
className: "text-center py-6",
|
|
350
|
-
children: [
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
children: M("bigconsole.dashboards.import.successBody", "Dashboard \"{{name}}\" has been created.", { name: J.dashboard?.name ?? "" })
|
|
391
|
-
}),
|
|
392
|
-
J.stats && /* @__PURE__ */ E(g, {
|
|
393
|
-
className: "inline-block text-left",
|
|
394
|
-
children: /* @__PURE__ */ D(_, {
|
|
395
|
-
className: "p-4",
|
|
396
|
-
children: [/* @__PURE__ */ E("p", {
|
|
397
|
-
className: "text-xs font-medium text-text-secondary mb-2",
|
|
398
|
-
children: M("bigconsole.dashboards.import.summaryTitle", "Import Summary")
|
|
399
|
-
}), /* @__PURE__ */ D("div", {
|
|
400
|
-
className: "grid grid-cols-2 gap-x-6 gap-y-1 text-xs",
|
|
401
|
-
children: [
|
|
402
|
-
/* @__PURE__ */ E("span", {
|
|
403
|
-
className: "text-text-secondary",
|
|
404
|
-
children: M("bigconsole.dashboards.import.summaryPages", "Pages:")
|
|
405
|
-
}),
|
|
406
|
-
/* @__PURE__ */ E("span", { children: J.stats.pagesCreated }),
|
|
407
|
-
/* @__PURE__ */ E("span", {
|
|
408
|
-
className: "text-text-secondary",
|
|
409
|
-
children: M("bigconsole.dashboards.import.summaryWidgets", "Widgets:")
|
|
410
|
-
}),
|
|
411
|
-
/* @__PURE__ */ E("span", { children: J.stats.widgetsCreated }),
|
|
412
|
-
/* @__PURE__ */ E("span", {
|
|
413
|
-
className: "text-text-secondary",
|
|
414
|
-
children: M("bigconsole.dashboards.import.summaryActions", "Actions:")
|
|
415
|
-
}),
|
|
416
|
-
/* @__PURE__ */ E("span", { children: J.stats.actionsCreated })
|
|
417
|
-
]
|
|
418
|
-
})]
|
|
419
|
-
})
|
|
347
|
+
children: /* @__PURE__ */ C(x, { children: [
|
|
348
|
+
/* @__PURE__ */ S("div", {
|
|
349
|
+
className: "mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-[var(--color-status-success-bgSubtle)]",
|
|
350
|
+
children: /* @__PURE__ */ S(ne, { className: "size-8 text-status-success-text" })
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ S("h3", {
|
|
353
|
+
className: "text-lg font-medium mb-2",
|
|
354
|
+
children: D("bigconsole.dashboards.import.successTitle", "Import Successful!")
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ S("p", {
|
|
357
|
+
className: "text-sm text-text-secondary mb-4",
|
|
358
|
+
children: D("bigconsole.dashboards.import.successBody", "Dashboard \"{{name}}\" has been created.", { name: J.dashboard?.name ?? "" })
|
|
359
|
+
}),
|
|
360
|
+
J.stats && /* @__PURE__ */ S(ae, {
|
|
361
|
+
className: "inline-block text-left",
|
|
362
|
+
children: /* @__PURE__ */ C(m, {
|
|
363
|
+
className: "p-4",
|
|
364
|
+
children: [/* @__PURE__ */ S("p", {
|
|
365
|
+
className: "text-xs font-medium text-text-secondary mb-2",
|
|
366
|
+
children: D("bigconsole.dashboards.import.summaryTitle", "Import Summary")
|
|
367
|
+
}), /* @__PURE__ */ C("div", {
|
|
368
|
+
className: "grid grid-cols-2 gap-x-6 gap-y-1 text-xs",
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ S("span", {
|
|
371
|
+
className: "text-text-secondary",
|
|
372
|
+
children: D("bigconsole.dashboards.import.summaryPages", "Pages:")
|
|
373
|
+
}),
|
|
374
|
+
/* @__PURE__ */ S("span", { children: J.stats.pagesCreated }),
|
|
375
|
+
/* @__PURE__ */ S("span", {
|
|
376
|
+
className: "text-text-secondary",
|
|
377
|
+
children: D("bigconsole.dashboards.import.summaryWidgets", "Widgets:")
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ S("span", { children: J.stats.widgetsCreated }),
|
|
380
|
+
/* @__PURE__ */ S("span", {
|
|
381
|
+
className: "text-text-secondary",
|
|
382
|
+
children: D("bigconsole.dashboards.import.summaryActions", "Actions:")
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ S("span", { children: J.stats.actionsCreated })
|
|
385
|
+
]
|
|
386
|
+
})]
|
|
420
387
|
})
|
|
421
|
-
|
|
422
|
-
]
|
|
388
|
+
})
|
|
389
|
+
] })
|
|
390
|
+
}),
|
|
391
|
+
A && /* @__PURE__ */ S(n, {
|
|
392
|
+
headingLevel: 3,
|
|
393
|
+
tone: "danger",
|
|
394
|
+
padding: "compact",
|
|
395
|
+
title: "Import failed",
|
|
396
|
+
description: A
|
|
423
397
|
}),
|
|
424
|
-
K && /* @__PURE__ */
|
|
398
|
+
K && /* @__PURE__ */ S(n, {
|
|
425
399
|
headingLevel: 3,
|
|
426
400
|
tone: "danger",
|
|
427
401
|
padding: "compact",
|
|
428
402
|
title: "Import failed",
|
|
429
403
|
description: K.message
|
|
430
404
|
}),
|
|
431
|
-
J && !J.success && J.errorMessage && /* @__PURE__ */
|
|
405
|
+
J && !J.success && J.errorMessage && /* @__PURE__ */ S(n, {
|
|
432
406
|
headingLevel: 3,
|
|
433
407
|
tone: "danger",
|
|
434
408
|
padding: "compact",
|
|
@@ -437,36 +411,36 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
|
|
|
437
411
|
})
|
|
438
412
|
]
|
|
439
413
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
className: "flex-
|
|
442
|
-
children: [/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ C(se, {
|
|
415
|
+
className: "shrink-0 flex-wrap gap-2 sm:justify-between",
|
|
416
|
+
children: [/* @__PURE__ */ S("div", { children: O === "preview" && /* @__PURE__ */ C(p, {
|
|
443
417
|
variant: "ghost",
|
|
444
418
|
onClick: () => {
|
|
445
|
-
|
|
419
|
+
M.current++, k("select"), j(null), z(""), V("PRIVATE"), U(!1), L(null), Z();
|
|
446
420
|
},
|
|
447
421
|
disabled: G,
|
|
448
|
-
children: [/* @__PURE__ */
|
|
449
|
-
}) }), /* @__PURE__ */
|
|
450
|
-
className: "flex items-center gap-2",
|
|
422
|
+
children: [/* @__PURE__ */ S(te, { className: "size-4" }), D("bigconsole.dashboards.import.back", "Back")]
|
|
423
|
+
}) }), /* @__PURE__ */ C("div", {
|
|
424
|
+
className: "flex flex-wrap items-center gap-2",
|
|
451
425
|
children: [
|
|
452
|
-
|
|
426
|
+
O !== "complete" && /* @__PURE__ */ S(p, {
|
|
453
427
|
variant: "outline",
|
|
454
|
-
onClick:
|
|
428
|
+
onClick: T,
|
|
455
429
|
disabled: !$,
|
|
456
|
-
children:
|
|
430
|
+
children: D("bigconsole.dashboards.import.cancel", "Cancel")
|
|
457
431
|
}),
|
|
458
|
-
|
|
459
|
-
onClick:
|
|
432
|
+
O === "preview" && q?.isValid && /* @__PURE__ */ C(p, {
|
|
433
|
+
onClick: fe,
|
|
460
434
|
disabled: G || q.warnings.length > 0 && !H,
|
|
461
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ S(d, { className: "size-4" }), D("bigconsole.dashboards.import.importButton", "Import Dashboard")]
|
|
462
436
|
}),
|
|
463
|
-
|
|
437
|
+
O === "importing" && /* @__PURE__ */ C("div", {
|
|
464
438
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ S(b, { className: "size-4" }), D("bigconsole.dashboards.import.importing", "Importing...")]
|
|
466
440
|
}),
|
|
467
|
-
|
|
468
|
-
onClick:
|
|
469
|
-
children:
|
|
441
|
+
O === "complete" && /* @__PURE__ */ S(p, {
|
|
442
|
+
onClick: T,
|
|
443
|
+
children: D("bigconsole.dashboards.import.done", "Done")
|
|
470
444
|
})
|
|
471
445
|
]
|
|
472
446
|
})]
|
|
@@ -476,4 +450,4 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
|
|
|
476
450
|
});
|
|
477
451
|
});
|
|
478
452
|
//#endregion
|
|
479
|
-
export {
|
|
453
|
+
export { T as default };
|