@burdenoff/microfe-bigconsole 2026.1118.9 → 2026.1119.1
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/asof/AsOfBanner.d.ts +3 -0
- package/dist/bigconsole/asof/AsOfBanner.js +38 -0
- package/dist/bigconsole/asof/AsOfControl.d.ts +4 -0
- package/dist/bigconsole/asof/AsOfControl.js +96 -0
- package/dist/bigconsole/asof/AsOfProvider.d.ts +24 -0
- package/dist/bigconsole/asof/AsOfProvider.js +76 -0
- package/dist/bigconsole/asof/asOfMessage.d.ts +12 -0
- package/dist/bigconsole/asof/asOfMessage.js +12 -0
- package/dist/bigconsole/asof/asOfParam.d.ts +48 -0
- package/dist/bigconsole/asof/asOfParam.js +34 -0
- package/dist/bigconsole/asof/index.d.ts +7 -0
- package/dist/bigconsole/asof/index.js +6 -0
- package/dist/bigconsole/components/dashboard/BoardMigrationReport.d.ts +7 -0
- package/dist/bigconsole/components/dashboard/BoardMigrationReport.js +136 -0
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +142 -138
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +97 -92
- package/dist/bigconsole/components/dashboard/ImportFromToolDialog.d.ts +8 -0
- package/dist/bigconsole/components/dashboard/ImportFromToolDialog.js +464 -0
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +78 -74
- package/dist/bigconsole/components/dashboard/index.d.ts +2 -0
- package/dist/bigconsole/components/dashboard/index.js +2 -0
- package/dist/bigconsole/components/widgets/WidgetMenu.js +98 -96
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +345 -306
- 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/hooks/useFilterFieldValues.js +52 -22
- package/dist/bigconsole/hooks/useWidgetData.d.ts +7 -0
- package/dist/bigconsole/hooks/useWidgetData.js +53 -43
- package/dist/bigconsole/pages/DashboardViewPage.d.ts +7 -1
- package/dist/bigconsole/pages/DashboardViewPage.js +300 -278
- package/dist/bigconsole/pages/DashboardsPage.js +396 -376
- package/dist/bigconsole/pages/index.d.ts +1 -1
- package/dist/bigconsole/types/index.d.ts +13 -0
- 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/bigconsole/utils/widgetDisplayData.d.ts +6 -0
- package/dist/bigconsole/utils/widgetDisplayData.js +4 -0
- package/dist/generated/wspace-operations.d.ts +116 -0
- package/dist/generated/wspace-operations.js +793 -183
- package/dist/generated/wspace-types.d.ts +78 -0
- package/dist/generated/wspace-types.js +12 -10
- package/package.json +1 -1
|
@@ -2,45 +2,59 @@ import { useWidgetStore as e } from "../store/widgetStore.js";
|
|
|
2
2
|
import { useDashboardStore as t } from "../store/dashboardStore.js";
|
|
3
3
|
import { BIGCONSOLE_PERMISSIONS as n } from "../../constants/permissions.js";
|
|
4
4
|
import "../context/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useBigConsole as r, useBigConsoleBasePath as i, useBigConsoleNavigate as a } from "../context/BigConsoleContext.js";
|
|
6
|
+
import "../asof/index.js";
|
|
7
|
+
import { Section as o } from "../components/common/Section.js";
|
|
6
8
|
import "../components/dashboard/index.js";
|
|
7
|
-
import { Section as a } from "../components/common/Section.js";
|
|
8
|
-
import { useReconcileAgentTool as o } from "../components/reconcile/useReconcileAgentTool.js";
|
|
9
9
|
import s from "../hooks/useWidgetOperations.js";
|
|
10
10
|
import ee from "../hooks/useDashboardOperations.js";
|
|
11
|
+
import { useReconcileAgentTool as c } from "../components/reconcile/useReconcileAgentTool.js";
|
|
11
12
|
import "../components/common/index.js";
|
|
12
|
-
import "../components/narrative/index.js";
|
|
13
13
|
import te from "../hooks/usePageOperations.js";
|
|
14
|
+
import "../components/narrative/index.js";
|
|
15
|
+
import { AsOfProvider as ne, HideWhenAsOf as l, useAsOf as re } from "../asof/AsOfProvider.js";
|
|
14
16
|
import "../store/index.js";
|
|
15
17
|
import "../hooks/index.js";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { DashboardCanvas as
|
|
19
|
-
import { dashboardPageTabs as
|
|
20
|
-
import { LiveCanvasToggle as
|
|
21
|
-
import { ExportDashboardDialog as
|
|
22
|
-
import { DrilldownBreadcrumb as
|
|
23
|
-
import { PublishToStoreDialog as
|
|
24
|
-
import { DashboardReviewDialog as
|
|
25
|
-
import { loadBigConsoleSettings as
|
|
26
|
-
import { LIVE_STRUCTURE_POLL_MS as
|
|
27
|
-
import { registerBreadcrumbName as
|
|
28
|
-
import { DigestPanel as
|
|
29
|
-
import { GetWidgetDocument as
|
|
30
|
-
import { dashboardSuggestAnchorProps as
|
|
31
|
-
import { memo as
|
|
32
|
-
import { useLocation as
|
|
33
|
-
import { AccessDenied as
|
|
34
|
-
import { usePermissions as
|
|
35
|
-
import { ArrowLeft as
|
|
36
|
-
import { Button as
|
|
37
|
-
import { useI18n as
|
|
38
|
-
import { useApolloClient as
|
|
39
|
-
import { Fragment as
|
|
40
|
-
import { useAssistantPageControls as
|
|
18
|
+
import ie, { parseUrlToGlobalFilterValues as ae } from "../hooks/useFilterUrlSync.js";
|
|
19
|
+
import oe from "../hooks/useActivePage.js";
|
|
20
|
+
import { DashboardCanvas as se } from "../components/dashboard/DashboardCanvas.js";
|
|
21
|
+
import { dashboardPageTabs as ce } from "../assistant/pageControls.js";
|
|
22
|
+
import { LiveCanvasToggle as le } from "../components/dashboard/LiveCanvasToggle.js";
|
|
23
|
+
import { ExportDashboardDialog as ue } from "../components/dashboard/ExportDashboardDialog.js";
|
|
24
|
+
import { DrilldownBreadcrumb as de } from "../components/dashboard/DrilldownBreadcrumb.js";
|
|
25
|
+
import { PublishToStoreDialog as fe } from "../components/dashboard/PublishToStoreDialog.js";
|
|
26
|
+
import { DashboardReviewDialog as pe } from "../components/dashboard/DashboardReviewDialog.js";
|
|
27
|
+
import { loadBigConsoleSettings as me } from "../hooks/useBigConsoleSettings.js";
|
|
28
|
+
import { LIVE_STRUCTURE_POLL_MS as he, isLiveDataRefreshDue as ge } from "../utils/liveBoardRefresh.js";
|
|
29
|
+
import { registerBreadcrumbName as _e, unregisterBreadcrumbName as ve } from "../utils/breadcrumbRegistry.js";
|
|
30
|
+
import { DigestPanel as ye } from "../components/narrative/DigestPanel.js";
|
|
31
|
+
import { GetWidgetDocument as be } from "../../generated/wspace-operations.js";
|
|
32
|
+
import { dashboardSuggestAnchorProps as xe } from "../proactive/entities.js";
|
|
33
|
+
import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as Se, useState as m } from "react";
|
|
34
|
+
import { useLocation as Ce, useParams as we } from "react-router";
|
|
35
|
+
import { AccessDenied as Te } from "@burdenoff/fe-libs/shared/components";
|
|
36
|
+
import { usePermissions as Ee } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
37
|
+
import { ArrowLeft as De, Sparkles as Oe } from "lucide-react";
|
|
38
|
+
import { Button as h, IllustratedEmptyState as ke } from "@burdenoff/fe-libs/ui";
|
|
39
|
+
import { useI18n as Ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
40
|
+
import { useApolloClient as je } from "@apollo/client/react";
|
|
41
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
42
|
+
import { useAssistantPageControls as Me } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
|
|
41
43
|
// src/bigconsole/pages/DashboardViewPage.tsx
|
|
42
|
-
var
|
|
43
|
-
let { dashboardId:
|
|
44
|
+
var y = u(function() {
|
|
45
|
+
let { dashboardId: r } = we(), c = a(), ne = i(), { t: u } = Ae(), y = re().asOf !== null, b = je(), { hasPermission: x, isLoading: S } = Ee(), C = x(n.DASHBOARD_READ), w = x(n.DASHBOARD_UPDATE), Pe = x(n.DASHBOARD_EXPORT), Fe = x(n.DASHBOARD_PUBLISH), [Ie, T] = m(!1), [E, D] = m(!1), [Le, O] = m(!1), [k, Re] = m(!1), [A, ze] = m(!1), { isInDrilldown: j, getContextFromUrl: M, getDrilldownMetadata: N } = ie(), P = t((e) => e.currentDashboard), F = t((e) => e.setCurrentDashboard), I = t((e) => e.setGlobalFilterValue), L = t((e) => e.viewMode), Be = t((e) => e.setViewMode);
|
|
46
|
+
f(() => {
|
|
47
|
+
y && L === "edit" && Be("view");
|
|
48
|
+
}, [
|
|
49
|
+
y,
|
|
50
|
+
L,
|
|
51
|
+
Be
|
|
52
|
+
]);
|
|
53
|
+
let Ve = e((e) => e.closeConfigPanel);
|
|
54
|
+
f(() => {
|
|
55
|
+
y && Ve();
|
|
56
|
+
}, [y, Ve]);
|
|
57
|
+
let R = t((e) => e.clearAllGlobalFilters), He = t((e) => e.setGlobalFilterValues), z = e((e) => e.widgets), Ue = Ce(), { activePageId: B, setActivePage: V } = oe(P?.id === r ? P?.pages : void 0), H = e((e) => e.clipboardWidgetId), U = e((e) => e.clipboardAction), W = e((e) => e.clearClipboard), G = e((e) => e.selectWidget), { loading: K, error: q, fetchDashboard: J, updateDashboard: Y } = ee(), { createWidget: We, deleteWidget: Ge, duplicateWidget: Ke, batchUpdatePositions: qe, refetch: Je } = s(B || void 0, r), { createPage: Ye, updatePage: Xe, deletePage: Ze, duplicatePage: Qe, reorderPages: $e } = te(), et = d((e) => {
|
|
44
58
|
let t = e?.parentElement;
|
|
45
59
|
if (!e || !t) return;
|
|
46
60
|
let n = t;
|
|
@@ -59,98 +73,100 @@ var _ = c(function() {
|
|
|
59
73
|
a.disconnect(), s.disconnect();
|
|
60
74
|
};
|
|
61
75
|
}, []);
|
|
62
|
-
|
|
63
|
-
if (!
|
|
64
|
-
else return
|
|
65
|
-
e ||
|
|
76
|
+
f(() => {
|
|
77
|
+
if (!r) c("/dashboards");
|
|
78
|
+
else return He(ae(window.location.search, "filter_")), D(!1), J(r).then((e) => {
|
|
79
|
+
e || D(!0);
|
|
66
80
|
}), () => {
|
|
67
|
-
|
|
81
|
+
F(null), R(), D(!1);
|
|
68
82
|
};
|
|
69
83
|
}, [
|
|
84
|
+
r,
|
|
70
85
|
c,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
let e = k(), t = A();
|
|
86
|
+
J,
|
|
87
|
+
F,
|
|
88
|
+
R,
|
|
89
|
+
He
|
|
90
|
+
]), f(() => {
|
|
91
|
+
if (!j) return;
|
|
92
|
+
let e = M(), t = N();
|
|
79
93
|
Object.entries(e).forEach(([e, t]) => {
|
|
80
|
-
|
|
81
|
-
}), t.depth > 0 && (
|
|
94
|
+
I(`ctx_${e}`, t);
|
|
95
|
+
}), t.depth > 0 && (I("__drilldown_depth", t.depth), I("__drilldown_parent", t.parent), I("__drilldown_path", t.path)), Object.keys(e).length;
|
|
82
96
|
}, [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
A,
|
|
97
|
+
j,
|
|
98
|
+
M,
|
|
86
99
|
N,
|
|
87
|
-
|
|
100
|
+
I,
|
|
101
|
+
Ue.search
|
|
88
102
|
]);
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
if (!
|
|
103
|
+
let tt = Se(Je);
|
|
104
|
+
tt.current = Je, f(() => {
|
|
105
|
+
if (!k || !r || y) return;
|
|
92
106
|
let e = null, n = () => {
|
|
93
107
|
if (typeof document < "u" && document.visibilityState !== "visible" || t.getState().viewMode === "edit") return;
|
|
94
|
-
|
|
108
|
+
J(r, { silent: !0 }), tt.current();
|
|
95
109
|
let n = Date.now();
|
|
96
|
-
|
|
110
|
+
ge(e, n) && (e = n, b.refetchQueries({ include: [be] }).catch((e) => {
|
|
97
111
|
console.warn("[DashboardViewPage] Live widget data refresh failed", e);
|
|
98
112
|
}));
|
|
99
113
|
};
|
|
100
114
|
n();
|
|
101
|
-
let
|
|
115
|
+
let i = window.setInterval(n, he), a = () => {
|
|
102
116
|
document.visibilityState === "visible" && (e = null, n());
|
|
103
117
|
};
|
|
104
|
-
return document.addEventListener("visibilitychange",
|
|
105
|
-
window.clearInterval(
|
|
118
|
+
return document.addEventListener("visibilitychange", a), () => {
|
|
119
|
+
window.clearInterval(i), document.removeEventListener("visibilitychange", a);
|
|
106
120
|
};
|
|
107
121
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
k,
|
|
123
|
+
r,
|
|
124
|
+
y,
|
|
125
|
+
J,
|
|
126
|
+
b
|
|
112
127
|
]);
|
|
113
|
-
let
|
|
114
|
-
if (
|
|
115
|
-
|
|
128
|
+
let nt = d(async () => {
|
|
129
|
+
if (r && !y) {
|
|
130
|
+
T(!0);
|
|
116
131
|
try {
|
|
117
|
-
let e = Array.from(
|
|
132
|
+
let e = Array.from(z.values());
|
|
118
133
|
if (e.length > 0) {
|
|
119
134
|
let t = e.map((e) => ({
|
|
120
135
|
id: e.id,
|
|
121
136
|
position: e.position
|
|
122
137
|
}));
|
|
123
|
-
await
|
|
138
|
+
await qe(t);
|
|
124
139
|
}
|
|
125
|
-
|
|
126
|
-
id:
|
|
127
|
-
name:
|
|
128
|
-
description:
|
|
140
|
+
P && await Y({
|
|
141
|
+
id: r,
|
|
142
|
+
name: P.name,
|
|
143
|
+
description: P.description
|
|
129
144
|
});
|
|
130
145
|
} catch {} finally {
|
|
131
|
-
|
|
146
|
+
T(!1);
|
|
132
147
|
}
|
|
133
148
|
}
|
|
134
149
|
}, [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
r,
|
|
151
|
+
y,
|
|
152
|
+
z,
|
|
153
|
+
P,
|
|
154
|
+
qe,
|
|
155
|
+
Y
|
|
156
|
+
]), rt = d(() => {
|
|
157
|
+
c("/dashboards");
|
|
158
|
+
}, [c]), X = d((e) => {
|
|
159
|
+
V(e);
|
|
160
|
+
}, [V]), Z = p(() => (P?.pages || []).map((e, t) => ({
|
|
145
161
|
id: e.id,
|
|
146
|
-
name: e.name ||
|
|
162
|
+
name: e.name || u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
|
|
147
163
|
order: e.order ?? 0
|
|
148
|
-
})), [
|
|
149
|
-
|
|
150
|
-
if (
|
|
151
|
-
}, [
|
|
152
|
-
let
|
|
153
|
-
dashboardName: Q ||
|
|
164
|
+
})), [P?.pages, u]), Q = P && P.id === r ? P.name : null, $ = B || P?.pages?.[0]?.id || null;
|
|
165
|
+
f(() => {
|
|
166
|
+
if (r && Q) return _e(r, Q), () => ve(r);
|
|
167
|
+
}, [r, Q]);
|
|
168
|
+
let it = p(() => !S && C && !q && !E && !K && Q !== null ? ce({
|
|
169
|
+
dashboardName: Q || u("bigconsole.dashboards.title", "Dashboards"),
|
|
154
170
|
tabs: Z.map((e) => ({
|
|
155
171
|
id: e.id,
|
|
156
172
|
label: e.name
|
|
@@ -158,43 +174,43 @@ var _ = c(function() {
|
|
|
158
174
|
current: $,
|
|
159
175
|
select: X
|
|
160
176
|
}) : null, [
|
|
161
|
-
x,
|
|
162
177
|
S,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
178
|
+
C,
|
|
179
|
+
q,
|
|
180
|
+
E,
|
|
181
|
+
K,
|
|
166
182
|
Q,
|
|
167
183
|
Z,
|
|
168
184
|
$,
|
|
169
185
|
X,
|
|
170
|
-
|
|
186
|
+
u
|
|
171
187
|
]);
|
|
172
|
-
|
|
173
|
-
let
|
|
174
|
-
let e =
|
|
175
|
-
if (!
|
|
176
|
-
let t =
|
|
188
|
+
Me(it);
|
|
189
|
+
let at = d(async () => {
|
|
190
|
+
let e = B || P?.pages?.[0]?.id;
|
|
191
|
+
if (!H || !r || !e) return;
|
|
192
|
+
let t = z.get(H);
|
|
177
193
|
if (!t) {
|
|
178
|
-
|
|
194
|
+
W();
|
|
179
195
|
return;
|
|
180
196
|
}
|
|
181
197
|
let n = {
|
|
182
198
|
x: 0,
|
|
183
|
-
y: Array.from(
|
|
199
|
+
y: Array.from(z.values()).reduce((e, t) => {
|
|
184
200
|
let n = (t.positionY ?? 0) + (t.positionHeight ?? 4);
|
|
185
201
|
return Math.max(e, n);
|
|
186
202
|
}, 0),
|
|
187
|
-
width: Math.min(t.positionWidth ?? 4,
|
|
203
|
+
width: Math.min(t.positionWidth ?? 4, P?.pages.find((t) => t.id === e)?.gridColumns ?? 12),
|
|
188
204
|
height: t.positionHeight ?? 4
|
|
189
|
-
},
|
|
205
|
+
}, i = U === "copy" ? u("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, a = null;
|
|
190
206
|
try {
|
|
191
|
-
|
|
207
|
+
a = await Ke(H, n, i);
|
|
192
208
|
} catch {}
|
|
193
|
-
|
|
209
|
+
a ||= await We({
|
|
194
210
|
pageId: e,
|
|
195
|
-
dashboardId:
|
|
211
|
+
dashboardId: r,
|
|
196
212
|
type: t.type,
|
|
197
|
-
title:
|
|
213
|
+
title: i,
|
|
198
214
|
description: t.description,
|
|
199
215
|
dataSinkId: t.dataSinkId,
|
|
200
216
|
datasetId: t.datasetId,
|
|
@@ -204,279 +220,285 @@ var _ = c(function() {
|
|
|
204
220
|
position: n,
|
|
205
221
|
refreshInterval: t.refreshInterval ?? void 0,
|
|
206
222
|
metadata: t.metadata
|
|
207
|
-
}),
|
|
223
|
+
}), a && (G(a.id), U === "cut" && await Ge(H)), W();
|
|
208
224
|
}, [
|
|
209
|
-
z,
|
|
210
|
-
B,
|
|
211
|
-
c,
|
|
212
|
-
L,
|
|
213
|
-
j,
|
|
214
|
-
I,
|
|
215
|
-
Ve,
|
|
216
|
-
q,
|
|
217
|
-
J,
|
|
218
225
|
H,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
226
|
+
U,
|
|
227
|
+
r,
|
|
228
|
+
B,
|
|
229
|
+
P,
|
|
230
|
+
z,
|
|
231
|
+
Ke,
|
|
232
|
+
We,
|
|
233
|
+
Ge,
|
|
234
|
+
G,
|
|
235
|
+
W,
|
|
236
|
+
u
|
|
237
|
+
]), ot = d(() => {
|
|
238
|
+
O(!0);
|
|
239
|
+
}, []), [st, ct] = m(!1), lt = d(() => {
|
|
240
|
+
ct(!0);
|
|
241
|
+
}, []), ut = d(() => {
|
|
242
|
+
ct(!1);
|
|
243
|
+
}, []), dt = d(() => {
|
|
244
|
+
O(!1);
|
|
245
|
+
}, []), [ft, pt] = m(!1), mt = d(() => pt(!0), []), ht = d(() => pt(!1), []), gt = d(async () => {
|
|
246
|
+
if (!P || !r) return;
|
|
247
|
+
let e = (P.pages?.length || 0) + 1, t = u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await Ye({
|
|
248
|
+
dashboardId: r,
|
|
233
249
|
name: t,
|
|
234
|
-
gridColumns:
|
|
250
|
+
gridColumns: me().defaultGridColumns
|
|
235
251
|
});
|
|
236
|
-
n && (
|
|
237
|
-
...
|
|
238
|
-
pages: [...
|
|
239
|
-
}),
|
|
252
|
+
n && (F({
|
|
253
|
+
...P,
|
|
254
|
+
pages: [...P.pages || [], n]
|
|
255
|
+
}), V(n.id));
|
|
240
256
|
}, [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
]),
|
|
248
|
-
|
|
257
|
+
P,
|
|
258
|
+
r,
|
|
259
|
+
F,
|
|
260
|
+
Ye,
|
|
261
|
+
V,
|
|
262
|
+
u
|
|
263
|
+
]), _t = d(async (e, t) => {
|
|
264
|
+
P && await Xe({
|
|
249
265
|
id: e,
|
|
250
266
|
name: t
|
|
251
|
-
}) &&
|
|
252
|
-
...
|
|
253
|
-
pages:
|
|
267
|
+
}) && F({
|
|
268
|
+
...P,
|
|
269
|
+
pages: P.pages?.map((n) => n.id === e ? {
|
|
254
270
|
...n,
|
|
255
271
|
name: t
|
|
256
272
|
} : n)
|
|
257
273
|
});
|
|
258
274
|
}, [
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
]),
|
|
263
|
-
if (!
|
|
264
|
-
let t =
|
|
275
|
+
P,
|
|
276
|
+
F,
|
|
277
|
+
Xe
|
|
278
|
+
]), vt = d(async (e) => {
|
|
279
|
+
if (!P || !r) return;
|
|
280
|
+
let t = P.pages?.find((t) => t.id === e);
|
|
265
281
|
if (!t) return;
|
|
266
|
-
let n = await
|
|
267
|
-
n && (
|
|
268
|
-
...
|
|
269
|
-
pages: [...
|
|
270
|
-
}),
|
|
282
|
+
let n = await Qe(e, u("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" }));
|
|
283
|
+
n && (F({
|
|
284
|
+
...P,
|
|
285
|
+
pages: [...P.pages || [], n]
|
|
286
|
+
}), V(n.id));
|
|
271
287
|
}, [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
]),
|
|
279
|
-
if (!(!
|
|
280
|
-
let t =
|
|
288
|
+
P,
|
|
289
|
+
r,
|
|
290
|
+
F,
|
|
291
|
+
Qe,
|
|
292
|
+
V,
|
|
293
|
+
u
|
|
294
|
+
]), yt = d(async (e) => {
|
|
295
|
+
if (!(!P || (P.pages?.length || 0) <= 1) && await Ze(e)) {
|
|
296
|
+
let t = P.pages?.filter((t) => t.id !== e).map((e, t) => ({
|
|
281
297
|
...e,
|
|
282
298
|
order: t
|
|
283
299
|
}));
|
|
284
|
-
|
|
285
|
-
...
|
|
300
|
+
F({
|
|
301
|
+
...P,
|
|
286
302
|
pages: t
|
|
287
303
|
});
|
|
288
304
|
let n = t?.[0]?.id;
|
|
289
|
-
|
|
305
|
+
B === e && n && V(n, { replace: !0 });
|
|
290
306
|
}
|
|
291
307
|
}, [
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
]),
|
|
298
|
-
if (!
|
|
299
|
-
|
|
300
|
-
...
|
|
308
|
+
P,
|
|
309
|
+
F,
|
|
310
|
+
B,
|
|
311
|
+
Ze,
|
|
312
|
+
V
|
|
313
|
+
]), bt = d(async (e) => {
|
|
314
|
+
if (!P || !r) return;
|
|
315
|
+
F({
|
|
316
|
+
...P,
|
|
301
317
|
pages: e.map((e, t) => ({
|
|
302
318
|
...e,
|
|
303
319
|
order: t
|
|
304
320
|
}))
|
|
305
321
|
});
|
|
306
322
|
let t = e.map((e) => e.id);
|
|
307
|
-
await
|
|
323
|
+
await $e(r, t);
|
|
308
324
|
}, [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
325
|
+
P,
|
|
326
|
+
r,
|
|
327
|
+
F,
|
|
328
|
+
$e
|
|
313
329
|
]);
|
|
314
|
-
return
|
|
330
|
+
return S ? /* @__PURE__ */ _("div", {
|
|
315
331
|
className: "flex items-center justify-center h-full",
|
|
316
|
-
children: /* @__PURE__ */
|
|
317
|
-
}) :
|
|
332
|
+
children: /* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
|
|
333
|
+
}) : C ? q ? /* @__PURE__ */ _("div", {
|
|
318
334
|
className: "flex h-full flex-col items-center justify-center",
|
|
319
335
|
style: { padding: "var(--space-pagePadding)" },
|
|
320
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ _(o, {
|
|
321
337
|
headingLevel: 2,
|
|
322
338
|
tone: "danger",
|
|
323
|
-
title:
|
|
324
|
-
description: /* @__PURE__ */
|
|
339
|
+
title: u("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
|
|
340
|
+
description: /* @__PURE__ */ _("span", {
|
|
325
341
|
className: "break-words",
|
|
326
|
-
children:
|
|
342
|
+
children: q.message
|
|
327
343
|
}),
|
|
328
344
|
className: "w-full max-w-md",
|
|
329
345
|
"data-testid": "dashboard-view-error",
|
|
330
|
-
actions: /* @__PURE__ */ g
|
|
346
|
+
actions: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(h, {
|
|
331
347
|
size: "sm",
|
|
332
|
-
onClick: () =>
|
|
333
|
-
children:
|
|
334
|
-
}), /* @__PURE__ */ h
|
|
348
|
+
onClick: () => J(r),
|
|
349
|
+
children: u("bigconsole.dashboards.view.retry", "Retry")
|
|
350
|
+
}), /* @__PURE__ */ _(h, {
|
|
335
351
|
size: "sm",
|
|
336
352
|
variant: "outline",
|
|
337
|
-
onClick: () =>
|
|
338
|
-
children:
|
|
353
|
+
onClick: () => c("/dashboards"),
|
|
354
|
+
children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
|
|
339
355
|
})] })
|
|
340
356
|
})
|
|
341
|
-
}) :
|
|
357
|
+
}) : E ? /* @__PURE__ */ _("div", {
|
|
342
358
|
className: "flex flex-col items-center justify-center h-full",
|
|
343
359
|
style: { padding: "var(--space-pagePadding)" },
|
|
344
|
-
children: /* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ _(ke, {
|
|
345
361
|
illustration: "empty-data",
|
|
346
|
-
title:
|
|
347
|
-
description: /* @__PURE__ */ g
|
|
362
|
+
title: u("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
|
|
363
|
+
description: /* @__PURE__ */ v(g, { children: [u("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ _("span", {
|
|
348
364
|
className: "mt-2 block font-mono text-xs text-text-muted break-all",
|
|
349
|
-
children:
|
|
365
|
+
children: u("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: r ?? "" })
|
|
350
366
|
})] }),
|
|
351
|
-
action: /* @__PURE__ */ h
|
|
352
|
-
onClick: () =>
|
|
353
|
-
children:
|
|
367
|
+
action: /* @__PURE__ */ _(h, {
|
|
368
|
+
onClick: () => c("/dashboards"),
|
|
369
|
+
children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
|
|
354
370
|
})
|
|
355
371
|
})
|
|
356
|
-
}) :
|
|
372
|
+
}) : K || !P ? /* @__PURE__ */ _("div", {
|
|
357
373
|
className: "flex items-center justify-center h-full",
|
|
358
374
|
role: "status",
|
|
359
375
|
"aria-live": "polite",
|
|
360
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ v("div", {
|
|
361
377
|
className: "flex flex-col items-center gap-4",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
378
|
+
children: [/* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ _("p", {
|
|
363
379
|
className: "text-sm text-text-secondary",
|
|
364
|
-
children:
|
|
380
|
+
children: u("bigconsole.dashboards.view.loading", "Loading dashboard...")
|
|
365
381
|
})]
|
|
366
382
|
})
|
|
367
|
-
}) : /* @__PURE__ */ g("div", {
|
|
368
|
-
ref:
|
|
383
|
+
}) : /* @__PURE__ */ v(g, { children: [!y && /* @__PURE__ */ _(Ne, {}), /* @__PURE__ */ v("div", {
|
|
384
|
+
ref: et,
|
|
369
385
|
className: "h-full flex flex-col overflow-hidden",
|
|
370
386
|
children: [
|
|
371
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ _(o, {
|
|
372
388
|
emphasis: "bare",
|
|
373
389
|
padding: "none",
|
|
374
390
|
"data-testid": "dashboard-route-header",
|
|
375
391
|
"aria-label": "Dashboard",
|
|
376
392
|
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2",
|
|
377
393
|
headerClassName: "",
|
|
378
|
-
header: /* @__PURE__ */
|
|
394
|
+
header: /* @__PURE__ */ v("div", {
|
|
379
395
|
className: "flex flex-wrap items-center gap-control-gap",
|
|
380
396
|
children: [
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
onClick:
|
|
397
|
+
/* @__PURE__ */ v(h, {
|
|
398
|
+
onClick: rt,
|
|
383
399
|
variant: "ghost",
|
|
384
400
|
size: "sm",
|
|
385
|
-
title:
|
|
386
|
-
"aria-label":
|
|
401
|
+
title: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
|
|
402
|
+
"aria-label": u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
|
|
387
403
|
className: "flex-shrink-0",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ _(De, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.back", "Back")]
|
|
389
405
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ _("h1", {
|
|
391
407
|
className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-primary",
|
|
392
|
-
title:
|
|
393
|
-
...
|
|
394
|
-
children:
|
|
408
|
+
title: P.name,
|
|
409
|
+
...xe(P.id),
|
|
410
|
+
children: P.name
|
|
395
411
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
412
|
+
!y && /* @__PURE__ */ _("div", {
|
|
397
413
|
className: "flex-shrink-0",
|
|
398
|
-
children: /* @__PURE__ */
|
|
399
|
-
isLive:
|
|
400
|
-
onToggle: () =>
|
|
414
|
+
children: /* @__PURE__ */ _(le, {
|
|
415
|
+
isLive: k,
|
|
416
|
+
onToggle: () => Re((e) => !e)
|
|
401
417
|
})
|
|
402
418
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
|
|
404
420
|
className: "flex-shrink-0",
|
|
405
|
-
children: /* @__PURE__ */
|
|
421
|
+
children: /* @__PURE__ */ v(h, {
|
|
406
422
|
onClick: () => ze((e) => !e),
|
|
407
423
|
variant: "ghost",
|
|
408
424
|
size: "sm",
|
|
409
|
-
"aria-pressed":
|
|
410
|
-
title:
|
|
411
|
-
"aria-label":
|
|
412
|
-
children: [/* @__PURE__ */
|
|
425
|
+
"aria-pressed": A,
|
|
426
|
+
title: u("bigconsole.dashboards.view.digest", "Console digest"),
|
|
427
|
+
"aria-label": u("bigconsole.dashboards.view.digest", "Console digest"),
|
|
428
|
+
children: [/* @__PURE__ */ _(Oe, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.digest", "Digest")]
|
|
413
429
|
})
|
|
414
|
-
})
|
|
430
|
+
}) })
|
|
415
431
|
]
|
|
416
432
|
})
|
|
417
433
|
}),
|
|
418
|
-
|
|
434
|
+
A && P && /* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
|
|
419
435
|
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2 sm:px-4",
|
|
420
|
-
children: /* @__PURE__ */
|
|
436
|
+
children: /* @__PURE__ */ _("div", {
|
|
421
437
|
className: "mx-auto max-w-3xl",
|
|
422
|
-
children: /* @__PURE__ */
|
|
423
|
-
dashboardId:
|
|
438
|
+
children: /* @__PURE__ */ _(ye, {
|
|
439
|
+
dashboardId: P.id,
|
|
424
440
|
onClose: () => ze(!1)
|
|
425
441
|
})
|
|
426
442
|
})
|
|
443
|
+
}) }),
|
|
444
|
+
j && /* @__PURE__ */ _(de, {
|
|
445
|
+
currentDashboardId: P.id,
|
|
446
|
+
currentDashboardName: P.name,
|
|
447
|
+
basePath: `${ne}/dashboards`
|
|
427
448
|
}),
|
|
428
|
-
|
|
429
|
-
currentDashboardId: j.id,
|
|
430
|
-
currentDashboardName: j.name,
|
|
431
|
-
basePath: `${je}/dashboards`
|
|
432
|
-
}),
|
|
433
|
-
/* @__PURE__ */ h("div", {
|
|
449
|
+
/* @__PURE__ */ _("div", {
|
|
434
450
|
className: "flex-1 min-w-0 overflow-hidden",
|
|
435
|
-
children: /* @__PURE__ */
|
|
436
|
-
dashboardId:
|
|
437
|
-
pageId:
|
|
438
|
-
title:
|
|
439
|
-
onPaste:
|
|
440
|
-
onSave:
|
|
441
|
-
isSaving:
|
|
442
|
-
onReview:
|
|
443
|
-
onExport:
|
|
444
|
-
onPublishTemplate:
|
|
451
|
+
children: /* @__PURE__ */ _(se, {
|
|
452
|
+
dashboardId: P.id,
|
|
453
|
+
pageId: B || P.pages?.[0]?.id,
|
|
454
|
+
title: P.name,
|
|
455
|
+
onPaste: at,
|
|
456
|
+
onSave: w && !y ? nt : void 0,
|
|
457
|
+
isSaving: Ie,
|
|
458
|
+
onReview: y ? void 0 : mt,
|
|
459
|
+
onExport: Pe ? ot : void 0,
|
|
460
|
+
onPublishTemplate: Fe ? lt : void 0,
|
|
445
461
|
pages: Z,
|
|
446
462
|
activePageId: $ ?? void 0,
|
|
447
463
|
onPageChange: X,
|
|
448
|
-
onPageAdd:
|
|
449
|
-
onPageRename:
|
|
450
|
-
onPageDuplicate:
|
|
451
|
-
onPageDelete:
|
|
452
|
-
onPagesReorder:
|
|
464
|
+
onPageAdd: gt,
|
|
465
|
+
onPageRename: _t,
|
|
466
|
+
onPageDuplicate: vt,
|
|
467
|
+
onPageDelete: yt,
|
|
468
|
+
onPagesReorder: bt,
|
|
453
469
|
showPageTabs: !0
|
|
454
470
|
})
|
|
455
471
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
open:
|
|
458
|
-
onClose:
|
|
459
|
-
dashboardId:
|
|
472
|
+
/* @__PURE__ */ _(pe, {
|
|
473
|
+
open: ft && !y,
|
|
474
|
+
onClose: ht,
|
|
475
|
+
dashboardId: P.id,
|
|
460
476
|
pages: Z,
|
|
461
|
-
canFix:
|
|
477
|
+
canFix: w && !y
|
|
462
478
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
isOpen:
|
|
465
|
-
dashboardId:
|
|
466
|
-
dashboardName:
|
|
467
|
-
onClose:
|
|
479
|
+
/* @__PURE__ */ _(ue, {
|
|
480
|
+
isOpen: Le,
|
|
481
|
+
dashboardId: P.id,
|
|
482
|
+
dashboardName: P.name,
|
|
483
|
+
onClose: dt
|
|
468
484
|
}),
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
isOpen:
|
|
471
|
-
dashboardId:
|
|
472
|
-
dashboardName:
|
|
473
|
-
dashboardDescription:
|
|
474
|
-
onClose:
|
|
485
|
+
/* @__PURE__ */ _(fe, {
|
|
486
|
+
isOpen: st,
|
|
487
|
+
dashboardId: P.id,
|
|
488
|
+
dashboardName: P.name,
|
|
489
|
+
dashboardDescription: P.description,
|
|
490
|
+
onClose: ut
|
|
475
491
|
})
|
|
476
492
|
]
|
|
477
|
-
}) : /* @__PURE__ */
|
|
478
|
-
title:
|
|
479
|
-
description:
|
|
493
|
+
})] }) : /* @__PURE__ */ _(Te, {
|
|
494
|
+
title: u("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
|
|
495
|
+
description: u("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
|
|
496
|
+
});
|
|
497
|
+
}), Ne = () => (c(), null), b = u(function() {
|
|
498
|
+
let { workspaceId: e } = r();
|
|
499
|
+
return /* @__PURE__ */ _(ne, {
|
|
500
|
+
workspaceId: e,
|
|
501
|
+
children: /* @__PURE__ */ _(y, {})
|
|
480
502
|
});
|
|
481
503
|
});
|
|
482
|
-
export {
|
|
504
|
+
export { y as DashboardViewPage, b as default };
|