@burdenoff/microfe-bigconsole 2026.1012.4 → 2026.1012.5
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/BigConsoleRoutes.js +149 -140
- package/dist/bigconsole/assistant/assistantProduct.js +4 -1
- package/dist/bigconsole/assistant/displayCopy.d.ts +32 -0
- package/dist/bigconsole/assistant/pageContext.d.ts +14 -0
- package/dist/bigconsole/assistant/pageContext.js +6 -1
- package/dist/bigconsole/assistant/pageControls.d.ts +81 -0
- package/dist/bigconsole/assistant/pageControls.js +169 -0
- package/dist/bigconsole/assistant/previewControl.d.ts +16 -0
- package/dist/bigconsole/assistant/previewControl.js +10 -0
- package/dist/bigconsole/assistant/recordAdapters.js +27 -26
- package/dist/bigconsole/assistant/usePreviewControl.d.ts +2 -0
- package/dist/bigconsole/assistant/usePreviewControl.js +20 -0
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +9 -9
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
- package/dist/bigconsole/components/common/SortBySelect.d.ts +11 -0
- package/dist/bigconsole/components/common/SortBySelect.js +29 -0
- package/dist/bigconsole/components/common/index.d.ts +1 -0
- package/dist/bigconsole/components/common/index.js +1 -0
- 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 +15 -15
- 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 +153 -153
- 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 +134 -134
- 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 +46 -46
- 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 +51 -50
- 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 +77 -76
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +96 -95
- 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 +507 -499
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +14 -14
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.js +68 -67
- package/dist/bigconsole/components/widgets/advanced/boxPlotDescription.d.ts +7 -0
- package/dist/bigconsole/components/widgets/advanced/boxPlotDescription.js +12 -0
- 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/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/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/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/constants/backendErrors.js +94 -0
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +10 -10
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +67 -67
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +14 -0
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +32 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +23 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.js +138 -113
- package/dist/bigconsole/hooks/useDrilldown.js +3 -3
- package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
- package/dist/bigconsole/pages/AdminPage.js +130 -130
- package/dist/bigconsole/pages/DashboardBuilderPage.js +72 -60
- package/dist/bigconsole/pages/DashboardViewPage.js +244 -221
- package/dist/bigconsole/pages/DashboardsPage.js +269 -221
- package/dist/bigconsole/pages/DataParsersPage.js +180 -157
- package/dist/bigconsole/pages/DataSinkAlertsPage.js +62 -55
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +252 -234
- package/dist/bigconsole/pages/DataSinkViewPage.js +1 -1
- package/dist/bigconsole/pages/DataSinksPage.js +335 -299
- package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
- package/dist/bigconsole/pages/InsightsPage.js +279 -265
- package/dist/bigconsole/pages/OverviewPage.js +47 -47
- package/dist/bigconsole/pages/ParserBuilderPage.js +229 -213
- package/dist/bigconsole/pages/ParserViewPage.js +97 -97
- package/dist/bigconsole/pages/PipelineBuilderPage.js +256 -214
- package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
- package/dist/bigconsole/pages/PipelinesPage.js +107 -88
- package/dist/bigconsole/pages/SettingsPage.js +179 -173
- 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 +34 -34
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +69 -69
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
- package/dist/bigconsole/store/widgetStore.d.ts +12 -0
- package/dist/bigconsole/store/widgetStore.js +3 -1
- package/dist/bigconsole/utils/backendError.d.ts +18 -0
- package/dist/bigconsole/utils/backendError.js +42 -0
- package/dist/bigconsole/utils/dashboardList.d.ts +28 -0
- package/dist/bigconsole/utils/dashboardList.js +15 -0
- package/dist/bigconsole/utils/dataSinkList.d.ts +15 -0
- package/dist/bigconsole/utils/dataSinkList.js +15 -0
- package/dist/bigconsole/utils/formDirty.d.ts +82 -0
- package/dist/bigconsole/utils/formDirty.js +21 -0
- package/dist/bigconsole/utils/insightsDraft.d.ts +29 -0
- package/dist/bigconsole/utils/insightsDraft.js +8 -0
- package/dist/bigconsole/utils/layoutBaseline.d.ts +130 -0
- package/dist/bigconsole/utils/layoutBaseline.js +96 -0
- package/dist/bigconsole/utils/listSort.d.ts +80 -0
- package/dist/bigconsole/utils/listSort.js +85 -0
- package/dist/bigconsole/utils/widgetFormDirty.d.ts +16 -0
- package/dist/bigconsole/utils/widgetFormDirty.js +13 -0
- package/dist/bigconsole/workflowOpen.js +15 -14
- package/package.json +3 -3
|
@@ -7,8 +7,8 @@ import { localProposalSource as ne } from "./proposalSource.js";
|
|
|
7
7
|
import { memo as a, useCallback as o, useEffect as re, useMemo as s, useState as c } from "react";
|
|
8
8
|
import { AlertTriangle as l, Check as u, Loader2 as d, RefreshCw as ie, Sparkles as ae, X as oe } from "lucide-react";
|
|
9
9
|
import { Button as f, Input as p, Label as m, Textarea as se } from "@burdenoff/fe-libs/ui";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { useI18n as ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
11
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
12
|
//#region src/bigconsole/customWidget/CustomWidgetProposalPanel.tsx
|
|
13
13
|
var v = "w-full", y = {
|
|
14
14
|
loading: "neutral",
|
|
@@ -61,7 +61,7 @@ function S(e) {
|
|
|
61
61
|
return 0;
|
|
62
62
|
}
|
|
63
63
|
var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T, onClose: E, source: D = ne }) {
|
|
64
|
-
let { t: O } =
|
|
64
|
+
let { t: O } = ce(), k = s(() => ({
|
|
65
65
|
loading: {
|
|
66
66
|
title: O("bigconsole.widget.customWidget.preview.loading.title", "Building preview…"),
|
|
67
67
|
body: O("bigconsole.widget.customWidget.preview.loading.body", "Reading the selected data binding.")
|
|
@@ -162,43 +162,43 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
162
162
|
E,
|
|
163
163
|
O
|
|
164
164
|
]), Q = J.issues.filter((e) => e.severity === "error"), $ = J.issues.filter((e) => e.severity === "warning");
|
|
165
|
-
return /* @__PURE__ */
|
|
165
|
+
return /* @__PURE__ */ g("section", {
|
|
166
166
|
"data-testid": "custom-widget-proposal-panel",
|
|
167
167
|
"aria-label": O("bigconsole.widget.customWidget.panel.ariaLabel", "AI custom widget builder"),
|
|
168
168
|
className: "flex h-full w-full min-w-0 flex-col overflow-y-auto p-4",
|
|
169
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ _(t, { children: [/* @__PURE__ */ g(e, {
|
|
170
170
|
title: O("bigconsole.widget.customWidget.prompt.label", "Describe the widget you need"),
|
|
171
171
|
description: "Plain English. The assistant proposes a typed widget you can edit before anything is saved.",
|
|
172
|
-
icon: /* @__PURE__ */
|
|
172
|
+
icon: /* @__PURE__ */ g(ae, {
|
|
173
173
|
className: "size-4",
|
|
174
174
|
"aria-hidden": "true"
|
|
175
175
|
}),
|
|
176
|
-
actions: /* @__PURE__ */
|
|
176
|
+
actions: /* @__PURE__ */ _("div", {
|
|
177
177
|
className: "flex flex-wrap gap-2",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ _(f, {
|
|
179
179
|
"data-testid": "custom-widget-generate",
|
|
180
180
|
onClick: ue,
|
|
181
181
|
disabled: !A.trim() || N,
|
|
182
|
-
children: [N ? /* @__PURE__ */
|
|
182
|
+
children: [N ? /* @__PURE__ */ g(d, {
|
|
183
183
|
className: "mr-2 size-4 animate-spin",
|
|
184
184
|
"aria-hidden": "true"
|
|
185
185
|
}) : null, j ? O("bigconsole.widget.customWidget.action.regenerate", "Regenerate") : O("bigconsole.widget.customWidget.action.generateProposal", "Generate proposal")]
|
|
186
|
-
}), j ? /* @__PURE__ */
|
|
186
|
+
}), j ? /* @__PURE__ */ _(f, {
|
|
187
187
|
variant: "outline",
|
|
188
188
|
"data-testid": "custom-widget-reject",
|
|
189
189
|
onClick: de,
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ g(oe, {
|
|
191
191
|
className: "mr-1 size-4",
|
|
192
192
|
"aria-hidden": "true"
|
|
193
193
|
}), O("bigconsole.widget.customWidget.action.reject", "Reject")]
|
|
194
194
|
}) : null]
|
|
195
195
|
}),
|
|
196
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ _("div", {
|
|
197
197
|
className: "flex flex-col gap-2",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ g(m, {
|
|
199
199
|
htmlFor: "custom-widget-prompt",
|
|
200
200
|
children: "What should it show?"
|
|
201
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ g(se, {
|
|
202
202
|
id: "custom-widget-prompt",
|
|
203
203
|
"data-testid": "custom-widget-prompt",
|
|
204
204
|
value: A,
|
|
@@ -207,95 +207,95 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
207
207
|
rows: 3
|
|
208
208
|
})]
|
|
209
209
|
})
|
|
210
|
-
}), j ? /* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
210
|
+
}), j ? /* @__PURE__ */ _(h, { children: [
|
|
211
|
+
/* @__PURE__ */ _(e, {
|
|
212
212
|
emphasis: "primary",
|
|
213
213
|
tone: y[Y],
|
|
214
214
|
title: k[Y].title,
|
|
215
215
|
description: j.binding.parserId ? O("bigconsole.widget.customWidget.preview.parserDescription", "Rendered using the saved parser output.") : O("bigconsole.widget.customWidget.preview.sourceDescription", "Rendered using up to 50 source rows. Full data may differ."),
|
|
216
|
-
meta: /* @__PURE__ */
|
|
216
|
+
meta: /* @__PURE__ */ g("span", {
|
|
217
217
|
"data-testid": "custom-widget-preview-state",
|
|
218
218
|
"data-state": Y,
|
|
219
219
|
className: "rounded-pill bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
220
220
|
children: Y
|
|
221
221
|
}),
|
|
222
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ g("div", {
|
|
223
223
|
"data-testid": "custom-widget-preview",
|
|
224
224
|
className: "min-h-[220px] min-w-0 rounded-card border border-[var(--color-border-subtle)] bg-bg-surface p-2",
|
|
225
|
-
children: Y === "loading" ? /* @__PURE__ */
|
|
225
|
+
children: Y === "loading" ? /* @__PURE__ */ _("div", {
|
|
226
226
|
className: "flex h-[200px] items-center justify-center text-text-secondary",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
227
|
+
children: [/* @__PURE__ */ g(d, {
|
|
228
228
|
className: "mr-2 size-4 animate-spin",
|
|
229
229
|
"aria-hidden": "true"
|
|
230
|
-
}), /* @__PURE__ */
|
|
230
|
+
}), /* @__PURE__ */ g("span", {
|
|
231
231
|
className: "text-sm",
|
|
232
232
|
children: k.loading.body
|
|
233
233
|
})]
|
|
234
|
-
}) : Y === "valid" ? /* @__PURE__ */
|
|
234
|
+
}) : Y === "valid" ? /* @__PURE__ */ g("div", {
|
|
235
235
|
className: "h-[200px]",
|
|
236
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ g(n, {
|
|
237
237
|
widgetId: `preview-${j.id}`,
|
|
238
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ g(ee, {
|
|
239
239
|
widget: b(j, O("bigconsole.widget.customWidget.untitledWidget", "Untitled widget")),
|
|
240
240
|
data: z
|
|
241
241
|
})
|
|
242
242
|
})
|
|
243
|
-
}) : /* @__PURE__ */
|
|
243
|
+
}) : /* @__PURE__ */ _("div", {
|
|
244
244
|
className: "flex h-[200px] flex-col items-center justify-center gap-2 px-4 text-center",
|
|
245
245
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ g(l, {
|
|
247
247
|
className: "size-5 text-[var(--color-status-warning-text)]",
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ g("p", {
|
|
251
251
|
className: "text-sm text-text-secondary",
|
|
252
252
|
children: k[Y].body
|
|
253
253
|
}),
|
|
254
|
-
Y === "access-error" ? /* @__PURE__ */
|
|
254
|
+
Y === "access-error" ? /* @__PURE__ */ _(f, {
|
|
255
255
|
size: "sm",
|
|
256
256
|
variant: "outline",
|
|
257
257
|
onClick: () => X((e) => ({ ...e })),
|
|
258
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ g(ie, {
|
|
259
259
|
className: "mr-1 size-3.5",
|
|
260
260
|
"aria-hidden": "true"
|
|
261
261
|
}), O("bigconsole.widget.customWidget.action.retry", "Retry")]
|
|
262
262
|
}) : null
|
|
263
263
|
]
|
|
264
264
|
})
|
|
265
|
-
}), j.rationale ? /* @__PURE__ */
|
|
265
|
+
}), j.rationale ? /* @__PURE__ */ g("p", {
|
|
266
266
|
className: "mt-2 text-xs text-text-secondary",
|
|
267
267
|
"data-testid": "custom-widget-rationale",
|
|
268
268
|
children: j.rationale
|
|
269
269
|
}) : null]
|
|
270
270
|
}),
|
|
271
|
-
Q.length > 0 || $.length > 0 ? /* @__PURE__ */
|
|
271
|
+
Q.length > 0 || $.length > 0 ? /* @__PURE__ */ g(e, {
|
|
272
272
|
tone: Q.length > 0 ? "danger" : "warning",
|
|
273
273
|
padding: "compact",
|
|
274
274
|
headingLevel: 3,
|
|
275
275
|
title: Q.length > 0 ? `${Q.length} ${Q.length === 1 ? "problem" : "problems"} to fix before approving` : `${$.length} ${$.length === 1 ? "warning" : "warnings"}`,
|
|
276
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ g("ul", {
|
|
277
277
|
"data-testid": "custom-widget-issues",
|
|
278
278
|
className: "flex min-w-0 flex-col gap-1",
|
|
279
|
-
children: [...Q, ...$].map((e) => /* @__PURE__ */
|
|
279
|
+
children: [...Q, ...$].map((e) => /* @__PURE__ */ g("li", {
|
|
280
280
|
"data-severity": e.severity,
|
|
281
281
|
className: `break-words text-xs ${e.severity === "error" ? "text-[var(--color-status-error-text)]" : "text-[var(--color-status-warning-text)]"}`,
|
|
282
282
|
children: e.message
|
|
283
283
|
}, `${e.code}-${e.path ?? ""}`))
|
|
284
284
|
})
|
|
285
285
|
}) : null,
|
|
286
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ g(e, {
|
|
287
287
|
title: O("bigconsole.widget.customWidget.proposal.heading", "Proposal"),
|
|
288
288
|
description: "Every field is editable — the assistant proposes, you dispose.",
|
|
289
289
|
"data-testid": "custom-widget-proposal-fields",
|
|
290
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ _("div", {
|
|
291
291
|
className: "flex flex-col gap-3",
|
|
292
292
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ _("div", {
|
|
294
294
|
className: "flex flex-col gap-1",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ g(m, {
|
|
296
296
|
htmlFor: "custom-widget-title",
|
|
297
297
|
children: O("bigconsole.widget.customWidget.field.title", "Title")
|
|
298
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ g(p, {
|
|
299
299
|
id: "custom-widget-title",
|
|
300
300
|
"data-testid": "custom-widget-title",
|
|
301
301
|
className: v,
|
|
@@ -309,12 +309,12 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
309
309
|
}))
|
|
310
310
|
})]
|
|
311
311
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ _("div", {
|
|
313
313
|
className: "flex flex-col gap-1",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ g(m, {
|
|
315
315
|
htmlFor: "custom-widget-type",
|
|
316
316
|
children: O("bigconsole.widget.customWidget.field.widgetType", "Widget type")
|
|
317
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ g("select", {
|
|
318
318
|
id: "custom-widget-type",
|
|
319
319
|
"data-testid": "custom-widget-type",
|
|
320
320
|
value: j.widgetType,
|
|
@@ -323,18 +323,18 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
323
323
|
widgetType: e.target.value
|
|
324
324
|
})),
|
|
325
325
|
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",
|
|
326
|
-
children: te.map((e) => /* @__PURE__ */
|
|
326
|
+
children: te.map((e) => /* @__PURE__ */ g("option", {
|
|
327
327
|
value: e,
|
|
328
328
|
children: e
|
|
329
329
|
}, e))
|
|
330
330
|
})]
|
|
331
331
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ _("div", {
|
|
333
333
|
className: "flex flex-col gap-1",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ g(m, {
|
|
335
335
|
htmlFor: "custom-widget-sink",
|
|
336
336
|
children: O("bigconsole.widget.customWidget.field.dataSink", "DataSink")
|
|
337
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ _("select", {
|
|
338
338
|
id: "custom-widget-sink",
|
|
339
339
|
"data-testid": "custom-widget-sink",
|
|
340
340
|
value: j.binding.dataSinkId,
|
|
@@ -350,21 +350,21 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
350
350
|
}));
|
|
351
351
|
},
|
|
352
352
|
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",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ g("option", {
|
|
354
354
|
value: "",
|
|
355
355
|
children: O("bigconsole.widget.customWidget.field.selectDataSink", "Select a DataSink…")
|
|
356
|
-
}), a.map((e) => /* @__PURE__ */
|
|
356
|
+
}), a.map((e) => /* @__PURE__ */ g("option", {
|
|
357
357
|
value: e.id,
|
|
358
358
|
children: e.name || e.key
|
|
359
359
|
}, e.id))]
|
|
360
360
|
})]
|
|
361
361
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ _("div", {
|
|
363
363
|
className: "flex flex-col gap-1",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
364
|
+
children: [/* @__PURE__ */ g(m, {
|
|
365
365
|
htmlFor: "custom-widget-parser",
|
|
366
366
|
children: O("bigconsole.widget.customWidget.field.parser", "Parser")
|
|
367
|
-
}), /* @__PURE__ */
|
|
367
|
+
}), /* @__PURE__ */ _("select", {
|
|
368
368
|
id: "custom-widget-parser",
|
|
369
369
|
"data-testid": "custom-widget-parser",
|
|
370
370
|
value: j.binding.parserId ?? "",
|
|
@@ -380,29 +380,29 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
380
380
|
}));
|
|
381
381
|
},
|
|
382
382
|
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",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ g("option", {
|
|
384
384
|
value: "",
|
|
385
385
|
children: O("bigconsole.widget.customWidget.field.noParser", "No parser")
|
|
386
|
-
}), C.map((e) => /* @__PURE__ */
|
|
386
|
+
}), C.map((e) => /* @__PURE__ */ g("option", {
|
|
387
387
|
value: e.id,
|
|
388
388
|
children: e.name
|
|
389
389
|
}, e.id))]
|
|
390
390
|
})]
|
|
391
391
|
}),
|
|
392
|
-
Object.keys(j.fieldMapping).length > 0 ? /* @__PURE__ */
|
|
392
|
+
Object.keys(j.fieldMapping).length > 0 ? /* @__PURE__ */ _("fieldset", {
|
|
393
393
|
className: "flex flex-col gap-2",
|
|
394
394
|
"data-testid": "custom-widget-field-mapping",
|
|
395
395
|
children: [
|
|
396
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ g("legend", {
|
|
397
397
|
className: "text-sm font-medium text-text-primary",
|
|
398
398
|
children: O("bigconsole.widget.customWidget.fieldMapping.legend", "Field mapping")
|
|
399
399
|
}),
|
|
400
|
-
Object.entries(j.fieldMapping).map(([e, t]) => /* @__PURE__ */
|
|
400
|
+
Object.entries(j.fieldMapping).map(([e, t]) => /* @__PURE__ */ _("div", {
|
|
401
401
|
className: "flex flex-col gap-1",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ g(m, {
|
|
403
403
|
htmlFor: `custom-widget-field-${e}`,
|
|
404
404
|
children: e
|
|
405
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ g(p, {
|
|
406
406
|
id: `custom-widget-field-${e}`,
|
|
407
407
|
"data-testid": `custom-widget-field-${e}`,
|
|
408
408
|
value: t,
|
|
@@ -415,7 +415,7 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
415
415
|
}))
|
|
416
416
|
})]
|
|
417
417
|
}, e)),
|
|
418
|
-
q?.length ? /* @__PURE__ */
|
|
418
|
+
q?.length ? /* @__PURE__ */ g("p", {
|
|
419
419
|
className: "break-words text-xs text-text-secondary",
|
|
420
420
|
children: O("bigconsole.widget.customWidget.fieldMapping.available", "Available: {{fields}}", { fields: q.join(", ") })
|
|
421
421
|
}) : null
|
|
@@ -424,44 +424,44 @@ var C = a(function({ sinks: a, parsers: C, resolvePreviewData: w, onApprove: T,
|
|
|
424
424
|
]
|
|
425
425
|
})
|
|
426
426
|
}),
|
|
427
|
-
L ? /* @__PURE__ */
|
|
427
|
+
L ? /* @__PURE__ */ g(e, {
|
|
428
428
|
tone: "danger",
|
|
429
429
|
padding: "compact",
|
|
430
430
|
headingLevel: 3,
|
|
431
431
|
title: "Could not add the widget",
|
|
432
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ g("p", {
|
|
433
433
|
role: "alert",
|
|
434
434
|
className: "break-words text-xs text-[var(--color-status-error-text)]",
|
|
435
435
|
"data-testid": "custom-widget-approve-error",
|
|
436
436
|
children: L
|
|
437
437
|
})
|
|
438
438
|
}) : null,
|
|
439
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ _("div", {
|
|
440
440
|
className: "flex flex-wrap gap-2 border-t border-[var(--color-border-subtle)] pt-3",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ _(f, {
|
|
442
442
|
"data-testid": "custom-widget-approve",
|
|
443
443
|
onClick: Z,
|
|
444
444
|
disabled: !J.canApprove || V || U || F,
|
|
445
|
-
children: [F ? /* @__PURE__ */
|
|
445
|
+
children: [F ? /* @__PURE__ */ g(d, {
|
|
446
446
|
className: "mr-2 size-4 animate-spin",
|
|
447
447
|
"aria-hidden": "true"
|
|
448
|
-
}) : /* @__PURE__ */
|
|
448
|
+
}) : /* @__PURE__ */ g(u, {
|
|
449
449
|
className: "mr-1 size-4",
|
|
450
450
|
"aria-hidden": "true"
|
|
451
451
|
}), O("bigconsole.widget.customWidget.action.approveAndAdd", "Approve & add to dashboard")]
|
|
452
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ g(f, {
|
|
453
453
|
variant: "outline",
|
|
454
454
|
onClick: E,
|
|
455
455
|
"data-testid": "custom-widget-cancel",
|
|
456
456
|
children: O("bigconsole.widget.customWidget.action.cancel", "Cancel")
|
|
457
457
|
})]
|
|
458
458
|
})
|
|
459
|
-
] }) : /* @__PURE__ */
|
|
459
|
+
] }) : /* @__PURE__ */ g(e, {
|
|
460
460
|
emphasis: "muted",
|
|
461
461
|
padding: "compact",
|
|
462
462
|
title: "No proposal yet",
|
|
463
463
|
headingLevel: 3,
|
|
464
|
-
children: /* @__PURE__ */
|
|
464
|
+
children: /* @__PURE__ */ g("p", {
|
|
465
465
|
className: "text-sm text-text-secondary",
|
|
466
466
|
"data-testid": "custom-widget-empty",
|
|
467
467
|
children: O("bigconsole.widget.customWidget.empty", "No proposal yet. Describe a widget and the assistant will propose one for you to review — nothing is added to the dashboard until you approve it.")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LayoutItem } from '../utils/layoutBaseline';
|
|
2
|
+
|
|
3
|
+
export interface DashboardLayoutBaseline {
|
|
4
|
+
/** The board's positions differ from the last loaded or saved ones, because a person placed something. */
|
|
5
|
+
dirty: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Re-take the baseline after the positions reached the server. `sent` is exactly
|
|
8
|
+
* what was sent; `editRevisionAtSave` is `layoutEditRevision` read BEFORE the
|
|
9
|
+
* request began, so a placement made while it was in flight stays dirty.
|
|
10
|
+
* Call it on success only: a failed save must leave the layout dirty.
|
|
11
|
+
*/
|
|
12
|
+
markSaved: (sent: ReadonlyArray<LayoutItem>, editRevisionAtSave: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function useDashboardLayoutBaseline(dashboardId: string | undefined): DashboardLayoutBaseline;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useWidgetStore as e } from "../store/widgetStore.js";
|
|
2
|
+
import "../store/index.js";
|
|
3
|
+
import { INITIAL_LAYOUT_BASELINE as t, isLayoutBaselineDirty as n, layoutFromWidgets as r, normaliseLayout as i, reduceLayoutBaseline as a } from "../utils/layoutBaseline.js";
|
|
4
|
+
import { useCallback as o, useEffect as s, useMemo as c, useReducer as l, useState as u } from "react";
|
|
5
|
+
//#region src/bigconsole/hooks/useDashboardLayoutBaseline.ts
|
|
6
|
+
function d(d) {
|
|
7
|
+
let f = e((e) => e.widgets), p = e((e) => e.layoutEditRevision), [m, h] = l(a, t), g = c(() => r(f.values()), [f]), [_, v] = u(d);
|
|
8
|
+
_ !== d && (v(d), h({ type: "reset" })), s(() => {
|
|
9
|
+
h({
|
|
10
|
+
type: "observe",
|
|
11
|
+
layout: g,
|
|
12
|
+
editRevision: p
|
|
13
|
+
});
|
|
14
|
+
}, [
|
|
15
|
+
d,
|
|
16
|
+
g,
|
|
17
|
+
p
|
|
18
|
+
]);
|
|
19
|
+
let y = o((e, t) => {
|
|
20
|
+
h({
|
|
21
|
+
type: "saved",
|
|
22
|
+
layout: i(e),
|
|
23
|
+
editRevision: t
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
return {
|
|
27
|
+
dirty: n(m, g),
|
|
28
|
+
markSaved: y
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { d as useDashboardLayoutBaseline };
|
|
@@ -7,6 +7,25 @@ export type AlertChannel = BigConsoleDataSinkAlertChannelsQuery['dataSinkAlertCh
|
|
|
7
7
|
export type AlertExecution = BigConsoleDataSinkAlertExecutionsQuery['dataSinkAlertExecutions'][number];
|
|
8
8
|
export type AlertPreview = BigConsolePreviewDataSinkAlertQuery['previewDataSinkAlert'];
|
|
9
9
|
export declare const alertErrorMessage: (error: unknown) => string;
|
|
10
|
+
/**
|
|
11
|
+
* "This data sink is not here": the client's own check (`getDataSink` answers
|
|
12
|
+
* `null`, or a sink from another workspace) and the server's codes for it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ALERT_SINK_NOT_FOUND = "DATASINK_NOT_FOUND";
|
|
15
|
+
type Translate = (key: string, fallback: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* What the alerts page says when the data sink could not be loaded
|
|
18
|
+
* (BOFF-8060 i18n B3). The server's English never wins over a keyed string:
|
|
19
|
+
*
|
|
20
|
+
* - not found (or nothing recorded) → `bigconsole.alerts.notFound`;
|
|
21
|
+
* - a coded failure → `bigconsole.errors.<CODE>`, the catalog the rest of
|
|
22
|
+
* BigConsole localizes backend errors with;
|
|
23
|
+
* - only an uncoded failure falls back to its raw message, which has no key.
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeAlertLoadFailure(t: Translate, failure: {
|
|
26
|
+
error: string | null;
|
|
27
|
+
errorCode: string | null;
|
|
28
|
+
}): string;
|
|
10
29
|
/** Every read and write uses the selected workspace; late requests cannot populate a new owner. */
|
|
11
30
|
export declare function useDataSinkAlerts(dataSinkId: string, enabled: boolean): {
|
|
12
31
|
owner: string;
|
|
@@ -43,6 +62,7 @@ export declare function useDataSinkAlerts(dataSinkId: string, enabled: boolean):
|
|
|
43
62
|
}> | null;
|
|
44
63
|
} | null | undefined>;
|
|
45
64
|
reloadChannels: () => Promise<void>;
|
|
65
|
+
reloadSinkThenChannels: () => Promise<void>;
|
|
46
66
|
save: (alert: DataSinkAlertInput, expectedVersion: number) => Promise<{
|
|
47
67
|
__typename?: "DataSink";
|
|
48
68
|
id: string;
|
|
@@ -141,5 +161,8 @@ export declare function useDataSinkAlerts(dataSinkId: string, enabled: boolean):
|
|
|
141
161
|
channels: AlertChannel[];
|
|
142
162
|
loading: boolean;
|
|
143
163
|
error: string | null;
|
|
164
|
+
/** The first GraphQL `extensions.code` behind `error`, or the client's own not-found marker. */
|
|
165
|
+
errorCode: string | null;
|
|
144
166
|
channelError: string | null;
|
|
145
167
|
};
|
|
168
|
+
export {};
|