@burdenoff/microfe-bigconsole 2026.1118.7 → 2026.1118.9
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/components/dashboard/DashboardCanvas.d.ts +2 -0
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +69 -68
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.d.ts +13 -0
- package/dist/bigconsole/components/dashboard/DashboardReviewDialog.js +136 -0
- package/dist/bigconsole/components/dashboard/DashboardToolbar.d.ts +2 -0
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +102 -89
- package/dist/bigconsole/components/dashboard/index.d.ts +1 -0
- package/dist/bigconsole/components/dashboard/index.js +2 -1
- package/dist/bigconsole/components/insights/BoardLintPanel.d.ts +18 -8
- package/dist/bigconsole/components/insights/BoardLintPanel.js +52 -52
- package/dist/bigconsole/pages/DashboardViewPage.js +191 -182
- package/dist/bigconsole/utils/boardLint.d.ts +8 -0
- package/dist/bigconsole/utils/boardLint.js +4 -0
- package/dist/bigconsole/utils/savedBoardLint.d.ts +102 -0
- package/dist/bigconsole/utils/savedBoardLint.js +100 -0
- package/dist/generated/wspace-operations.d.ts +26 -2
- package/dist/generated/wspace-types.d.ts +17923 -1542
- package/package.json +1 -1
|
@@ -9,176 +9,189 @@ import "./SavedViewsDropdown/index.js";
|
|
|
9
9
|
import { memo as a, useCallback as o } from "react";
|
|
10
10
|
import { PermissionButton as s } from "@burdenoff/fe-libs/shared/components";
|
|
11
11
|
import { usePermissions as c } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
|
-
import { Clipboard as l,
|
|
13
|
-
import { Button as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { Fragment as
|
|
12
|
+
import { Clipboard as l, ClipboardCheck as u, Download as d, Eye as f, FileText as p, Image as m, Minus as h, PanelLeft as g, PanelLeftClose as _, Pencil as v, Plus as y, RotateCcw as b, Save as x, Share2 as S, Store as C } from "lucide-react";
|
|
13
|
+
import { Button as w, Spinner as T, Tooltip as E, TooltipContent as D, TooltipProvider as O, TooltipTrigger as k } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { useI18n as A } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
16
16
|
// src/bigconsole/components/dashboard/DashboardToolbar.tsx
|
|
17
|
-
var
|
|
18
|
-
let { hasPermission:
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
return /* @__PURE__ */
|
|
17
|
+
var P = a(function({ dashboardId: a, title: P, onAddWidget: F, onTogglePalette: I, isPaletteOpen: L = !1, onPaste: R, onSave: z, isSaving: B = !1, onReview: V, onExport: H, onPublishTemplate: U, onExportImage: W, onExportPdf: G, isExportingImage: K = !1, onShare: q }) {
|
|
18
|
+
let { hasPermission: ee } = c(), { t: J } = A(), Y = t((e) => e.viewMode === "edit"), X = t((e) => e.toggleViewMode), Z = t((e) => e.zoomLevel), Q = t((e) => e.setZoomLevel), $ = !!e((e) => e.clipboardWidgetId), te = o(() => {
|
|
19
|
+
$ && R && R();
|
|
20
|
+
}, [$, R]);
|
|
21
|
+
return /* @__PURE__ */ M(O, { children: /* @__PURE__ */ N(n, {
|
|
22
22
|
emphasis: "bare",
|
|
23
23
|
padding: "none",
|
|
24
|
-
"aria-label":
|
|
24
|
+
"aria-label": P ? `Board toolbar — ${P}` : "Board toolbar",
|
|
25
25
|
"data-testid": "dashboard-toolbar",
|
|
26
26
|
className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-4 py-2",
|
|
27
27
|
bodyClassName: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2",
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ M("div", {
|
|
30
30
|
className: "flex min-w-0 items-center gap-4",
|
|
31
|
-
children: a && /* @__PURE__ */
|
|
31
|
+
children: a && /* @__PURE__ */ M(i, { dashboardId: a })
|
|
32
32
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ N("div", {
|
|
34
34
|
role: "group",
|
|
35
35
|
"aria-label": "Zoom",
|
|
36
36
|
className: "flex min-w-0 items-center gap-1 border-l border-[var(--color-border-subtle)] pl-4",
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
39
39
|
asChild: !0,
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ M(w, {
|
|
41
41
|
variant: "ghost",
|
|
42
42
|
size: "icon-sm",
|
|
43
|
-
onClick: () =>
|
|
44
|
-
disabled:
|
|
45
|
-
children: /* @__PURE__ */
|
|
43
|
+
onClick: () => Q(Math.max(50, Z - 10)),
|
|
44
|
+
disabled: Z <= 50,
|
|
45
|
+
children: /* @__PURE__ */ M(h, { className: "size-4" })
|
|
46
46
|
})
|
|
47
|
-
}), /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.zoomOut", "Zoom out") })] }),
|
|
48
|
+
/* @__PURE__ */ N("span", {
|
|
49
49
|
className: "text-sm text-text-secondary w-12 text-center",
|
|
50
|
-
children: [
|
|
50
|
+
children: [Z, "%"]
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
53
53
|
asChild: !0,
|
|
54
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ M(w, {
|
|
55
55
|
variant: "ghost",
|
|
56
56
|
size: "icon-sm",
|
|
57
|
-
onClick: () =>
|
|
58
|
-
disabled:
|
|
59
|
-
children: /* @__PURE__ */
|
|
57
|
+
onClick: () => Q(Math.min(200, Z + 10)),
|
|
58
|
+
disabled: Z >= 200,
|
|
59
|
+
children: /* @__PURE__ */ M(y, { className: "size-4" })
|
|
60
60
|
})
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.zoomIn", "Zoom in") })] }),
|
|
62
|
+
/* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
63
63
|
asChild: !0,
|
|
64
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ N(w, {
|
|
65
65
|
variant: "ghost",
|
|
66
66
|
size: "sm",
|
|
67
|
-
onClick: () =>
|
|
68
|
-
children: [/* @__PURE__ */
|
|
67
|
+
onClick: () => Q(100),
|
|
68
|
+
children: [/* @__PURE__ */ M(b, { className: "size-3.5 mr-1" }), J("bigconsole.dashboards.toolbar.reset", "Reset")]
|
|
69
69
|
})
|
|
70
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.resetZoomTooltip", "Reset zoom to 100%") })] })
|
|
71
71
|
]
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ N("div", {
|
|
74
74
|
role: "group",
|
|
75
75
|
"aria-label": "Board actions",
|
|
76
76
|
className: "flex min-w-0 flex-wrap items-center justify-end gap-2 border-l border-[var(--color-border-subtle)] pl-4",
|
|
77
77
|
children: [
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
Y && /* @__PURE__ */ N(j, { children: [
|
|
79
|
+
I && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
80
80
|
asChild: !0,
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
-
variant:
|
|
81
|
+
children: /* @__PURE__ */ N(w, {
|
|
82
|
+
variant: L ? "secondary" : "outline",
|
|
83
83
|
size: "sm",
|
|
84
|
-
onClick:
|
|
85
|
-
children: [
|
|
84
|
+
onClick: I,
|
|
85
|
+
children: [M(L ? _ : g, { className: "size-4" }), J("bigconsole.dashboards.toolbar.widgets", "Widgets")]
|
|
86
86
|
})
|
|
87
|
-
}), /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ M(D, { children: L ? J("bigconsole.dashboards.toolbar.hidePalette", "Hide widget palette") : J("bigconsole.dashboards.toolbar.showPalette", "Show widget palette for drag & drop") })] }),
|
|
88
|
+
/* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
89
89
|
asChild: !0,
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ N(w, {
|
|
91
91
|
variant: "ghost",
|
|
92
92
|
size: "sm",
|
|
93
|
-
onClick:
|
|
94
|
-
disabled:
|
|
95
|
-
children: [/* @__PURE__ */
|
|
93
|
+
onClick: te,
|
|
94
|
+
disabled: !$,
|
|
95
|
+
children: [/* @__PURE__ */ M(l, { className: "size-4" }), J("bigconsole.dashboards.toolbar.paste", "Paste")]
|
|
96
96
|
})
|
|
97
|
-
}), /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.pasteTooltip", "Paste widget from clipboard") })] }),
|
|
98
|
+
/* @__PURE__ */ M(s, {
|
|
99
99
|
permission: r.WIDGET_CREATE,
|
|
100
100
|
deniedBehavior: "hide",
|
|
101
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ N(w, {
|
|
102
102
|
size: "sm",
|
|
103
|
-
onClick:
|
|
104
|
-
children: [/* @__PURE__ */
|
|
103
|
+
onClick: F,
|
|
104
|
+
children: [/* @__PURE__ */ M(y, { className: "size-4" }), J("bigconsole.dashboards.toolbar.addWidget", "Add Widget")]
|
|
105
105
|
})
|
|
106
106
|
})
|
|
107
107
|
] }),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
variant:
|
|
108
|
+
/* @__PURE__ */ M(w, {
|
|
109
|
+
variant: Y ? "secondary" : "outline",
|
|
110
110
|
size: "sm",
|
|
111
|
-
onClick:
|
|
112
|
-
children:
|
|
111
|
+
onClick: X,
|
|
112
|
+
children: Y ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(f, { className: "size-4" }), J("bigconsole.dashboards.toolbar.preview", "Preview")] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(v, { className: "size-4" }), J("bigconsole.dashboards.toolbar.edit", "Edit")] })
|
|
113
113
|
}),
|
|
114
|
-
|
|
114
|
+
z && /* @__PURE__ */ M(w, {
|
|
115
115
|
variant: "outline",
|
|
116
116
|
size: "sm",
|
|
117
|
-
onClick:
|
|
118
|
-
disabled:
|
|
119
|
-
children:
|
|
117
|
+
onClick: z,
|
|
118
|
+
disabled: B,
|
|
119
|
+
children: B ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(T, { className: "size-4" }), J("bigconsole.dashboards.toolbar.saving", "Saving...")] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(x, { className: "size-4" }), J("bigconsole.dashboards.toolbar.save", "Save")] })
|
|
120
120
|
}),
|
|
121
|
-
|
|
121
|
+
q && /* @__PURE__ */ M(s, {
|
|
122
122
|
permission: r.DASHBOARD_SHARE,
|
|
123
123
|
deniedBehavior: "hide",
|
|
124
|
-
children: /* @__PURE__ */
|
|
124
|
+
children: /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
125
125
|
asChild: !0,
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ N(w, {
|
|
127
127
|
variant: "outline",
|
|
128
128
|
size: "sm",
|
|
129
|
-
onClick:
|
|
130
|
-
children: [/* @__PURE__ */
|
|
129
|
+
onClick: q,
|
|
130
|
+
children: [/* @__PURE__ */ M(S, { className: "size-4" }), J("bigconsole.dashboards.toolbar.share", "Share")]
|
|
131
131
|
})
|
|
132
|
-
}), /* @__PURE__ */
|
|
132
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.shareTooltip", "Share dashboard with others") })] })
|
|
133
133
|
}),
|
|
134
|
-
|
|
134
|
+
U && /* @__PURE__ */ M(s, {
|
|
135
135
|
permission: r.DASHBOARD_PUBLISH,
|
|
136
136
|
deniedBehavior: "hide",
|
|
137
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
138
138
|
asChild: !0,
|
|
139
|
-
children: /* @__PURE__ */
|
|
139
|
+
children: /* @__PURE__ */ N(w, {
|
|
140
140
|
variant: "outline",
|
|
141
141
|
size: "sm",
|
|
142
|
-
onClick:
|
|
143
|
-
children: [/* @__PURE__ */
|
|
142
|
+
onClick: U,
|
|
143
|
+
children: [/* @__PURE__ */ M(C, { className: "size-4" }), /* @__PURE__ */ M("span", {
|
|
144
144
|
className: "hidden sm:inline",
|
|
145
|
-
children:
|
|
145
|
+
children: J("bigconsole.dashboards.toolbar.publish", "Publish")
|
|
146
146
|
})]
|
|
147
147
|
})
|
|
148
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.publishTooltip", "Publish this dashboard as a reusable template") })] })
|
|
149
149
|
}),
|
|
150
|
-
|
|
150
|
+
V && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
151
151
|
asChild: !0,
|
|
152
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ N(w, {
|
|
153
153
|
variant: "outline",
|
|
154
154
|
size: "sm",
|
|
155
|
-
onClick:
|
|
156
|
-
|
|
155
|
+
onClick: V,
|
|
156
|
+
"data-testid": "dashboard-review-button",
|
|
157
|
+
children: [/* @__PURE__ */ M(u, { className: "size-4" }), /* @__PURE__ */ M("span", {
|
|
158
|
+
className: "hidden sm:inline",
|
|
159
|
+
children: J("bigconsole.dashboards.toolbar.review", "Review")
|
|
160
|
+
})]
|
|
157
161
|
})
|
|
158
|
-
}), /* @__PURE__ */
|
|
159
|
-
H && /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.reviewTooltip", "Check charts for misleading axes, colour-only meaning and unclear titles") })] }),
|
|
163
|
+
H && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
160
164
|
asChild: !0,
|
|
161
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ N(w, {
|
|
162
166
|
variant: "outline",
|
|
163
|
-
size: "
|
|
167
|
+
size: "sm",
|
|
164
168
|
onClick: H,
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
children: [/* @__PURE__ */ M(d, { className: "size-4" }), J("bigconsole.dashboards.toolbar.export", "Export")]
|
|
170
|
+
})
|
|
171
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.exportTooltip", "Export dashboard to JSON") })] }),
|
|
172
|
+
W && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
173
|
+
asChild: !0,
|
|
174
|
+
children: /* @__PURE__ */ M(w, {
|
|
175
|
+
variant: "outline",
|
|
176
|
+
size: "icon-sm",
|
|
177
|
+
onClick: W,
|
|
178
|
+
disabled: K,
|
|
179
|
+
children: M(K ? T : m, { className: "size-4" })
|
|
167
180
|
})
|
|
168
|
-
}), /* @__PURE__ */
|
|
169
|
-
|
|
181
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.exportPngTooltip", "Export board as PNG image") })] }),
|
|
182
|
+
G && /* @__PURE__ */ N(E, { children: [/* @__PURE__ */ M(k, {
|
|
170
183
|
asChild: !0,
|
|
171
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ M(w, {
|
|
172
185
|
variant: "outline",
|
|
173
186
|
size: "icon-sm",
|
|
174
|
-
onClick:
|
|
175
|
-
disabled:
|
|
176
|
-
children: /* @__PURE__ */
|
|
187
|
+
onClick: G,
|
|
188
|
+
disabled: K,
|
|
189
|
+
children: /* @__PURE__ */ M(p, { className: "size-4" })
|
|
177
190
|
})
|
|
178
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ M(D, { children: J("bigconsole.dashboards.toolbar.exportPdfTooltip", "Export board as PDF") })] })
|
|
179
192
|
]
|
|
180
193
|
})
|
|
181
194
|
]
|
|
182
195
|
}) });
|
|
183
196
|
});
|
|
184
|
-
export {
|
|
197
|
+
export { P as DashboardToolbar, P as default };
|
|
@@ -21,3 +21,4 @@ export { WidgetPalette, type WidgetPaletteProps } from './WidgetPalette';
|
|
|
21
21
|
export { DrilldownBreadcrumb } from './DrilldownBreadcrumb';
|
|
22
22
|
export { BuilderCanvas, BuilderTopbar, DashboardEditorShell } from '../builder';
|
|
23
23
|
export { PublishToStoreDialog } from './PublishToStoreDialog';
|
|
24
|
+
export { DashboardReviewDialog, type DashboardReviewDialogProps } from './DashboardReviewDialog';
|
|
@@ -25,4 +25,5 @@ import "./WidgetPalette.js";
|
|
|
25
25
|
import { DrilldownBreadcrumb as r } from "./DrilldownBreadcrumb.js";
|
|
26
26
|
import "../builder/index.js";
|
|
27
27
|
import { PublishToStoreDialog as i } from "./PublishToStoreDialog.js";
|
|
28
|
-
|
|
28
|
+
import { DashboardReviewDialog as a } from "./DashboardReviewDialog.js";
|
|
29
|
+
export { e as DashboardCanvas, a as DashboardReviewDialog, r as DrilldownBreadcrumb, n as ExportDashboardDialog, t as LiveCanvasToggle, i as PublishToStoreDialog };
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { LintFix } from '../../utils/boardLint';
|
|
3
|
-
import { GeneratedDashboardSpecLike } from '../../utils/consoleDefinition';
|
|
2
|
+
import { LintableBoard, LintFix } from '../../utils/boardLint';
|
|
4
3
|
export interface BoardLintPanelProps {
|
|
5
|
-
/** The generated proposal
|
|
6
|
-
spec:
|
|
4
|
+
/** The board being reviewed: an AI-generated proposal or a saved dashboard. */
|
|
5
|
+
spec: LintableBoard | null;
|
|
7
6
|
/**
|
|
8
|
-
* Applies one fix
|
|
9
|
-
*
|
|
10
|
-
* listed without a "Fix it" action.
|
|
7
|
+
* Applies one fix and returns an id the host can use to undo it later: the refined copy's generation id
|
|
8
|
+
* for a draft, or an undo-history key for a saved dashboard (null when nothing was changed, for example
|
|
9
|
+
* after a quota error). When omitted, findings are listed without a "Fix it" action.
|
|
11
10
|
*/
|
|
12
11
|
onApplyFix?: (fix: LintFix) => Promise<string | null>;
|
|
13
|
-
/**
|
|
12
|
+
/** Reverts a change made by `onApplyFix`. When omitted, no Undo link is shown. */
|
|
14
13
|
onUndoFix?: (generationId: string) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* The board is a saved dashboard rather than a draft: fixes change the real widget, and a widget with
|
|
16
|
+
* no data connection is reported on its own instead of once for the whole board.
|
|
17
|
+
*/
|
|
18
|
+
saved?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Keep "Fix it" available after a fix, so several problems can be fixed in turn. The host must keep an
|
|
21
|
+
* undo history, because the panel only ever shows the latest change. Draft mode leaves this off: a
|
|
22
|
+
* second refined copy would replace the first one's id and strand it without an Undo.
|
|
23
|
+
*/
|
|
24
|
+
repeatable?: boolean;
|
|
15
25
|
/**
|
|
16
26
|
* The refined copy already created for this draft. Pass it (with `onAppliedChange`) from a parent that
|
|
17
27
|
* renders more than one panel for the same draft, so they share one "one copy at a time" guard and one Undo.
|
|
@@ -11,47 +11,47 @@ var h = {
|
|
|
11
11
|
success: /* @__PURE__ */ p(c, { className: "size-4" }),
|
|
12
12
|
info: /* @__PURE__ */ p(l, { className: "size-4" }),
|
|
13
13
|
warning: /* @__PURE__ */ p(u, { className: "size-4" })
|
|
14
|
-
}, g = i(function({ spec: i, onApplyFix: c, onUndoFix: l, applied: u, onAppliedChange: g }) {
|
|
15
|
-
let { t:
|
|
14
|
+
}, g = i(function({ spec: i, onApplyFix: c, onUndoFix: l, applied: u, onAppliedChange: g, saved: _ = !1, repeatable: v = !1 }) {
|
|
15
|
+
let { t: y } = f(), b = o(() => i ? t(i, { draft: !_ }) : [], [i]), x = n(b), [S, C] = s(null), [w, T] = s(null), [E, D] = s(null), [O, k] = s(null), A = g !== void 0, j = A ? u ?? null : O, M = A ? g : k, N = j !== null && !v;
|
|
16
16
|
a(() => {
|
|
17
|
-
|
|
18
|
-
}, [i,
|
|
19
|
-
let
|
|
20
|
-
let e =
|
|
17
|
+
C(null), D(null), A || k(null);
|
|
18
|
+
}, [i, A]);
|
|
19
|
+
let P = o(() => {
|
|
20
|
+
let e = S === null ? void 0 : b[S];
|
|
21
21
|
return i && e ? r(i, e) : null;
|
|
22
22
|
}, [
|
|
23
23
|
i,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]),
|
|
27
|
-
if (
|
|
28
|
-
|
|
24
|
+
S,
|
|
25
|
+
b
|
|
26
|
+
]), F = async () => {
|
|
27
|
+
if (P && c && !N) {
|
|
28
|
+
T("apply"), D(null);
|
|
29
29
|
try {
|
|
30
|
-
let e = await c(
|
|
31
|
-
|
|
30
|
+
let e = await c(P);
|
|
31
|
+
C(null), e && M({
|
|
32
32
|
generationId: e,
|
|
33
|
-
summary:
|
|
33
|
+
summary: P.summary
|
|
34
34
|
});
|
|
35
35
|
} catch (e) {
|
|
36
|
-
|
|
36
|
+
D(e instanceof Error ? e.message : String(e));
|
|
37
37
|
} finally {
|
|
38
|
-
|
|
38
|
+
T(null);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
return i ? /* @__PURE__ */ m(e, {
|
|
43
43
|
headingLevel: 3,
|
|
44
|
-
tone:
|
|
44
|
+
tone: x,
|
|
45
45
|
padding: "compact",
|
|
46
|
-
icon: h[
|
|
47
|
-
title:
|
|
48
|
-
count:
|
|
49
|
-
plural:
|
|
46
|
+
icon: h[x],
|
|
47
|
+
title: b.length === 0 ? y("bigconsole.analysis.boardLint.cleanTitle", "No chart-quality problems found") : y("bigconsole.analysis.boardLint.issuesTitle", "{{count}} chart-quality note{{plural}}", {
|
|
48
|
+
count: b.length,
|
|
49
|
+
plural: b.length === 1 ? "" : "s"
|
|
50
50
|
}),
|
|
51
|
-
description: _("bigconsole.analysis.boardLint.description", "A quick review of axes, colours and labels. These do not block creating the dashboard."),
|
|
51
|
+
description: _ ? y("bigconsole.analysis.boardLint.savedDescription", "A quick review of axes, colours and labels. These are suggestions; your dashboard keeps working as it is.") : y("bigconsole.analysis.boardLint.description", "A quick review of axes, colours and labels. These do not block creating the dashboard."),
|
|
52
52
|
"data-testid": "board-lint",
|
|
53
53
|
children: [
|
|
54
|
-
|
|
54
|
+
j && /* @__PURE__ */ m("div", {
|
|
55
55
|
role: "status",
|
|
56
56
|
"data-testid": "board-lint-applied",
|
|
57
57
|
style: {
|
|
@@ -62,39 +62,39 @@ var h = {
|
|
|
62
62
|
fontSize: "var(--font-size-body-sm)",
|
|
63
63
|
color: "var(--color-text-primary)"
|
|
64
64
|
},
|
|
65
|
-
children: [/* @__PURE__ */ p("p", { children: _("bigconsole.analysis.boardLint.appliedNote", "Created a refined copy with this change: {{summary}} Your original draft is unchanged.", { summary:
|
|
65
|
+
children: [/* @__PURE__ */ p("p", { children: _ ? y("bigconsole.analysis.boardLint.savedAppliedNote", "Changed this dashboard: {{summary}} You can undo it.", { summary: j.summary }) : y("bigconsole.analysis.boardLint.appliedNote", "Created a refined copy with this change: {{summary}} Your original draft is unchanged.", { summary: j.summary }) }), l && /* @__PURE__ */ p("div", {
|
|
66
66
|
style: { marginTop: "var(--space-controlGap)" },
|
|
67
67
|
children: /* @__PURE__ */ p(d, {
|
|
68
68
|
type: "button",
|
|
69
69
|
size: "sm",
|
|
70
70
|
variant: "outline",
|
|
71
71
|
onClick: async () => {
|
|
72
|
-
if (
|
|
73
|
-
|
|
72
|
+
if (j && l) {
|
|
73
|
+
T("undo"), D(null);
|
|
74
74
|
try {
|
|
75
|
-
await l(
|
|
75
|
+
await l(j.generationId), M(null);
|
|
76
76
|
} catch (e) {
|
|
77
|
-
|
|
77
|
+
D(e instanceof Error ? e.message : String(e));
|
|
78
78
|
} finally {
|
|
79
|
-
|
|
79
|
+
T(null);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: w !== null,
|
|
84
84
|
"data-testid": "board-lint-undo",
|
|
85
|
-
children:
|
|
85
|
+
children: w === "undo" ? y("bigconsole.analysis.boardLint.undoing", "Undoing…") : y("bigconsole.analysis.boardLint.undo", "Undo")
|
|
86
86
|
})
|
|
87
87
|
})]
|
|
88
88
|
}),
|
|
89
|
-
|
|
89
|
+
E && S === null && /* @__PURE__ */ p("p", {
|
|
90
90
|
role: "alert",
|
|
91
91
|
style: { color: "var(--color-status-danger-text, var(--color-text-primary))" },
|
|
92
|
-
children:
|
|
92
|
+
children: E
|
|
93
93
|
}),
|
|
94
|
-
|
|
94
|
+
b.length > 0 && /* @__PURE__ */ p("ul", {
|
|
95
95
|
className: "space-y-2",
|
|
96
96
|
"data-testid": "board-lint-findings",
|
|
97
|
-
children:
|
|
97
|
+
children: b.map((e, t) => /* @__PURE__ */ m("li", {
|
|
98
98
|
"data-rule": e.ruleId,
|
|
99
99
|
style: {
|
|
100
100
|
padding: "var(--space-controlGap)",
|
|
@@ -105,22 +105,22 @@ var h = {
|
|
|
105
105
|
color: "var(--color-text-primary)"
|
|
106
106
|
},
|
|
107
107
|
children: [
|
|
108
|
-
|
|
109
|
-
c && e.fixable &&
|
|
108
|
+
y(`bigconsole.analysis.boardLint.rule.${e.ruleId}`, e.message),
|
|
109
|
+
c && e.fixable && S !== t && !N && /* @__PURE__ */ p("div", {
|
|
110
110
|
style: { marginTop: "var(--space-controlGap)" },
|
|
111
111
|
children: /* @__PURE__ */ p(d, {
|
|
112
112
|
type: "button",
|
|
113
113
|
size: "sm",
|
|
114
114
|
variant: "outline",
|
|
115
115
|
onClick: () => {
|
|
116
|
-
|
|
116
|
+
D(null), C(t);
|
|
117
117
|
},
|
|
118
|
-
disabled:
|
|
118
|
+
disabled: w !== null,
|
|
119
119
|
"data-testid": "board-lint-fix",
|
|
120
|
-
children:
|
|
120
|
+
children: y("bigconsole.analysis.boardLint.fixIt", "Fix it")
|
|
121
121
|
})
|
|
122
122
|
}),
|
|
123
|
-
|
|
123
|
+
S === t && P && /* @__PURE__ */ m("div", {
|
|
124
124
|
"data-testid": "board-lint-preview",
|
|
125
125
|
style: {
|
|
126
126
|
marginTop: "var(--space-controlGap)",
|
|
@@ -130,16 +130,16 @@ var h = {
|
|
|
130
130
|
/* @__PURE__ */ m("p", { children: [
|
|
131
131
|
/* @__PURE__ */ m("span", {
|
|
132
132
|
style: { fontWeight: "var(--font-weight-semibold)" },
|
|
133
|
-
children: [
|
|
133
|
+
children: [y("bigconsole.analysis.boardLint.previewLabel", "Proposed change"), ":"]
|
|
134
134
|
}),
|
|
135
135
|
" ",
|
|
136
|
-
|
|
136
|
+
P.summary
|
|
137
137
|
] }),
|
|
138
|
-
/* @__PURE__ */ p("p", { children: _("bigconsole.analysis.boardLint.previewNote", "This creates a refined copy of the draft. Your current draft stays as it is, and you can undo it.") }),
|
|
139
|
-
|
|
138
|
+
/* @__PURE__ */ p("p", { children: _ ? y("bigconsole.analysis.boardLint.savedPreviewNote", "This changes the widget on your dashboard. You can undo it right after.") : y("bigconsole.analysis.boardLint.previewNote", "This creates a refined copy of the draft. Your current draft stays as it is, and you can undo it.") }),
|
|
139
|
+
E && /* @__PURE__ */ p("p", {
|
|
140
140
|
role: "alert",
|
|
141
141
|
style: { color: "var(--color-status-danger-text, var(--color-text-primary))" },
|
|
142
|
-
children:
|
|
142
|
+
children: E
|
|
143
143
|
}),
|
|
144
144
|
/* @__PURE__ */ m("div", {
|
|
145
145
|
className: "flex gap-2",
|
|
@@ -147,17 +147,17 @@ var h = {
|
|
|
147
147
|
children: [/* @__PURE__ */ p(d, {
|
|
148
148
|
type: "button",
|
|
149
149
|
size: "sm",
|
|
150
|
-
onClick:
|
|
151
|
-
disabled:
|
|
150
|
+
onClick: F,
|
|
151
|
+
disabled: w !== null,
|
|
152
152
|
"data-testid": "board-lint-apply",
|
|
153
|
-
children:
|
|
153
|
+
children: w === "apply" ? _ ? y("bigconsole.analysis.boardLint.savedApplying", "Applying…") : y("bigconsole.analysis.boardLint.applying", "Creating…") : _ ? y("bigconsole.analysis.boardLint.savedApply", "Apply this change") : y("bigconsole.analysis.boardLint.apply", "Create refined draft")
|
|
154
154
|
}), /* @__PURE__ */ p(d, {
|
|
155
155
|
type: "button",
|
|
156
156
|
size: "sm",
|
|
157
157
|
variant: "outline",
|
|
158
|
-
onClick: () =>
|
|
159
|
-
disabled:
|
|
160
|
-
children:
|
|
158
|
+
onClick: () => C(null),
|
|
159
|
+
disabled: w !== null,
|
|
160
|
+
children: y("bigconsole.analysis.boardLint.cancel", "Cancel")
|
|
161
161
|
})]
|
|
162
162
|
})
|
|
163
163
|
]
|