@burdenoff/microfe-bigconsole 2026.1123.3 → 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/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/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/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
|
@@ -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;
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { useBigConsole as e } from "../../context/BigConsoleContext.js";
|
|
2
|
+
import { BIGCONSOLE_PERMISSIONS as t } from "../../../constants/permissions.js";
|
|
3
|
+
import { useTr as n } from "../../../shared/hooks/useTr.js";
|
|
4
|
+
import "../../context/index.js";
|
|
5
|
+
import { useFleetChildren as r } from "../../hooks/useFleetChildren.js";
|
|
6
|
+
import { useFleetMasterActions as i } from "../../hooks/useFleetMasterActions.js";
|
|
7
|
+
import { pushIsEmpty as a } from "../../utils/fleetPush.js";
|
|
8
|
+
import { CreateLinkedCopyDialog as o } from "./CreateLinkedCopyDialog.js";
|
|
9
|
+
import { FleetPushResultTable as s } from "./FleetPushResultTable.js";
|
|
10
|
+
import { memo as c, useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import { PermissionButton as p } from "@burdenoff/fe-libs/shared/components";
|
|
12
|
+
import { Network as m, X as h } from "lucide-react";
|
|
13
|
+
import { Button as g, Spinner as _ } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
|
+
// src/bigconsole/components/fleet/FleetChildrenPanel.tsx
|
|
16
|
+
var x = {
|
|
17
|
+
display: "inline-flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
padding: "2px 8px",
|
|
20
|
+
borderRadius: "var(--radius-pill)",
|
|
21
|
+
border: "1px solid var(--color-border-subtle)",
|
|
22
|
+
fontSize: "10px",
|
|
23
|
+
fontWeight: "var(--font-weight-semibold)",
|
|
24
|
+
textTransform: "uppercase",
|
|
25
|
+
letterSpacing: "0.02em",
|
|
26
|
+
whiteSpace: "nowrap"
|
|
27
|
+
}, S = {
|
|
28
|
+
...x,
|
|
29
|
+
backgroundColor: "var(--color-status-warning-bgSubtle)",
|
|
30
|
+
color: "var(--color-status-warning-text)"
|
|
31
|
+
}, C = (e, t) => e instanceof Error && e.message ? e.message : t, w = c(function({ dashboardId: c, dashboardName: w, onClose: T, onOpenBoard: E }) {
|
|
32
|
+
let D = n(), { workspaceId: O, currentUser: k } = e(), A = `${O ?? ""}:${k?.id ?? ""}:${c}`, { loading: j, error: M, isMaster: N, summary: P, refetch: F } = r(c, !0), I = i(), [L, R] = f({ phase: "idle" }), [z, B] = f(!1), [V, H] = f(null), [U, W] = f(null), [G, K] = f(!1), q = I.busy || G, J = d(A);
|
|
33
|
+
u(() => {
|
|
34
|
+
J.current !== A && (J.current = A, R({ phase: "idle" }), B(!1), H(null), W(null), K(!1));
|
|
35
|
+
}, [A]);
|
|
36
|
+
let Y = l(async (e, t, n) => {
|
|
37
|
+
let r = J.current, i = () => J.current !== r;
|
|
38
|
+
K(!0);
|
|
39
|
+
try {
|
|
40
|
+
let r;
|
|
41
|
+
try {
|
|
42
|
+
r = await e();
|
|
43
|
+
} catch (e) {
|
|
44
|
+
i() || n(e);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (i()) return;
|
|
48
|
+
t(r), await F();
|
|
49
|
+
} finally {
|
|
50
|
+
i() || K(!1);
|
|
51
|
+
}
|
|
52
|
+
}, [F]), X = l(() => (W(null), Y(() => I.setAsMaster(c), () => W({
|
|
53
|
+
tone: "ok",
|
|
54
|
+
text: D("bigconsole.fleet.children.nowMaster", "This board is now a master.")
|
|
55
|
+
}), (e) => W({
|
|
56
|
+
tone: "error",
|
|
57
|
+
text: C(e, D("bigconsole.fleet.error.setMaster", "The board could not be made a master."))
|
|
58
|
+
}))), [
|
|
59
|
+
I,
|
|
60
|
+
c,
|
|
61
|
+
Y,
|
|
62
|
+
D
|
|
63
|
+
]), Z = l(() => (W(null), Y(() => I.unsetAsMaster(c), () => W({
|
|
64
|
+
tone: "ok",
|
|
65
|
+
text: D("bigconsole.fleet.children.noLongerMaster", "This board is no longer a master.")
|
|
66
|
+
}), (e) => W({
|
|
67
|
+
tone: "error",
|
|
68
|
+
text: C(e, D("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
|
|
69
|
+
}))), [
|
|
70
|
+
I,
|
|
71
|
+
c,
|
|
72
|
+
Y,
|
|
73
|
+
D
|
|
74
|
+
]), Q = l((e) => (H(null), Y(() => I.createLinkedCopy(c, e), () => {
|
|
75
|
+
B(!1), W({
|
|
76
|
+
tone: "ok",
|
|
77
|
+
text: D("bigconsole.fleet.children.created", "\"{{name}}\" is now a linked copy.", { name: e })
|
|
78
|
+
});
|
|
79
|
+
}, (e) => H(C(e, D("bigconsole.fleet.error.create", "The linked copy could not be created."))))), [
|
|
80
|
+
I,
|
|
81
|
+
c,
|
|
82
|
+
Y,
|
|
83
|
+
D
|
|
84
|
+
]), $ = l((e) => (W(null), Y(() => I.previewPush(c, e), (t) => R({
|
|
85
|
+
phase: "preview",
|
|
86
|
+
scope: e,
|
|
87
|
+
result: t
|
|
88
|
+
}), (e) => W({
|
|
89
|
+
tone: "error",
|
|
90
|
+
text: C(e, D("bigconsole.fleet.error.preview", "The preview could not be made."))
|
|
91
|
+
}))), [
|
|
92
|
+
I,
|
|
93
|
+
c,
|
|
94
|
+
Y,
|
|
95
|
+
D
|
|
96
|
+
]), ee = l((e) => (W(null), Y(() => I.push(c, e), (e) => R({
|
|
97
|
+
phase: "done",
|
|
98
|
+
result: e
|
|
99
|
+
}), (e) => W({
|
|
100
|
+
tone: "error",
|
|
101
|
+
text: C(e, D("bigconsole.fleet.error.push", "The push could not be made."))
|
|
102
|
+
}))), [
|
|
103
|
+
I,
|
|
104
|
+
c,
|
|
105
|
+
Y,
|
|
106
|
+
D
|
|
107
|
+
]), te = (e) => /* @__PURE__ */ b("span", {
|
|
108
|
+
className: "flex flex-wrap items-center gap-1",
|
|
109
|
+
children: [
|
|
110
|
+
e.status === "PENDING" && /* @__PURE__ */ y("span", {
|
|
111
|
+
"data-testid": "fleet-child-pending",
|
|
112
|
+
style: S,
|
|
113
|
+
children: D("bigconsole.fleet.badge.pending", "Waiting for the owner's OK")
|
|
114
|
+
}),
|
|
115
|
+
e.behindMaster && /* @__PURE__ */ y("span", {
|
|
116
|
+
"data-testid": "fleet-child-behind",
|
|
117
|
+
style: S,
|
|
118
|
+
children: e.missingWidgetCount ? D("bigconsole.fleet.children.behindCount", "Behind · {{count}} widgets missing", { count: e.missingWidgetCount }) : D("bigconsole.fleet.children.behind", "Behind the master")
|
|
119
|
+
}),
|
|
120
|
+
e.openFlagCount > 0 && /* @__PURE__ */ y("span", {
|
|
121
|
+
"data-testid": "fleet-child-flags",
|
|
122
|
+
style: S,
|
|
123
|
+
children: D("bigconsole.fleet.children.flags", "{{count}} open flags", { count: e.openFlagCount })
|
|
124
|
+
}),
|
|
125
|
+
e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */ y("span", {
|
|
126
|
+
style: {
|
|
127
|
+
...x,
|
|
128
|
+
color: "var(--color-status-success-text)"
|
|
129
|
+
},
|
|
130
|
+
children: D("bigconsole.fleet.children.inSync", "In sync")
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
});
|
|
134
|
+
return /* @__PURE__ */ b("section", {
|
|
135
|
+
"aria-label": D("bigconsole.fleet.children.title", "Children"),
|
|
136
|
+
"data-testid": "fleet-children-panel",
|
|
137
|
+
className: "flex flex-col gap-form-gap",
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ b("div", {
|
|
140
|
+
className: "flex items-center justify-between gap-form-gap",
|
|
141
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
142
|
+
className: "flex items-center gap-2",
|
|
143
|
+
style: {
|
|
144
|
+
margin: 0,
|
|
145
|
+
color: "var(--color-text-primary)",
|
|
146
|
+
fontSize: "var(--font-size-body)",
|
|
147
|
+
fontWeight: "var(--font-weight-semibold)"
|
|
148
|
+
},
|
|
149
|
+
children: [/* @__PURE__ */ y(m, {
|
|
150
|
+
"aria-hidden": "true",
|
|
151
|
+
style: {
|
|
152
|
+
height: "var(--size-icon-sm)",
|
|
153
|
+
width: "var(--size-icon-sm)"
|
|
154
|
+
}
|
|
155
|
+
}), D("bigconsole.fleet.children.title", "Children")]
|
|
156
|
+
}), /* @__PURE__ */ y(g, {
|
|
157
|
+
variant: "ghost",
|
|
158
|
+
size: "sm",
|
|
159
|
+
onClick: T,
|
|
160
|
+
"aria-label": D("bigconsole.fleet.children.close", "Close the Children panel"),
|
|
161
|
+
title: D("bigconsole.fleet.children.close", "Close the Children panel"),
|
|
162
|
+
"data-testid": "fleet-children-close",
|
|
163
|
+
children: /* @__PURE__ */ y(h, { style: {
|
|
164
|
+
height: "var(--size-icon-sm)",
|
|
165
|
+
width: "var(--size-icon-sm)"
|
|
166
|
+
} })
|
|
167
|
+
})]
|
|
168
|
+
}),
|
|
169
|
+
U && /* @__PURE__ */ y("p", {
|
|
170
|
+
role: U.tone === "error" ? "alert" : "status",
|
|
171
|
+
"data-testid": "fleet-children-message",
|
|
172
|
+
style: {
|
|
173
|
+
margin: 0,
|
|
174
|
+
color: U.tone === "error" ? "var(--color-status-error-text)" : "var(--color-text-primary)",
|
|
175
|
+
fontSize: "var(--font-size-body-sm)"
|
|
176
|
+
},
|
|
177
|
+
children: U.text
|
|
178
|
+
}),
|
|
179
|
+
j && !P && !N && /* @__PURE__ */ b("div", {
|
|
180
|
+
className: "flex items-center gap-2",
|
|
181
|
+
style: { color: "var(--color-text-secondary)" },
|
|
182
|
+
children: [/* @__PURE__ */ y(_, { style: {
|
|
183
|
+
height: "var(--size-icon-sm)",
|
|
184
|
+
width: "var(--size-icon-sm)"
|
|
185
|
+
} }), D("bigconsole.fleet.children.loading", "Loading the copies of this board…")]
|
|
186
|
+
}),
|
|
187
|
+
!j && M && /* @__PURE__ */ y("p", {
|
|
188
|
+
role: "alert",
|
|
189
|
+
style: {
|
|
190
|
+
margin: 0,
|
|
191
|
+
color: "var(--color-status-error-text)"
|
|
192
|
+
},
|
|
193
|
+
children: D("bigconsole.fleet.children.loadError", "The copies of this board could not be loaded.")
|
|
194
|
+
}),
|
|
195
|
+
!j && !M && !N && /* @__PURE__ */ b("div", {
|
|
196
|
+
className: "flex flex-col gap-form-gap",
|
|
197
|
+
"data-testid": "fleet-children-not-master",
|
|
198
|
+
children: [/* @__PURE__ */ y("p", {
|
|
199
|
+
style: {
|
|
200
|
+
margin: 0,
|
|
201
|
+
color: "var(--color-text-secondary)",
|
|
202
|
+
fontSize: "var(--font-size-body-sm)"
|
|
203
|
+
},
|
|
204
|
+
children: D("bigconsole.fleet.children.notMaster", "Other boards can follow this one as linked copies once it is a master. Its own widgets stay as they are.")
|
|
205
|
+
}), /* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(p, {
|
|
206
|
+
permission: t.DASHBOARD_UPDATE,
|
|
207
|
+
deniedBehavior: "hide",
|
|
208
|
+
children: /* @__PURE__ */ b(g, {
|
|
209
|
+
onClick: X,
|
|
210
|
+
disabled: q,
|
|
211
|
+
"data-testid": "fleet-set-master",
|
|
212
|
+
children: [q && /* @__PURE__ */ y(_, { style: {
|
|
213
|
+
height: "var(--size-icon-sm)",
|
|
214
|
+
width: "var(--size-icon-sm)"
|
|
215
|
+
} }), D("bigconsole.fleet.children.setMaster", "Set as master")]
|
|
216
|
+
})
|
|
217
|
+
}) })]
|
|
218
|
+
}),
|
|
219
|
+
!M && N && P && /* @__PURE__ */ b(v, { children: [
|
|
220
|
+
/* @__PURE__ */ b("p", {
|
|
221
|
+
"data-testid": "fleet-children-counts",
|
|
222
|
+
style: {
|
|
223
|
+
margin: 0,
|
|
224
|
+
color: "var(--color-text-secondary)",
|
|
225
|
+
fontSize: "var(--font-size-body-sm)"
|
|
226
|
+
},
|
|
227
|
+
children: [D("bigconsole.fleet.children.counts", "{{total}} copies: {{active}} active, {{pending}} waiting for an owner, {{behind}} behind the master.", {
|
|
228
|
+
total: P.total,
|
|
229
|
+
active: P.active,
|
|
230
|
+
pending: P.pending,
|
|
231
|
+
behind: P.behind
|
|
232
|
+
}), P.hiddenCount > 0 && /* @__PURE__ */ b(v, { children: [" ", D("bigconsole.fleet.children.hidden", "{{count}} you cannot open are not listed.", { count: P.hiddenCount })] })]
|
|
233
|
+
}),
|
|
234
|
+
/* @__PURE__ */ b("ul", {
|
|
235
|
+
className: "flex flex-col gap-1",
|
|
236
|
+
style: {
|
|
237
|
+
listStyle: "none",
|
|
238
|
+
margin: 0,
|
|
239
|
+
padding: 0
|
|
240
|
+
},
|
|
241
|
+
children: [P.children.length === 0 && P.total === 0 && /* @__PURE__ */ y("li", {
|
|
242
|
+
style: {
|
|
243
|
+
color: "var(--color-text-secondary)",
|
|
244
|
+
fontSize: "var(--font-size-body-sm)"
|
|
245
|
+
},
|
|
246
|
+
children: D("bigconsole.fleet.children.none", "No copies yet. Create one, or link a board from the dashboards list.")
|
|
247
|
+
}), P.children.map((e) => /* @__PURE__ */ b("li", {
|
|
248
|
+
"data-testid": "fleet-child",
|
|
249
|
+
className: "flex items-center justify-between gap-form-gap rounded-input border px-3 py-2",
|
|
250
|
+
style: { borderColor: "var(--color-border-subtle)" },
|
|
251
|
+
children: [/* @__PURE__ */ y("button", {
|
|
252
|
+
type: "button",
|
|
253
|
+
onClick: () => E(e.dashboardId),
|
|
254
|
+
className: "min-w-0 truncate text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
255
|
+
style: {
|
|
256
|
+
color: "var(--color-text-primary)",
|
|
257
|
+
background: "none",
|
|
258
|
+
border: "none",
|
|
259
|
+
padding: 0,
|
|
260
|
+
cursor: "pointer"
|
|
261
|
+
},
|
|
262
|
+
children: e.name
|
|
263
|
+
}), te(e)]
|
|
264
|
+
}, e.dashboardId))]
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ b("div", {
|
|
267
|
+
className: "flex flex-wrap items-center gap-2",
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ y(p, {
|
|
270
|
+
permission: t.DASHBOARD_CREATE,
|
|
271
|
+
deniedBehavior: "hide",
|
|
272
|
+
children: /* @__PURE__ */ y(g, {
|
|
273
|
+
variant: "outline",
|
|
274
|
+
onClick: () => {
|
|
275
|
+
H(null), B(!0);
|
|
276
|
+
},
|
|
277
|
+
disabled: q,
|
|
278
|
+
"data-testid": "fleet-create-copy",
|
|
279
|
+
children: D("bigconsole.fleet.children.createCopy", "Create linked copy…")
|
|
280
|
+
})
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ y(p, {
|
|
283
|
+
permission: t.DASHBOARD_UPDATE,
|
|
284
|
+
deniedBehavior: "hide",
|
|
285
|
+
children: /* @__PURE__ */ y(g, {
|
|
286
|
+
onClick: () => $("DIRECT_COPIES"),
|
|
287
|
+
disabled: q || P.total === 0 || L.phase === "preview",
|
|
288
|
+
"data-testid": "fleet-push",
|
|
289
|
+
children: D("bigconsole.fleet.children.push", "Push to copies…")
|
|
290
|
+
})
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ y(p, {
|
|
293
|
+
permission: t.DASHBOARD_UPDATE,
|
|
294
|
+
deniedBehavior: "hide",
|
|
295
|
+
children: /* @__PURE__ */ y(g, {
|
|
296
|
+
variant: "ghost",
|
|
297
|
+
onClick: Z,
|
|
298
|
+
disabled: q || P.total > 0,
|
|
299
|
+
title: P.total > 0 ? D("bigconsole.fleet.children.unsetBlocked", "Detach or remove every copy first.") : void 0,
|
|
300
|
+
"data-testid": "fleet-unset-master",
|
|
301
|
+
children: D("bigconsole.fleet.children.unsetMaster", "Stop being a master")
|
|
302
|
+
})
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
})
|
|
306
|
+
] }),
|
|
307
|
+
L.phase === "preview" && /* @__PURE__ */ b("div", {
|
|
308
|
+
className: "flex flex-col gap-form-gap rounded-input border p-3",
|
|
309
|
+
style: { borderColor: "var(--color-border-subtle)" },
|
|
310
|
+
"data-testid": "fleet-push-preview",
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ y("strong", {
|
|
313
|
+
style: { color: "var(--color-text-primary)" },
|
|
314
|
+
children: D("bigconsole.fleet.push.previewTitle", "Preview: nothing has been changed yet")
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ y("div", {
|
|
317
|
+
role: "radiogroup",
|
|
318
|
+
"aria-label": D("bigconsole.fleet.push.scopeLabel", "How far to push"),
|
|
319
|
+
className: "flex flex-wrap gap-2",
|
|
320
|
+
children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */ y("button", {
|
|
321
|
+
type: "button",
|
|
322
|
+
role: "radio",
|
|
323
|
+
"aria-checked": L.scope === e,
|
|
324
|
+
disabled: q,
|
|
325
|
+
onClick: () => L.scope !== e && $(e),
|
|
326
|
+
className: "rounded-input border px-3 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
327
|
+
style: {
|
|
328
|
+
borderColor: L.scope === e ? "var(--color-action-primary-bg)" : "var(--color-border-subtle)",
|
|
329
|
+
backgroundColor: L.scope === e ? "var(--color-bg-accentSubtle)" : void 0,
|
|
330
|
+
color: "var(--color-text-primary)"
|
|
331
|
+
},
|
|
332
|
+
"data-testid": `fleet-push-scope-${e}`,
|
|
333
|
+
children: e === "DIRECT_COPIES" ? D("bigconsole.fleet.push.scopeDirect", "Direct copies") : D("bigconsole.fleet.push.scopeAll", "Copies of copies too")
|
|
334
|
+
}, e))
|
|
335
|
+
}),
|
|
336
|
+
/* @__PURE__ */ y(s, { result: L.result }),
|
|
337
|
+
a(L.result) && /* @__PURE__ */ y("p", {
|
|
338
|
+
style: {
|
|
339
|
+
margin: 0,
|
|
340
|
+
color: "var(--color-text-secondary)",
|
|
341
|
+
fontSize: "var(--font-size-body-sm)"
|
|
342
|
+
},
|
|
343
|
+
children: D("bigconsole.fleet.push.nothing", "Nothing to push: every copy already has what this board has.")
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ b("div", {
|
|
346
|
+
className: "flex gap-2",
|
|
347
|
+
children: [/* @__PURE__ */ b(g, {
|
|
348
|
+
onClick: () => ee(L.scope),
|
|
349
|
+
disabled: q || a(L.result),
|
|
350
|
+
"data-testid": "fleet-push-confirm",
|
|
351
|
+
children: [q && /* @__PURE__ */ y(_, { style: {
|
|
352
|
+
height: "var(--size-icon-sm)",
|
|
353
|
+
width: "var(--size-icon-sm)"
|
|
354
|
+
} }), D("bigconsole.fleet.push.confirm", "Push now")]
|
|
355
|
+
}), /* @__PURE__ */ y(g, {
|
|
356
|
+
variant: "outline",
|
|
357
|
+
onClick: () => R({ phase: "idle" }),
|
|
358
|
+
disabled: q,
|
|
359
|
+
children: D("bigconsole.fleet.link.cancel", "Cancel")
|
|
360
|
+
})]
|
|
361
|
+
})
|
|
362
|
+
]
|
|
363
|
+
}),
|
|
364
|
+
L.phase === "done" && /* @__PURE__ */ b("div", {
|
|
365
|
+
className: "flex flex-col gap-form-gap rounded-input border p-3",
|
|
366
|
+
style: { borderColor: "var(--color-border-subtle)" },
|
|
367
|
+
"data-testid": "fleet-push-done",
|
|
368
|
+
children: [
|
|
369
|
+
/* @__PURE__ */ y("strong", {
|
|
370
|
+
style: { color: "var(--color-text-primary)" },
|
|
371
|
+
children: D("bigconsole.fleet.push.doneTitle", "Pushed")
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ y(s, { result: L.result }),
|
|
374
|
+
/* @__PURE__ */ y("div", { children: /* @__PURE__ */ y(g, {
|
|
375
|
+
variant: "outline",
|
|
376
|
+
onClick: () => R({ phase: "idle" }),
|
|
377
|
+
children: D("bigconsole.fleet.push.done", "Done")
|
|
378
|
+
}) })
|
|
379
|
+
]
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ y(o, {
|
|
382
|
+
isOpen: z,
|
|
383
|
+
masterName: w,
|
|
384
|
+
busy: q,
|
|
385
|
+
error: V,
|
|
386
|
+
onClose: () => B(!1),
|
|
387
|
+
onCreate: Q
|
|
388
|
+
})
|
|
389
|
+
]
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
export { w as FleetChildrenPanel, w as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FleetPushResult } from '../../hooks/useFleetMasterActions';
|
|
3
|
+
export interface FleetPushResultTableProps {
|
|
4
|
+
result: FleetPushResult;
|
|
5
|
+
}
|
|
6
|
+
export declare const FleetPushResultTable: FC<FleetPushResultTableProps>;
|
|
7
|
+
export default FleetPushResultTable;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
|
+
import { countPushStates as t, pushTone as n } from "../../utils/fleetPush.js";
|
|
3
|
+
import { memo as r } from "react";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
// src/bigconsole/components/fleet/FleetPushResultTable.tsx
|
|
6
|
+
var s = {
|
|
7
|
+
success: {
|
|
8
|
+
backgroundColor: "var(--color-status-success-bgSubtle)",
|
|
9
|
+
color: "var(--color-status-success-text)"
|
|
10
|
+
},
|
|
11
|
+
warning: {
|
|
12
|
+
backgroundColor: "var(--color-status-warning-bgSubtle)",
|
|
13
|
+
color: "var(--color-status-warning-text)"
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
backgroundColor: "var(--color-status-error-bgSubtle)",
|
|
17
|
+
color: "var(--color-status-error-text)"
|
|
18
|
+
},
|
|
19
|
+
muted: { color: "var(--color-text-secondary)" }
|
|
20
|
+
}, c = {
|
|
21
|
+
display: "inline-flex",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
padding: "2px 8px",
|
|
24
|
+
borderRadius: "var(--radius-pill)",
|
|
25
|
+
border: "1px solid var(--color-border-subtle)",
|
|
26
|
+
fontSize: "10px",
|
|
27
|
+
fontWeight: "var(--font-weight-semibold)",
|
|
28
|
+
textTransform: "uppercase",
|
|
29
|
+
letterSpacing: "0.02em",
|
|
30
|
+
whiteSpace: "nowrap"
|
|
31
|
+
}, l = r(function({ result: r }) {
|
|
32
|
+
let l = e(), u = t(r.copies), d = (e) => {
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "APPLIED": return l("bigconsole.fleet.push.state.applied", "Up to date");
|
|
35
|
+
case "BLOCKED": return l("bigconsole.fleet.push.state.blocked", "Not reached");
|
|
36
|
+
case "INCOMPATIBLE": return l("bigconsole.fleet.push.state.incompatible", "Cannot take it");
|
|
37
|
+
default: return l("bigconsole.fleet.push.state.notSelected", "Not selected");
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ o("div", {
|
|
41
|
+
"data-testid": "fleet-push-result",
|
|
42
|
+
className: "flex flex-col gap-form-gap",
|
|
43
|
+
children: [/* @__PURE__ */ o("p", {
|
|
44
|
+
style: {
|
|
45
|
+
margin: 0,
|
|
46
|
+
color: "var(--color-text-primary)",
|
|
47
|
+
fontSize: "var(--font-size-body-sm)"
|
|
48
|
+
},
|
|
49
|
+
children: [l("bigconsole.fleet.push.totals", "{{added}} widgets added, {{updated}} updated, {{flags}} flagged for owners across {{copies}} copies.", {
|
|
50
|
+
added: r.widgetsAdded,
|
|
51
|
+
updated: r.widgetsUpdated,
|
|
52
|
+
flags: r.flagsRaised,
|
|
53
|
+
copies: r.appliedCount
|
|
54
|
+
}), (u.blocked > 0 || u.incompatible > 0) && /* @__PURE__ */ o(i, { children: [" ", l("bigconsole.fleet.push.skipped", "{{count}} copies did not take it.", { count: u.blocked + u.incompatible })] })]
|
|
55
|
+
}), /* @__PURE__ */ a("ul", {
|
|
56
|
+
className: "flex flex-col gap-1",
|
|
57
|
+
style: {
|
|
58
|
+
listStyle: "none",
|
|
59
|
+
margin: 0,
|
|
60
|
+
padding: 0
|
|
61
|
+
},
|
|
62
|
+
children: r.copies.map((e) => /* @__PURE__ */ o("li", {
|
|
63
|
+
"data-testid": "fleet-push-copy",
|
|
64
|
+
className: "flex flex-col gap-1 rounded-input border px-3 py-2",
|
|
65
|
+
style: {
|
|
66
|
+
borderColor: "var(--color-border-subtle)",
|
|
67
|
+
marginLeft: `calc(${Math.max(e.level - 1, 0)} * var(--space-controlGap))`
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ o("div", {
|
|
71
|
+
className: "flex items-center justify-between gap-form-gap",
|
|
72
|
+
children: [/* @__PURE__ */ a("span", {
|
|
73
|
+
className: "min-w-0 truncate",
|
|
74
|
+
style: { color: "var(--color-text-primary)" },
|
|
75
|
+
children: e.name ?? l("bigconsole.fleet.push.unreadable", "A board you cannot open")
|
|
76
|
+
}), /* @__PURE__ */ a("span", {
|
|
77
|
+
style: {
|
|
78
|
+
...c,
|
|
79
|
+
...s[n(e.state)]
|
|
80
|
+
},
|
|
81
|
+
children: d(e.state)
|
|
82
|
+
})]
|
|
83
|
+
}),
|
|
84
|
+
e.state === "APPLIED" && /* @__PURE__ */ a("span", {
|
|
85
|
+
style: {
|
|
86
|
+
color: "var(--color-text-secondary)",
|
|
87
|
+
fontSize: "var(--font-size-body-sm)"
|
|
88
|
+
},
|
|
89
|
+
children: l("bigconsole.fleet.push.copyDetail", "{{added}} widgets added, {{updated}} updated, {{flags}} flagged.", {
|
|
90
|
+
added: e.widgetCount,
|
|
91
|
+
updated: e.widgetsUpdated,
|
|
92
|
+
flags: e.flagsRaised
|
|
93
|
+
})
|
|
94
|
+
}),
|
|
95
|
+
e.state === "INCOMPATIBLE" && e.reason && /* @__PURE__ */ a("span", {
|
|
96
|
+
style: {
|
|
97
|
+
color: "var(--color-status-error-text)",
|
|
98
|
+
fontSize: "var(--font-size-body-sm)"
|
|
99
|
+
},
|
|
100
|
+
children: e.reason
|
|
101
|
+
}),
|
|
102
|
+
e.state === "BLOCKED" && /* @__PURE__ */ a("span", {
|
|
103
|
+
style: {
|
|
104
|
+
color: "var(--color-text-secondary)",
|
|
105
|
+
fontSize: "var(--font-size-body-sm)"
|
|
106
|
+
},
|
|
107
|
+
children: e.blockedByName ? l("bigconsole.fleet.push.blockedBy", "\"{{name}}\" above it did not take the push.", { name: e.blockedByName }) : l("bigconsole.fleet.push.blockedByUnknown", "A board above it did not take the push.")
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
}, e.dashboardId))
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
export { l as FleetPushResultTable, l as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTr as e } from "../../../shared/hooks/useTr.js";
|
|
2
2
|
import { memo as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
|
-
import { Button as o,
|
|
3
|
+
import { Button as o, Input as s, ResponsiveDialog as c, ResponsiveDialogContent as l, ResponsiveDialogDescription as u, ResponsiveDialogFooter as d, ResponsiveDialogHeader as f, ResponsiveDialogTitle as p, Spinner as m } from "@burdenoff/fe-libs/ui";
|
|
4
4
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
5
|
// src/bigconsole/components/fleet/LinkToMasterDialog.tsx
|
|
6
6
|
var _ = t(function({ isOpen: t, board: _, candidates: v, busy: y, error: b, onClose: x, onLink: S, onQueryChange: C }) {
|
|
@@ -24,12 +24,12 @@ var _ = t(function({ isOpen: t, board: _, candidates: v, busy: y, error: b, onCl
|
|
|
24
24
|
S,
|
|
25
25
|
A
|
|
26
26
|
]);
|
|
27
|
-
return /* @__PURE__ */ h(
|
|
27
|
+
return /* @__PURE__ */ h(c, {
|
|
28
28
|
open: t,
|
|
29
29
|
onOpenChange: (e) => !e && !y && x(),
|
|
30
|
-
children: /* @__PURE__ */ g(
|
|
31
|
-
/* @__PURE__ */ g(
|
|
32
|
-
/* @__PURE__ */ h(
|
|
30
|
+
children: /* @__PURE__ */ g(l, { children: [
|
|
31
|
+
/* @__PURE__ */ g(f, { children: [/* @__PURE__ */ h(p, { children: w("bigconsole.fleet.link.title", "Link to master") }), /* @__PURE__ */ h(u, { children: w("bigconsole.fleet.link.description", "\"{{name}}\" will follow the board you choose and receive the widgets added to it. Its own widgets stay.", { name: _?.name ?? "" }) })] }),
|
|
32
|
+
/* @__PURE__ */ h(s, {
|
|
33
33
|
value: T,
|
|
34
34
|
onChange: (e) => E(e.target.value),
|
|
35
35
|
placeholder: w("bigconsole.fleet.link.search", "Search boards"),
|
|
@@ -88,7 +88,7 @@ var _ = t(function({ isOpen: t, board: _, candidates: v, busy: y, error: b, onCl
|
|
|
88
88
|
},
|
|
89
89
|
children: b
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */ g(
|
|
91
|
+
/* @__PURE__ */ g(d, { children: [/* @__PURE__ */ h(o, {
|
|
92
92
|
variant: "outline",
|
|
93
93
|
onClick: x,
|
|
94
94
|
disabled: y,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFleetChildren (BOFF-15410)
|
|
3
|
+
*
|
|
4
|
+
* What the Children panel shows for one board: whether it is a master, and (for a master) its copies with how
|
|
5
|
+
* many are active, pending and behind. Two small reads, because the full dashboard selection trips the gateway
|
|
6
|
+
* cost limit. A read that finishes after the board, workspace or account changed is dropped.
|
|
7
|
+
*
|
|
8
|
+
* A failure is returned for the panel to say so, never thrown: the board itself keeps working.
|
|
9
|
+
*/
|
|
10
|
+
export interface FleetChild {
|
|
11
|
+
dashboardId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
ownerId: string;
|
|
14
|
+
isMaster: boolean;
|
|
15
|
+
status: 'ACTIVE' | 'PENDING';
|
|
16
|
+
behindMaster: boolean;
|
|
17
|
+
missingWidgetCount: number | null;
|
|
18
|
+
openFlagCount: number;
|
|
19
|
+
}
|
|
20
|
+
export interface FleetChildrenSummary {
|
|
21
|
+
total: number;
|
|
22
|
+
active: number;
|
|
23
|
+
pending: number;
|
|
24
|
+
behind: number;
|
|
25
|
+
/** Copies the caller cannot read: counted above, not listed below. */
|
|
26
|
+
hiddenCount: number;
|
|
27
|
+
children: FleetChild[];
|
|
28
|
+
}
|
|
29
|
+
interface UseFleetChildrenResult {
|
|
30
|
+
loading: boolean;
|
|
31
|
+
error: Error | null;
|
|
32
|
+
isMaster: boolean;
|
|
33
|
+
summary: FleetChildrenSummary | null;
|
|
34
|
+
refetch: () => Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
export declare function useFleetChildren(dashboardId: string | undefined, enabled: boolean): UseFleetChildrenResult;
|
|
37
|
+
export {};
|