@burdenoff/microfe-bigconsole 2026.1123.2 → 2026.1123.4
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/compare/compareEngine.js +79 -66
- package/dist/bigconsole/components/fleet/CreateLinkedCopyDialog.d.ts +12 -0
- package/dist/bigconsole/components/fleet/CreateLinkedCopyDialog.js +61 -0
- package/dist/bigconsole/components/fleet/FleetChildrenPanel.d.ts +9 -0
- package/dist/bigconsole/components/fleet/FleetChildrenPanel.js +392 -0
- package/dist/bigconsole/components/fleet/FleetPushResultTable.d.ts +7 -0
- package/dist/bigconsole/components/fleet/FleetPushResultTable.js +114 -0
- package/dist/bigconsole/components/fleet/LinkToMasterDialog.js +6 -6
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +144 -148
- package/dist/bigconsole/hooks/useFleetChildren.d.ts +37 -0
- package/dist/bigconsole/hooks/useFleetChildren.js +93 -0
- package/dist/bigconsole/hooks/useFleetMasterActions.d.ts +13 -0
- package/dist/bigconsole/hooks/useFleetMasterActions.js +71 -0
- package/dist/bigconsole/pages/DashboardViewPage.js +252 -224
- package/dist/bigconsole/utils/fleetPush.d.ts +24 -0
- package/dist/bigconsole/utils/fleetPush.js +23 -0
- package/dist/bigconsole/utils/legacyChartRows.d.ts +2 -0
- package/dist/bigconsole/utils/legacyChartRows.js +19 -0
- package/dist/generated/wspace-operations.d.ts +186 -0
- package/dist/generated/wspace-operations.js +1183 -240
- package/dist/generated/wspace-types.js +10 -8
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { numericSeriesKeys as e } from "../components/widgets/chart/charts/numericSeries.js";
|
|
2
2
|
import { classifyChartData as t } from "../components/widgets/chart/chartRows.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { legacyChartToRows as n } from "../utils/legacyChartRows.js";
|
|
4
|
+
import { normalizeMetricData as r } from "../components/widgets/metric-card/metricData.js";
|
|
5
|
+
import { normalizeTableRows as i } from "../components/widgets/table/tableRows.js";
|
|
5
6
|
// src/bigconsole/compare/compareEngine.ts
|
|
6
|
-
var
|
|
7
|
+
var a = {
|
|
7
8
|
absolute: null,
|
|
8
9
|
percent: null,
|
|
9
10
|
direction: "unknown"
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
+
function o(e) {
|
|
12
13
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
13
14
|
if (typeof e == "string" && e.trim() !== "") {
|
|
14
15
|
let t = Number(e);
|
|
@@ -16,65 +17,65 @@ function a(e) {
|
|
|
16
17
|
}
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
let n =
|
|
21
|
-
if (n === null || r === null) return
|
|
22
|
-
let
|
|
20
|
+
function s(e, t) {
|
|
21
|
+
let n = o(e), r = o(t);
|
|
22
|
+
if (n === null || r === null) return a;
|
|
23
|
+
let i = r - n;
|
|
23
24
|
return {
|
|
24
|
-
absolute:
|
|
25
|
-
percent: n === 0 ? null :
|
|
26
|
-
direction:
|
|
25
|
+
absolute: i,
|
|
26
|
+
percent: n === 0 ? null : i / Math.abs(n) * 100,
|
|
27
|
+
direction: i === 0 ? "same" : i > 0 ? "up" : "down"
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
var
|
|
30
|
+
var c = (e) => ({
|
|
30
31
|
kind: "unavailable",
|
|
31
32
|
reason: e
|
|
32
|
-
}),
|
|
33
|
-
from:
|
|
34
|
-
to:
|
|
35
|
-
change:
|
|
33
|
+
}), l = (e) => typeof e == "number" ? Number.isFinite(e) ? e : null : typeof e == "string" ? e : null, u = (e, t) => ({
|
|
34
|
+
from: l(e),
|
|
35
|
+
to: l(t),
|
|
36
|
+
change: s(e, t)
|
|
36
37
|
});
|
|
37
|
-
function
|
|
38
|
-
let i = e ?? void 0, a = (e) =>
|
|
39
|
-
return o === void 0 &&
|
|
38
|
+
function d(e, t, n) {
|
|
39
|
+
let i = e ?? void 0, a = (e) => r(e, i), o = a(t), s = a(n);
|
|
40
|
+
return o === void 0 && s === void 0 ? c("unreadable_data") : {
|
|
40
41
|
kind: "metric",
|
|
41
|
-
value:
|
|
42
|
+
value: u(o?.value, s?.value),
|
|
42
43
|
from: o ?? null,
|
|
43
|
-
to:
|
|
44
|
+
to: s ?? null
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
48
|
-
let
|
|
49
|
-
return
|
|
47
|
+
var f = /* @__PURE__ */ new Set(["bar", "line"]);
|
|
48
|
+
function p(e) {
|
|
49
|
+
let r = t(n(e) ?? e);
|
|
50
|
+
return r.kind === "rows" ? r.rows : r.kind === "empty" ? [] : null;
|
|
50
51
|
}
|
|
51
|
-
var
|
|
52
|
+
var m = (e, t) => {
|
|
52
53
|
let n = e[t];
|
|
53
54
|
return n == null ? "" : String(n);
|
|
54
55
|
};
|
|
55
|
-
function
|
|
56
|
+
function h(e, t) {
|
|
56
57
|
let n = /* @__PURE__ */ new Map();
|
|
57
58
|
for (let r of e) {
|
|
58
|
-
let e =
|
|
59
|
+
let e = m(r, t);
|
|
59
60
|
if (n.has(e)) return null;
|
|
60
61
|
n.set(e, r);
|
|
61
62
|
}
|
|
62
63
|
return n;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
let i =
|
|
66
|
-
if (i === null || a === null) return
|
|
67
|
-
let o = String(t?.xAxisField || t?.labelField || "name"),
|
|
68
|
-
return d === null ||
|
|
65
|
+
function g(t, n, r) {
|
|
66
|
+
let i = p(n), a = p(r);
|
|
67
|
+
if (i === null || a === null) return c("unreadable_data");
|
|
68
|
+
let o = String(t?.xAxisField || t?.labelField || "name"), s = Array.isArray(t?.selectedFields) ? t.selectedFields : void 0, l = [.../* @__PURE__ */ new Set([...e(a, o, s), ...e(i, o, s)])], d = h(i, o), f = h(a, o);
|
|
69
|
+
return d === null || f === null ? c("duplicate_keys") : {
|
|
69
70
|
kind: "chart",
|
|
70
|
-
series:
|
|
71
|
-
points: [.../* @__PURE__ */ new Set([...
|
|
71
|
+
series: l,
|
|
72
|
+
points: [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => ({
|
|
72
73
|
label: e,
|
|
73
|
-
values:
|
|
74
|
+
values: l.map((t) => u(d.get(e)?.[t], f.get(e)?.[t]))
|
|
74
75
|
}))
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function _(e, t) {
|
|
78
79
|
let n = (Array.isArray(e?.columns) ? e.columns : []).flatMap((e) => {
|
|
79
80
|
if (typeof e == "string") return [e];
|
|
80
81
|
if (e && typeof e == "object") {
|
|
@@ -87,18 +88,18 @@ function g(e, t) {
|
|
|
87
88
|
let r = t[0];
|
|
88
89
|
return r ? Object.keys(r) : [];
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function v(e, t) {
|
|
91
92
|
if (e === t) return !0;
|
|
92
93
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
93
|
-
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) =>
|
|
94
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) => v(e, t[n]));
|
|
94
95
|
let n = e, r = t, i = Object.keys(n);
|
|
95
|
-
return i.length === Object.keys(r).length && i.every((e) => e in r &&
|
|
96
|
+
return i.length === Object.keys(r).length && i.every((e) => e in r && v(n[e], r[e]));
|
|
96
97
|
}
|
|
97
|
-
var
|
|
98
|
-
function
|
|
98
|
+
var y = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
99
|
+
function b(e, t) {
|
|
99
100
|
return t.length > 0 && t.every((e) => e.id !== void 0 && e.id !== null) ? "id" : e[0] ?? null;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function x(e, t) {
|
|
102
103
|
let n = /* @__PURE__ */ new Map();
|
|
103
104
|
for (let r of e) {
|
|
104
105
|
let e = r[t], i = e == null ? "" : String(e);
|
|
@@ -107,22 +108,34 @@ function b(e, t) {
|
|
|
107
108
|
}
|
|
108
109
|
return n;
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
let
|
|
112
|
-
if (!
|
|
113
|
-
let l =
|
|
114
|
-
if (u === null) return
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
function S(e, t, n) {
|
|
112
|
+
let r = i(t), o = i(n);
|
|
113
|
+
if (!r.every(y) || !o.every(y)) return c("unreadable_data");
|
|
114
|
+
let l = _(e, [...o, ...r]), u = b(l, [...o, ...r]);
|
|
115
|
+
if (u === null && o.length === 0 && r.length === 0) return {
|
|
116
|
+
kind: "table",
|
|
117
|
+
columns: l,
|
|
118
|
+
keyColumn: "",
|
|
119
|
+
rows: [],
|
|
120
|
+
summary: {
|
|
121
|
+
added: 0,
|
|
122
|
+
removed: 0,
|
|
123
|
+
changed: 0,
|
|
124
|
+
unchanged: 0
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
if (u === null) return c("no_key_column");
|
|
128
|
+
let d = x(r, u), f = x(o, u);
|
|
129
|
+
if (d === null || f === null) return c("duplicate_keys");
|
|
117
130
|
let p = [.../* @__PURE__ */ new Set([...f.keys(), ...d.keys()])].map((e) => {
|
|
118
131
|
let t = d.get(e), n = f.get(e), r = l.map((e) => {
|
|
119
|
-
let r = t?.[e],
|
|
132
|
+
let r = t?.[e], i = n?.[e], o = t !== void 0 && n !== void 0 && !v(r, i);
|
|
120
133
|
return {
|
|
121
134
|
column: e,
|
|
122
135
|
from: r,
|
|
123
|
-
to:
|
|
124
|
-
changed:
|
|
125
|
-
change:
|
|
136
|
+
to: i,
|
|
137
|
+
changed: o,
|
|
138
|
+
change: o ? s(r, i) : a
|
|
126
139
|
};
|
|
127
140
|
});
|
|
128
141
|
return {
|
|
@@ -145,28 +158,28 @@ function x(e, t, n) {
|
|
|
145
158
|
summary: m
|
|
146
159
|
};
|
|
147
160
|
}
|
|
148
|
-
function
|
|
161
|
+
function C(e) {
|
|
149
162
|
return e === "metric_card" || e === "chart" || e === "table";
|
|
150
163
|
}
|
|
151
|
-
function
|
|
164
|
+
function w(e) {
|
|
152
165
|
return typeof e?.chartType == "string" ? e.chartType.toLowerCase() : "line";
|
|
153
166
|
}
|
|
154
|
-
function
|
|
155
|
-
if (!
|
|
167
|
+
function T(e) {
|
|
168
|
+
if (!C(e.widgetType)) return {
|
|
156
169
|
kind: "unsupported",
|
|
157
170
|
widgetType: e.widgetType
|
|
158
171
|
};
|
|
159
|
-
if (e.widgetType === "chart" && !
|
|
172
|
+
if (e.widgetType === "chart" && !f.has(w(e.config))) return {
|
|
160
173
|
kind: "unsupported",
|
|
161
|
-
widgetType: `chart:${
|
|
174
|
+
widgetType: `chart:${w(e.config)}`
|
|
162
175
|
};
|
|
163
176
|
let { from: t, to: n } = e;
|
|
164
|
-
if (!t.available) return
|
|
165
|
-
if (!n.available) return
|
|
177
|
+
if (!t.available) return c("no_data_from");
|
|
178
|
+
if (!n.available) return c("no_data_to");
|
|
166
179
|
switch (e.widgetType) {
|
|
167
|
-
case "metric_card": return
|
|
168
|
-
case "chart": return
|
|
169
|
-
default: return
|
|
180
|
+
case "metric_card": return d(e.config, t.data, n.data);
|
|
181
|
+
case "chart": return g(e.config, t.data, n.data);
|
|
182
|
+
default: return S(e.config, t.data, n.data);
|
|
170
183
|
}
|
|
171
184
|
}
|
|
172
|
-
export {
|
|
185
|
+
export { s as changeBetween, T as compareWidget, C as isCompareSupported };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface CreateLinkedCopyDialogProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
masterName: string;
|
|
5
|
+
busy: boolean;
|
|
6
|
+
/** The server's refusal, worded for the person, or null. */
|
|
7
|
+
error: string | null;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onCreate: (name: string) => void | Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const CreateLinkedCopyDialog: FC<CreateLinkedCopyDialogProps>;
|
|
12
|
+
export default CreateLinkedCopyDialog;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
+
import { memo as t, useEffect as n, useState as r } from "react";
|
|
3
|
+
import { Button as i, Input as a, ResponsiveDialog as o, ResponsiveDialogContent as s, ResponsiveDialogDescription as c, ResponsiveDialogFooter as l, ResponsiveDialogHeader as u, ResponsiveDialogTitle as d, Spinner as f } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
5
|
+
// src/bigconsole/components/fleet/CreateLinkedCopyDialog.tsx
|
|
6
|
+
var h = t(function({ isOpen: t, masterName: h, busy: g, error: _, onClose: v, onCreate: y }) {
|
|
7
|
+
let b = e(), [x, S] = r("");
|
|
8
|
+
n(() => {
|
|
9
|
+
t && S(b("bigconsole.fleet.create.defaultName", "{{name}} (copy)", { name: h }));
|
|
10
|
+
}, [
|
|
11
|
+
t,
|
|
12
|
+
h,
|
|
13
|
+
b
|
|
14
|
+
]);
|
|
15
|
+
let C = x.trim();
|
|
16
|
+
return /* @__PURE__ */ p(o, {
|
|
17
|
+
open: t,
|
|
18
|
+
onOpenChange: (e) => !e && !g && v(),
|
|
19
|
+
children: /* @__PURE__ */ p(s, { children: /* @__PURE__ */ m("form", {
|
|
20
|
+
onSubmit: (e) => {
|
|
21
|
+
e.preventDefault(), C && !g && y(C);
|
|
22
|
+
},
|
|
23
|
+
className: "flex flex-col gap-form-gap",
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ m(u, { children: [/* @__PURE__ */ p(d, { children: b("bigconsole.fleet.create.title", "Create linked copy") }), /* @__PURE__ */ p(c, { children: b("bigconsole.fleet.create.description", "A new board that starts as a copy of \"{{name}}\" and keeps following it.", { name: h }) })] }),
|
|
26
|
+
/* @__PURE__ */ p(a, {
|
|
27
|
+
value: x,
|
|
28
|
+
onChange: (e) => S(e.target.value),
|
|
29
|
+
"aria-label": b("bigconsole.fleet.create.nameLabel", "Name of the new board"),
|
|
30
|
+
"data-testid": "fleet-create-name",
|
|
31
|
+
autoFocus: !0
|
|
32
|
+
}),
|
|
33
|
+
_ && /* @__PURE__ */ p("p", {
|
|
34
|
+
role: "alert",
|
|
35
|
+
"data-testid": "fleet-create-error",
|
|
36
|
+
style: {
|
|
37
|
+
color: "var(--color-status-error-text)",
|
|
38
|
+
margin: 0
|
|
39
|
+
},
|
|
40
|
+
children: _
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ m(l, { children: [/* @__PURE__ */ p(i, {
|
|
43
|
+
type: "button",
|
|
44
|
+
variant: "outline",
|
|
45
|
+
onClick: v,
|
|
46
|
+
disabled: g,
|
|
47
|
+
children: b("bigconsole.fleet.link.cancel", "Cancel")
|
|
48
|
+
}), /* @__PURE__ */ m(i, {
|
|
49
|
+
type: "submit",
|
|
50
|
+
disabled: !C || g,
|
|
51
|
+
"data-testid": "fleet-create-confirm",
|
|
52
|
+
children: [g && /* @__PURE__ */ p(f, { style: {
|
|
53
|
+
height: "var(--size-icon-sm)",
|
|
54
|
+
width: "var(--size-icon-sm)"
|
|
55
|
+
} }), b("bigconsole.fleet.create.confirm", "Create")]
|
|
56
|
+
})] })
|
|
57
|
+
]
|
|
58
|
+
}) })
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
export { h as CreateLinkedCopyDialog, h as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface FleetChildrenPanelProps {
|
|
3
|
+
dashboardId: string;
|
|
4
|
+
dashboardName: string;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onOpenBoard: (dashboardId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const FleetChildrenPanel: FC<FleetChildrenPanelProps>;
|
|
9
|
+
export default FleetChildrenPanel;
|