@burdenoff/microfe-bigconsole 2026.1010.12 → 2026.1012.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/README.md +19 -0
- package/dist/bigconsole/BigConsoleRoot.js +88 -82
- package/dist/bigconsole/BigConsoleRoutes.js +163 -136
- package/dist/bigconsole/assistant/assistantProduct.js +1 -4
- package/dist/bigconsole/assistant/pageContext.d.ts +0 -14
- package/dist/bigconsole/assistant/pageContext.js +1 -6
- package/dist/bigconsole/assistant/recordAdapters.js +26 -27
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
- package/dist/bigconsole/components/common/index.d.ts +0 -1
- package/dist/bigconsole/components/common/index.js +0 -1
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +58 -57
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +110 -110
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +164 -173
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +165 -163
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
- package/dist/bigconsole/components/datasink/DataSinkCard.js +50 -51
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
- package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
- package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
- package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +76 -77
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -96
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +499 -507
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +0 -1
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
- package/dist/bigconsole/components/widgets/custom/CustomWidget.js +73 -131
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
- package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
- package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.d.ts +28 -9
- package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js +115 -42
- package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.d.ts +20 -0
- package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.js +10 -0
- package/dist/bigconsole/components/widgets/iframe-widget/index.d.ts +2 -1
- package/dist/bigconsole/components/widgets/iframe-widget/index.js +3 -2
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
- package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
- package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
- package/dist/bigconsole/components/widgets/text-widget/TextWidget.js +110 -27
- package/dist/bigconsole/components/widgets/text-widget/textData.d.ts +6 -0
- package/dist/bigconsole/components/widgets/text-widget/textData.js +17 -14
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
- package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
- package/dist/bigconsole/context/BigConsoleContext.d.ts +10 -0
- package/dist/bigconsole/context/BigConsoleContext.js +47 -30
- package/dist/bigconsole/context/index.d.ts +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +58 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +74 -72
- package/dist/bigconsole/customWidget/proposalPreview.d.ts +5 -0
- package/dist/bigconsole/customWidget/proposalPreview.js +31 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +0 -23
- package/dist/bigconsole/hooks/useDataSinkAlerts.js +113 -138
- package/dist/bigconsole/hooks/useDataSinkOperations.d.ts +7 -0
- package/dist/bigconsole/hooks/useDataSinkOperations.js +109 -98
- package/dist/bigconsole/hooks/useDataSinkSubscription.js +0 -1
- package/dist/bigconsole/hooks/useDrilldown.js +68 -67
- package/dist/bigconsole/hooks/useExportDataSink.js +1 -1
- package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
- package/dist/bigconsole/hooks/useImportDataSink.js +102 -90
- package/dist/bigconsole/pages/AdminPage.js +130 -130
- package/dist/bigconsole/pages/DashboardBuilderPage.js +60 -72
- package/dist/bigconsole/pages/DashboardViewPage.js +235 -258
- package/dist/bigconsole/pages/DashboardsPage.js +221 -269
- package/dist/bigconsole/pages/DataParsersPage.js +157 -180
- package/dist/bigconsole/pages/DataSinkAlertsPage.js +55 -62
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +318 -295
- package/dist/bigconsole/pages/DataSinkViewPage.js +256 -255
- package/dist/bigconsole/pages/DataSinksPage.js +216 -251
- package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
- package/dist/bigconsole/pages/InsightsPage.js +265 -279
- package/dist/bigconsole/pages/OverviewPage.js +47 -47
- package/dist/bigconsole/pages/ParserBuilderPage.js +213 -229
- package/dist/bigconsole/pages/ParserViewPage.js +97 -97
- package/dist/bigconsole/pages/PipelineBuilderPage.js +214 -256
- package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
- package/dist/bigconsole/pages/PipelinesPage.js +88 -107
- package/dist/bigconsole/pages/SettingsPage.js +173 -179
- package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
- package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +235 -122
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.d.ts +6 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +151 -151
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
- package/dist/bigconsole/renderers/adapters/adaptiveCardContent.d.ts +29 -0
- package/dist/bigconsole/renderers/adapters/adaptiveCardContent.js +51 -0
- package/dist/bigconsole/store/widgetStore.d.ts +0 -12
- package/dist/bigconsole/store/widgetStore.js +1 -3
- package/dist/bigconsole/types/index.d.ts +17 -2
- package/dist/bigconsole/utils/backendError.d.ts +0 -18
- package/dist/bigconsole/utils/dataSinkPayload.d.ts +48 -0
- package/dist/bigconsole/utils/dataSinkPayload.js +38 -0
- package/dist/bigconsole/utils/index.d.ts +2 -0
- package/dist/bigconsole/utils/safeUrl.d.ts +79 -0
- package/dist/bigconsole/utils/safeUrl.js +93 -0
- package/dist/bigconsole/utils/sanitizeHtml.d.ts +16 -0
- package/dist/bigconsole/utils/sanitizeHtml.js +67 -0
- package/dist/bigconsole/workflowOpen.js +14 -15
- package/dist/generated/wspace-operations.d.ts +138 -8
- package/dist/generated/wspace-operations.js +281 -240
- package/dist/node_modules/dompurify/dist/purify.es.js +800 -0
- package/package.json +9 -5
- package/dist/bigconsole/assistant/displayCopy.d.ts +0 -32
- package/dist/bigconsole/assistant/pageControls.d.ts +0 -81
- package/dist/bigconsole/assistant/pageControls.js +0 -169
- package/dist/bigconsole/assistant/previewControl.d.ts +0 -16
- package/dist/bigconsole/assistant/previewControl.js +0 -10
- package/dist/bigconsole/assistant/usePreviewControl.d.ts +0 -2
- package/dist/bigconsole/assistant/usePreviewControl.js +0 -20
- package/dist/bigconsole/components/common/SortBySelect.d.ts +0 -11
- package/dist/bigconsole/components/common/SortBySelect.js +0 -29
- package/dist/bigconsole/constants/backendErrors.js +0 -94
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +0 -14
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +0 -32
- package/dist/bigconsole/utils/backendError.js +0 -42
- package/dist/bigconsole/utils/dashboardList.d.ts +0 -28
- package/dist/bigconsole/utils/dashboardList.js +0 -15
- package/dist/bigconsole/utils/dataSinkList.d.ts +0 -15
- package/dist/bigconsole/utils/dataSinkList.js +0 -15
- package/dist/bigconsole/utils/formDirty.d.ts +0 -82
- package/dist/bigconsole/utils/formDirty.js +0 -21
- package/dist/bigconsole/utils/insightsDraft.d.ts +0 -29
- package/dist/bigconsole/utils/insightsDraft.js +0 -8
- package/dist/bigconsole/utils/layoutBaseline.d.ts +0 -130
- package/dist/bigconsole/utils/layoutBaseline.js +0 -96
- package/dist/bigconsole/utils/listSort.d.ts +0 -80
- package/dist/bigconsole/utils/listSort.js +0 -85
- package/dist/bigconsole/utils/widgetFormDirty.d.ts +0 -16
- package/dist/bigconsole/utils/widgetFormDirty.js +0 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useDataSinkStore as e } from "../store/dataSinkStore.js";
|
|
2
|
-
import { BatchCreateDataSinksDocument as t, BatchDeleteDataSinksDocument as n, CreateDataSinkDocument as r, DeleteDataSinkDocument as i, GetDataSinkDataDocument as a, GetDataSinkDocument as o,
|
|
3
|
-
import { createBigConsoleQuotaError as
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { useApolloClient as
|
|
2
|
+
import { BatchCreateDataSinksDocument as t, BatchDeleteDataSinksDocument as n, CreateDataSinkDocument as r, DeleteDataSinkDocument as i, GetDataSinkDataDocument as a, GetDataSinkDocument as o, GetDataSinkPayloadDocument as s, InvalidateDataSinkCacheDocument as c, ListDataSinksDocument as l, RefreshDataSinkDocument as u, UpdateDataSinkDocument as d } from "../../generated/wspace-operations.js";
|
|
3
|
+
import { createBigConsoleQuotaError as f, isBigConsoleQuotaError as p } from "../utils/quota.js";
|
|
4
|
+
import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
|
|
5
|
+
import { useApolloClient as v } from "@apollo/client/react";
|
|
6
6
|
//#region src/bigconsole/hooks/useDataSinkOperations.ts
|
|
7
|
-
function
|
|
7
|
+
function y(e) {
|
|
8
8
|
let t = e;
|
|
9
9
|
return {
|
|
10
10
|
id: t.id,
|
|
@@ -16,7 +16,6 @@ function v(e) {
|
|
|
16
16
|
fluidGridsWorkflowId: t.fluidGridsWorkflowId || null,
|
|
17
17
|
fluidGridsWorkflowExecutionId: t.fluidGridsWorkflowExecutionId || null,
|
|
18
18
|
config: t.config || null,
|
|
19
|
-
data: t.data || {},
|
|
20
19
|
dataStats: t.dataStats || null,
|
|
21
20
|
lastRefreshedAt: t.lastRefreshedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
22
21
|
lastRefreshedBy: t.lastRefreshedBy || null,
|
|
@@ -47,46 +46,57 @@ function v(e) {
|
|
|
47
46
|
deletedBy: t.deletedBy || null
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
|
-
function
|
|
51
|
-
let { workspaceId:
|
|
49
|
+
function b(b = {}) {
|
|
50
|
+
let { workspaceId: x, skipFetch: S = !1 } = b, [C, w] = _(!1), [T, E] = _(null), D = v(), O = e((e) => e.dataSinks), k = e((e) => e.setDataSinks), A = e((e) => e.addDataSink), j = e((e) => e.updateDataSink), M = e((e) => e.removeDataSink), N = e((e) => e.setDataSinkRefreshing), P = g(() => Array.from(O.values()), [O]), F = m(async (e) => {
|
|
52
51
|
try {
|
|
53
|
-
|
|
54
|
-
let t = ((await
|
|
55
|
-
query:
|
|
52
|
+
w(!0), E(null), k([]);
|
|
53
|
+
let t = ((await D.query({
|
|
54
|
+
query: l,
|
|
56
55
|
variables: {
|
|
57
56
|
status: e?.status,
|
|
58
57
|
isActive: e?.isActive,
|
|
59
58
|
search: e?.search
|
|
60
59
|
},
|
|
61
60
|
fetchPolicy: "network-only"
|
|
62
|
-
})).data?.listDataSinks?.edges || []).map((e) =>
|
|
63
|
-
return
|
|
61
|
+
})).data?.listDataSinks?.edges || []).map((e) => y(e.node));
|
|
62
|
+
return k(t), t;
|
|
64
63
|
} catch (e) {
|
|
65
|
-
return
|
|
64
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch DataSinks")), k([]), [];
|
|
66
65
|
} finally {
|
|
67
|
-
|
|
66
|
+
w(!1);
|
|
68
67
|
}
|
|
69
|
-
}, [
|
|
68
|
+
}, [D, k]), I = m(async (e) => {
|
|
70
69
|
try {
|
|
71
|
-
|
|
72
|
-
let t = await
|
|
70
|
+
w(!0), E(null);
|
|
71
|
+
let t = await D.query({
|
|
73
72
|
query: o,
|
|
74
73
|
variables: { id: e },
|
|
75
74
|
fetchPolicy: "network-only"
|
|
76
75
|
});
|
|
77
76
|
if (t.data?.getDataSink) {
|
|
78
|
-
let e =
|
|
79
|
-
return
|
|
77
|
+
let e = y(t.data.getDataSink);
|
|
78
|
+
return A(e), e;
|
|
80
79
|
}
|
|
81
80
|
return null;
|
|
82
81
|
} catch (e) {
|
|
83
|
-
return
|
|
82
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch DataSink")), null;
|
|
84
83
|
} finally {
|
|
85
|
-
|
|
84
|
+
w(!1);
|
|
86
85
|
}
|
|
87
|
-
}, [
|
|
86
|
+
}, [D, A]), L = m(async (e) => {
|
|
87
|
+
let t = (await D.query({
|
|
88
|
+
query: s,
|
|
89
|
+
variables: { id: e },
|
|
90
|
+
fetchPolicy: "network-only"
|
|
91
|
+
})).data?.getDataSink;
|
|
92
|
+
return t ? {
|
|
93
|
+
id: t.id,
|
|
94
|
+
version: t.version,
|
|
95
|
+
data: t.data
|
|
96
|
+
} : null;
|
|
97
|
+
}, [D]), R = m(async (e, t) => {
|
|
88
98
|
try {
|
|
89
|
-
return
|
|
99
|
+
return w(!0), E(null), (await D.query({
|
|
90
100
|
query: a,
|
|
91
101
|
variables: {
|
|
92
102
|
id: e.id,
|
|
@@ -100,82 +110,82 @@ function y(y = {}) {
|
|
|
100
110
|
fetchPolicy: "network-only"
|
|
101
111
|
})).data?.getDataSinkData || null;
|
|
102
112
|
} catch (e) {
|
|
103
|
-
return
|
|
113
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to get DataSink data")), null;
|
|
104
114
|
} finally {
|
|
105
|
-
|
|
115
|
+
w(!1);
|
|
106
116
|
}
|
|
107
|
-
}, [
|
|
117
|
+
}, [D]), z = m(async (e) => {
|
|
108
118
|
try {
|
|
109
|
-
|
|
110
|
-
let t = await
|
|
119
|
+
w(!0), E(null);
|
|
120
|
+
let t = await D.mutate({
|
|
111
121
|
mutation: r,
|
|
112
122
|
variables: { input: e }
|
|
113
123
|
});
|
|
114
|
-
if (
|
|
124
|
+
if (p(t)) throw f(t);
|
|
115
125
|
if (t.data?.createDataSink) {
|
|
116
|
-
let e =
|
|
117
|
-
return
|
|
126
|
+
let e = y(t.data.createDataSink);
|
|
127
|
+
return A(e), e;
|
|
118
128
|
}
|
|
119
129
|
return null;
|
|
120
130
|
} catch (e) {
|
|
121
|
-
if (
|
|
122
|
-
return
|
|
131
|
+
if (p(e)) throw e;
|
|
132
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create DataSink")), null;
|
|
123
133
|
} finally {
|
|
124
|
-
|
|
134
|
+
w(!1);
|
|
125
135
|
}
|
|
126
|
-
}, [
|
|
136
|
+
}, [D, A]), B = m(async (e) => {
|
|
127
137
|
try {
|
|
128
|
-
|
|
129
|
-
let t = await
|
|
130
|
-
mutation:
|
|
138
|
+
w(!0), E(null);
|
|
139
|
+
let t = await D.mutate({
|
|
140
|
+
mutation: d,
|
|
131
141
|
variables: { input: e }
|
|
132
142
|
});
|
|
133
143
|
if (t.data?.updateDataSink) {
|
|
134
|
-
let e =
|
|
135
|
-
return
|
|
144
|
+
let e = y(t.data.updateDataSink);
|
|
145
|
+
return j(e.id, e), e;
|
|
136
146
|
}
|
|
137
147
|
return null;
|
|
138
148
|
} catch (e) {
|
|
139
|
-
return
|
|
149
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to update DataSink")), null;
|
|
140
150
|
} finally {
|
|
141
|
-
|
|
151
|
+
w(!1);
|
|
142
152
|
}
|
|
143
|
-
}, [
|
|
153
|
+
}, [D, j]), V = m(async (e) => {
|
|
144
154
|
try {
|
|
145
|
-
return
|
|
155
|
+
return w(!0), E(null), (await D.mutate({
|
|
146
156
|
mutation: i,
|
|
147
157
|
variables: { id: e }
|
|
148
|
-
})).data?.deleteDataSink ? (
|
|
158
|
+
})).data?.deleteDataSink ? (M(e), !0) : !1;
|
|
149
159
|
} catch (e) {
|
|
150
|
-
return
|
|
160
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete DataSink")), !1;
|
|
151
161
|
} finally {
|
|
152
|
-
|
|
162
|
+
w(!1);
|
|
153
163
|
}
|
|
154
|
-
}, [
|
|
164
|
+
}, [D, M]), H = m(async (e) => {
|
|
155
165
|
try {
|
|
156
|
-
|
|
157
|
-
let t = await
|
|
158
|
-
mutation:
|
|
166
|
+
w(!0), E(null), e.id && N(e.id, !0);
|
|
167
|
+
let t = await D.mutate({
|
|
168
|
+
mutation: u,
|
|
159
169
|
variables: { input: e }
|
|
160
170
|
});
|
|
161
171
|
if (t.data?.refreshDataSink) {
|
|
162
|
-
let e =
|
|
163
|
-
return
|
|
172
|
+
let e = y(t.data.refreshDataSink);
|
|
173
|
+
return j(e.id, e), N(e.id, !1), e;
|
|
164
174
|
}
|
|
165
175
|
return null;
|
|
166
176
|
} catch (t) {
|
|
167
|
-
return
|
|
177
|
+
return E(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to refresh DataSink")), e.id && N(e.id, !1), null;
|
|
168
178
|
} finally {
|
|
169
|
-
|
|
179
|
+
w(!1);
|
|
170
180
|
}
|
|
171
181
|
}, [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
]),
|
|
182
|
+
D,
|
|
183
|
+
j,
|
|
184
|
+
N
|
|
185
|
+
]), U = m(async (e) => {
|
|
176
186
|
try {
|
|
177
|
-
return
|
|
178
|
-
mutation:
|
|
187
|
+
return w(!0), E(null), (await D.mutate({
|
|
188
|
+
mutation: c,
|
|
179
189
|
variables: { id: e }
|
|
180
190
|
})).data?.invalidateDataSinkCache || {
|
|
181
191
|
count: 0,
|
|
@@ -184,66 +194,67 @@ function y(y = {}) {
|
|
|
184
194
|
};
|
|
185
195
|
} catch (e) {
|
|
186
196
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to invalidate cache");
|
|
187
|
-
return
|
|
197
|
+
return E(t), {
|
|
188
198
|
count: 0,
|
|
189
199
|
invalidatedIds: [],
|
|
190
200
|
success: !1,
|
|
191
201
|
message: t.message
|
|
192
202
|
};
|
|
193
203
|
} finally {
|
|
194
|
-
|
|
204
|
+
w(!1);
|
|
195
205
|
}
|
|
196
|
-
}, [
|
|
206
|
+
}, [D, x]), W = m(async (e) => {
|
|
197
207
|
try {
|
|
198
|
-
|
|
199
|
-
let n = await
|
|
208
|
+
w(!0), E(null);
|
|
209
|
+
let n = await D.mutate({
|
|
200
210
|
mutation: t,
|
|
201
211
|
variables: { inputs: e }
|
|
202
212
|
});
|
|
203
213
|
if (n.data?.batchCreateDataSinks) {
|
|
204
|
-
let e = n.data.batchCreateDataSinks.map(
|
|
205
|
-
return e.forEach(
|
|
214
|
+
let e = n.data.batchCreateDataSinks.map(y);
|
|
215
|
+
return e.forEach(A), e;
|
|
206
216
|
}
|
|
207
217
|
return [];
|
|
208
218
|
} catch (e) {
|
|
209
|
-
return
|
|
219
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to batch create DataSinks")), [];
|
|
210
220
|
} finally {
|
|
211
|
-
|
|
221
|
+
w(!1);
|
|
212
222
|
}
|
|
213
|
-
}, [
|
|
223
|
+
}, [D, A]), G = m(async (e) => {
|
|
214
224
|
try {
|
|
215
|
-
|
|
216
|
-
let t = await
|
|
225
|
+
w(!0), E(null);
|
|
226
|
+
let t = await D.mutate({
|
|
217
227
|
mutation: n,
|
|
218
228
|
variables: { ids: e }
|
|
219
229
|
});
|
|
220
|
-
return t.data?.batchDeleteDataSinks ? (e.forEach(
|
|
230
|
+
return t.data?.batchDeleteDataSinks ? (e.forEach(M), t.data.batchDeleteDataSinks) : [];
|
|
221
231
|
} catch (e) {
|
|
222
|
-
return
|
|
232
|
+
return E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to batch delete DataSinks")), [];
|
|
223
233
|
} finally {
|
|
224
|
-
|
|
234
|
+
w(!1);
|
|
225
235
|
}
|
|
226
|
-
}, [
|
|
227
|
-
await
|
|
228
|
-
}, [
|
|
229
|
-
return
|
|
230
|
-
|
|
231
|
-
}, [
|
|
232
|
-
loading:
|
|
233
|
-
error:
|
|
234
|
-
dataSinks:
|
|
235
|
-
fetchDataSinks:
|
|
236
|
-
fetchDataSink:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
236
|
+
}, [D, M]), K = m(async () => {
|
|
237
|
+
await F();
|
|
238
|
+
}, [F]);
|
|
239
|
+
return h(() => {
|
|
240
|
+
S || F();
|
|
241
|
+
}, [S, F]), {
|
|
242
|
+
loading: C,
|
|
243
|
+
error: T,
|
|
244
|
+
dataSinks: P,
|
|
245
|
+
fetchDataSinks: F,
|
|
246
|
+
fetchDataSink: I,
|
|
247
|
+
fetchDataSinkPayload: L,
|
|
248
|
+
getDataSinkData: R,
|
|
249
|
+
createDataSink: z,
|
|
250
|
+
updateDataSink: B,
|
|
251
|
+
deleteDataSink: V,
|
|
252
|
+
refreshDataSink: H,
|
|
253
|
+
invalidateCache: U,
|
|
254
|
+
batchCreateDataSinks: W,
|
|
255
|
+
batchDeleteDataSinks: G,
|
|
256
|
+
refetch: K
|
|
246
257
|
};
|
|
247
258
|
}
|
|
248
259
|
//#endregion
|
|
249
|
-
export {
|
|
260
|
+
export { b as default };
|
|
@@ -18,7 +18,6 @@ function c(e) {
|
|
|
18
18
|
fluidGridsWorkflowId: e.fluidGridsWorkflowId || null,
|
|
19
19
|
fluidGridsWorkflowExecutionId: e.fluidGridsWorkflowExecutionId || null,
|
|
20
20
|
config: e.config || null,
|
|
21
|
-
data: e.data || {},
|
|
22
21
|
dataStats: e.dataStats || null,
|
|
23
22
|
lastRefreshedAt: e.lastRefreshedAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
24
23
|
lastRefreshedBy: e.lastRefreshedBy || null,
|
|
@@ -4,17 +4,18 @@ import "../store/index.js";
|
|
|
4
4
|
import { GetDrilldownTargetDashboardDocument as n } from "../../generated/wspace-operations.js";
|
|
5
5
|
import { useBigConsoleBasePath as r, useBigConsoleNavigate as i } from "../context/BigConsoleContext.js";
|
|
6
6
|
import "../context/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { appendPathSegment as a } from "../utils/safeUrl.js";
|
|
8
|
+
import { PAGE_PARAM as o } from "./useActivePage.js";
|
|
9
|
+
import { useCallback as s } from "react";
|
|
10
10
|
import { useApolloClient as c } from "@apollo/client/react";
|
|
11
|
-
import {
|
|
11
|
+
import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { toast as u } from "sonner";
|
|
12
13
|
//#region src/bigconsole/hooks/useDrilldown.ts
|
|
13
|
-
var
|
|
14
|
+
var d = "ctx_", f = "filter_", p = "drilldown_", m = "__targetPageId", h = [
|
|
14
15
|
"org",
|
|
15
16
|
"workspace",
|
|
16
17
|
"project"
|
|
17
|
-
],
|
|
18
|
+
], g = new Set([
|
|
18
19
|
"selectedData",
|
|
19
20
|
"selectedRow",
|
|
20
21
|
"selectedPoint",
|
|
@@ -24,12 +25,12 @@ var u = "ctx_", d = "filter_", f = "drilldown_", p = "__targetPageId", m = [
|
|
|
24
25
|
"widgetData",
|
|
25
26
|
"metadata"
|
|
26
27
|
]);
|
|
27
|
-
function
|
|
28
|
+
function _(e, t) {
|
|
28
29
|
if (t.startsWith("$.")) {
|
|
29
30
|
let n = t.slice(2).split(".");
|
|
30
31
|
if (n.length >= 1 && e && typeof e == "object" && "selectedData" in e) {
|
|
31
32
|
let t = e.selectedData, r = n[0];
|
|
32
|
-
if (!
|
|
33
|
+
if (!g.has(r) && t && typeof t == "object" && r in t) {
|
|
33
34
|
let e = t;
|
|
34
35
|
for (let t of n) {
|
|
35
36
|
if (e == null) return;
|
|
@@ -77,10 +78,10 @@ function g(e, t) {
|
|
|
77
78
|
}
|
|
78
79
|
return t;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function v(e) {
|
|
81
82
|
return e == null ? "" : encodeURIComponent(typeof e == "object" ? JSON.stringify(e) : String(e));
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function y(e) {
|
|
84
85
|
if (!e) return;
|
|
85
86
|
let t = decodeURIComponent(e);
|
|
86
87
|
try {
|
|
@@ -89,23 +90,23 @@ function v(e) {
|
|
|
89
90
|
return t;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
let { basePath:
|
|
94
|
-
let e = new URLSearchParams(window.location.search), t = e.get(`${
|
|
93
|
+
function b(g = {}) {
|
|
94
|
+
let { basePath: b = "/dashboards", onDrilldown: x, onModalOpen: S, onMaxDepthReached: C } = g, w = i(), T = r(), E = c(), { t: D } = l(), O = t((e) => e.openModal), k = t((e) => e.pushDrilldown), A = t((e) => e.isOpen), j = t((e) => e.dashboardId), M = s(() => {
|
|
95
|
+
let e = new URLSearchParams(window.location.search), t = e.get(`${p}depth`), n = e.get(`${p}parent`), r = e.get(`${p}path`);
|
|
95
96
|
return {
|
|
96
97
|
depth: t ? parseInt(t, 10) : 0,
|
|
97
98
|
parent: n || null,
|
|
98
99
|
path: r ? JSON.parse(decodeURIComponent(r)) : []
|
|
99
100
|
};
|
|
100
|
-
}, []),
|
|
101
|
+
}, []), N = s(() => {
|
|
101
102
|
let e = new URLSearchParams(window.location.search), t = {};
|
|
102
103
|
return e.forEach((e, n) => {
|
|
103
104
|
if (n.startsWith("ctx_")) {
|
|
104
105
|
let r = n.slice(4);
|
|
105
|
-
t[r] =
|
|
106
|
+
t[r] = y(e);
|
|
106
107
|
}
|
|
107
108
|
}), t;
|
|
108
|
-
}, []),
|
|
109
|
+
}, []), P = s((e, t) => {
|
|
109
110
|
let n = {}, r = {
|
|
110
111
|
selectedData: t.selectedData || {},
|
|
111
112
|
selectedRow: t.selectedData || {},
|
|
@@ -124,27 +125,27 @@ function y(h = {}) {
|
|
|
124
125
|
for (let [t, a] of Object.entries(e)) if (typeof a == "string") {
|
|
125
126
|
let e = a.startsWith("$."), o = /^\{\{.+\}\}$/.test(a);
|
|
126
127
|
if (e || o) {
|
|
127
|
-
let e =
|
|
128
|
+
let e = _(r, a);
|
|
128
129
|
e === void 0 ? i.push(`${t}="${a}"`) : n[t] = e;
|
|
129
130
|
} else n[t] = a;
|
|
130
131
|
} else n[t] = a;
|
|
131
132
|
if (i.length > 0 && console.warn("[useDrilldown] Drilldown parameterMapping path(s) failed to resolve from the clicked context:", i.join(", "), "— available selectedData keys:", t.selectedData ? Object.keys(t.selectedData).join(", ") : "(none)"), Object.keys(n).length === 0 && t.selectedData && Object.keys(t.selectedData).length > 0) for (let [e, r] of Object.entries(t.selectedData)) e.startsWith("_") || e.startsWith("__") || r != null && (typeof r == "string" || typeof r == "number" || typeof r == "boolean" || Array.isArray(r) && r.every((e) => typeof e != "object")) && (n[e] = r);
|
|
132
133
|
return n;
|
|
133
|
-
}, []),
|
|
134
|
-
let
|
|
135
|
-
for (let e of
|
|
136
|
-
let t =
|
|
137
|
-
t &&
|
|
134
|
+
}, []), F = s((e, t, n, r, i) => {
|
|
135
|
+
let s = new URL(a(b, e) ?? b, window.location.origin), c = new URLSearchParams(window.location.search);
|
|
136
|
+
for (let e of h) {
|
|
137
|
+
let t = c.get(e);
|
|
138
|
+
t && s.searchParams.set(e, t);
|
|
138
139
|
}
|
|
139
|
-
i &&
|
|
140
|
-
for (let [e, n] of Object.entries(t)) n != null &&
|
|
141
|
-
for (let [e, t] of Object.entries(n)) t != null &&
|
|
142
|
-
return
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
}, [
|
|
140
|
+
i && s.searchParams.set(o, i);
|
|
141
|
+
for (let [e, n] of Object.entries(t)) n != null && s.searchParams.set(`${d}${e}`, v(n));
|
|
142
|
+
for (let [e, t] of Object.entries(n)) t != null && s.searchParams.set(`${f}${e}`, v(t));
|
|
143
|
+
return s.searchParams.set(`${p}depth`, String(r.depth)), r.parent && s.searchParams.set(`${p}parent`, r.parent), r.path.length > 0 && s.searchParams.set(`${p}path`, encodeURIComponent(JSON.stringify(r.path))), s.pathname + s.search;
|
|
144
|
+
}, [b]), I = s((e) => !!(e.drilldown?.enabled && e.drilldown?.targetDashboardId), []), L = s((e, t) => t < (e.maxDepth ?? 3), []), R = s(() => {
|
|
145
|
+
u.warning(D("bigconsole.widget.drilldown.targetUnavailableToast", "This drilldown target is no longer available"), { description: D("bigconsole.widget.drilldown.targetUnavailableToastHelp", "It may have been deleted, archived, or unshared. Ask the dashboard owner to update the drilldown.") });
|
|
146
|
+
}, [D]), z = s(async (e) => {
|
|
146
147
|
try {
|
|
147
|
-
let t = (await
|
|
148
|
+
let t = (await E.query({
|
|
148
149
|
query: n,
|
|
149
150
|
variables: { id: e },
|
|
150
151
|
fetchPolicy: "network-only"
|
|
@@ -153,85 +154,85 @@ function y(h = {}) {
|
|
|
153
154
|
} catch {
|
|
154
155
|
return !1;
|
|
155
156
|
}
|
|
156
|
-
}, [
|
|
157
|
+
}, [E]), B = s((e) => new URL(`${T}${e}`, window.location.origin).toString(), [T]);
|
|
157
158
|
return {
|
|
158
|
-
executeDrilldown:
|
|
159
|
+
executeDrilldown: s(async (t, n) => {
|
|
159
160
|
if (!t.enabled || !t.targetDashboardId) return;
|
|
160
|
-
let r = n.currentDepth ??
|
|
161
|
+
let r = n.currentDepth ?? M().depth, i = n.currentPath ?? M().path, a = t.maxDepth ?? 3;
|
|
161
162
|
if (r >= a) {
|
|
162
|
-
|
|
163
|
+
C && C(r, a), console.warn(`[useDrilldown] Max drilldown depth (${a}) reached. Navigation blocked.`);
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
|
-
let o = t.targetDashboardId, s = t.targetPageId ?? null, c = n.sourceDashboardId || "", l = o === c,
|
|
166
|
-
if (l && !
|
|
166
|
+
let o = t.targetDashboardId, s = t.targetPageId ?? null, c = n.sourceDashboardId || "", l = o === c, u = A && !!c && c === j;
|
|
167
|
+
if (l && !u) {
|
|
167
168
|
let t = e.getState().currentDashboard?.pages ?? [];
|
|
168
169
|
if (!s || !t.some((e) => e.id === s)) {
|
|
169
|
-
|
|
170
|
+
R();
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
172
|
-
} else if (!l && !await
|
|
173
|
-
|
|
173
|
+
} else if (!l && !await z(o)) {
|
|
174
|
+
R();
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
176
|
-
let f =
|
|
177
|
-
for (let [e, t] of Object.entries(f)) t != null && (
|
|
178
|
-
t.passGlobalFilters && n.globalFilters && Object.assign(
|
|
177
|
+
let f = P(t.parameterMapping || {}, n), p = {};
|
|
178
|
+
for (let [e, t] of Object.entries(f)) t != null && (p[`${d}${e}`] = t);
|
|
179
|
+
t.passGlobalFilters && n.globalFilters && Object.assign(p, n.globalFilters);
|
|
179
180
|
let h = {
|
|
180
181
|
depth: r + 1,
|
|
181
182
|
parent: c,
|
|
182
183
|
path: c ? [...i, c] : i
|
|
183
|
-
}, g =
|
|
184
|
-
|
|
184
|
+
}, g = F(o, f, p, h, s);
|
|
185
|
+
x && x({
|
|
185
186
|
...f,
|
|
186
|
-
...
|
|
187
|
+
...p
|
|
187
188
|
}, t.navigationMode);
|
|
188
189
|
let _ = t.navigationMode;
|
|
189
190
|
if (_ === "NEW_TAB") {
|
|
190
|
-
window.open(
|
|
191
|
+
window.open(B(g), "_blank", "noopener,noreferrer");
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
|
-
if (_ === "MODAL" ||
|
|
194
|
+
if (_ === "MODAL" || u) {
|
|
194
195
|
let e = {
|
|
195
196
|
...f,
|
|
196
|
-
...
|
|
197
|
+
...p,
|
|
197
198
|
__drilldown: h,
|
|
198
|
-
[
|
|
199
|
+
[m]: s
|
|
199
200
|
};
|
|
200
|
-
|
|
201
|
+
A ? k(o, e) : O(o, e), S && S(o, {
|
|
201
202
|
...f,
|
|
202
|
-
...
|
|
203
|
+
...p
|
|
203
204
|
});
|
|
204
205
|
return;
|
|
205
206
|
}
|
|
206
207
|
if (l) {
|
|
207
208
|
let e = g.slice(g.indexOf("?"));
|
|
208
|
-
|
|
209
|
+
w(`${window.location.pathname}${e}`);
|
|
209
210
|
return;
|
|
210
211
|
}
|
|
211
|
-
|
|
212
|
+
w(g);
|
|
212
213
|
}, [
|
|
213
|
-
N,
|
|
214
214
|
P,
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
F,
|
|
216
|
+
w,
|
|
217
217
|
O,
|
|
218
218
|
k,
|
|
219
219
|
A,
|
|
220
|
-
|
|
220
|
+
j,
|
|
221
221
|
x,
|
|
222
222
|
S,
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
C,
|
|
224
|
+
M,
|
|
225
225
|
R,
|
|
226
|
-
z
|
|
226
|
+
z,
|
|
227
|
+
B
|
|
227
228
|
]),
|
|
228
|
-
canDrilldown:
|
|
229
|
-
canNavigate:
|
|
230
|
-
buildDrilldownUrl:
|
|
231
|
-
extractParameters:
|
|
232
|
-
parseUrlMetadata:
|
|
233
|
-
parseUrlContext:
|
|
229
|
+
canDrilldown: I,
|
|
230
|
+
canNavigate: L,
|
|
231
|
+
buildDrilldownUrl: F,
|
|
232
|
+
extractParameters: P,
|
|
233
|
+
parseUrlMetadata: M,
|
|
234
|
+
parseUrlContext: N
|
|
234
235
|
};
|
|
235
236
|
}
|
|
236
237
|
//#endregion
|
|
237
|
-
export {
|
|
238
|
+
export { d as CONTEXT_PARAM_PREFIX, p as DRILLDOWN_PARAM_PREFIX, f as FILTER_PARAM_PREFIX, m as MODAL_TARGET_PAGE_PARAM, b as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetDataSinkForExportDocument as e } from "../../generated/wspace-operations.js";
|
|
2
2
|
import { useCallback as t, useState as n } from "react";
|
|
3
3
|
import { useApolloClient as r } from "@apollo/client/react";
|
|
4
4
|
//#region src/bigconsole/hooks/useExportDataSink.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateGlobalFilterDocument as e, DeleteGlobalFilterDocument as t, GetDashboardDocument as n, ReorderGlobalFiltersDocument as r, UpdateGlobalFilterDocument as i } from "../../generated/wspace-operations.js";
|
|
2
2
|
import { useCallback as a, useRef as o, useState as s } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useApolloClient as c } from "@apollo/client/react";
|
|
4
|
+
import { useLocalStorage as l } from "@burdenoff/fe-libs/shared/hooks";
|
|
5
5
|
//#region src/bigconsole/hooks/useGlobalFilters.ts
|
|
6
6
|
var u = "bigconsole_local_filters";
|
|
7
7
|
function d(e) {
|
|
@@ -24,7 +24,7 @@ function d(e) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
function f() {
|
|
27
|
-
let [f, p] = s([]), [m, h] = s({}), [g, _] = s(!1), [v, y] = s(null), b = o(""), [x, S] =
|
|
27
|
+
let [f, p] = s([]), [m, h] = s({}), [g, _] = s(!1), [v, y] = s(null), b = o(""), [x, S] = l(u, {}), C = c();
|
|
28
28
|
a((e) => {
|
|
29
29
|
let t = x[e];
|
|
30
30
|
return t ? t.map((e) => d(e)) : [];
|