@burdenoff/microfe-bigconsole 2026.1123.6 → 2026.1124.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/AsOfControl.js +2 -2
- package/dist/bigconsole/components/dashboard/DashboardCommentsDrawer.js +107 -106
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.d.ts +34 -0
- package/dist/bigconsole/components/dashboard/DashboardGalleryCard.js +123 -0
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.js +1 -1
- package/dist/bigconsole/components/dashboard/DashboardStatusPill.js +19 -35
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +119 -116
- package/dist/bigconsole/components/dashboard/LiveCanvasToggle.js +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.d.ts +0 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +172 -170
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +210 -208
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +97 -97
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +92 -92
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +149 -149
- package/dist/bigconsole/components/datasink/AnomalyDetectorPanel.js +54 -54
- package/dist/bigconsole/components/datasink/DataSinkStatusBadge.js +30 -37
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +4 -4
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +130 -129
- package/dist/bigconsole/components/datasink/SetupStateBadge.js +24 -33
- package/dist/bigconsole/components/datasink/SinkWorkflowLinkForm.js +38 -38
- package/dist/bigconsole/components/explore/CreateQueryWidget.js +57 -56
- package/dist/bigconsole/components/explore/SqlDraftEditor.js +140 -140
- package/dist/bigconsole/components/explore/VisualBuilder.js +85 -84
- package/dist/bigconsole/components/explore/queryAccess/GrantsPanel.js +168 -167
- package/dist/bigconsole/components/explore/queryAccess/QueryAccessAdmin.js +2 -2
- package/dist/bigconsole/components/explore/queryAccess/RelationEditor.js +118 -117
- package/dist/bigconsole/components/insights/BoardLintPanel.js +2 -2
- package/dist/bigconsole/components/insights/OutlierSpottingDialog.js +123 -123
- package/dist/bigconsole/components/kpi-change/KpiChangePanel.js +2 -2
- package/dist/bigconsole/components/narrative/NarrativePanel.js +1 -1
- package/dist/bigconsole/components/overview/DataHealthCard.js +3 -0
- package/dist/bigconsole/components/overview/RecentDashboardsPanel.js +3 -0
- package/dist/bigconsole/components/parser/ParserStatusBadge.js +25 -28
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +23 -22
- package/dist/bigconsole/components/pipeline/PipelineStatusBadge.js +15 -26
- package/dist/bigconsole/components/reconcile/KpiReconcileDialog.js +24 -24
- package/dist/bigconsole/components/settings/WidgetCatalogSection.js +1 -1
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +188 -187
- package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +1 -1
- package/dist/bigconsole/components/widgets/UnsupportedDataSourceNotice.js +1 -1
- package/dist/bigconsole/components/widgets/WidgetCompareView.js +3 -1
- package/dist/bigconsole/components/widgets/WidgetHeader.js +1 -1
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +45 -44
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +151 -147
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +48 -47
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +1 -1
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +139 -138
- package/dist/bigconsole/components/widgets/form/FormWidget.js +149 -148
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +80 -77
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +58 -56
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +75 -73
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +86 -85
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +80 -77
- package/dist/bigconsole/components/widgets/retention/RetentionView.js +1 -1
- package/dist/bigconsole/components/widgets/table/TableConfig.js +214 -211
- package/dist/bigconsole/components/widgets/table/TablePagination.js +59 -58
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +140 -138
- package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js +74 -66
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +48 -48
- package/dist/bigconsole/components/workflow/WorkflowStatusBadge.js +28 -37
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +69 -69
- package/dist/bigconsole/hooks/useDashboardListQuery.d.ts +22 -0
- package/dist/bigconsole/hooks/useDashboardListQuery.js +39 -0
- package/dist/bigconsole/pages/AdminPage.js +147 -146
- package/dist/bigconsole/pages/DashboardViewPage.js +2 -0
- package/dist/bigconsole/pages/DashboardsPage.js +638 -855
- package/dist/bigconsole/pages/DataParsersPage.js +5 -0
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +4 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +263 -261
- package/dist/bigconsole/pages/DataSinksPage.js +210 -186
- package/dist/bigconsole/pages/InsightsPage.js +386 -383
- package/dist/bigconsole/pages/ParserBuilderPage.js +413 -413
- package/dist/bigconsole/pages/ParserViewPage.js +2 -0
- package/dist/bigconsole/pages/PipelineBuilderPage.js +279 -276
- package/dist/bigconsole/pages/PipelineViewPage.js +3 -0
- package/dist/bigconsole/pages/PipelinesPage.js +198 -165
- package/dist/bigconsole/pages/SettingsPage.js +160 -160
- package/dist/bigconsole/pages/WidgetDemoPage.js +2 -0
- package/dist/bigconsole/pages/WorkflowViewPage.js +5 -0
- package/dist/bigconsole/pages/WorkflowsPage.js +144 -123
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +1 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +123 -122
- package/dist/bigconsole/utils/dashboardGallery.d.ts +84 -0
- package/dist/bigconsole/utils/dashboardGallery.js +93 -0
- package/dist/bigconsole/utils/statusTone.d.ts +17 -0
- package/dist/bigconsole/utils/statusTone.js +44 -0
- package/package.json +4 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Section as e, SectionStack as t } from "../components/common/Section.js";
|
|
2
2
|
import { BigConsoleRenderer as n } from "../renderers/adapters/BigConsoleRenderer.js";
|
|
3
|
-
import { WidgetErrorBoundary as
|
|
4
|
-
import { BINDING_NOTICE_CODES as
|
|
5
|
-
import { describeProposalPreviewData as
|
|
6
|
-
import { changeProposalWidgetType as
|
|
3
|
+
import { WidgetErrorBoundary as ee } from "../components/widgets/WidgetErrorBoundary.js";
|
|
4
|
+
import { BINDING_NOTICE_CODES as r, PROPOSABLE_WIDGET_TYPES as te, derivePreviewState as i, isProposableWidgetType as ne, mappedFields as a, validateProposal as re, withoutNotices as o } from "./proposalContract.js";
|
|
5
|
+
import { describeProposalPreviewData as ie } from "./proposalPreviewData.js";
|
|
6
|
+
import { changeProposalWidgetType as ae, localProposalSource as oe } from "./proposalSource.js";
|
|
7
7
|
import "../components/common/index.js";
|
|
8
|
-
import { memo as
|
|
9
|
-
import { AlertTriangle as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { Fragment as
|
|
8
|
+
import { memo as s, useCallback as c, useEffect as se, useMemo as l, useState as u } from "react";
|
|
9
|
+
import { AlertTriangle as d, Check as ce, Loader2 as f, RefreshCw as p, Sparkles as m, X as le } from "lucide-react";
|
|
10
|
+
import { Button as h, Input as g, Label as _, Textarea as ue, ThemedSelect as v } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { useI18n as de } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { Fragment as fe, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
13
13
|
// src/bigconsole/customWidget/CustomWidgetProposalPanel.tsx
|
|
14
|
-
var
|
|
14
|
+
var pe = "w-full", me = {
|
|
15
15
|
loading: "neutral",
|
|
16
16
|
valid: "neutral",
|
|
17
17
|
"no-data": "warning",
|
|
@@ -30,7 +30,7 @@ function x(e, t) {
|
|
|
30
30
|
parserId: e.binding.parserId || null,
|
|
31
31
|
config: {
|
|
32
32
|
...e.presentation.config,
|
|
33
|
-
...
|
|
33
|
+
...a(e.fieldMapping)
|
|
34
34
|
},
|
|
35
35
|
position: {
|
|
36
36
|
x: 0,
|
|
@@ -46,8 +46,8 @@ function x(e, t) {
|
|
|
46
46
|
updatedAt: n
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
var S =
|
|
50
|
-
let { t: E } =
|
|
49
|
+
var S = s(function({ sinks: a, parsers: s, resolvePreviewData: S, onApprove: C, onClose: w, source: T = oe }) {
|
|
50
|
+
let { t: E } = de(), D = l(() => ({
|
|
51
51
|
loading: {
|
|
52
52
|
title: E("bigconsole.widget.customWidget.preview.loading.title", "Building preview…"),
|
|
53
53
|
body: E("bigconsole.widget.customWidget.preview.loading.body", "Reading the selected data binding.")
|
|
@@ -68,7 +68,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
68
68
|
title: E("bigconsole.widget.customWidget.preview.accessError.title", "Cannot read this data"),
|
|
69
69
|
body: E("bigconsole.widget.customWidget.preview.accessError.body", "You do not have access to the proposed DataSink or parser in this workspace.")
|
|
70
70
|
}
|
|
71
|
-
}), [E]), [O, k] =
|
|
71
|
+
}), [E]), [O, k] = u(""), [A, j] = u(null), [M, N] = u(!1), [P, F] = u(!1), [I, L] = u(null), [R, z] = u(void 0), [B, V] = u(!1), [H, U] = u(!1), W = l(() => a.map((e) => e.id), [a]), G = l(() => s.map((e) => e.id), [s]), K = l(() => A ? ie(A.widgetType, R, A.fieldMapping) : void 0, [A, R]), q = K?.fields, J = l(() => A ? re(A, {
|
|
72
72
|
permittedDataSinkIds: W,
|
|
73
73
|
permittedParserIds: G,
|
|
74
74
|
availableFields: q,
|
|
@@ -82,7 +82,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
82
82
|
G,
|
|
83
83
|
q,
|
|
84
84
|
K
|
|
85
|
-
]), Y =
|
|
85
|
+
]), Y = l(() => i(J, {
|
|
86
86
|
loading: B,
|
|
87
87
|
accessError: H,
|
|
88
88
|
rowCount: K?.rowCount ?? 0
|
|
@@ -91,7 +91,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
91
91
|
B,
|
|
92
92
|
H,
|
|
93
93
|
K
|
|
94
|
-
]), X =
|
|
94
|
+
]), X = c((e) => {
|
|
95
95
|
switch (e) {
|
|
96
96
|
case "chart": return E("bigconsole.widget.customWidget.typeOption.chart", "Chart");
|
|
97
97
|
case "funnel_chart": return E("bigconsole.widget.customWidget.typeOption.funnel_chart", "Funnel chart");
|
|
@@ -100,7 +100,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
100
100
|
case "metric_card": return E("bigconsole.widget.customWidget.typeOption.metric_card", "Metric card");
|
|
101
101
|
case "retention": return E("bigconsole.widget.customWidget.typeOption.retention", "Retention");
|
|
102
102
|
}
|
|
103
|
-
}, [E]),
|
|
103
|
+
}, [E]), he = c((e) => {
|
|
104
104
|
switch (e.code) {
|
|
105
105
|
case "DATASINK_MATCHED": return e.parserName ? e.parserMatched ? E("bigconsole.widget.customWidget.notice.sinkMatchedWithParser", "Matched DataSink \"{{sink}}\" and parser \"{{parser}}\".", {
|
|
106
106
|
sink: e.sinkName,
|
|
@@ -116,8 +116,8 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
116
116
|
type: X(e.widgetType)
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
}, [E, X]),
|
|
120
|
-
|
|
119
|
+
}, [E, X]), ge = A ? `${A.binding.dataSinkId}|${A.binding.parserId ?? ""}|${A.binding.dataPath ?? ""}` : "";
|
|
120
|
+
se(() => {
|
|
121
121
|
if (!A || !A.binding.dataSinkId) {
|
|
122
122
|
z(void 0);
|
|
123
123
|
return;
|
|
@@ -132,15 +132,15 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
132
132
|
}), () => {
|
|
133
133
|
e = !0;
|
|
134
134
|
};
|
|
135
|
-
}, [
|
|
136
|
-
let
|
|
135
|
+
}, [ge, S]);
|
|
136
|
+
let _e = c(async () => {
|
|
137
137
|
if (O.trim()) {
|
|
138
138
|
N(!0), L(null);
|
|
139
139
|
try {
|
|
140
140
|
let e = await T.propose({
|
|
141
141
|
prompt: O.trim(),
|
|
142
|
-
sinks:
|
|
143
|
-
parsers:
|
|
142
|
+
sinks: a,
|
|
143
|
+
parsers: s
|
|
144
144
|
});
|
|
145
145
|
j(e);
|
|
146
146
|
} finally {
|
|
@@ -150,13 +150,13 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
150
150
|
}, [
|
|
151
151
|
O,
|
|
152
152
|
T,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
]), Z =
|
|
153
|
+
a,
|
|
154
|
+
s
|
|
155
|
+
]), Z = c((e) => {
|
|
156
156
|
j((t) => t && e(t));
|
|
157
|
-
}, []),
|
|
157
|
+
}, []), ve = c(() => {
|
|
158
158
|
j(null), z(void 0), U(!1), L(null);
|
|
159
|
-
}, []),
|
|
159
|
+
}, []), ye = c(async () => {
|
|
160
160
|
if (A && J.canApprove && !B && !H) {
|
|
161
161
|
F(!0), L(null);
|
|
162
162
|
try {
|
|
@@ -183,25 +183,25 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
183
183
|
children: /* @__PURE__ */ b(t, { children: [/* @__PURE__ */ y(e, {
|
|
184
184
|
title: E("bigconsole.widget.customWidget.prompt.label", "Describe the widget you need"),
|
|
185
185
|
description: "Plain English. The assistant proposes a typed widget you can edit before anything is saved.",
|
|
186
|
-
icon: /* @__PURE__ */ y(
|
|
186
|
+
icon: /* @__PURE__ */ y(m, {
|
|
187
187
|
className: "size-4",
|
|
188
188
|
"aria-hidden": "true"
|
|
189
189
|
}),
|
|
190
190
|
actions: /* @__PURE__ */ b("div", {
|
|
191
191
|
className: "flex flex-wrap gap-2",
|
|
192
|
-
children: [/* @__PURE__ */ b(
|
|
192
|
+
children: [/* @__PURE__ */ b(h, {
|
|
193
193
|
"data-testid": "custom-widget-generate",
|
|
194
|
-
onClick:
|
|
194
|
+
onClick: _e,
|
|
195
195
|
disabled: !O.trim() || M,
|
|
196
|
-
children: [M ? /* @__PURE__ */ y(
|
|
196
|
+
children: [M ? /* @__PURE__ */ y(f, {
|
|
197
197
|
className: "mr-2 size-4 animate-spin",
|
|
198
198
|
"aria-hidden": "true"
|
|
199
199
|
}) : null, A ? E("bigconsole.widget.customWidget.action.regenerate", "Regenerate") : E("bigconsole.widget.customWidget.action.generateProposal", "Generate proposal")]
|
|
200
|
-
}), A ? /* @__PURE__ */ b(
|
|
200
|
+
}), A ? /* @__PURE__ */ b(h, {
|
|
201
201
|
variant: "outline",
|
|
202
202
|
"data-testid": "custom-widget-reject",
|
|
203
|
-
onClick:
|
|
204
|
-
children: [/* @__PURE__ */ y(
|
|
203
|
+
onClick: ve,
|
|
204
|
+
children: [/* @__PURE__ */ y(le, {
|
|
205
205
|
className: "mr-1 size-4",
|
|
206
206
|
"aria-hidden": "true"
|
|
207
207
|
}), E("bigconsole.widget.customWidget.action.reject", "Reject")]
|
|
@@ -209,10 +209,10 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
209
209
|
}),
|
|
210
210
|
children: /* @__PURE__ */ b("div", {
|
|
211
211
|
className: "flex flex-col gap-2",
|
|
212
|
-
children: [/* @__PURE__ */ y(
|
|
212
|
+
children: [/* @__PURE__ */ y(_, {
|
|
213
213
|
htmlFor: "custom-widget-prompt",
|
|
214
214
|
children: "What should it show?"
|
|
215
|
-
}), /* @__PURE__ */ y(
|
|
215
|
+
}), /* @__PURE__ */ y(ue, {
|
|
216
216
|
id: "custom-widget-prompt",
|
|
217
217
|
"data-testid": "custom-widget-prompt",
|
|
218
218
|
value: O,
|
|
@@ -221,10 +221,10 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
221
221
|
rows: 3
|
|
222
222
|
})]
|
|
223
223
|
})
|
|
224
|
-
}), A ? /* @__PURE__ */ b(
|
|
224
|
+
}), A ? /* @__PURE__ */ b(fe, { children: [
|
|
225
225
|
/* @__PURE__ */ b(e, {
|
|
226
226
|
emphasis: "primary",
|
|
227
|
-
tone:
|
|
227
|
+
tone: me[Y],
|
|
228
228
|
title: D[Y].title,
|
|
229
229
|
description: A.binding.parserId ? E("bigconsole.widget.customWidget.preview.parserDescription", "Rendered using the saved parser output.") : E("bigconsole.widget.customWidget.preview.sourceDescription", "Rendered using up to 50 source rows. Full data may differ."),
|
|
230
230
|
meta: /* @__PURE__ */ y("span", {
|
|
@@ -238,7 +238,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
238
238
|
className: "min-h-[220px] min-w-0 rounded-card border border-[var(--color-border-subtle)] bg-bg-surface p-2",
|
|
239
239
|
children: Y === "loading" ? /* @__PURE__ */ b("div", {
|
|
240
240
|
className: "flex h-[200px] items-center justify-center text-text-secondary",
|
|
241
|
-
children: [/* @__PURE__ */ y(
|
|
241
|
+
children: [/* @__PURE__ */ y(f, {
|
|
242
242
|
className: "mr-2 size-4 animate-spin",
|
|
243
243
|
"aria-hidden": "true"
|
|
244
244
|
}), /* @__PURE__ */ y("span", {
|
|
@@ -247,7 +247,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
247
247
|
})]
|
|
248
248
|
}) : Y === "valid" ? /* @__PURE__ */ y("div", {
|
|
249
249
|
className: "h-[200px]",
|
|
250
|
-
children: /* @__PURE__ */ y(
|
|
250
|
+
children: /* @__PURE__ */ y(ee, {
|
|
251
251
|
widgetId: `preview-${A.id}`,
|
|
252
252
|
children: /* @__PURE__ */ y(n, {
|
|
253
253
|
widget: x(A, E("bigconsole.widget.customWidget.untitledWidget", "Untitled widget")),
|
|
@@ -257,7 +257,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
257
257
|
}) : /* @__PURE__ */ b("div", {
|
|
258
258
|
className: "flex h-[200px] flex-col items-center justify-center gap-2 px-4 text-center",
|
|
259
259
|
children: [
|
|
260
|
-
/* @__PURE__ */ y(
|
|
260
|
+
/* @__PURE__ */ y(d, {
|
|
261
261
|
className: "size-5 text-[var(--color-status-warning-text)]",
|
|
262
262
|
"aria-hidden": "true"
|
|
263
263
|
}),
|
|
@@ -265,11 +265,11 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
265
265
|
className: "text-sm text-text-secondary",
|
|
266
266
|
children: D[Y].body
|
|
267
267
|
}),
|
|
268
|
-
Y === "access-error" ? /* @__PURE__ */ b(
|
|
268
|
+
Y === "access-error" ? /* @__PURE__ */ b(h, {
|
|
269
269
|
size: "sm",
|
|
270
270
|
variant: "outline",
|
|
271
271
|
onClick: () => Z((e) => ({ ...e })),
|
|
272
|
-
children: [/* @__PURE__ */ y(
|
|
272
|
+
children: [/* @__PURE__ */ y(p, {
|
|
273
273
|
className: "mr-1 size-3.5",
|
|
274
274
|
"aria-hidden": "true"
|
|
275
275
|
}), E("bigconsole.widget.customWidget.action.retry", "Retry")]
|
|
@@ -282,7 +282,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
282
282
|
children: A.notices.map((e) => /* @__PURE__ */ y("li", {
|
|
283
283
|
"data-notice": e.code,
|
|
284
284
|
className: `break-words text-xs ${e.code === "DATASINK_MATCHED" && (e.parserMatched || !e.parserName) ? "text-text-secondary" : "text-[var(--color-status-warning-text)]"}`,
|
|
285
|
-
children:
|
|
285
|
+
children: he(e)
|
|
286
286
|
}, e.code))
|
|
287
287
|
}) : A.rationale ? /* @__PURE__ */ y("p", {
|
|
288
288
|
className: "mt-2 text-xs text-text-secondary",
|
|
@@ -314,13 +314,13 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
314
314
|
children: [
|
|
315
315
|
/* @__PURE__ */ b("div", {
|
|
316
316
|
className: "flex flex-col gap-1",
|
|
317
|
-
children: [/* @__PURE__ */ y(
|
|
317
|
+
children: [/* @__PURE__ */ y(_, {
|
|
318
318
|
htmlFor: "custom-widget-title",
|
|
319
319
|
children: E("bigconsole.widget.customWidget.field.title", "Title")
|
|
320
|
-
}), /* @__PURE__ */ y(
|
|
320
|
+
}), /* @__PURE__ */ y(g, {
|
|
321
321
|
id: "custom-widget-title",
|
|
322
322
|
"data-testid": "custom-widget-title",
|
|
323
|
-
className:
|
|
323
|
+
className: pe,
|
|
324
324
|
value: A.presentation.title,
|
|
325
325
|
onChange: (e) => Z((t) => ({
|
|
326
326
|
...t,
|
|
@@ -333,19 +333,19 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
333
333
|
}),
|
|
334
334
|
/* @__PURE__ */ b("div", {
|
|
335
335
|
className: "flex flex-col gap-1",
|
|
336
|
-
children: [/* @__PURE__ */ y(
|
|
336
|
+
children: [/* @__PURE__ */ y(_, {
|
|
337
337
|
htmlFor: "custom-widget-type",
|
|
338
338
|
children: E("bigconsole.widget.customWidget.field.widgetType", "Widget type")
|
|
339
|
-
}), /* @__PURE__ */ y(
|
|
339
|
+
}), /* @__PURE__ */ y(v, {
|
|
340
340
|
id: "custom-widget-type",
|
|
341
341
|
"data-testid": "custom-widget-type",
|
|
342
342
|
value: A.widgetType,
|
|
343
343
|
onChange: (e) => {
|
|
344
344
|
let t = e.target.value;
|
|
345
|
-
|
|
345
|
+
ne(t) && Z((e) => ae(e, t));
|
|
346
346
|
},
|
|
347
347
|
className: "w-full rounded-md border border-[var(--color-border-default)] bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
|
|
348
|
-
children:
|
|
348
|
+
children: te.map((e) => /* @__PURE__ */ y("option", {
|
|
349
349
|
value: e,
|
|
350
350
|
children: X(e)
|
|
351
351
|
}, e))
|
|
@@ -353,17 +353,17 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
353
353
|
}),
|
|
354
354
|
/* @__PURE__ */ b("div", {
|
|
355
355
|
className: "flex flex-col gap-1",
|
|
356
|
-
children: [/* @__PURE__ */ y(
|
|
356
|
+
children: [/* @__PURE__ */ y(_, {
|
|
357
357
|
htmlFor: "custom-widget-sink",
|
|
358
358
|
children: E("bigconsole.widget.customWidget.field.dataSink", "DataSink")
|
|
359
|
-
}), /* @__PURE__ */ b(
|
|
359
|
+
}), /* @__PURE__ */ b(v, {
|
|
360
360
|
id: "custom-widget-sink",
|
|
361
361
|
"data-testid": "custom-widget-sink",
|
|
362
362
|
value: A.binding.dataSinkId,
|
|
363
363
|
onChange: (e) => {
|
|
364
|
-
let t =
|
|
364
|
+
let t = a.find((t) => t.id === e.target.value);
|
|
365
365
|
Z((n) => ({
|
|
366
|
-
...
|
|
366
|
+
...o(n, r),
|
|
367
367
|
binding: {
|
|
368
368
|
...n.binding,
|
|
369
369
|
dataSinkId: e.target.value,
|
|
@@ -376,7 +376,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
376
376
|
children: [/* @__PURE__ */ y("option", {
|
|
377
377
|
value: "",
|
|
378
378
|
children: E("bigconsole.widget.customWidget.field.selectDataSink", "Select a DataSink…")
|
|
379
|
-
}),
|
|
379
|
+
}), a.map((e) => /* @__PURE__ */ y("option", {
|
|
380
380
|
value: e.id,
|
|
381
381
|
children: e.name || e.key
|
|
382
382
|
}, e.id))]
|
|
@@ -384,17 +384,17 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
384
384
|
}),
|
|
385
385
|
/* @__PURE__ */ b("div", {
|
|
386
386
|
className: "flex flex-col gap-1",
|
|
387
|
-
children: [/* @__PURE__ */ y(
|
|
387
|
+
children: [/* @__PURE__ */ y(_, {
|
|
388
388
|
htmlFor: "custom-widget-parser",
|
|
389
389
|
children: E("bigconsole.widget.customWidget.field.parser", "Parser")
|
|
390
|
-
}), /* @__PURE__ */ b(
|
|
390
|
+
}), /* @__PURE__ */ b(v, {
|
|
391
391
|
id: "custom-widget-parser",
|
|
392
392
|
"data-testid": "custom-widget-parser",
|
|
393
393
|
value: A.binding.parserId ?? "",
|
|
394
394
|
onChange: (e) => {
|
|
395
|
-
let t =
|
|
395
|
+
let t = s.find((t) => t.id === e.target.value);
|
|
396
396
|
Z((n) => ({
|
|
397
|
-
...
|
|
397
|
+
...o(n, r),
|
|
398
398
|
binding: {
|
|
399
399
|
...n.binding,
|
|
400
400
|
parserId: e.target.value || void 0,
|
|
@@ -407,7 +407,7 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
407
407
|
children: [/* @__PURE__ */ y("option", {
|
|
408
408
|
value: "",
|
|
409
409
|
children: E("bigconsole.widget.customWidget.field.noParser", "No parser")
|
|
410
|
-
}),
|
|
410
|
+
}), s.map((e) => /* @__PURE__ */ y("option", {
|
|
411
411
|
value: e.id,
|
|
412
412
|
children: e.name
|
|
413
413
|
}, e.id))]
|
|
@@ -423,10 +423,10 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
423
423
|
}),
|
|
424
424
|
Object.entries(A.fieldMapping).map(([e, t]) => /* @__PURE__ */ b("div", {
|
|
425
425
|
className: "flex flex-col gap-1",
|
|
426
|
-
children: [/* @__PURE__ */ y(
|
|
426
|
+
children: [/* @__PURE__ */ y(_, {
|
|
427
427
|
htmlFor: `custom-widget-field-${e}`,
|
|
428
428
|
children: e
|
|
429
|
-
}), /* @__PURE__ */ y(
|
|
429
|
+
}), /* @__PURE__ */ y(g, {
|
|
430
430
|
id: `custom-widget-field-${e}`,
|
|
431
431
|
"data-testid": `custom-widget-field-${e}`,
|
|
432
432
|
value: t,
|
|
@@ -463,18 +463,18 @@ var S = l(function({ sinks: o, parsers: l, resolvePreviewData: S, onApprove: C,
|
|
|
463
463
|
}) : null,
|
|
464
464
|
/* @__PURE__ */ b("div", {
|
|
465
465
|
className: "flex flex-wrap gap-2 border-t border-[var(--color-border-subtle)] pt-3",
|
|
466
|
-
children: [/* @__PURE__ */ b(
|
|
466
|
+
children: [/* @__PURE__ */ b(h, {
|
|
467
467
|
"data-testid": "custom-widget-approve",
|
|
468
|
-
onClick:
|
|
468
|
+
onClick: ye,
|
|
469
469
|
disabled: !J.canApprove || B || H || P,
|
|
470
|
-
children: [P ? /* @__PURE__ */ y(
|
|
470
|
+
children: [P ? /* @__PURE__ */ y(f, {
|
|
471
471
|
className: "mr-2 size-4 animate-spin",
|
|
472
472
|
"aria-hidden": "true"
|
|
473
|
-
}) : /* @__PURE__ */ y(
|
|
473
|
+
}) : /* @__PURE__ */ y(ce, {
|
|
474
474
|
className: "mr-1 size-4",
|
|
475
475
|
"aria-hidden": "true"
|
|
476
476
|
}), E("bigconsole.widget.customWidget.action.approveAndAdd", "Approve & add to dashboard")]
|
|
477
|
-
}), /* @__PURE__ */ y(
|
|
477
|
+
}), /* @__PURE__ */ y(h, {
|
|
478
478
|
variant: "outline",
|
|
479
479
|
onClick: w,
|
|
480
480
|
"data-testid": "custom-widget-cancel",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DashboardListQuery } from '../utils/dashboardGallery';
|
|
2
|
+
import { ListSortValue } from '../utils/listSort';
|
|
3
|
+
export interface DashboardListQueryState {
|
|
4
|
+
/** The query the list shows, as the address states it. */
|
|
5
|
+
query: DashboardListQuery;
|
|
6
|
+
/** What the search box shows: what was typed, a moment ahead of the address. */
|
|
7
|
+
searchText: string;
|
|
8
|
+
/** The page the address asks for (1 when it names none). */
|
|
9
|
+
requestedPage: number;
|
|
10
|
+
/** Typing: replaces the current history entry rather than adding one per key. */
|
|
11
|
+
setSearch: (search: string) => void;
|
|
12
|
+
setCategory: (category: string) => void;
|
|
13
|
+
setStatus: (status: string) => void;
|
|
14
|
+
setSort: (sort: ListSortValue) => void;
|
|
15
|
+
/** Search, category and status back to every dashboard; the sort stays. */
|
|
16
|
+
clearFilters: () => void;
|
|
17
|
+
/** Another page, as a new history entry, so Back returns to this one. */
|
|
18
|
+
goToPage: (page: number) => void;
|
|
19
|
+
/** Page 1 without a new history entry (the layout changed). */
|
|
20
|
+
resetPage: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function useDashboardListQuery(): DashboardListQueryState;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cleanDashboardListParams as e, readDashboardListQuery as t, withDashboardListQuery as n } from "../utils/dashboardGallery.js";
|
|
2
|
+
import { useCallback as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
|
+
import { useSearchParams as c } from "react-router";
|
|
4
|
+
import { parsePageParam as l, withPageParam as u } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
// src/bigconsole/hooks/useDashboardListQuery.ts
|
|
6
|
+
function d() {
|
|
7
|
+
let [d, f] = c(), p = a(() => t(d), [d]), [m, h] = s(p.search), [g, _] = s(p.search), [v, y] = s(p.search);
|
|
8
|
+
p.search !== g && (_(p.search), p.search !== v && (y(p.search), h(p.search)));
|
|
9
|
+
let b = o(d);
|
|
10
|
+
i(() => {
|
|
11
|
+
b.current = d;
|
|
12
|
+
}, [d]);
|
|
13
|
+
let x = r((e, t) => {
|
|
14
|
+
b.current = e, f(e, { replace: t });
|
|
15
|
+
}, [f]), S = r((e, t) => x(n(b.current, e), t), [x]), C = r((e) => {
|
|
16
|
+
h(e), y(e), S({ search: e }, !0);
|
|
17
|
+
}, [S]), w = r((e) => S({ category: e }, !1), [S]), T = r((e) => S({ status: e }, !1), [S]), E = r((e) => S({ sort: e }, !1), [S]), D = r(() => {
|
|
18
|
+
h(""), y(""), S({
|
|
19
|
+
search: "",
|
|
20
|
+
category: "",
|
|
21
|
+
status: ""
|
|
22
|
+
}, !1);
|
|
23
|
+
}, [S]), O = r((t) => x(u(e(b.current), t), !1), [x]), k = r(() => {
|
|
24
|
+
b.current.has("page") && x(u(e(b.current), 1), !0);
|
|
25
|
+
}, [x]);
|
|
26
|
+
return {
|
|
27
|
+
query: p,
|
|
28
|
+
searchText: m,
|
|
29
|
+
requestedPage: l(d.get("page")),
|
|
30
|
+
setSearch: C,
|
|
31
|
+
setCategory: w,
|
|
32
|
+
setStatus: T,
|
|
33
|
+
setSort: E,
|
|
34
|
+
clearFilters: D,
|
|
35
|
+
goToPage: O,
|
|
36
|
+
resetPage: k
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export { d as useDashboardListQuery };
|