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