@burdenoff/microfe-bigconsole 2026.1118.8 → 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 +95 -2
- package/dist/generated/wspace-operations.js +438 -73
- package/dist/generated/wspace-types.d.ts +17923 -1542
- package/dist/generated/wspace-types.js +12 -10
- package/package.json +1 -1
|
@@ -13,26 +13,27 @@ import "./useWidgetEvents.js";
|
|
|
13
13
|
import "./useWidgetActions.js";
|
|
14
14
|
import u from "./useExportDashboard.js";
|
|
15
15
|
import d from "./useImportDashboard.js";
|
|
16
|
+
import f from "./useBoardMigrationPreview.js";
|
|
16
17
|
import "./useEventWebhooks.js";
|
|
17
18
|
import "./useEventLogs.js";
|
|
18
|
-
import
|
|
19
|
+
import p from "./useDataSinkOperations.js";
|
|
19
20
|
import "./useBigConsoleAnalytics.js";
|
|
20
|
-
import
|
|
21
|
+
import m from "./useParserOperations.js";
|
|
21
22
|
import "./useWorkflowOperations.js";
|
|
22
23
|
import "./usePipelineOperations.js";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
24
|
+
import h from "./useGlobalFilters.js";
|
|
25
|
+
import g from "./useDashboardSharing.js";
|
|
26
|
+
import _ from "./useDashboardViews.js";
|
|
26
27
|
import "./useDashboardTemplates.js";
|
|
27
|
-
import
|
|
28
|
-
import
|
|
28
|
+
import v from "./useFilterUrlSync.js";
|
|
29
|
+
import y from "./useFilterPresets.js";
|
|
29
30
|
import "./useCrossFilter.js";
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
31
|
+
import b from "./usePageOperations.js";
|
|
32
|
+
import x from "./useExportParser.js";
|
|
33
|
+
import S from "./useImportParser.js";
|
|
33
34
|
import "./useDetectAnomalies.js";
|
|
34
|
-
import
|
|
35
|
-
import
|
|
35
|
+
import C from "./useExportDataSink.js";
|
|
36
|
+
import w from "./useImportDataSink.js";
|
|
36
37
|
import "./useWidgetNarrative.js";
|
|
37
38
|
import "./useDashboardDigest.js";
|
|
38
|
-
export { t as formatTimeUntilRefresh, o as useDashboardOperations,
|
|
39
|
+
export { t as formatTimeUntilRefresh, f as useBoardMigrationPreview, o as useDashboardOperations, g as useDashboardSharing, _ as useDashboardViews, p as useDataSinkOperations, c as useDrilldown, l as useDrilldownOperations, u as useExportDashboard, C as useExportDataSink, x as useExportParser, y as useFilterPresets, v as useFilterUrlSync, h as useGlobalFilters, d as useImportDashboard, w as useImportDataSink, S as useImportParser, b as usePageOperations, m as useParserOperations, n as useWidgetAutoRefresh, i as useWidgetComments, a as useWidgetConfigPersist, e as useWidgetData, s as useWidgetExport, r as useWidgetOperations };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PreviewBoardMigrationQuery } from '../../generated/wspace-operations';
|
|
2
|
+
import { MigrationSourceId } from '../utils/boardMigration';
|
|
3
|
+
export type BoardMigrationPreview = PreviewBoardMigrationQuery['previewBoardMigration'];
|
|
4
|
+
export type BoardMigrationReportData = BoardMigrationPreview['report'];
|
|
5
|
+
export type BoardMigrationItemData = BoardMigrationReportData['items'][number];
|
|
6
|
+
export interface PreviewBoardInput {
|
|
7
|
+
source: MigrationSourceId;
|
|
8
|
+
/** The board in the shape the source needs: a Metabase dashboard, `{ name, workbook }` or the gathered PBIR report. */
|
|
9
|
+
board: Record<string, unknown>;
|
|
10
|
+
/** Where the board lives; the service drops credentials and the query string. */
|
|
11
|
+
sourceUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UseBoardMigrationPreviewResult {
|
|
14
|
+
loading: boolean;
|
|
15
|
+
error: Error | null;
|
|
16
|
+
preview: BoardMigrationPreview | null;
|
|
17
|
+
/** Convert a board. Resolves to null when it failed or was superseded. */
|
|
18
|
+
previewBoard: (input: PreviewBoardInput) => Promise<BoardMigrationPreview | null>;
|
|
19
|
+
clearPreview: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function useBoardMigrationPreview(): UseBoardMigrationPreviewResult;
|
|
22
|
+
export default useBoardMigrationPreview;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PreviewBoardMigrationDocument as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useBigConsole as t } from "../context/BigConsoleContext.js";
|
|
3
|
+
import { BigConsoleBoardMigrationSource as n } from "../../generated/wspace-types.js";
|
|
4
|
+
import "../context/index.js";
|
|
5
|
+
import { useCallback as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { useApolloClient as s } from "@apollo/client/react";
|
|
7
|
+
// src/bigconsole/hooks/useBoardMigrationPreview.ts
|
|
8
|
+
var c = {
|
|
9
|
+
METABASE: n.Metabase,
|
|
10
|
+
TABLEAU: n.Tableau,
|
|
11
|
+
POWER_BI: n.PowerBi
|
|
12
|
+
};
|
|
13
|
+
function l() {
|
|
14
|
+
let [n, l] = o(!1), [u, d] = o(null), [f, p] = o(null), m = s(), { currentUser: h, workspaceId: g } = t(), _ = `${h?.id ?? ""}|${g ?? ""}`, v = a(_), y = a(0);
|
|
15
|
+
return i(() => (v.current = _, y.current++, l(!1), d(null), p(null), () => {
|
|
16
|
+
v.current = "";
|
|
17
|
+
}), [_]), {
|
|
18
|
+
loading: n,
|
|
19
|
+
error: u,
|
|
20
|
+
preview: f,
|
|
21
|
+
previewBoard: r(async ({ source: t, board: n, sourceUrl: r }) => {
|
|
22
|
+
let i = ++y.current, a = () => v.current === _ && y.current === i;
|
|
23
|
+
try {
|
|
24
|
+
if (!g || !h?.id || v.current !== _) throw Error("Select a workspace before importing a dashboard.");
|
|
25
|
+
l(!0), d(null), p(null);
|
|
26
|
+
let i = {
|
|
27
|
+
source: c[t],
|
|
28
|
+
boardJson: n,
|
|
29
|
+
sourceUrl: r
|
|
30
|
+
}, o = await m.query({
|
|
31
|
+
query: e,
|
|
32
|
+
variables: i,
|
|
33
|
+
fetchPolicy: "no-cache",
|
|
34
|
+
errorPolicy: "none",
|
|
35
|
+
context: {
|
|
36
|
+
requiredWorkspaceAuth: !0,
|
|
37
|
+
requiredWorkspaceId: g,
|
|
38
|
+
queryDeduplication: !1
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (!a()) return null;
|
|
42
|
+
if (o.error) throw o.error;
|
|
43
|
+
let s = o.data?.previewBoardMigration;
|
|
44
|
+
if (!s) throw Error("The conversion returned no result");
|
|
45
|
+
return p(s), s;
|
|
46
|
+
} catch (e) {
|
|
47
|
+
return a() && d(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to convert the board")), null;
|
|
48
|
+
} finally {
|
|
49
|
+
a() && l(!1);
|
|
50
|
+
}
|
|
51
|
+
}, [
|
|
52
|
+
m,
|
|
53
|
+
h,
|
|
54
|
+
_,
|
|
55
|
+
g
|
|
56
|
+
]),
|
|
57
|
+
clearPreview: r(() => {
|
|
58
|
+
y.current++, l(!1), d(null), p(null);
|
|
59
|
+
}, [])
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export { l as default, l as useBoardMigrationPreview };
|