@burdenoff/microfe-bigconsole 2026.1118.9 → 2026.1118.10
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/dashboard/BoardMigrationReport.d.ts +7 -0
- package/dist/bigconsole/components/dashboard/BoardMigrationReport.js +136 -0
- package/dist/bigconsole/components/dashboard/ImportFromToolDialog.d.ts +8 -0
- package/dist/bigconsole/components/dashboard/ImportFromToolDialog.js +464 -0
- package/dist/bigconsole/components/dashboard/index.d.ts +2 -0
- package/dist/bigconsole/components/dashboard/index.js +2 -0
- package/dist/bigconsole/constants/backendErrors.js +1 -0
- package/dist/bigconsole/hooks/index.d.ts +1 -0
- package/dist/bigconsole/hooks/index.js +14 -13
- package/dist/bigconsole/hooks/useBoardMigrationPreview.d.ts +22 -0
- package/dist/bigconsole/hooks/useBoardMigrationPreview.js +62 -0
- package/dist/bigconsole/pages/DashboardsPage.js +396 -376
- package/dist/bigconsole/utils/backendError.js +46 -24
- package/dist/bigconsole/utils/boardMigration.d.ts +53 -0
- package/dist/bigconsole/utils/boardMigration.js +92 -0
- package/dist/generated/wspace-operations.d.ts +69 -0
- package/dist/generated/wspace-operations.js +438 -73
- package/dist/generated/wspace-types.js +12 -10
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BoardMigrationReportData } from '../../hooks/useBoardMigrationPreview';
|
|
3
|
+
export interface BoardMigrationReportProps {
|
|
4
|
+
report: BoardMigrationReportData;
|
|
5
|
+
}
|
|
6
|
+
export declare const BoardMigrationReport: FC<BoardMigrationReportProps>;
|
|
7
|
+
export default BoardMigrationReport;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Section as e } from "../common/Section.js";
|
|
2
|
+
import "../common/index.js";
|
|
3
|
+
import { statusBadgeVariant as t } from "../../utils/boardMigration.js";
|
|
4
|
+
import { memo as n } from "react";
|
|
5
|
+
import { Badge as r } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
import { useI18n as i } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
// src/bigconsole/components/dashboard/BoardMigrationReport.tsx
|
|
9
|
+
var s = {
|
|
10
|
+
CLEAN: "Clean",
|
|
11
|
+
APPROXIMATE: "Approximate",
|
|
12
|
+
UNSUPPORTED: "Not supported"
|
|
13
|
+
}, c = n(function({ report: n }) {
|
|
14
|
+
let { t: c } = i(), l = (e) => c(`bigconsole.dashboards.importFromTool.status.${e}`, s[e]);
|
|
15
|
+
return /* @__PURE__ */ o("div", {
|
|
16
|
+
className: "space-y-4",
|
|
17
|
+
"data-testid": "board-migration-report",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ o(e, {
|
|
20
|
+
headingLevel: 3,
|
|
21
|
+
emphasis: "muted",
|
|
22
|
+
padding: "compact",
|
|
23
|
+
title: c("bigconsole.dashboards.importFromTool.summaryTitle", "What carried over"),
|
|
24
|
+
"data-testid": "board-migration-summary",
|
|
25
|
+
bodyClassName: "space-y-2",
|
|
26
|
+
children: [/* @__PURE__ */ o("div", {
|
|
27
|
+
className: "flex flex-wrap items-center gap-2",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ a(r, {
|
|
30
|
+
variant: "success",
|
|
31
|
+
"data-testid": "board-migration-clean",
|
|
32
|
+
children: c("bigconsole.dashboards.importFromTool.cleanCount", "{{count}} clean", { count: n.cleanCount })
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ a(r, {
|
|
35
|
+
variant: "warning",
|
|
36
|
+
"data-testid": "board-migration-approximate",
|
|
37
|
+
children: c("bigconsole.dashboards.importFromTool.approximateCount", "{{count}} approximate", { count: n.approximateCount })
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ a(r, {
|
|
40
|
+
variant: "destructive",
|
|
41
|
+
"data-testid": "board-migration-unsupported",
|
|
42
|
+
children: c("bigconsole.dashboards.importFromTool.unsupportedCount", "{{count}} not supported", { count: n.unsupportedCount })
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}), /* @__PURE__ */ a("p", {
|
|
46
|
+
className: "text-xs text-text-secondary",
|
|
47
|
+
children: c("bigconsole.dashboards.importFromTool.summaryBody", "{{count}} items in \"{{name}}\". Nothing has been created yet.", {
|
|
48
|
+
count: n.totalCount,
|
|
49
|
+
name: n.sourceName
|
|
50
|
+
})
|
|
51
|
+
})]
|
|
52
|
+
}),
|
|
53
|
+
n.warnings.length > 0 && /* @__PURE__ */ a(e, {
|
|
54
|
+
headingLevel: 3,
|
|
55
|
+
tone: "info",
|
|
56
|
+
padding: "compact",
|
|
57
|
+
title: c("bigconsole.dashboards.importFromTool.notesTitle", "Before you import"),
|
|
58
|
+
"data-testid": "board-migration-warnings",
|
|
59
|
+
children: /* @__PURE__ */ a("ul", {
|
|
60
|
+
className: "space-y-1 text-xs",
|
|
61
|
+
children: n.warnings.map((e) => /* @__PURE__ */ a("li", {
|
|
62
|
+
className: "break-words",
|
|
63
|
+
children: e
|
|
64
|
+
}, e))
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ a(e, {
|
|
68
|
+
headingLevel: 3,
|
|
69
|
+
padding: "compact",
|
|
70
|
+
title: c("bigconsole.dashboards.importFromTool.itemsTitle", "Cards and filters"),
|
|
71
|
+
"data-testid": "board-migration-items",
|
|
72
|
+
children: /* @__PURE__ */ a("ul", {
|
|
73
|
+
className: "divide-y divide-border-subtle",
|
|
74
|
+
children: n.items.map((e, n) => /* @__PURE__ */ o("li", {
|
|
75
|
+
className: "flex flex-wrap items-start justify-between gap-x-3 gap-y-1 py-2",
|
|
76
|
+
"data-testid": "board-migration-item",
|
|
77
|
+
children: [/* @__PURE__ */ o("div", {
|
|
78
|
+
className: "min-w-0 flex-1",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ a("p", {
|
|
81
|
+
className: "break-words text-sm font-medium",
|
|
82
|
+
children: e.title
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ o("p", {
|
|
85
|
+
className: "text-xs text-text-secondary",
|
|
86
|
+
children: [
|
|
87
|
+
e.sourceType,
|
|
88
|
+
" → ",
|
|
89
|
+
e.targetType,
|
|
90
|
+
e.page ? ` · ${e.page}` : ""
|
|
91
|
+
]
|
|
92
|
+
}),
|
|
93
|
+
e.reason && /* @__PURE__ */ a("p", {
|
|
94
|
+
className: "mt-1 break-words text-xs text-text-secondary",
|
|
95
|
+
children: e.reason
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
}), /* @__PURE__ */ a(r, {
|
|
99
|
+
variant: t(e.status),
|
|
100
|
+
children: l(e.status)
|
|
101
|
+
})]
|
|
102
|
+
}, `${e.kind}-${e.page ?? ""}-${e.title}-${n}`))
|
|
103
|
+
})
|
|
104
|
+
}),
|
|
105
|
+
n.dataNeeds.length > 0 && /* @__PURE__ */ a(e, {
|
|
106
|
+
headingLevel: 3,
|
|
107
|
+
tone: "warning",
|
|
108
|
+
padding: "compact",
|
|
109
|
+
title: c("bigconsole.dashboards.importFromTool.dataNeedsTitle", "Widgets that need a data source ({{count}})", { count: n.dataNeeds.length }),
|
|
110
|
+
description: c("bigconsole.dashboards.importFromTool.dataNeedsBody", "BigConsole does not copy data. After the import, connect each widget to a data sink. The original query is kept on the widget for reference."),
|
|
111
|
+
"data-testid": "board-migration-data-needs",
|
|
112
|
+
children: /* @__PURE__ */ a("ul", {
|
|
113
|
+
className: "space-y-2 text-xs",
|
|
114
|
+
children: n.dataNeeds.map((e, t) => /* @__PURE__ */ o("li", {
|
|
115
|
+
className: "min-w-0",
|
|
116
|
+
children: [/* @__PURE__ */ o("p", {
|
|
117
|
+
className: "break-words font-medium",
|
|
118
|
+
children: [
|
|
119
|
+
e.widgetTitle,
|
|
120
|
+
" ",
|
|
121
|
+
/* @__PURE__ */ o("span", {
|
|
122
|
+
className: "font-normal text-text-secondary",
|
|
123
|
+
children: ["· ", e.page]
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}), /* @__PURE__ */ a("p", {
|
|
127
|
+
className: "line-clamp-2 break-words font-mono text-text-secondary",
|
|
128
|
+
children: e.summary
|
|
129
|
+
})]
|
|
130
|
+
}, `${e.page}-${e.widgetTitle}-${t}`))
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
export { c as BoardMigrationReport, c as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface ImportFromToolDialogProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onSuccess?: (dashboardId: string, dashboardName: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ImportFromToolDialog: FC<ImportFromToolDialogProps>;
|
|
8
|
+
export default ImportFromToolDialog;
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import "../common/index.js";
|
|
2
|
+
import { useBigConsole as e } from "../../context/BigConsoleContext.js";
|
|
3
|
+
import "../../context/index.js";
|
|
4
|
+
import "../../hooks/index.js";
|
|
5
|
+
import { Section as t } from "../common/Section.js";
|
|
6
|
+
import n from "../../hooks/useBigConsoleAnalytics.js";
|
|
7
|
+
import { resolveBackendErrorMessage as r } from "../../utils/backendError.js";
|
|
8
|
+
import i from "../../hooks/useImportDashboard.js";
|
|
9
|
+
import a from "../../hooks/useBoardMigrationPreview.js";
|
|
10
|
+
import { MIGRATION_SOURCES as ee, buildTableauBoard as te, canImportWithoutAcknowledging as ne, gatherPowerBiBoard as re, isPbirFile as ie, normalizeSourceUrl as ae, parseBoardJson as oe } from "../../utils/boardMigration.js";
|
|
11
|
+
import { reportBigConsoleQuotaError as se } from "../../utils/quota.js";
|
|
12
|
+
import { BoardMigrationReport as ce } from "./BoardMigrationReport.js";
|
|
13
|
+
import { memo as o, useCallback as s, useLayoutEffect as le, useRef as c, useState as l } from "react";
|
|
14
|
+
import { AlertTriangle as ue, ArrowLeft as de, ArrowRightLeft as fe, Check as pe, FileJson as u, FolderOpen as me, XCircle as he } from "lucide-react";
|
|
15
|
+
import { Button as d, Checkbox as ge, Dialog as _e, DialogContent as ve, DialogDescription as ye, DialogFooter as be, DialogHeader as xe, DialogTitle as Se, Input as f, Label as p, Spinner as m, Textarea as Ce } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { useI18n as we } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
18
|
+
// src/bigconsole/components/dashboard/ImportFromToolDialog.tsx
|
|
19
|
+
var v = o(function({ isOpen: o, onClose: v, onSuccess: y }) {
|
|
20
|
+
let { t: b } = we(), { currentUser: Te, workspaceId: Ee } = e(), De = `${Te?.id ?? ""}|${Ee ?? ""}`, x = c(0), S = c(null), C = c(null), w = c(null), [T, E] = l("source"), [D, O] = l("METABASE"), [k, A] = l(null), [j, M] = l(""), [N, P] = l(""), [F, I] = l(null), [L, R] = l(""), [z, B] = l(!1), { loading: V, error: Oe, preview: H, previewBoard: U, clearPreview: W } = a(), { loading: ke, error: Ae, importResult: G, importDashboard: K, clearState: q } = i(), J = n();
|
|
21
|
+
le(() => (x.current++, W(), q(), o && (E("source"), O("METABASE"), A(null), M(""), P(""), I(null), R(""), B(!1)), () => {
|
|
22
|
+
x.current++;
|
|
23
|
+
}), [
|
|
24
|
+
o,
|
|
25
|
+
De,
|
|
26
|
+
W,
|
|
27
|
+
q
|
|
28
|
+
]);
|
|
29
|
+
let Y = s((e) => e === "empty" ? b("bigconsole.dashboards.importFromTool.errorEmpty", "Paste the board JSON or choose a file.") : e === "not-json" ? b("bigconsole.dashboards.importFromTool.errorNotJson", "That is not valid JSON.") : b("bigconsole.dashboards.importFromTool.errorNotObject", "Expected one dashboard as a JSON object, not a list."), [b]), je = s((e) => {
|
|
30
|
+
let t = e.target.files?.[0];
|
|
31
|
+
if (!t) return;
|
|
32
|
+
let n = ++x.current;
|
|
33
|
+
if (I(null), !t.name.toLowerCase().endsWith(".json")) {
|
|
34
|
+
I(b("bigconsole.dashboards.import.selectJsonFile", "Please select a JSON file"));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let r = new FileReader();
|
|
38
|
+
r.onload = (e) => {
|
|
39
|
+
if (x.current !== n) return;
|
|
40
|
+
let t = e.target?.result;
|
|
41
|
+
typeof t == "string" ? M(t) : I(b("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
|
|
42
|
+
}, r.onerror = () => {
|
|
43
|
+
x.current === n && I(b("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
|
|
44
|
+
}, r.readAsText(t);
|
|
45
|
+
}, [b]), Me = s((e) => {
|
|
46
|
+
x.current++, O(e), A(null), I(null);
|
|
47
|
+
}, []), Ne = s(async (e) => {
|
|
48
|
+
let t = e.target.files?.[0];
|
|
49
|
+
if (e.target.value = "", !t) return;
|
|
50
|
+
let n = ++x.current;
|
|
51
|
+
if (I(null), !t.name.toLowerCase().endsWith(".twb")) I(b("bigconsole.dashboards.importFromTool.errorNotTwb", "Choose a .twb workbook. A packaged .twbx must be unzipped first."));
|
|
52
|
+
else try {
|
|
53
|
+
let e = await t.text();
|
|
54
|
+
x.current === n && A({
|
|
55
|
+
label: t.name,
|
|
56
|
+
board: te(t.name, e)
|
|
57
|
+
});
|
|
58
|
+
} catch {
|
|
59
|
+
x.current === n && I(b("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
|
|
60
|
+
}
|
|
61
|
+
}, [b]), Pe = s(async (e) => {
|
|
62
|
+
let t = Array.from(e.target.files ?? []);
|
|
63
|
+
e.target.value = "";
|
|
64
|
+
let n = ++x.current;
|
|
65
|
+
I(null);
|
|
66
|
+
try {
|
|
67
|
+
let e = t.filter((e) => ie(e.webkitRelativePath || e.name)), r = await Promise.all(e.map(async (e) => ({
|
|
68
|
+
path: e.webkitRelativePath || e.name,
|
|
69
|
+
text: await e.text()
|
|
70
|
+
})));
|
|
71
|
+
if (x.current !== n) return;
|
|
72
|
+
let i = re(r);
|
|
73
|
+
if (!i.ok) {
|
|
74
|
+
I(i.problem === "no-pages" ? b("bigconsole.dashboards.importFromTool.errorNoPbir", "No Power BI pages found. Choose the .Report folder of a report saved in PBIR format.") : Y("not-json"));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
let a = typeof i.board.name == "string" ? i.board.name : "Power BI report";
|
|
78
|
+
A({
|
|
79
|
+
label: a,
|
|
80
|
+
board: i.board
|
|
81
|
+
});
|
|
82
|
+
} catch {
|
|
83
|
+
x.current === n && I(b("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
|
|
84
|
+
}
|
|
85
|
+
}, [Y, b]), Fe = s(async () => {
|
|
86
|
+
let e;
|
|
87
|
+
if (D === "METABASE") {
|
|
88
|
+
let t = oe(j);
|
|
89
|
+
if (!t.ok) {
|
|
90
|
+
I(Y(t.problem));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
e = t.value;
|
|
94
|
+
} else if (k) e = k.board;
|
|
95
|
+
else {
|
|
96
|
+
I(D === "TABLEAU" ? b("bigconsole.dashboards.importFromTool.errorNoWorkbook", "Choose a .twb workbook.") : b("bigconsole.dashboards.importFromTool.errorNoFolder", "Choose the report folder."));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
I(null);
|
|
100
|
+
let t = x.current, n = await U({
|
|
101
|
+
source: D,
|
|
102
|
+
board: e,
|
|
103
|
+
sourceUrl: ae(N)
|
|
104
|
+
});
|
|
105
|
+
x.current === t && n && (R(n.report.sourceName), B(!1), E("report"));
|
|
106
|
+
}, [
|
|
107
|
+
j,
|
|
108
|
+
Y,
|
|
109
|
+
k,
|
|
110
|
+
U,
|
|
111
|
+
D,
|
|
112
|
+
N,
|
|
113
|
+
b
|
|
114
|
+
]), Ie = s(async () => {
|
|
115
|
+
if (!H) return;
|
|
116
|
+
let e = x.current;
|
|
117
|
+
E("importing"), J("bigconsole.dashboard.import_clicked", { source: "import" });
|
|
118
|
+
try {
|
|
119
|
+
let t = await K(H.definition, {
|
|
120
|
+
name: L.trim() || void 0,
|
|
121
|
+
visibility: "PRIVATE",
|
|
122
|
+
skipWarnings: z
|
|
123
|
+
});
|
|
124
|
+
if (x.current !== e) return;
|
|
125
|
+
t?.success && t.dashboard ? (E("complete"), J("bigconsole.dashboard.imported", {
|
|
126
|
+
dashboardId: t.dashboard.id,
|
|
127
|
+
source: "import",
|
|
128
|
+
originalUpdated: !1
|
|
129
|
+
}), y?.(t.dashboard.id, t.dashboard.name)) : E("report");
|
|
130
|
+
} catch (t) {
|
|
131
|
+
if (x.current !== e) return;
|
|
132
|
+
if (se(t, "project")) {
|
|
133
|
+
v();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
E("report");
|
|
137
|
+
}
|
|
138
|
+
}, [
|
|
139
|
+
z,
|
|
140
|
+
J,
|
|
141
|
+
K,
|
|
142
|
+
L,
|
|
143
|
+
v,
|
|
144
|
+
y,
|
|
145
|
+
H
|
|
146
|
+
]), X = V || ke || T === "importing", Z = !X, Q = H?.validation, Le = Q ? Q.isValid && !ne(Q) : !1, Re = !!Q?.isValid && (!Le || z), $ = Oe ?? Ae, ze = D === "METABASE" ? j.trim() !== "" : k !== null, Be = {
|
|
147
|
+
METABASE: "Metabase",
|
|
148
|
+
TABLEAU: "Tableau",
|
|
149
|
+
POWER_BI: "Power BI"
|
|
150
|
+
}, Ve = {
|
|
151
|
+
METABASE: b("bigconsole.dashboards.importFromTool.sourceHint", "Use the JSON that Metabase returns for one dashboard (GET /api/dashboard/{id}), or run \"bigconsole migrate metabase\" to fetch it."),
|
|
152
|
+
TABLEAU: b("bigconsole.dashboards.importFromTool.sourceHintTableau", "Choose a .twb workbook. Each dashboard becomes a page. A packaged .twbx must be unzipped first."),
|
|
153
|
+
POWER_BI: b("bigconsole.dashboards.importFromTool.sourceHintPowerBi", "Choose the .Report folder of a report saved as a Power BI project in PBIR format. Only the page and visual files are read.")
|
|
154
|
+
};
|
|
155
|
+
return /* @__PURE__ */ g(_e, {
|
|
156
|
+
open: o,
|
|
157
|
+
onOpenChange: (e) => !e && Z && v(),
|
|
158
|
+
children: /* @__PURE__ */ _(ve, {
|
|
159
|
+
className: "sm:max-w-2xl flex max-h-[calc(100dvh-3rem)] flex-col overflow-hidden",
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ _(xe, {
|
|
162
|
+
className: "shrink-0",
|
|
163
|
+
children: [/* @__PURE__ */ _("div", {
|
|
164
|
+
className: "flex items-center gap-3",
|
|
165
|
+
children: [/* @__PURE__ */ g("div", {
|
|
166
|
+
className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10",
|
|
167
|
+
children: /* @__PURE__ */ g(fe, { className: "size-5 text-primary" })
|
|
168
|
+
}), /* @__PURE__ */ g(Se, { children: b("bigconsole.dashboards.importFromTool.title", "Import from another tool") })]
|
|
169
|
+
}), /* @__PURE__ */ g(ye, { children: b("bigconsole.dashboards.importFromTool.description", "Bring a dashboard from Metabase, Tableau or Power BI into BigConsole. You see what carries over before anything is created.") })]
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ _("div", {
|
|
172
|
+
className: "min-h-0 flex-1 space-y-4 overflow-y-auto py-4",
|
|
173
|
+
children: [
|
|
174
|
+
T === "source" && /* @__PURE__ */ _("div", {
|
|
175
|
+
className: "space-y-4",
|
|
176
|
+
"data-testid": "import-from-tool-source",
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ _("div", {
|
|
179
|
+
className: "space-y-2",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ g(p, { children: b("bigconsole.dashboards.importFromTool.sourceLabel", "Source") }),
|
|
182
|
+
/* @__PURE__ */ g("div", {
|
|
183
|
+
className: "flex flex-wrap gap-2",
|
|
184
|
+
role: "radiogroup",
|
|
185
|
+
"aria-label": "Source",
|
|
186
|
+
children: ee.map((e) => /* @__PURE__ */ g(d, {
|
|
187
|
+
type: "button",
|
|
188
|
+
role: "radio",
|
|
189
|
+
"aria-checked": D === e,
|
|
190
|
+
variant: D === e ? "default" : "outline",
|
|
191
|
+
size: "sm",
|
|
192
|
+
disabled: X,
|
|
193
|
+
onClick: () => Me(e),
|
|
194
|
+
"data-testid": `import-from-tool-source-${e}`,
|
|
195
|
+
children: Be[e]
|
|
196
|
+
}, e))
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ g("p", {
|
|
199
|
+
className: "text-xs text-text-secondary",
|
|
200
|
+
children: Ve[D]
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
}),
|
|
204
|
+
D === "METABASE" && /* @__PURE__ */ _("div", {
|
|
205
|
+
className: "space-y-2",
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ g(p, {
|
|
208
|
+
htmlFor: "import-from-tool-json",
|
|
209
|
+
children: b("bigconsole.dashboards.importFromTool.jsonLabel", "Dashboard JSON")
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ g(Ce, {
|
|
212
|
+
id: "import-from-tool-json",
|
|
213
|
+
value: j,
|
|
214
|
+
onChange: (e) => M(e.target.value),
|
|
215
|
+
rows: 8,
|
|
216
|
+
className: "font-mono text-xs",
|
|
217
|
+
placeholder: "{ \"name\": \"Sales overview\", \"dashcards\": [ ... ] }",
|
|
218
|
+
disabled: X
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ _("div", {
|
|
221
|
+
className: "flex items-center gap-2",
|
|
222
|
+
children: [/* @__PURE__ */ g("input", {
|
|
223
|
+
ref: S,
|
|
224
|
+
id: "import-from-tool-file",
|
|
225
|
+
type: "file",
|
|
226
|
+
accept: ".json,application/json",
|
|
227
|
+
onChange: je,
|
|
228
|
+
className: "hidden"
|
|
229
|
+
}), /* @__PURE__ */ _(d, {
|
|
230
|
+
type: "button",
|
|
231
|
+
variant: "outline",
|
|
232
|
+
size: "sm",
|
|
233
|
+
onClick: () => S.current?.click(),
|
|
234
|
+
children: [/* @__PURE__ */ g(u, { className: "mr-2 size-4" }), b("bigconsole.dashboards.importFromTool.chooseFile", "Choose a .json file")]
|
|
235
|
+
})]
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
D === "TABLEAU" && /* @__PURE__ */ _("div", {
|
|
240
|
+
className: "space-y-2",
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ g("input", {
|
|
243
|
+
ref: C,
|
|
244
|
+
id: "import-from-tool-twb",
|
|
245
|
+
"data-testid": "import-from-tool-twb",
|
|
246
|
+
type: "file",
|
|
247
|
+
accept: ".twb",
|
|
248
|
+
onChange: (e) => void Ne(e),
|
|
249
|
+
className: "hidden"
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ _(d, {
|
|
252
|
+
type: "button",
|
|
253
|
+
variant: "outline",
|
|
254
|
+
size: "sm",
|
|
255
|
+
disabled: X,
|
|
256
|
+
onClick: () => C.current?.click(),
|
|
257
|
+
children: [/* @__PURE__ */ g(u, { className: "mr-2 size-4" }), b("bigconsole.dashboards.importFromTool.chooseWorkbook", "Choose a .twb workbook")]
|
|
258
|
+
}),
|
|
259
|
+
k && /* @__PURE__ */ g("p", {
|
|
260
|
+
className: "text-sm font-medium",
|
|
261
|
+
children: k.label
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
}),
|
|
265
|
+
D === "POWER_BI" && /* @__PURE__ */ _("div", {
|
|
266
|
+
className: "space-y-2",
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ g("input", {
|
|
269
|
+
ref: w,
|
|
270
|
+
id: "import-from-tool-folder",
|
|
271
|
+
"data-testid": "import-from-tool-folder",
|
|
272
|
+
type: "file",
|
|
273
|
+
webkitdirectory: "",
|
|
274
|
+
multiple: !0,
|
|
275
|
+
onChange: (e) => void Pe(e),
|
|
276
|
+
className: "hidden"
|
|
277
|
+
}),
|
|
278
|
+
/* @__PURE__ */ _(d, {
|
|
279
|
+
type: "button",
|
|
280
|
+
variant: "outline",
|
|
281
|
+
size: "sm",
|
|
282
|
+
disabled: X,
|
|
283
|
+
onClick: () => w.current?.click(),
|
|
284
|
+
children: [/* @__PURE__ */ g(me, { className: "mr-2 size-4" }), b("bigconsole.dashboards.importFromTool.chooseFolder", "Choose the report folder")]
|
|
285
|
+
}),
|
|
286
|
+
k && /* @__PURE__ */ g("p", {
|
|
287
|
+
className: "text-sm font-medium",
|
|
288
|
+
children: k.label
|
|
289
|
+
})
|
|
290
|
+
]
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ _("div", {
|
|
293
|
+
className: "space-y-2",
|
|
294
|
+
children: [
|
|
295
|
+
/* @__PURE__ */ g(p, {
|
|
296
|
+
htmlFor: "import-from-tool-url",
|
|
297
|
+
children: b("bigconsole.dashboards.importFromTool.urlLabel", "Dashboard link (optional)")
|
|
298
|
+
}),
|
|
299
|
+
/* @__PURE__ */ g(f, {
|
|
300
|
+
id: "import-from-tool-url",
|
|
301
|
+
type: "url",
|
|
302
|
+
value: N,
|
|
303
|
+
onChange: (e) => P(e.target.value),
|
|
304
|
+
placeholder: "https://",
|
|
305
|
+
disabled: X
|
|
306
|
+
}),
|
|
307
|
+
/* @__PURE__ */ g("p", {
|
|
308
|
+
className: "text-xs text-text-secondary",
|
|
309
|
+
children: b("bigconsole.dashboards.importFromTool.urlHint", "Kept as a link back to the original. Credentials and the query string are removed.")
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
}),
|
|
315
|
+
(T === "report" || T === "importing") && H && /* @__PURE__ */ _(h, { children: [
|
|
316
|
+
/* @__PURE__ */ g(ce, { report: H.report }),
|
|
317
|
+
Q && Q.errors.length > 0 && /* @__PURE__ */ g(t, {
|
|
318
|
+
headingLevel: 3,
|
|
319
|
+
tone: "danger",
|
|
320
|
+
padding: "compact",
|
|
321
|
+
icon: /* @__PURE__ */ g(he, { className: "size-4" }),
|
|
322
|
+
title: b("bigconsole.dashboards.import.errorsCount", "Errors ({{count}})", { count: Q.errors.length }),
|
|
323
|
+
"data-testid": "import-from-tool-errors",
|
|
324
|
+
children: /* @__PURE__ */ g("ul", {
|
|
325
|
+
className: "space-y-1 text-xs text-status-error-text",
|
|
326
|
+
children: Q.errors.map((e) => /* @__PURE__ */ _("li", { children: [
|
|
327
|
+
/* @__PURE__ */ _("span", {
|
|
328
|
+
className: "font-mono",
|
|
329
|
+
children: [
|
|
330
|
+
"[",
|
|
331
|
+
e.code,
|
|
332
|
+
"]"
|
|
333
|
+
]
|
|
334
|
+
}),
|
|
335
|
+
" ",
|
|
336
|
+
e.message
|
|
337
|
+
] }, `${e.code}-${e.message}`))
|
|
338
|
+
})
|
|
339
|
+
}),
|
|
340
|
+
Q && Q.warnings.length > 0 && /* @__PURE__ */ g(t, {
|
|
341
|
+
headingLevel: 3,
|
|
342
|
+
tone: "warning",
|
|
343
|
+
padding: "compact",
|
|
344
|
+
icon: /* @__PURE__ */ g(ue, { className: "size-4" }),
|
|
345
|
+
title: b("bigconsole.dashboards.import.warningsCount", "Warnings ({{count}})", { count: Q.warnings.length }),
|
|
346
|
+
"data-testid": "import-from-tool-warnings",
|
|
347
|
+
children: /* @__PURE__ */ g("ul", {
|
|
348
|
+
className: "space-y-1 text-xs",
|
|
349
|
+
children: Q.warnings.map((e) => /* @__PURE__ */ _("li", {
|
|
350
|
+
className: "break-words",
|
|
351
|
+
children: [
|
|
352
|
+
/* @__PURE__ */ _("span", {
|
|
353
|
+
className: "font-mono",
|
|
354
|
+
children: [
|
|
355
|
+
"[",
|
|
356
|
+
e.code,
|
|
357
|
+
"]"
|
|
358
|
+
]
|
|
359
|
+
}),
|
|
360
|
+
" ",
|
|
361
|
+
e.message
|
|
362
|
+
]
|
|
363
|
+
}, `${e.code}-${e.message}`))
|
|
364
|
+
})
|
|
365
|
+
}),
|
|
366
|
+
Q?.isValid && /* @__PURE__ */ _("div", {
|
|
367
|
+
className: "space-y-4",
|
|
368
|
+
children: [/* @__PURE__ */ _("div", {
|
|
369
|
+
className: "space-y-2",
|
|
370
|
+
children: [
|
|
371
|
+
/* @__PURE__ */ g(p, {
|
|
372
|
+
htmlFor: "import-from-tool-name",
|
|
373
|
+
children: b("bigconsole.dashboards.import.dashboardNameLabel", "Dashboard Name")
|
|
374
|
+
}),
|
|
375
|
+
/* @__PURE__ */ g(f, {
|
|
376
|
+
id: "import-from-tool-name",
|
|
377
|
+
type: "text",
|
|
378
|
+
value: L,
|
|
379
|
+
onChange: (e) => R(e.target.value),
|
|
380
|
+
disabled: X
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ g("p", {
|
|
383
|
+
className: "text-xs text-text-secondary",
|
|
384
|
+
children: b("bigconsole.dashboards.importFromTool.privateHint", "The new dashboard is private until you share it.")
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
}), Le && /* @__PURE__ */ _("div", {
|
|
388
|
+
className: "flex items-start space-x-3",
|
|
389
|
+
children: [/* @__PURE__ */ g(ge, {
|
|
390
|
+
id: "import-from-tool-acknowledge",
|
|
391
|
+
checked: z,
|
|
392
|
+
onCheckedChange: (e) => B(e === !0),
|
|
393
|
+
disabled: X
|
|
394
|
+
}), /* @__PURE__ */ g(p, {
|
|
395
|
+
htmlFor: "import-from-tool-acknowledge",
|
|
396
|
+
className: "cursor-pointer",
|
|
397
|
+
children: b("bigconsole.dashboards.import.acknowledgeWarnings", "Acknowledge warnings and proceed")
|
|
398
|
+
})]
|
|
399
|
+
})]
|
|
400
|
+
})
|
|
401
|
+
] }),
|
|
402
|
+
T === "complete" && /* @__PURE__ */ g(t, {
|
|
403
|
+
headingLevel: 3,
|
|
404
|
+
tone: "success",
|
|
405
|
+
padding: "compact",
|
|
406
|
+
icon: /* @__PURE__ */ g(pe, { className: "size-4" }),
|
|
407
|
+
title: b("bigconsole.dashboards.importFromTool.doneTitle", "Dashboard created"),
|
|
408
|
+
description: b("bigconsole.dashboards.importFromTool.doneBody", "Open it and connect each widget to a data sink to see data."),
|
|
409
|
+
"data-testid": "import-from-tool-complete"
|
|
410
|
+
}),
|
|
411
|
+
F && /* @__PURE__ */ g("p", {
|
|
412
|
+
className: "text-sm text-status-error-text",
|
|
413
|
+
role: "alert",
|
|
414
|
+
"data-testid": "import-from-tool-input-error",
|
|
415
|
+
children: F
|
|
416
|
+
}),
|
|
417
|
+
$ && /* @__PURE__ */ g("p", {
|
|
418
|
+
className: "break-words text-sm text-status-error-text",
|
|
419
|
+
role: "alert",
|
|
420
|
+
"data-testid": "import-from-tool-error",
|
|
421
|
+
children: r(b, $)
|
|
422
|
+
}),
|
|
423
|
+
!$ && G && !G.success && G.errorMessage && /* @__PURE__ */ g("p", {
|
|
424
|
+
className: "break-words text-sm text-status-error-text",
|
|
425
|
+
role: "alert",
|
|
426
|
+
"data-testid": "import-from-tool-import-failed",
|
|
427
|
+
children: G.errorMessage
|
|
428
|
+
})
|
|
429
|
+
]
|
|
430
|
+
}),
|
|
431
|
+
/* @__PURE__ */ _(be, {
|
|
432
|
+
className: "shrink-0",
|
|
433
|
+
children: [
|
|
434
|
+
T === "source" && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, {
|
|
435
|
+
variant: "outline",
|
|
436
|
+
onClick: v,
|
|
437
|
+
disabled: !Z,
|
|
438
|
+
children: b("bigconsole.dashboards.import.cancel", "Cancel")
|
|
439
|
+
}), /* @__PURE__ */ _(d, {
|
|
440
|
+
onClick: Fe,
|
|
441
|
+
disabled: X || !ze,
|
|
442
|
+
children: [V ? /* @__PURE__ */ g(m, { className: "mr-2 size-4" }) : null, b("bigconsole.dashboards.importFromTool.preview", "Preview conversion")]
|
|
443
|
+
})] }),
|
|
444
|
+
(T === "report" || T === "importing") && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(d, {
|
|
445
|
+
variant: "outline",
|
|
446
|
+
onClick: () => E("source"),
|
|
447
|
+
disabled: X,
|
|
448
|
+
children: [/* @__PURE__ */ g(de, { className: "mr-2 size-4" }), b("bigconsole.dashboards.importFromTool.back", "Back")]
|
|
449
|
+
}), /* @__PURE__ */ _(d, {
|
|
450
|
+
onClick: Ie,
|
|
451
|
+
disabled: X || !Re,
|
|
452
|
+
children: [T === "importing" ? /* @__PURE__ */ g(m, { className: "mr-2 size-4" }) : null, b("bigconsole.dashboards.importFromTool.import", "Import dashboard")]
|
|
453
|
+
})] }),
|
|
454
|
+
T === "complete" && /* @__PURE__ */ g(d, {
|
|
455
|
+
onClick: v,
|
|
456
|
+
children: b("bigconsole.dashboards.import.done", "Done")
|
|
457
|
+
})
|
|
458
|
+
]
|
|
459
|
+
})
|
|
460
|
+
]
|
|
461
|
+
})
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
export { v as ImportFromToolDialog, v as default };
|
|
@@ -12,6 +12,8 @@ export { CreateDashboardDialog, type CreateDashboardDialogProps } from './Create
|
|
|
12
12
|
export { DashboardStatusPill, useDashboardStatusLabel, type DashboardStatusPillProps } from './DashboardStatusPill';
|
|
13
13
|
export { ExportDashboardDialog, type ExportDashboardDialogProps } from './ExportDashboardDialog';
|
|
14
14
|
export { ImportDashboardDialog, type ImportDashboardDialogProps } from './ImportDashboardDialog';
|
|
15
|
+
export { ImportFromToolDialog, type ImportFromToolDialogProps } from './ImportFromToolDialog';
|
|
16
|
+
export { BoardMigrationReport, type BoardMigrationReportProps } from './BoardMigrationReport';
|
|
15
17
|
export { GlobalFiltersBar, type GlobalFiltersBarProps, FilterChip, type FilterChipProps, FilterEditor, type FilterEditorProps, } from './GlobalFiltersBar';
|
|
16
18
|
export { PageTabsManager, type PageTabsManagerProps, type DashboardPageTab } from './PageTabsManager';
|
|
17
19
|
export { ShareDialog, type ShareDialogProps } from './ShareDialog';
|
|
@@ -16,6 +16,8 @@ import "../builder/BuilderCanvas.js";
|
|
|
16
16
|
import "../builder/BuilderTopbar.js";
|
|
17
17
|
import "../builder/DashboardEditorShell.js";
|
|
18
18
|
import "./ImportDashboardDialog.js";
|
|
19
|
+
import "./ImportFromToolDialog.js";
|
|
20
|
+
import "./BoardMigrationReport.js";
|
|
19
21
|
import "./GlobalFiltersBar/index.js";
|
|
20
22
|
import "./PageTabsManager/index.js";
|
|
21
23
|
import "./ShareDialog/index.js";
|
|
@@ -5,6 +5,7 @@ var e = {
|
|
|
5
5
|
DASHBOARD_ARCHIVED_CANNOT_PUBLISH: "An archived dashboard cannot be published. Restore it first.",
|
|
6
6
|
DASHBOARD_INVALID_STATUS_TRANSITION: "That status change is not allowed for this dashboard.",
|
|
7
7
|
SOURCE_DASHBOARD_NOT_FOUND: "The source dashboard could not be found.",
|
|
8
|
+
BOARD_MIGRATION_INVALID: "That file is not a board this tool can convert. Check that it is one Metabase dashboard as JSON, a Tableau .twb workbook, or a Power BI report folder in PBIR format.",
|
|
8
9
|
DASHBOARD_IMPORT_INVALID_JSON: "The import file is not valid JSON.",
|
|
9
10
|
DASHBOARD_IMPORT_MISSING_DATA: "The import file is missing its dashboard data.",
|
|
10
11
|
DASHBOARD_LOCALE_REQUIRED: "A locale is required.",
|
|
@@ -19,6 +19,7 @@ export { useWidgetEvents, createWidgetActionHandler, type EventStatus, type Even
|
|
|
19
19
|
export { useWidgetActions, type ActionType, type ActionStyle, type ActionConfirmation, type WidgetAction, type CreateWidgetActionInput, type UpdateWidgetActionInput, type UseWidgetActionsOptions, type UseWidgetActionsResult, default as useWidgetActionsDefault, } from './useWidgetActions';
|
|
20
20
|
export { useExportDashboard, type ExportDashboardOptions, type UseExportDashboardResult, default as useExportDashboardDefault, } from './useExportDashboard';
|
|
21
21
|
export { useImportDashboard, type ImportDashboardInfo, type ImportValidationError, type ImportValidationWarning, type ImportValidationResult, type ImportStats, type ImportDashboardResult, type ImportDashboardOptions, type UseImportDashboardResult, default as useImportDashboardDefault, } from './useImportDashboard';
|
|
22
|
+
export { useBoardMigrationPreview, type BoardMigrationPreview, type BoardMigrationReportData, type BoardMigrationItemData, type PreviewBoardInput, type UseBoardMigrationPreviewResult, } from './useBoardMigrationPreview';
|
|
22
23
|
export { useEventWebhooks, type HttpMethod, type RetryPolicy, type EventWebhookMapping, type CreateEventWebhookMappingInput, type UpdateEventWebhookMappingInput, type WebhookTestResult, type UseEventWebhooksOptions, type UseEventWebhooksResult, default as useEventWebhooksDefault, } from './useEventWebhooks';
|
|
23
24
|
export { useEventLogs, getEventStatusColor, getEventStatusLabel, getEventStatusIcon, type EventLog as EventLogType, type EventLogEdge, type EventLogConnection, type UseEventLogsOptions, type UseEventLogsResult, default as useEventLogsDefault, } from './useEventLogs';
|
|
24
25
|
export { useDataSinkOperations, default as useDataSinkOperationsDefault } from './useDataSinkOperations';
|