@burdenoff/microfe-bigconsole 2026.624.2 → 2026.625.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.
Files changed (71) hide show
  1. package/dist/bigconsole/BigConsoleRoutes.js +93 -93
  2. package/dist/bigconsole/assistant/assistantApi.js +215 -0
  3. package/dist/bigconsole/assistant/assistantApi.js.map +1 -0
  4. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js +119 -0
  5. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js.map +1 -0
  6. package/dist/bigconsole/assistant/index.js +2 -0
  7. package/dist/bigconsole/assistant/pageContext.js +51 -0
  8. package/dist/bigconsole/assistant/pageContext.js.map +1 -0
  9. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +48 -48
  10. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +52 -52
  11. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js.map +1 -1
  12. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +33 -33
  13. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +179 -179
  14. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
  15. package/dist/bigconsole/components/dashboard/WidgetPalette.js +38 -38
  16. package/dist/bigconsole/components/datasink/DataSinkTableViewer.js +32 -32
  17. package/dist/bigconsole/components/datasink/ExportDataSinkDialog.js +31 -31
  18. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +98 -98
  19. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js.map +1 -1
  20. package/dist/bigconsole/components/parser/ExportParserDialog.js +31 -31
  21. package/dist/bigconsole/components/parser/ImportParserDialog.js +162 -162
  22. package/dist/bigconsole/components/parser/ImportParserDialog.js.map +1 -1
  23. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +79 -79
  24. package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
  25. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js.map +1 -1
  26. package/dist/bigconsole/components/widgets/PropertiesPanel.js +307 -307
  27. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  28. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js +222 -222
  29. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js.map +1 -1
  30. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js +23 -23
  31. package/dist/bigconsole/index.js +3 -0
  32. package/dist/bigconsole/pages/DashboardBuilderPage.js +74 -74
  33. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  34. package/dist/bigconsole/pages/DashboardViewPage.js +168 -189
  35. package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
  36. package/dist/bigconsole/pages/DashboardsPage.js +266 -310
  37. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  38. package/dist/bigconsole/pages/DataParsersPage.js +148 -194
  39. package/dist/bigconsole/pages/DataParsersPage.js.map +1 -1
  40. package/dist/bigconsole/pages/DataSinkBuilderPage.js +252 -246
  41. package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
  42. package/dist/bigconsole/pages/DataSinkViewPage.js +256 -231
  43. package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
  44. package/dist/bigconsole/pages/DataSinksPage.js +173 -219
  45. package/dist/bigconsole/pages/DataSinksPage.js.map +1 -1
  46. package/dist/bigconsole/pages/HomePage.js +125 -141
  47. package/dist/bigconsole/pages/HomePage.js.map +1 -1
  48. package/dist/bigconsole/pages/InsightsPage.js +159 -184
  49. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  50. package/dist/bigconsole/pages/ParserBuilderPage.js +401 -393
  51. package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
  52. package/dist/bigconsole/pages/ParserViewPage.js +220 -201
  53. package/dist/bigconsole/pages/ParserViewPage.js.map +1 -1
  54. package/dist/bigconsole/pages/PipelineBuilderPage.js +212 -206
  55. package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
  56. package/dist/bigconsole/pages/PipelineViewPage.js +204 -181
  57. package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
  58. package/dist/bigconsole/pages/PipelinesPage.js +107 -150
  59. package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
  60. package/dist/bigconsole/pages/SettingsPage.js +184 -171
  61. package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
  62. package/dist/bigconsole/pages/WidgetDemoPage.js +69 -81
  63. package/dist/bigconsole/pages/WidgetDemoPage.js.map +1 -1
  64. package/dist/bigconsole/pages/WorkflowViewPage.js +230 -216
  65. package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
  66. package/dist/bigconsole/pages/WorkflowsPage.js +106 -149
  67. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  68. package/dist/generated/wspace-operations.js +87 -36
  69. package/dist/generated/wspace-operations.js.map +1 -1
  70. package/dist/index.js +3 -1
  71. package/package.json +6 -2
@@ -8,97 +8,97 @@ import i from "../hooks/useDashboardOperations.js";
8
8
  import a from "../hooks/useFilterUrlSync.js";
9
9
  import o from "../hooks/usePageOperations.js";
10
10
  import "../hooks/index.js";
11
- import s from "../components/dashboard/DashboardCanvas.js";
12
- import c from "../components/dashboard/ExportDashboardDialog.js";
13
- import ee from "../components/dashboard/DrilldownBreadcrumb.js";
11
+ import ee from "../components/dashboard/DashboardCanvas.js";
12
+ import s from "../components/dashboard/ExportDashboardDialog.js";
13
+ import c from "../components/dashboard/DrilldownBreadcrumb.js";
14
14
  import "../components/dashboard/index.js";
15
15
  import { memo as l, useCallback as u, useEffect as d, useState as f } from "react";
16
16
  import { useParams as p } from "react-router-dom";
17
17
  import { ArrowLeft as m } from "lucide-react";
18
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
19
- import { Button as _ } from "@burdenoff/fe-libs/ui";
18
+ import { Button as h, IllustratedEmptyState as g } from "@burdenoff/fe-libs/ui";
19
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
20
20
  //#region src/bigconsole/pages/DashboardViewPage.tsx
21
- var v = l(function() {
22
- let { dashboardId: l } = p(), v = n(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(!1), [T, E] = f(!1), { isInDrilldown: D, getContextFromUrl: O, getDrilldownMetadata: k } = a(), A = t((e) => e.currentDashboard), j = t((e) => e.setCurrentDashboard), M = t((e) => e.setGlobalFilterValue), N = t((e) => e.clearAllGlobalFilters), P = e((e) => e.widgets), F = e((e) => e.clipboardWidgetId), I = e((e) => e.clipboardAction), L = e((e) => e.clearClipboard), R = e((e) => e.selectWidget), { loading: z, error: B, fetchDashboard: V, updateDashboard: H } = i(), { createWidget: U, deleteWidget: W, duplicateWidget: G, batchUpdatePositions: K } = r(y || void 0, l), { createPage: q, updatePage: J, deletePage: Y, reorderPages: X } = o();
21
+ var b = l(function() {
22
+ let { dashboardId: l } = p(), b = n(), [x, S] = f(null), [C, w] = f(!1), [T, E] = f(!1), [D, O] = f(!1), { isInDrilldown: k, getContextFromUrl: A, getDrilldownMetadata: j } = a(), M = t((e) => e.currentDashboard), N = t((e) => e.setCurrentDashboard), P = t((e) => e.setGlobalFilterValue), F = t((e) => e.clearAllGlobalFilters), I = e((e) => e.widgets), L = e((e) => e.clipboardWidgetId), R = e((e) => e.clipboardAction), z = e((e) => e.clearClipboard), B = e((e) => e.selectWidget), { loading: V, error: H, fetchDashboard: U, updateDashboard: W } = i(), { createWidget: G, deleteWidget: K, duplicateWidget: q, batchUpdatePositions: J } = r(x || void 0, l), { createPage: Y, updatePage: X, deletePage: Z, reorderPages: Q } = o();
23
23
  d(() => {
24
24
  if (!l) {
25
- v("/dashboards");
25
+ b("/dashboards");
26
26
  return;
27
27
  }
28
- return N(), w(!1), V(l).then((e) => {
29
- e ? e.pages && e.pages.length > 0 && b(e.pages[0].id) : w(!0);
28
+ return F(), E(!1), U(l).then((e) => {
29
+ e ? e.pages && e.pages.length > 0 && S(e.pages[0].id) : E(!0);
30
30
  }), () => {
31
- j(null), N(), w(!1);
31
+ N(null), F(), E(!1);
32
32
  };
33
33
  }, [
34
34
  l,
35
- v,
36
- V,
37
- j,
38
- N
35
+ b,
36
+ U,
37
+ N,
38
+ F
39
39
  ]), d(() => {
40
- if (!D) return;
41
- let e = O(), t = k();
40
+ if (!k) return;
41
+ let e = A(), t = j();
42
42
  Object.entries(e).forEach(([e, t]) => {
43
- M(`ctx_${e}`, t);
44
- }), t.depth > 0 && (M("__drilldown_depth", t.depth), M("__drilldown_parent", t.parent), M("__drilldown_path", t.path)), Object.keys(e).length > 0 && console.debug("[DashboardViewPage] Loaded drilldown context:", {
43
+ P(`ctx_${e}`, t);
44
+ }), t.depth > 0 && (P("__drilldown_depth", t.depth), P("__drilldown_parent", t.parent), P("__drilldown_path", t.path)), Object.keys(e).length > 0 && console.debug("[DashboardViewPage] Loaded drilldown context:", {
45
45
  context: e,
46
46
  metadata: t
47
47
  });
48
48
  }, [
49
- D,
50
- O,
51
49
  k,
52
- M
50
+ A,
51
+ j,
52
+ P
53
53
  ]);
54
- let Z = u(async () => {
54
+ let $ = u(async () => {
55
55
  if (l) {
56
- S(!0);
56
+ w(!0);
57
57
  try {
58
- let e = Array.from(P.values());
59
- e.length > 0 && await K(e.map((e) => ({
58
+ let e = Array.from(I.values());
59
+ e.length > 0 && await J(e.map((e) => ({
60
60
  id: e.id,
61
61
  position: e.position
62
- }))), A && await H({
62
+ }))), M && await W({
63
63
  id: l,
64
- name: A.name,
65
- description: A.description
64
+ name: M.name,
65
+ description: M.description
66
66
  });
67
67
  } catch {} finally {
68
- S(!1);
68
+ w(!1);
69
69
  }
70
70
  }
71
71
  }, [
72
72
  l,
73
- P,
74
- A,
75
- K,
76
- H
77
- ]), Q = u(() => {
78
- v("/dashboards");
79
- }, [v]), $ = u((e) => {
80
- b(e);
81
- }, []), te = u(async () => {
82
- let e = y || A?.pages?.[0]?.id;
83
- if (!F || !l || !e) return;
84
- let t = P.get(F);
73
+ I,
74
+ M,
75
+ J,
76
+ W
77
+ ]), te = u(() => {
78
+ b("/dashboards");
79
+ }, [b]), ne = u((e) => {
80
+ S(e);
81
+ }, []), re = u(async () => {
82
+ let e = x || M?.pages?.[0]?.id;
83
+ if (!L || !l || !e) return;
84
+ let t = I.get(L);
85
85
  if (!t) {
86
- L();
86
+ z();
87
87
  return;
88
88
  }
89
89
  let n = {
90
90
  x: 0,
91
- y: Array.from(P.values()).reduce((e, t) => {
91
+ y: Array.from(I.values()).reduce((e, t) => {
92
92
  let n = (t.positionY ?? 0) + (t.positionHeight ?? 4);
93
93
  return Math.max(e, n);
94
94
  }, 0),
95
95
  width: t.positionWidth ?? 4,
96
96
  height: t.positionHeight ?? 4
97
- }, r = I === "copy" ? `${t.title} (Copy)` : t.title, i = null;
97
+ }, r = R === "copy" ? `${t.title} (Copy)` : t.title, i = null;
98
98
  try {
99
- i = await G(F, n, r);
99
+ i = await q(L, n, r);
100
100
  } catch {}
101
- i ||= await U({
101
+ i ||= await G({
102
102
  pageId: e,
103
103
  dashboardId: l,
104
104
  type: t.type,
@@ -112,234 +112,213 @@ var v = l(function() {
112
112
  position: n,
113
113
  refreshInterval: t.refreshInterval ?? void 0,
114
114
  metadata: t.metadata
115
- }), i && (R(i.id), I === "cut" && await W(F)), L();
115
+ }), i && (B(i.id), R === "cut" && await K(L)), z();
116
116
  }, [
117
- F,
118
- I,
117
+ L,
118
+ R,
119
119
  l,
120
- y,
121
- A,
122
- P,
120
+ x,
121
+ M,
122
+ I,
123
+ q,
123
124
  G,
124
- U,
125
- W,
126
- R,
127
- L
128
- ]), ne = u(() => {
129
- E(!0);
130
- }, []), re = u(() => {
131
- E(!1);
132
- }, []), ie = u(async () => {
133
- if (!A || !l) return;
134
- let e = await q({
125
+ K,
126
+ B,
127
+ z
128
+ ]), ie = u(() => {
129
+ O(!0);
130
+ }, []), ae = u(() => {
131
+ O(!1);
132
+ }, []), oe = u(async () => {
133
+ if (!M || !l) return;
134
+ let e = await Y({
135
135
  dashboardId: l,
136
- name: `Page ${(A.pages?.length || 0) + 1}`
136
+ name: `Page ${(M.pages?.length || 0) + 1}`
137
137
  });
138
- e && (j({
139
- ...A,
140
- pages: [...A.pages || [], e]
141
- }), b(e.id));
138
+ e && (N({
139
+ ...M,
140
+ pages: [...M.pages || [], e]
141
+ }), S(e.id));
142
142
  }, [
143
- A,
143
+ M,
144
144
  l,
145
- j,
146
- q
147
- ]), ae = u(async (e, t) => {
148
- A && await J({
145
+ N,
146
+ Y
147
+ ]), se = u(async (e, t) => {
148
+ M && await X({
149
149
  id: e,
150
150
  name: t
151
- }) && j({
152
- ...A,
153
- pages: A.pages?.map((n) => n.id === e ? {
151
+ }) && N({
152
+ ...M,
153
+ pages: M.pages?.map((n) => n.id === e ? {
154
154
  ...n,
155
155
  name: t
156
156
  } : n)
157
157
  });
158
158
  }, [
159
- A,
160
- j,
161
- J
162
- ]), oe = u(async (e) => {
163
- if (!A || !l) return;
164
- let t = A.pages?.find((t) => t.id === e);
159
+ M,
160
+ N,
161
+ X
162
+ ]), ce = u(async (e) => {
163
+ if (!M || !l) return;
164
+ let t = M.pages?.find((t) => t.id === e);
165
165
  if (!t) return;
166
- let n = await q({
166
+ let n = await Y({
167
167
  dashboardId: l,
168
168
  name: `${t.name} (Copy)`
169
169
  });
170
- n && (j({
171
- ...A,
172
- pages: [...A.pages || [], n]
173
- }), b(n.id));
170
+ n && (N({
171
+ ...M,
172
+ pages: [...M.pages || [], n]
173
+ }), S(n.id));
174
174
  }, [
175
- A,
175
+ M,
176
176
  l,
177
- j,
178
- q
179
- ]), se = u(async (e) => {
180
- if (!(!A || (A.pages?.length || 0) <= 1) && await Y(e)) {
181
- let t = A.pages?.filter((t) => t.id !== e).map((e, t) => ({
177
+ N,
178
+ Y
179
+ ]), le = u(async (e) => {
180
+ if (!(!M || (M.pages?.length || 0) <= 1) && await Z(e)) {
181
+ let t = M.pages?.filter((t) => t.id !== e).map((e, t) => ({
182
182
  ...e,
183
183
  order: t
184
184
  }));
185
- j({
186
- ...A,
185
+ N({
186
+ ...M,
187
187
  pages: t
188
- }), y === e && b(t?.[0]?.id || null);
188
+ }), x === e && S(t?.[0]?.id || null);
189
189
  }
190
190
  }, [
191
- A,
192
- j,
193
- y,
194
- Y
195
- ]), ce = u(async (e) => {
196
- !A || !l || (j({
197
- ...A,
191
+ M,
192
+ N,
193
+ x,
194
+ Z
195
+ ]), ue = u(async (e) => {
196
+ !M || !l || (N({
197
+ ...M,
198
198
  pages: e.map((e, t) => ({
199
199
  ...e,
200
200
  order: t
201
201
  }))
202
- }), await X(l, e.map((e) => e.id)));
202
+ }), await Q(l, e.map((e) => e.id)));
203
203
  }, [
204
- A,
204
+ M,
205
205
  l,
206
- j,
207
- X
206
+ N,
207
+ Q
208
208
  ]);
209
- return B ? /* @__PURE__ */ h("div", {
209
+ return H ? /* @__PURE__ */ v("div", {
210
210
  className: "flex flex-col items-center justify-center h-full",
211
211
  style: { padding: "var(--space-pagePadding)" },
212
- children: /* @__PURE__ */ g("div", {
212
+ children: /* @__PURE__ */ y("div", {
213
213
  className: "bg-status-error-bg border border-status-error-border rounded-lg p-6 w-full max-w-md",
214
214
  children: [
215
- /* @__PURE__ */ h("h3", {
215
+ /* @__PURE__ */ v("h3", {
216
216
  className: "text-lg font-medium text-status-error-text mb-2",
217
217
  children: "Error loading dashboard"
218
218
  }),
219
- /* @__PURE__ */ h("p", {
219
+ /* @__PURE__ */ v("p", {
220
220
  className: "text-sm text-text-secondary mb-4 break-words",
221
- children: B.message
221
+ children: H.message
222
222
  }),
223
- /* @__PURE__ */ g("div", {
223
+ /* @__PURE__ */ y("div", {
224
224
  className: "flex flex-wrap gap-3",
225
- children: [/* @__PURE__ */ h("button", {
225
+ children: [/* @__PURE__ */ v("button", {
226
226
  type: "button",
227
- onClick: () => V(l),
227
+ onClick: () => U(l),
228
228
  className: "px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md",
229
229
  children: "Retry"
230
- }), /* @__PURE__ */ h("button", {
230
+ }), /* @__PURE__ */ v("button", {
231
231
  type: "button",
232
- onClick: () => v("/dashboards"),
232
+ onClick: () => b("/dashboards"),
233
233
  className: "px-4 py-2 text-sm font-medium text-text-secondary bg-bg-sunken hover:bg-bg-sunken/80 rounded-md",
234
234
  children: "Back to Dashboards"
235
235
  })]
236
236
  })
237
237
  ]
238
238
  })
239
- }) : C ? /* @__PURE__ */ h("div", {
239
+ }) : T ? /* @__PURE__ */ v("div", {
240
240
  className: "flex flex-col items-center justify-center h-full",
241
241
  style: { padding: "var(--space-pagePadding)" },
242
- children: /* @__PURE__ */ g("div", {
243
- className: "bg-bg-surface border border-border-default rounded-lg p-6 w-full max-w-md text-center",
244
- children: [
245
- /* @__PURE__ */ h("svg", {
246
- className: "w-16 h-16 mx-auto mb-4 text-text-tertiary",
247
- fill: "none",
248
- stroke: "currentColor",
249
- viewBox: "0 0 24 24",
250
- children: /* @__PURE__ */ h("path", {
251
- strokeLinecap: "round",
252
- strokeLinejoin: "round",
253
- strokeWidth: 1.5,
254
- d: "M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
255
- })
256
- }),
257
- /* @__PURE__ */ h("h3", {
258
- className: "text-lg font-medium text-text-primary mb-2",
259
- children: "Dashboard not found"
260
- }),
261
- /* @__PURE__ */ h("p", {
262
- className: "text-sm text-text-secondary mb-4",
263
- children: "The dashboard you're looking for doesn't exist or has been deleted."
264
- }),
265
- /* @__PURE__ */ g("p", {
266
- className: "text-xs text-text-tertiary mb-4 font-mono break-all",
267
- children: ["ID: ", l]
268
- }),
269
- /* @__PURE__ */ h("button", {
270
- type: "button",
271
- onClick: () => v("/dashboards"),
272
- className: "px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md",
273
- children: "Back to Dashboards"
274
- })
275
- ]
242
+ children: /* @__PURE__ */ v(g, {
243
+ illustration: "empty-data",
244
+ title: "Dashboard not found",
245
+ description: /* @__PURE__ */ y(_, { children: ["The dashboard you're looking for doesn't exist or has been deleted.", /* @__PURE__ */ y("span", {
246
+ className: "mt-2 block font-mono text-xs text-text-tertiary break-all",
247
+ children: ["ID: ", l]
248
+ })] }),
249
+ action: /* @__PURE__ */ v("button", {
250
+ type: "button",
251
+ onClick: () => b("/dashboards"),
252
+ className: "px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md",
253
+ children: "Back to Dashboards"
254
+ })
276
255
  })
277
- }) : z || !A ? /* @__PURE__ */ h("div", {
256
+ }) : V || !M ? /* @__PURE__ */ v("div", {
278
257
  className: "flex items-center justify-center h-full",
279
- children: /* @__PURE__ */ g("div", {
258
+ children: /* @__PURE__ */ y("div", {
280
259
  className: "flex flex-col items-center gap-4",
281
- children: [/* @__PURE__ */ h("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ h("p", {
260
+ children: [/* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ v("p", {
282
261
  className: "text-sm text-text-secondary",
283
262
  children: "Loading dashboard..."
284
263
  })]
285
264
  })
286
- }) : /* @__PURE__ */ g("div", {
265
+ }) : /* @__PURE__ */ y("div", {
287
266
  className: "h-full flex flex-col overflow-hidden",
288
267
  children: [
289
- /* @__PURE__ */ g("div", {
268
+ /* @__PURE__ */ y("div", {
290
269
  className: "flex items-center gap-3 px-3 py-2 border-b border-border-default bg-bg-surface flex-shrink-0",
291
- children: [/* @__PURE__ */ g(_, {
292
- onClick: Q,
270
+ children: [/* @__PURE__ */ y(h, {
271
+ onClick: te,
293
272
  variant: "ghost",
294
273
  size: "sm",
295
274
  title: "Back to Dashboards",
296
275
  "aria-label": "Back to Dashboards",
297
- children: [/* @__PURE__ */ h(m, { className: "w-4 h-4 mr-2" }), "Back"]
298
- }), /* @__PURE__ */ h("h2", {
276
+ children: [/* @__PURE__ */ v(m, { className: "w-4 h-4 mr-2" }), "Back"]
277
+ }), /* @__PURE__ */ v("h2", {
299
278
  className: "text-sm font-semibold text-text-primary truncate",
300
- children: A.name
279
+ children: M.name
301
280
  })]
302
281
  }),
303
- D && /* @__PURE__ */ h(ee, {
304
- currentDashboardId: A.id,
305
- currentDashboardName: A.name,
282
+ k && /* @__PURE__ */ v(c, {
283
+ currentDashboardId: M.id,
284
+ currentDashboardName: M.name,
306
285
  basePath: "/bigconsole/dashboards"
307
286
  }),
308
- /* @__PURE__ */ h("div", {
287
+ /* @__PURE__ */ v("div", {
309
288
  className: "flex-1 min-w-0 overflow-hidden",
310
- children: /* @__PURE__ */ h(s, {
311
- dashboardId: A.id,
312
- pageId: y || A.pages?.[0]?.id,
313
- title: A.name,
314
- onPaste: te,
315
- onSave: Z,
316
- isSaving: x,
317
- onExport: ne,
318
- pages: (A.pages || []).map((e, t) => ({
289
+ children: /* @__PURE__ */ v(ee, {
290
+ dashboardId: M.id,
291
+ pageId: x || M.pages?.[0]?.id,
292
+ title: M.name,
293
+ onPaste: re,
294
+ onSave: $,
295
+ isSaving: C,
296
+ onExport: ie,
297
+ pages: (M.pages || []).map((e, t) => ({
319
298
  id: e.id,
320
299
  name: e.name || `Page ${t + 1}`,
321
300
  order: e.order ?? 0
322
301
  })),
323
- activePageId: y || A.pages?.[0]?.id,
324
- onPageChange: $,
325
- onPageAdd: ie,
326
- onPageRename: ae,
327
- onPageDuplicate: oe,
328
- onPageDelete: se,
329
- onPagesReorder: ce,
302
+ activePageId: x || M.pages?.[0]?.id,
303
+ onPageChange: ne,
304
+ onPageAdd: oe,
305
+ onPageRename: se,
306
+ onPageDuplicate: ce,
307
+ onPageDelete: le,
308
+ onPagesReorder: ue,
330
309
  showPageTabs: !0
331
310
  })
332
311
  }),
333
- /* @__PURE__ */ h(c, {
334
- isOpen: T,
335
- dashboardId: A.id,
336
- dashboardName: A.name,
337
- onClose: re
312
+ /* @__PURE__ */ v(s, {
313
+ isOpen: D,
314
+ dashboardId: M.id,
315
+ dashboardName: M.name,
316
+ onClose: ae
338
317
  })
339
318
  ]
340
319
  });
341
320
  });
342
321
  //#endregion
343
- export { v as DashboardViewPage, v as default };
322
+ export { b as DashboardViewPage, b as default };
344
323
 
345
324
  //# sourceMappingURL=DashboardViewPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardViewPage.js","names":[],"sources":["../../../src/bigconsole/pages/DashboardViewPage.tsx"],"sourcesContent":["/**\n * DashboardViewPage\n *\n * View/edit a single dashboard - fetches data from real backend.\n * Supports drilldown context propagation via URL parameters.\n */\n\nimport { type FC, memo, useEffect, useCallback, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useBigConsoleNavigate } from '../context';\nimport { DashboardCanvas, ExportDashboardDialog, DrilldownBreadcrumb } from '../components/dashboard';\nimport { useDashboardStore, useWidgetStore } from '../store';\nimport { useDashboardOperations, useWidgetOperations, usePageOperations } from '../hooks';\nimport { useFilterUrlSync } from '../hooks/useFilterUrlSync';\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const DashboardViewPage: FC = memo(function DashboardViewPage() {\n const { dashboardId } = useParams<{ dashboardId: string }>();\n const navigate = useBigConsoleNavigate();\n const [currentPageId, setCurrentPageId] = useState<string | null>(null);\n const [isSaving, setIsSaving] = useState(false);\n const [notFound, setNotFound] = useState(false);\n const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);\n\n // Drilldown context from URL\n const { isInDrilldown, getContextFromUrl, getDrilldownMetadata } = useFilterUrlSync();\n\n // Store actions\n const currentDashboard = useDashboardStore((state) => state.currentDashboard);\n const setCurrentDashboard = useDashboardStore((state) => state.setCurrentDashboard);\n const setGlobalFilterValue = useDashboardStore((state) => state.setGlobalFilterValue);\n const clearAllGlobalFilters = useDashboardStore((state) => state.clearAllGlobalFilters);\n const widgets = useWidgetStore((state) => state.widgets);\n const clipboardWidgetId = useWidgetStore((state) => state.clipboardWidgetId);\n const clipboardAction = useWidgetStore((state) => state.clipboardAction);\n const clearClipboard = useWidgetStore((state) => state.clearClipboard);\n const selectWidget = useWidgetStore((state) => state.selectWidget);\n\n // Dashboard operations hook\n const { loading, error, fetchDashboard, updateDashboard } = useDashboardOperations();\n\n // Widget operations hook\n const {\n createWidget: createWidgetMutation,\n deleteWidget: deleteWidgetMutation,\n duplicateWidget: duplicateWidgetMutation,\n batchUpdatePositions,\n } = useWidgetOperations(currentPageId || undefined, dashboardId);\n\n // Page operations hook\n const {\n createPage: createPageMutation,\n updatePage: updatePageMutation,\n deletePage: deletePageMutation,\n reorderPages: reorderPagesMutation,\n } = usePageOperations();\n\n // Load dashboard data\n useEffect(() => {\n if (!dashboardId) {\n navigate('/dashboards');\n return;\n }\n\n // Clear stale global filters from previous dashboard before loading new one.\n // This prevents drilldown context filters (ctx_*) from the source dashboard\n // from persisting and incorrectly filtering data on the target dashboard.\n clearAllGlobalFilters();\n\n setNotFound(false);\n\n // Fetch dashboard from backend\n fetchDashboard(dashboardId).then((dashboard) => {\n if (dashboard) {\n // Set the first page as current page\n if (dashboard.pages && dashboard.pages.length > 0) {\n setCurrentPageId(dashboard.pages[0].id);\n }\n } else {\n // Dashboard not found\n setNotFound(true);\n }\n });\n\n // Cleanup\n return () => {\n setCurrentDashboard(null);\n clearAllGlobalFilters();\n setNotFound(false);\n };\n }, [dashboardId, navigate, fetchDashboard, setCurrentDashboard, clearAllGlobalFilters]);\n\n // Load drilldown context from URL and apply to global filters\n useEffect(() => {\n if (!isInDrilldown) return;\n\n // Get context params from URL (ctx_* params)\n const contextParams = getContextFromUrl();\n const drilldownMeta = getDrilldownMetadata();\n\n // Apply context to dashboard state (available for widgets to use)\n // Store as special filter values that widgets can reference\n Object.entries(contextParams).forEach(([key, value]) => {\n // Store context params as global filter values with ctx_ prefix for clarity\n setGlobalFilterValue(`ctx_${key}`, value);\n });\n\n // Store drilldown metadata as special values\n if (drilldownMeta.depth > 0) {\n setGlobalFilterValue('__drilldown_depth', drilldownMeta.depth);\n setGlobalFilterValue('__drilldown_parent', drilldownMeta.parent);\n setGlobalFilterValue('__drilldown_path', drilldownMeta.path);\n }\n\n // Log for debugging\n if (Object.keys(contextParams).length > 0) {\n console.debug('[DashboardViewPage] Loaded drilldown context:', {\n context: contextParams,\n metadata: drilldownMeta,\n });\n }\n }, [isInDrilldown, getContextFromUrl, getDrilldownMetadata, setGlobalFilterValue]);\n\n // Handle save - batch update widget positions and dashboard metadata\n const handleSave = useCallback(async () => {\n if (!dashboardId) return;\n\n setIsSaving(true);\n try {\n // Get all widgets and their positions\n const widgetList = Array.from(widgets.values());\n if (widgetList.length > 0) {\n const positionUpdates = widgetList.map((widget) => ({\n id: widget.id,\n position: widget.position,\n }));\n\n await batchUpdatePositions(positionUpdates);\n }\n\n // Update dashboard metadata if needed\n if (currentDashboard) {\n await updateDashboard({\n id: dashboardId,\n name: currentDashboard.name,\n description: currentDashboard.description,\n });\n }\n } catch (error) {\n } finally {\n setIsSaving(false);\n }\n }, [dashboardId, widgets, currentDashboard, batchUpdatePositions, updateDashboard]);\n\n // Navigate back to the dashboards list\n const handleBack = useCallback(() => {\n navigate('/dashboards');\n }, [navigate]);\n\n // Handle page change\n const handlePageChange = useCallback((pageId: string) => {\n setCurrentPageId(pageId);\n }, []);\n\n // Handle paste widget from clipboard\n const handlePaste = useCallback(async () => {\n const pageId = currentPageId || currentDashboard?.pages?.[0]?.id;\n if (!clipboardWidgetId || !dashboardId || !pageId) {\n return;\n }\n\n const sourceWidget = widgets.get(clipboardWidgetId);\n if (!sourceWidget) {\n clearClipboard();\n return;\n }\n\n // Calculate new position (place at bottom of existing widgets)\n const widgetsArray = Array.from(widgets.values());\n const maxY = widgetsArray.reduce((max, w) => {\n const widgetBottom = (w.positionY ?? 0) + (w.positionHeight ?? 4);\n return Math.max(max, widgetBottom);\n }, 0);\n\n const newPosition = {\n x: 0,\n y: maxY,\n width: sourceWidget.positionWidth ?? 4,\n height: sourceWidget.positionHeight ?? 4,\n };\n\n const newTitle = clipboardAction === 'copy' ? `${sourceWidget.title} (Copy)` : sourceWidget.title;\n\n let newWidget = null;\n\n // Try duplicateWidget API first\n try {\n newWidget = await duplicateWidgetMutation(clipboardWidgetId, newPosition, newTitle);\n } catch (err) {}\n\n // Fallback: Create new widget with source widget's data\n if (!newWidget) {\n newWidget = await createWidgetMutation({\n pageId,\n dashboardId,\n type: sourceWidget.type,\n title: newTitle,\n description: sourceWidget.description,\n // v2.0: Data source fields (DataSink → Parser → Widget)\n dataSinkId: (sourceWidget as unknown as Record<string, string | undefined>).dataSinkId,\n datasetId: (sourceWidget as unknown as Record<string, string | undefined>).datasetId,\n parserId: (sourceWidget as unknown as Record<string, string | undefined>).parserId,\n parserRules: (sourceWidget as unknown as Record<string, string | undefined>).parserRules,\n config: sourceWidget.config || {},\n position: newPosition,\n refreshInterval: sourceWidget.refreshInterval ?? undefined,\n metadata: sourceWidget.metadata,\n });\n }\n\n if (newWidget) {\n selectWidget(newWidget.id);\n\n // If cut action, delete the original widget from backend\n if (clipboardAction === 'cut') {\n await deleteWidgetMutation(clipboardWidgetId);\n }\n }\n\n clearClipboard();\n }, [\n clipboardWidgetId,\n clipboardAction,\n dashboardId,\n currentPageId,\n currentDashboard,\n widgets,\n duplicateWidgetMutation,\n createWidgetMutation,\n deleteWidgetMutation,\n selectWidget,\n clearClipboard,\n ]);\n\n // Handle export\n const handleExport = useCallback(() => {\n setIsExportDialogOpen(true);\n }, []);\n\n const handleExportClose = useCallback(() => {\n setIsExportDialogOpen(false);\n }, []);\n\n // ============================================================================\n // Page Management Callbacks\n // ============================================================================\n\n // Handle adding a new page\n const handlePageAdd = useCallback(async () => {\n if (!currentDashboard || !dashboardId) return;\n\n const newPageCount = (currentDashboard.pages?.length || 0) + 1;\n const newPageName = `Page ${newPageCount}`;\n\n // Call GraphQL mutation to create page\n // Note: 'order' is not available for create - backend auto-assigns order\n const newPage = await createPageMutation({\n dashboardId,\n name: newPageName,\n });\n\n if (newPage) {\n // Update local state with the created page\n setCurrentDashboard({\n ...currentDashboard,\n pages: [...(currentDashboard.pages || []), newPage],\n });\n\n // Switch to the new page\n setCurrentPageId(newPage.id);\n }\n }, [currentDashboard, dashboardId, setCurrentDashboard, createPageMutation]);\n\n // Handle renaming a page\n const handlePageRename = useCallback(\n async (pageId: string, newName: string) => {\n if (!currentDashboard) return;\n\n // Call GraphQL mutation to update page\n const updatedPage = await updatePageMutation({\n id: pageId,\n name: newName,\n });\n\n if (updatedPage) {\n setCurrentDashboard({\n ...currentDashboard,\n pages: currentDashboard.pages?.map((page) => (page.id === pageId ? { ...page, name: newName } : page)),\n });\n }\n },\n [currentDashboard, setCurrentDashboard, updatePageMutation]\n );\n\n // Handle duplicating a page\n const handlePageDuplicate = useCallback(\n async (pageId: string) => {\n if (!currentDashboard || !dashboardId) return;\n\n const sourcePage = currentDashboard.pages?.find((p) => p.id === pageId);\n if (!sourcePage) return;\n\n // Call GraphQL mutation to create a copy of the page\n // Note: 'order' is not available for create - backend auto-assigns order\n const newPage = await createPageMutation({\n dashboardId,\n name: `${sourcePage.name} (Copy)`,\n });\n\n if (newPage) {\n setCurrentDashboard({\n ...currentDashboard,\n pages: [...(currentDashboard.pages || []), newPage],\n });\n\n setCurrentPageId(newPage.id);\n }\n // Note: Widget duplication would require additional backend support\n },\n [currentDashboard, dashboardId, setCurrentDashboard, createPageMutation]\n );\n\n // Handle deleting a page\n const handlePageDelete = useCallback(\n async (pageId: string) => {\n if (!currentDashboard || (currentDashboard.pages?.length || 0) <= 1) return;\n\n // Call GraphQL mutation to delete page\n const success = await deletePageMutation(pageId);\n\n if (success) {\n const updatedPages = currentDashboard.pages\n ?.filter((p) => p.id !== pageId)\n .map((p, index) => ({ ...p, order: index }));\n\n setCurrentDashboard({\n ...currentDashboard,\n pages: updatedPages,\n });\n\n // Switch to first page if current page was deleted\n if (currentPageId === pageId) {\n setCurrentPageId(updatedPages?.[0]?.id || null);\n }\n }\n },\n [currentDashboard, setCurrentDashboard, currentPageId, deletePageMutation]\n );\n\n // Handle reordering pages\n const handlePagesReorder = useCallback(\n async (reorderedPages: Array<{ id: string; name?: string; order?: number }>) => {\n if (!currentDashboard || !dashboardId) return;\n\n // Update local state optimistically\n setCurrentDashboard({\n ...currentDashboard,\n pages: reorderedPages.map((page, index) => ({\n ...page,\n order: index,\n })),\n });\n\n // Call GraphQL mutation to persist the reorder\n const pageIds = reorderedPages.map((p) => p.id);\n await reorderPagesMutation(dashboardId, pageIds);\n },\n [currentDashboard, dashboardId, setCurrentDashboard, reorderPagesMutation]\n );\n\n // Error state\n if (error) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full\" style={{ padding: 'var(--space-pagePadding)' }}>\n <div className=\"bg-status-error-bg border border-status-error-border rounded-lg p-6 w-full max-w-md\">\n <h3 className=\"text-lg font-medium text-status-error-text mb-2\">Error loading dashboard</h3>\n <p className=\"text-sm text-text-secondary mb-4 break-words\">{error.message}</p>\n <div className=\"flex flex-wrap gap-3\">\n <button\n type=\"button\"\n onClick={() => fetchDashboard(dashboardId!)}\n className=\"px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md\"\n >\n Retry\n </button>\n <button\n type=\"button\"\n onClick={() => navigate('/dashboards')}\n className=\"px-4 py-2 text-sm font-medium text-text-secondary bg-bg-sunken hover:bg-bg-sunken/80 rounded-md\"\n >\n Back to Dashboards\n </button>\n </div>\n </div>\n </div>\n );\n }\n\n // Not found state\n if (notFound) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full\" style={{ padding: 'var(--space-pagePadding)' }}>\n <div className=\"bg-bg-surface border border-border-default rounded-lg p-6 w-full max-w-md text-center\">\n <svg\n className=\"w-16 h-16 mx-auto mb-4 text-text-tertiary\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1.5}\n d=\"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n <h3 className=\"text-lg font-medium text-text-primary mb-2\">Dashboard not found</h3>\n <p className=\"text-sm text-text-secondary mb-4\">\n The dashboard you&apos;re looking for doesn&apos;t exist or has been deleted.\n </p>\n <p className=\"text-xs text-text-tertiary mb-4 font-mono break-all\">ID: {dashboardId}</p>\n <button\n type=\"button\"\n onClick={() => navigate('/dashboards')}\n className=\"px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md\"\n >\n Back to Dashboards\n </button>\n </div>\n </div>\n );\n }\n\n // Loading state\n if (loading || !currentDashboard) {\n return (\n <div className=\"flex items-center justify-center h-full\">\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full\" />\n <p className=\"text-sm text-text-secondary\">Loading dashboard...</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"h-full flex flex-col overflow-hidden\">\n {/* Page header with back navigation - visible in both view and edit modes */}\n <div className=\"flex items-center gap-3 px-3 py-2 border-b border-border-default bg-bg-surface flex-shrink-0\">\n <Button\n onClick={handleBack}\n variant=\"ghost\"\n size=\"sm\"\n title=\"Back to Dashboards\"\n aria-label=\"Back to Dashboards\"\n >\n <ArrowLeft className=\"w-4 h-4 mr-2\" />\n Back\n </Button>\n <h2 className=\"text-sm font-semibold text-text-primary truncate\">{currentDashboard.name}</h2>\n </div>\n\n {/* Drilldown Breadcrumb - shown when navigating via drilldown */}\n {isInDrilldown && (\n <DrilldownBreadcrumb\n currentDashboardId={currentDashboard.id}\n currentDashboardName={currentDashboard.name}\n basePath=\"/bigconsole/dashboards\"\n />\n )}\n\n {/* Dashboard Canvas with Page Tabs */}\n <div className=\"flex-1 min-w-0 overflow-hidden\">\n <DashboardCanvas\n dashboardId={currentDashboard.id}\n pageId={currentPageId || currentDashboard.pages?.[0]?.id}\n title={currentDashboard.name}\n onPaste={handlePaste}\n onSave={handleSave}\n isSaving={isSaving}\n onExport={handleExport}\n // Page tabs props\n pages={(currentDashboard.pages || []).map((page, index) => ({\n id: page.id,\n name: page.name || `Page ${index + 1}`,\n order: page.order ?? 0,\n }))}\n activePageId={currentPageId || currentDashboard.pages?.[0]?.id}\n onPageChange={handlePageChange}\n onPageAdd={handlePageAdd}\n onPageRename={handlePageRename}\n onPageDuplicate={handlePageDuplicate}\n onPageDelete={handlePageDelete}\n onPagesReorder={handlePagesReorder}\n showPageTabs={true}\n />\n </div>\n\n {/* Export Dashboard Dialog */}\n <ExportDashboardDialog\n isOpen={isExportDialogOpen}\n dashboardId={currentDashboard.id}\n dashboardName={currentDashboard.name}\n onClose={handleExportClose}\n />\n </div>\n );\n});\n\nexport default DashboardViewPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,IAAa,IAAwB,EAAK,WAA6B;CACrE,IAAM,EAAE,mBAAgB,GAAoC,EACtD,IAAW,GAAuB,EAClC,CAAC,GAAe,KAAoB,EAAwB,KAAK,EACjE,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAoB,KAAyB,EAAS,GAAM,EAG7D,EAAE,kBAAe,sBAAmB,4BAAyB,GAAkB,EAG/E,IAAmB,GAAmB,MAAU,EAAM,iBAAiB,EACvE,IAAsB,GAAmB,MAAU,EAAM,oBAAoB,EAC7E,IAAuB,GAAmB,MAAU,EAAM,qBAAqB,EAC/E,IAAwB,GAAmB,MAAU,EAAM,sBAAsB,EACjF,IAAU,GAAgB,MAAU,EAAM,QAAQ,EAClD,IAAoB,GAAgB,MAAU,EAAM,kBAAkB,EACtE,IAAkB,GAAgB,MAAU,EAAM,gBAAgB,EAClE,IAAiB,GAAgB,MAAU,EAAM,eAAe,EAChE,IAAe,GAAgB,MAAU,EAAM,aAAa,EAG5D,EAAE,YAAS,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;MAC1D,IAAI,EAAK;MACT,MAAM,EAAK,QAAQ,QAAQ,IAAQ;MACnC,OAAO,EAAK,SAAS;MACtB,EAAE;KACH,cAAc,KAAiB,EAAiB,QAAQ,IAAI;KAC5D,cAAc;KACd,WAAW;KACX,cAAc;KACd,iBAAiB;KACjB,cAAc;KACd,gBAAgB;KAChB,cAAc;KACd,CAAA;IACE,CAAA;GAGN,kBAAC,GAAD;IACE,QAAQ;IACR,aAAa,EAAiB;IAC9B,eAAe,EAAiB;IAChC,SAAS;IACT,CAAA;GACE;;EAER"}
1
+ {"version":3,"file":"DashboardViewPage.js","names":[],"sources":["../../../src/bigconsole/pages/DashboardViewPage.tsx"],"sourcesContent":["/**\n * DashboardViewPage\n *\n * View/edit a single dashboard - fetches data from real backend.\n * Supports drilldown context propagation via URL parameters.\n */\n\nimport { type FC, memo, useEffect, useCallback, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { ArrowLeft } from 'lucide-react';\nimport { Button, IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { useBigConsoleNavigate } from '../context';\nimport { DashboardCanvas, ExportDashboardDialog, DrilldownBreadcrumb } from '../components/dashboard';\nimport { useDashboardStore, useWidgetStore } from '../store';\nimport { useDashboardOperations, useWidgetOperations, usePageOperations } from '../hooks';\nimport { useFilterUrlSync } from '../hooks/useFilterUrlSync';\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const DashboardViewPage: FC = memo(function DashboardViewPage() {\n const { dashboardId } = useParams<{ dashboardId: string }>();\n const navigate = useBigConsoleNavigate();\n const [currentPageId, setCurrentPageId] = useState<string | null>(null);\n const [isSaving, setIsSaving] = useState(false);\n const [notFound, setNotFound] = useState(false);\n const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);\n\n // Drilldown context from URL\n const { isInDrilldown, getContextFromUrl, getDrilldownMetadata } = useFilterUrlSync();\n\n // Store actions\n const currentDashboard = useDashboardStore((state) => state.currentDashboard);\n const setCurrentDashboard = useDashboardStore((state) => state.setCurrentDashboard);\n const setGlobalFilterValue = useDashboardStore((state) => state.setGlobalFilterValue);\n const clearAllGlobalFilters = useDashboardStore((state) => state.clearAllGlobalFilters);\n const widgets = useWidgetStore((state) => state.widgets);\n const clipboardWidgetId = useWidgetStore((state) => state.clipboardWidgetId);\n const clipboardAction = useWidgetStore((state) => state.clipboardAction);\n const clearClipboard = useWidgetStore((state) => state.clearClipboard);\n const selectWidget = useWidgetStore((state) => state.selectWidget);\n\n // Dashboard operations hook\n const { loading, error, fetchDashboard, updateDashboard } = useDashboardOperations();\n\n // Widget operations hook\n const {\n createWidget: createWidgetMutation,\n deleteWidget: deleteWidgetMutation,\n duplicateWidget: duplicateWidgetMutation,\n batchUpdatePositions,\n } = useWidgetOperations(currentPageId || undefined, dashboardId);\n\n // Page operations hook\n const {\n createPage: createPageMutation,\n updatePage: updatePageMutation,\n deletePage: deletePageMutation,\n reorderPages: reorderPagesMutation,\n } = usePageOperations();\n\n // Load dashboard data\n useEffect(() => {\n if (!dashboardId) {\n navigate('/dashboards');\n return;\n }\n\n // Clear stale global filters from previous dashboard before loading new one.\n // This prevents drilldown context filters (ctx_*) from the source dashboard\n // from persisting and incorrectly filtering data on the target dashboard.\n clearAllGlobalFilters();\n\n setNotFound(false);\n\n // Fetch dashboard from backend\n fetchDashboard(dashboardId).then((dashboard) => {\n if (dashboard) {\n // Set the first page as current page\n if (dashboard.pages && dashboard.pages.length > 0) {\n setCurrentPageId(dashboard.pages[0].id);\n }\n } else {\n // Dashboard not found\n setNotFound(true);\n }\n });\n\n // Cleanup\n return () => {\n setCurrentDashboard(null);\n clearAllGlobalFilters();\n setNotFound(false);\n };\n }, [dashboardId, navigate, fetchDashboard, setCurrentDashboard, clearAllGlobalFilters]);\n\n // Load drilldown context from URL and apply to global filters\n useEffect(() => {\n if (!isInDrilldown) return;\n\n // Get context params from URL (ctx_* params)\n const contextParams = getContextFromUrl();\n const drilldownMeta = getDrilldownMetadata();\n\n // Apply context to dashboard state (available for widgets to use)\n // Store as special filter values that widgets can reference\n Object.entries(contextParams).forEach(([key, value]) => {\n // Store context params as global filter values with ctx_ prefix for clarity\n setGlobalFilterValue(`ctx_${key}`, value);\n });\n\n // Store drilldown metadata as special values\n if (drilldownMeta.depth > 0) {\n setGlobalFilterValue('__drilldown_depth', drilldownMeta.depth);\n setGlobalFilterValue('__drilldown_parent', drilldownMeta.parent);\n setGlobalFilterValue('__drilldown_path', drilldownMeta.path);\n }\n\n // Log for debugging\n if (Object.keys(contextParams).length > 0) {\n console.debug('[DashboardViewPage] Loaded drilldown context:', {\n context: contextParams,\n metadata: drilldownMeta,\n });\n }\n }, [isInDrilldown, getContextFromUrl, getDrilldownMetadata, setGlobalFilterValue]);\n\n // Handle save - batch update widget positions and dashboard metadata\n const handleSave = useCallback(async () => {\n if (!dashboardId) return;\n\n setIsSaving(true);\n try {\n // Get all widgets and their positions\n const widgetList = Array.from(widgets.values());\n if (widgetList.length > 0) {\n const positionUpdates = widgetList.map((widget) => ({\n id: widget.id,\n position: widget.position,\n }));\n\n await batchUpdatePositions(positionUpdates);\n }\n\n // Update dashboard metadata if needed\n if (currentDashboard) {\n await updateDashboard({\n id: dashboardId,\n name: currentDashboard.name,\n description: currentDashboard.description,\n });\n }\n } catch (error) {\n } finally {\n setIsSaving(false);\n }\n }, [dashboardId, widgets, currentDashboard, batchUpdatePositions, updateDashboard]);\n\n // Navigate back to the dashboards list\n const handleBack = useCallback(() => {\n navigate('/dashboards');\n }, [navigate]);\n\n // Handle page change\n const handlePageChange = useCallback((pageId: string) => {\n setCurrentPageId(pageId);\n }, []);\n\n // Handle paste widget from clipboard\n const handlePaste = useCallback(async () => {\n const pageId = currentPageId || currentDashboard?.pages?.[0]?.id;\n if (!clipboardWidgetId || !dashboardId || !pageId) {\n return;\n }\n\n const sourceWidget = widgets.get(clipboardWidgetId);\n if (!sourceWidget) {\n clearClipboard();\n return;\n }\n\n // Calculate new position (place at bottom of existing widgets)\n const widgetsArray = Array.from(widgets.values());\n const maxY = widgetsArray.reduce((max, w) => {\n const widgetBottom = (w.positionY ?? 0) + (w.positionHeight ?? 4);\n return Math.max(max, widgetBottom);\n }, 0);\n\n const newPosition = {\n x: 0,\n y: maxY,\n width: sourceWidget.positionWidth ?? 4,\n height: sourceWidget.positionHeight ?? 4,\n };\n\n const newTitle = clipboardAction === 'copy' ? `${sourceWidget.title} (Copy)` : sourceWidget.title;\n\n let newWidget = null;\n\n // Try duplicateWidget API first\n try {\n newWidget = await duplicateWidgetMutation(clipboardWidgetId, newPosition, newTitle);\n } catch (err) {}\n\n // Fallback: Create new widget with source widget's data\n if (!newWidget) {\n newWidget = await createWidgetMutation({\n pageId,\n dashboardId,\n type: sourceWidget.type,\n title: newTitle,\n description: sourceWidget.description,\n // v2.0: Data source fields (DataSink → Parser → Widget)\n dataSinkId: (sourceWidget as unknown as Record<string, string | undefined>).dataSinkId,\n datasetId: (sourceWidget as unknown as Record<string, string | undefined>).datasetId,\n parserId: (sourceWidget as unknown as Record<string, string | undefined>).parserId,\n parserRules: (sourceWidget as unknown as Record<string, string | undefined>).parserRules,\n config: sourceWidget.config || {},\n position: newPosition,\n refreshInterval: sourceWidget.refreshInterval ?? undefined,\n metadata: sourceWidget.metadata,\n });\n }\n\n if (newWidget) {\n selectWidget(newWidget.id);\n\n // If cut action, delete the original widget from backend\n if (clipboardAction === 'cut') {\n await deleteWidgetMutation(clipboardWidgetId);\n }\n }\n\n clearClipboard();\n }, [\n clipboardWidgetId,\n clipboardAction,\n dashboardId,\n currentPageId,\n currentDashboard,\n widgets,\n duplicateWidgetMutation,\n createWidgetMutation,\n deleteWidgetMutation,\n selectWidget,\n clearClipboard,\n ]);\n\n // Handle export\n const handleExport = useCallback(() => {\n setIsExportDialogOpen(true);\n }, []);\n\n const handleExportClose = useCallback(() => {\n setIsExportDialogOpen(false);\n }, []);\n\n // ============================================================================\n // Page Management Callbacks\n // ============================================================================\n\n // Handle adding a new page\n const handlePageAdd = useCallback(async () => {\n if (!currentDashboard || !dashboardId) return;\n\n const newPageCount = (currentDashboard.pages?.length || 0) + 1;\n const newPageName = `Page ${newPageCount}`;\n\n // Call GraphQL mutation to create page\n // Note: 'order' is not available for create - backend auto-assigns order\n const newPage = await createPageMutation({\n dashboardId,\n name: newPageName,\n });\n\n if (newPage) {\n // Update local state with the created page\n setCurrentDashboard({\n ...currentDashboard,\n pages: [...(currentDashboard.pages || []), newPage],\n });\n\n // Switch to the new page\n setCurrentPageId(newPage.id);\n }\n }, [currentDashboard, dashboardId, setCurrentDashboard, createPageMutation]);\n\n // Handle renaming a page\n const handlePageRename = useCallback(\n async (pageId: string, newName: string) => {\n if (!currentDashboard) return;\n\n // Call GraphQL mutation to update page\n const updatedPage = await updatePageMutation({\n id: pageId,\n name: newName,\n });\n\n if (updatedPage) {\n setCurrentDashboard({\n ...currentDashboard,\n pages: currentDashboard.pages?.map((page) => (page.id === pageId ? { ...page, name: newName } : page)),\n });\n }\n },\n [currentDashboard, setCurrentDashboard, updatePageMutation]\n );\n\n // Handle duplicating a page\n const handlePageDuplicate = useCallback(\n async (pageId: string) => {\n if (!currentDashboard || !dashboardId) return;\n\n const sourcePage = currentDashboard.pages?.find((p) => p.id === pageId);\n if (!sourcePage) return;\n\n // Call GraphQL mutation to create a copy of the page\n // Note: 'order' is not available for create - backend auto-assigns order\n const newPage = await createPageMutation({\n dashboardId,\n name: `${sourcePage.name} (Copy)`,\n });\n\n if (newPage) {\n setCurrentDashboard({\n ...currentDashboard,\n pages: [...(currentDashboard.pages || []), newPage],\n });\n\n setCurrentPageId(newPage.id);\n }\n // Note: Widget duplication would require additional backend support\n },\n [currentDashboard, dashboardId, setCurrentDashboard, createPageMutation]\n );\n\n // Handle deleting a page\n const handlePageDelete = useCallback(\n async (pageId: string) => {\n if (!currentDashboard || (currentDashboard.pages?.length || 0) <= 1) return;\n\n // Call GraphQL mutation to delete page\n const success = await deletePageMutation(pageId);\n\n if (success) {\n const updatedPages = currentDashboard.pages\n ?.filter((p) => p.id !== pageId)\n .map((p, index) => ({ ...p, order: index }));\n\n setCurrentDashboard({\n ...currentDashboard,\n pages: updatedPages,\n });\n\n // Switch to first page if current page was deleted\n if (currentPageId === pageId) {\n setCurrentPageId(updatedPages?.[0]?.id || null);\n }\n }\n },\n [currentDashboard, setCurrentDashboard, currentPageId, deletePageMutation]\n );\n\n // Handle reordering pages\n const handlePagesReorder = useCallback(\n async (reorderedPages: Array<{ id: string; name?: string; order?: number }>) => {\n if (!currentDashboard || !dashboardId) return;\n\n // Update local state optimistically\n setCurrentDashboard({\n ...currentDashboard,\n pages: reorderedPages.map((page, index) => ({\n ...page,\n order: index,\n })),\n });\n\n // Call GraphQL mutation to persist the reorder\n const pageIds = reorderedPages.map((p) => p.id);\n await reorderPagesMutation(dashboardId, pageIds);\n },\n [currentDashboard, dashboardId, setCurrentDashboard, reorderPagesMutation]\n );\n\n // Error state\n if (error) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full\" style={{ padding: 'var(--space-pagePadding)' }}>\n <div className=\"bg-status-error-bg border border-status-error-border rounded-lg p-6 w-full max-w-md\">\n <h3 className=\"text-lg font-medium text-status-error-text mb-2\">Error loading dashboard</h3>\n <p className=\"text-sm text-text-secondary mb-4 break-words\">{error.message}</p>\n <div className=\"flex flex-wrap gap-3\">\n <button\n type=\"button\"\n onClick={() => fetchDashboard(dashboardId!)}\n className=\"px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md\"\n >\n Retry\n </button>\n <button\n type=\"button\"\n onClick={() => navigate('/dashboards')}\n className=\"px-4 py-2 text-sm font-medium text-text-secondary bg-bg-sunken hover:bg-bg-sunken/80 rounded-md\"\n >\n Back to Dashboards\n </button>\n </div>\n </div>\n </div>\n );\n }\n\n // Not found state\n if (notFound) {\n return (\n <div className=\"flex flex-col items-center justify-center h-full\" style={{ padding: 'var(--space-pagePadding)' }}>\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"Dashboard not found\"\n description={\n <>\n The dashboard you&apos;re looking for doesn&apos;t exist or has been deleted.\n <span className=\"mt-2 block font-mono text-xs text-text-tertiary break-all\">ID: {dashboardId}</span>\n </>\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigate('/dashboards')}\n className=\"px-4 py-2 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md\"\n >\n Back to Dashboards\n </button>\n }\n />\n </div>\n );\n }\n\n // Loading state\n if (loading || !currentDashboard) {\n return (\n <div className=\"flex items-center justify-center h-full\">\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full\" />\n <p className=\"text-sm text-text-secondary\">Loading dashboard...</p>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"h-full flex flex-col overflow-hidden\">\n {/* Page header with back navigation - visible in both view and edit modes */}\n <div className=\"flex items-center gap-3 px-3 py-2 border-b border-border-default bg-bg-surface flex-shrink-0\">\n <Button\n onClick={handleBack}\n variant=\"ghost\"\n size=\"sm\"\n title=\"Back to Dashboards\"\n aria-label=\"Back to Dashboards\"\n >\n <ArrowLeft className=\"w-4 h-4 mr-2\" />\n Back\n </Button>\n <h2 className=\"text-sm font-semibold text-text-primary truncate\">{currentDashboard.name}</h2>\n </div>\n\n {/* Drilldown Breadcrumb - shown when navigating via drilldown */}\n {isInDrilldown && (\n <DrilldownBreadcrumb\n currentDashboardId={currentDashboard.id}\n currentDashboardName={currentDashboard.name}\n basePath=\"/bigconsole/dashboards\"\n />\n )}\n\n {/* Dashboard Canvas with Page Tabs */}\n <div className=\"flex-1 min-w-0 overflow-hidden\">\n <DashboardCanvas\n dashboardId={currentDashboard.id}\n pageId={currentPageId || currentDashboard.pages?.[0]?.id}\n title={currentDashboard.name}\n onPaste={handlePaste}\n onSave={handleSave}\n isSaving={isSaving}\n onExport={handleExport}\n // Page tabs props\n pages={(currentDashboard.pages || []).map((page, index) => ({\n id: page.id,\n name: page.name || `Page ${index + 1}`,\n order: page.order ?? 0,\n }))}\n activePageId={currentPageId || currentDashboard.pages?.[0]?.id}\n onPageChange={handlePageChange}\n onPageAdd={handlePageAdd}\n onPageRename={handlePageRename}\n onPageDuplicate={handlePageDuplicate}\n onPageDelete={handlePageDelete}\n onPagesReorder={handlePagesReorder}\n showPageTabs={true}\n />\n </div>\n\n {/* Export Dashboard Dialog */}\n <ExportDashboardDialog\n isOpen={isExportDialogOpen}\n dashboardId={currentDashboard.id}\n dashboardName={currentDashboard.name}\n onClose={handleExportClose}\n />\n </div>\n );\n});\n\nexport default DashboardViewPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,IAAa,IAAwB,EAAK,WAA6B;CACrE,IAAM,EAAE,mBAAgB,GAAoC,EACtD,IAAW,GAAuB,EAClC,CAAC,GAAe,KAAoB,EAAwB,KAAK,EACjE,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAoB,KAAyB,EAAS,GAAM,EAG7D,EAAE,kBAAe,sBAAmB,4BAAyB,GAAkB,EAG/E,IAAmB,GAAmB,MAAU,EAAM,iBAAiB,EACvE,IAAsB,GAAmB,MAAU,EAAM,oBAAoB,EAC7E,IAAuB,GAAmB,MAAU,EAAM,qBAAqB,EAC/E,IAAwB,GAAmB,MAAU,EAAM,sBAAsB,EACjF,IAAU,GAAgB,MAAU,EAAM,QAAQ,EAClD,IAAoB,GAAgB,MAAU,EAAM,kBAAkB,EACtE,IAAkB,GAAgB,MAAU,EAAM,gBAAgB,EAClE,IAAiB,GAAgB,MAAU,EAAM,eAAe,EAChE,IAAe,GAAgB,MAAU,EAAM,aAAa,EAG5D,EAAE,YAAS,UAAO,mBAAgB,uBAAoB,GAAwB,EAG9E,EACJ,cAAc,GACd,cAAc,GACd,iBAAiB,GACjB,4BACE,EAAoB,KAAiB,KAAA,GAAW,EAAY,EAG1D,EACJ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,cAAc,MACZ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