@burdenoff/microfe-bigconsole 2026.1124.8 → 2026.1124.10

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.
@@ -2,21 +2,25 @@ import { useBigConsole as e } from "../../context/BigConsoleContext.js";
2
2
  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
- import { useFleetChildren as ee } from "../../hooks/useFleetChildren.js";
6
- import { useActionLock as te, useOwnerBoundRun as r } from "../../hooks/useOwnerBoundRun.js";
7
- import { useFleetMasterActions as i } from "../../hooks/useFleetMasterActions.js";
8
- import { pushIsEmpty as a } from "../../utils/fleetPush.js";
9
- import { CreateLinkedCopyDialog as o } from "./CreateLinkedCopyDialog.js";
10
- import { FleetBindingsDialog as s } from "./FleetBindingsDialog.js";
11
- import { FleetCopySection as c } from "./FleetCopySection.js";
12
- import { FleetPushResultTable as l } from "./FleetPushResultTable.js";
13
- import { memo as u, useCallback as d, useEffect as f, useMemo as ne, useRef as p, useState as m } from "react";
14
- import { PermissionButton as h } from "@burdenoff/fe-libs/shared/components";
15
- import { Network as g, X as _ } from "lucide-react";
16
- import { Button as v, Spinner as y } from "@burdenoff/fe-libs/ui";
17
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
5
+ import { useFleetBoardActions as r } from "../../hooks/useFleetBoardActions.js";
6
+ import { useFleetChildren as i } from "../../hooks/useFleetChildren.js";
7
+ import { useFleetConfirm as a } from "../../hooks/useFleetConfirm.js";
8
+ import { useActionLock as ee, useOwnerBoundRun as te } from "../../hooks/useOwnerBoundRun.js";
9
+ import { useFleetMasterActions as o } from "../../hooks/useFleetMasterActions.js";
10
+ import { canStopBeingMaster as s, detachCopies as ne } from "../../utils/fleetDetachCopies.js";
11
+ import { trCount as c } from "../../utils/fleetPlural.js";
12
+ import { pushIsEmpty as l } from "../../utils/fleetPush.js";
13
+ import { CreateLinkedCopyDialog as u } from "./CreateLinkedCopyDialog.js";
14
+ import { FleetBindingsDialog as d } from "./FleetBindingsDialog.js";
15
+ import { FleetCopySection as f } from "./FleetCopySection.js";
16
+ import { FleetPushResultTable as p } from "./FleetPushResultTable.js";
17
+ import { memo as m, useCallback as h, useEffect as re, useMemo as ie, useRef as ae, useState as g } from "react";
18
+ import { PermissionButton as _ } from "@burdenoff/fe-libs/shared/components";
19
+ import { Network as oe, Unlink as se, X as v } from "lucide-react";
20
+ import { Button as y, Spinner as b } from "@burdenoff/fe-libs/ui";
21
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
18
22
  // src/bigconsole/components/fleet/FleetChildrenPanel.tsx
19
- var C = {
23
+ var w = {
20
24
  display: "inline-flex",
21
25
  alignItems: "center",
22
26
  padding: "2px 8px",
@@ -27,110 +31,171 @@ var C = {
27
31
  textTransform: "uppercase",
28
32
  letterSpacing: "0.02em",
29
33
  whiteSpace: "nowrap"
30
- }, w = {
31
- ...C,
34
+ }, T = {
35
+ ...w,
32
36
  backgroundColor: "var(--color-status-warning-bgSubtle)",
33
37
  color: "var(--color-status-warning-text)"
34
- }, T = (e, t) => e instanceof Error && e.message ? e.message : t, E = u(function({ dashboardId: u, dashboardName: E, masterName: re = null, onBoardChanged: ie, lock: D, changeToken: O, onClose: k, onOpenBoard: A }) {
35
- let j = n(), { workspaceId: ae, currentUser: oe } = e(), se = `${ae ?? ""}:${oe?.id ?? ""}:${u}`, { loading: M, error: N, isMaster: P, linkStatus: F, summary: I, refetch: L } = ee(u, !0), R = i(), z = ne(() => (I?.children ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
38
+ }, E = (e, t) => e instanceof Error && e.message ? e.message : t, D = m(function({ dashboardId: m, dashboardName: D, masterName: ce = null, onBoardChanged: le, lock: ue, changeToken: O, onClose: de, onOpenBoard: fe }) {
39
+ let k = n(), { workspaceId: pe, currentUser: me } = e(), he = `${pe ?? ""}:${me?.id ?? ""}:${m}`, { loading: A, error: j, isMaster: M, linkStatus: N, summary: P, refetch: F } = i(m, !0), I = o(), L = r(), R = a(), z = ie(() => (P?.children ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
36
40
  id: e.dashboardId,
37
41
  name: e.name
38
- })), [I]), [B, V] = m({ phase: "idle" }), [H, U] = m(!1), [W, G] = m(!1), [ce, K] = m(null), [q, J] = m(null), le = te(), Y = D ?? le, X = p(O);
39
- f(() => {
40
- O !== X.current && (X.current = O, V((e) => e.phase === "preview" ? { phase: "idle" } : e), L());
41
- }, [O, L]);
42
- let ue = d(() => {
43
- V({ phase: "idle" }), U(!1), G(!1), K(null), J(null);
44
- }, []), { acting: de, run: Z } = r(se, L, ue, Y), Q = R.busy || de, fe = d(() => (J(null), Z(() => R.setAsMaster(u), () => J({
42
+ })), [P]), [B, V] = g({ phase: "idle" }), [ge, H] = g(!1), [_e, U] = g(!1), [ve, W] = g(null), [G, K] = g(null), ye = ee(), q = ue ?? ye, J = ae(O);
43
+ re(() => {
44
+ O !== J.current && (J.current = O, V((e) => e.phase === "preview" ? { phase: "idle" } : e), F());
45
+ }, [O, F]);
46
+ let be = h(() => {
47
+ V({ phase: "idle" }), H(!1), U(!1), W(null), K(null);
48
+ }, []), { acting: xe, begin: Y, run: X } = te(he, F, be, q), Z = I.busy || L.busy || xe, Q = h(() => (K(null), X(() => I.setAsMaster(m), () => K({
45
49
  tone: "ok",
46
- text: j("bigconsole.fleet.children.nowMaster", "This board is now a master.")
47
- }), (e) => J({
50
+ text: k("bigconsole.fleet.children.nowMaster", "This board is now a master.")
51
+ }), (e) => K({
48
52
  tone: "error",
49
- text: T(e, j("bigconsole.fleet.error.setMaster", "The board could not be made a master."))
53
+ text: E(e, k("bigconsole.fleet.error.setMaster", "The board could not be made a master."))
50
54
  }))), [
55
+ I,
56
+ m,
57
+ X,
58
+ k
59
+ ]), Se = h(async (e) => {
60
+ let t = Y();
61
+ await R(k("bigconsole.fleet.detach.title", "Detach from master?"), k("bigconsole.fleet.detach.confirm", "\"{{name}}\" will keep a plain copy of everything and stop following its master. Detach it?", { name: e.name }), k("bigconsole.fleet.detach.ok", "Detach")) && t() && (K(null), await X(() => L.detach(e.dashboardId), () => K({
62
+ tone: "ok",
63
+ text: k("bigconsole.fleet.notice.detached", "\"{{name}}\" no longer follows a master.", { name: e.name })
64
+ }), (e) => K({
65
+ tone: "error",
66
+ text: E(e, k("bigconsole.fleet.error.detach", "The board could not be detached."))
67
+ })));
68
+ }, [
69
+ Y,
70
+ L,
51
71
  R,
52
- u,
53
- Z,
54
- j
55
- ]), pe = d(() => (J(null), Z(() => R.unsetAsMaster(u), () => J({
56
- tone: "ok",
57
- text: j("bigconsole.fleet.children.noLongerMaster", "This board is no longer a master.")
58
- }), (e) => J({
59
- tone: "error",
60
- text: T(e, j("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
61
- }))), [
72
+ X,
73
+ k
74
+ ]), Ce = h(async () => {
75
+ K(null);
76
+ let e = P?.hiddenCount ?? 0, t = (P?.children ?? []).filter((e) => e.status === "ACTIVE").map((e) => ({
77
+ id: e.dashboardId,
78
+ name: e.name
79
+ })), n = (e) => K({
80
+ tone: "error",
81
+ text: E(e, k("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
82
+ });
83
+ if (t.length === 0) {
84
+ await X(() => I.unsetAsMaster(m), () => K({
85
+ tone: "ok",
86
+ text: k("bigconsole.fleet.children.noLongerMaster", "This board is no longer a master.")
87
+ }), n);
88
+ return;
89
+ }
90
+ let r = Y();
91
+ await R(k("bigconsole.fleet.children.unsetTitle", "Stop being a master?"), [c(k, t.length, "bigconsole.fleet.children.unsetConfirm", "{{count}} copies follow this board. Each keeps a plain copy of everything and stops following it, and then this board stops being a master. Continue?", "1 copy follows this board. It keeps a plain copy of everything and stops following it, and then this board stops being a master. Continue?"), e > 0 ? c(k, e, "bigconsole.fleet.children.unsetConfirmHidden", "{{count}} other copies you cannot open may follow it too: if they do, this board stays a master until their owners detach them.", "1 other copy you cannot open may follow it too: if it does, this board stays a master until its owner detaches it.") : ""].filter(Boolean).join(" "), k("bigconsole.fleet.children.unsetOk", "Stop being a master")) && r() && await X(async () => {
92
+ let e = await ne(t, L.detach, r), n = null;
93
+ if (s(e)) try {
94
+ await I.unsetAsMaster(m);
95
+ } catch (e) {
96
+ n = e;
97
+ }
98
+ return {
99
+ result: e,
100
+ unsetError: n,
101
+ stopped: s(e) && n === null
102
+ };
103
+ }, ({ result: t, unsetError: n, stopped: r }) => {
104
+ if (r) {
105
+ K({
106
+ tone: "ok",
107
+ text: c(k, t.detached.length, "bigconsole.fleet.children.unsetDone", "{{count}} copies detached. This board is no longer a master.", "1 copy detached. This board is no longer a master.")
108
+ });
109
+ return;
110
+ }
111
+ let i = t.failed.map((e) => e.message ? `${e.name}: ${e.message}` : e.name);
112
+ K({
113
+ tone: "error",
114
+ text: [
115
+ k("bigconsole.fleet.children.unsetPartial", "This board is still a master."),
116
+ t.detached.length > 0 ? c(k, t.detached.length, "bigconsole.fleet.children.unsetSome", "{{count}} copies were detached.", "1 copy was detached.") : "",
117
+ i.length > 0 ? k("bigconsole.fleet.children.unsetFailed", "These could not be detached: {{list}}.", { list: i.join("; ") }) : "",
118
+ n === null ? "" : e > 0 ? k("bigconsole.fleet.children.unsetHidden", "Copies you cannot open still follow it: their owners have to detach them.") : E(n, k("bigconsole.fleet.error.unsetMaster", "The board could not stop being a master."))
119
+ ].filter(Boolean).join(" ")
120
+ });
121
+ }, n);
122
+ }, [
123
+ I,
124
+ Y,
125
+ L,
62
126
  R,
63
- u,
64
- Z,
65
- j
66
- ]), me = d((e) => (K(null), Z(() => R.createLinkedCopy(u, e), () => {
67
- U(!1), J({
127
+ m,
128
+ X,
129
+ P,
130
+ k
131
+ ]), we = h((e) => (W(null), X(() => I.createLinkedCopy(m, e), () => {
132
+ H(!1), K({
68
133
  tone: "ok",
69
- text: j("bigconsole.fleet.children.created", "\"{{name}}\" is now a linked copy.", { name: e })
134
+ text: k("bigconsole.fleet.children.created", "\"{{name}}\" is now a linked copy.", { name: e })
70
135
  });
71
- }, (e) => K(T(e, j("bigconsole.fleet.error.create", "The linked copy could not be created."))))), [
72
- R,
73
- u,
74
- Z,
75
- j
76
- ]), $ = d((e) => (J(null), Z(() => R.previewPush(u, e), (t) => V({
136
+ }, (e) => W(E(e, k("bigconsole.fleet.error.create", "The linked copy could not be created."))))), [
137
+ I,
138
+ m,
139
+ X,
140
+ k
141
+ ]), $ = h((e) => (K(null), X(() => I.previewPush(m, e), (t) => V({
77
142
  phase: "preview",
78
143
  scope: e,
79
144
  result: t
80
- }), (e) => J({
145
+ }), (e) => K({
81
146
  tone: "error",
82
- text: T(e, j("bigconsole.fleet.error.preview", "The preview could not be made."))
147
+ text: E(e, k("bigconsole.fleet.error.preview", "The preview could not be made."))
83
148
  }))), [
84
- R,
85
- u,
86
- Z,
87
- j
88
- ]), he = d((e) => (J(null), Z(() => R.push(u, e), (e) => V({
149
+ I,
150
+ m,
151
+ X,
152
+ k
153
+ ]), Te = h((e) => (K(null), X(() => I.push(m, e), (e) => V({
89
154
  phase: "done",
90
155
  result: e
91
- }), (e) => J({
156
+ }), (e) => K({
92
157
  tone: "error",
93
- text: T(e, j("bigconsole.fleet.error.push", "The push could not be made."))
158
+ text: E(e, k("bigconsole.fleet.error.push", "The push could not be made."))
94
159
  }))), [
95
- R,
96
- u,
97
- Z,
98
- j
99
- ]), ge = (e) => /* @__PURE__ */ S("span", {
160
+ I,
161
+ m,
162
+ X,
163
+ k
164
+ ]), Ee = (e) => /* @__PURE__ */ C("span", {
100
165
  className: "flex flex-wrap items-center gap-1",
101
166
  children: [
102
- e.status === "PENDING" && /* @__PURE__ */ x("span", {
167
+ e.status === "PENDING" && /* @__PURE__ */ S("span", {
103
168
  "data-testid": "fleet-child-pending",
104
- style: w,
105
- children: j("bigconsole.fleet.badge.pending", "Waiting for the owner's OK")
169
+ style: T,
170
+ children: k("bigconsole.fleet.badge.pending", "Waiting for the owner's OK")
106
171
  }),
107
- e.behindMaster && /* @__PURE__ */ x("span", {
172
+ e.behindMaster && /* @__PURE__ */ S("span", {
108
173
  "data-testid": "fleet-child-behind",
109
- style: w,
110
- children: e.missingWidgetCount ? j("bigconsole.fleet.children.behindCount", "Behind · {{count}} widgets missing", { count: e.missingWidgetCount }) : j("bigconsole.fleet.children.behind", "Behind the master")
174
+ style: T,
175
+ children: e.missingWidgetCount ? k("bigconsole.fleet.children.behindCount", "Behind · {{count}} widgets missing", { count: e.missingWidgetCount }) : k("bigconsole.fleet.children.behind", "Behind the master")
111
176
  }),
112
- e.openFlagCount > 0 && /* @__PURE__ */ x("span", {
177
+ e.openFlagCount > 0 && /* @__PURE__ */ S("span", {
113
178
  "data-testid": "fleet-child-flags",
114
- style: w,
115
- children: j("bigconsole.fleet.children.flags", "{{count}} open flags", { count: e.openFlagCount })
179
+ style: T,
180
+ children: k("bigconsole.fleet.children.flags", "{{count}} open flags", { count: e.openFlagCount })
116
181
  }),
117
- e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */ x("span", {
182
+ e.status === "ACTIVE" && !e.behindMaster && e.openFlagCount === 0 && /* @__PURE__ */ S("span", {
118
183
  style: {
119
- ...C,
184
+ ...w,
120
185
  color: "var(--color-status-success-text)"
121
186
  },
122
- children: j("bigconsole.fleet.children.inSync", "In sync")
187
+ children: k("bigconsole.fleet.children.inSync", "In sync")
123
188
  })
124
189
  ]
125
190
  });
126
- return /* @__PURE__ */ S("section", {
127
- "aria-label": j("bigconsole.fleet.children.title", "Children"),
191
+ return /* @__PURE__ */ C("section", {
192
+ "aria-label": k("bigconsole.fleet.children.title", "Children"),
128
193
  "data-testid": "fleet-children-panel",
129
194
  className: "flex flex-col gap-form-gap",
130
195
  children: [
131
- /* @__PURE__ */ S("div", {
196
+ /* @__PURE__ */ C("div", {
132
197
  className: "flex items-center justify-between gap-form-gap",
133
- children: [/* @__PURE__ */ S("h2", {
198
+ children: [/* @__PURE__ */ C("h2", {
134
199
  className: "flex items-center gap-2",
135
200
  style: {
136
201
  margin: 0,
@@ -138,118 +203,118 @@ var C = {
138
203
  fontSize: "var(--font-size-body)",
139
204
  fontWeight: "var(--font-weight-semibold)"
140
205
  },
141
- children: [/* @__PURE__ */ x(g, {
206
+ children: [/* @__PURE__ */ S(oe, {
142
207
  "aria-hidden": "true",
143
208
  style: {
144
209
  height: "var(--size-icon-sm)",
145
210
  width: "var(--size-icon-sm)"
146
211
  }
147
- }), j("bigconsole.fleet.children.title", "Children")]
148
- }), /* @__PURE__ */ x(v, {
212
+ }), k("bigconsole.fleet.children.title", "Children")]
213
+ }), /* @__PURE__ */ S(y, {
149
214
  variant: "ghost",
150
215
  size: "sm",
151
- onClick: k,
152
- "aria-label": j("bigconsole.fleet.children.close", "Close the Children panel"),
153
- title: j("bigconsole.fleet.children.close", "Close the Children panel"),
216
+ onClick: de,
217
+ "aria-label": k("bigconsole.fleet.children.close", "Close the Children panel"),
218
+ title: k("bigconsole.fleet.children.close", "Close the Children panel"),
154
219
  "data-testid": "fleet-children-close",
155
- children: /* @__PURE__ */ x(_, { style: {
220
+ children: /* @__PURE__ */ S(v, { style: {
156
221
  height: "var(--size-icon-sm)",
157
222
  width: "var(--size-icon-sm)"
158
223
  } })
159
224
  })]
160
225
  }),
161
- q && /* @__PURE__ */ x("p", {
162
- role: q.tone === "error" ? "alert" : "status",
226
+ G && /* @__PURE__ */ S("p", {
227
+ role: G.tone === "error" ? "alert" : "status",
163
228
  "data-testid": "fleet-children-message",
164
229
  style: {
165
230
  margin: 0,
166
- color: q.tone === "error" ? "var(--color-status-error-text)" : "var(--color-text-primary)",
231
+ color: G.tone === "error" ? "var(--color-status-error-text)" : "var(--color-text-primary)",
167
232
  fontSize: "var(--font-size-body-sm)"
168
233
  },
169
- children: q.text
234
+ children: G.text
170
235
  }),
171
- M && !I && !P && /* @__PURE__ */ S("div", {
236
+ A && !P && !M && /* @__PURE__ */ C("div", {
172
237
  className: "flex items-center gap-2",
173
238
  style: { color: "var(--color-text-secondary)" },
174
- children: [/* @__PURE__ */ x(y, { style: {
239
+ children: [/* @__PURE__ */ S(b, { style: {
175
240
  height: "var(--size-icon-sm)",
176
241
  width: "var(--size-icon-sm)"
177
- } }), j("bigconsole.fleet.children.loading", "Loading the copies of this board…")]
242
+ } }), k("bigconsole.fleet.children.loading", "Loading the copies of this board…")]
178
243
  }),
179
- !M && N && /* @__PURE__ */ x("p", {
244
+ !A && j && /* @__PURE__ */ S("p", {
180
245
  role: "alert",
181
246
  style: {
182
247
  margin: 0,
183
248
  color: "var(--color-status-error-text)"
184
249
  },
185
- children: j("bigconsole.fleet.children.loadError", "The copies of this board could not be loaded.")
250
+ children: k("bigconsole.fleet.children.loadError", "The copies of this board could not be loaded.")
186
251
  }),
187
- !M && !N && F === "ACTIVE" && /* @__PURE__ */ x(c, {
188
- dashboardId: u,
189
- masterName: re,
190
- onBoardChanged: ie,
191
- lock: Y,
252
+ !A && !j && N === "ACTIVE" && /* @__PURE__ */ S(f, {
253
+ dashboardId: m,
254
+ masterName: ce,
255
+ onBoardChanged: le,
256
+ lock: q,
192
257
  changeToken: O
193
258
  }),
194
- !M && !N && !P && /* @__PURE__ */ S("div", {
259
+ !A && !j && !M && /* @__PURE__ */ C("div", {
195
260
  className: "flex flex-col gap-form-gap",
196
261
  "data-testid": "fleet-children-not-master",
197
- children: [/* @__PURE__ */ x("p", {
262
+ children: [/* @__PURE__ */ S("p", {
198
263
  style: {
199
264
  margin: 0,
200
265
  color: "var(--color-text-secondary)",
201
266
  fontSize: "var(--font-size-body-sm)"
202
267
  },
203
- children: j("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.")
204
- }), /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x(h, {
268
+ 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.")
269
+ }), /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(_, {
205
270
  permission: t.DASHBOARD_UPDATE,
206
271
  deniedBehavior: "hide",
207
- children: /* @__PURE__ */ S(v, {
208
- onClick: fe,
209
- disabled: Q,
272
+ children: /* @__PURE__ */ C(y, {
273
+ onClick: Q,
274
+ disabled: Z,
210
275
  "data-testid": "fleet-set-master",
211
- children: [Q && /* @__PURE__ */ x(y, { style: {
276
+ children: [Z && /* @__PURE__ */ S(b, { style: {
212
277
  height: "var(--size-icon-sm)",
213
278
  width: "var(--size-icon-sm)"
214
- } }), j("bigconsole.fleet.children.setMaster", "Set as master")]
279
+ } }), k("bigconsole.fleet.children.setMaster", "Set as master")]
215
280
  })
216
281
  }) })]
217
282
  }),
218
- !N && P && I && /* @__PURE__ */ S(b, { children: [
219
- /* @__PURE__ */ S("p", {
283
+ !j && M && P && /* @__PURE__ */ C(x, { children: [
284
+ /* @__PURE__ */ C("p", {
220
285
  "data-testid": "fleet-children-counts",
221
286
  style: {
222
287
  margin: 0,
223
288
  color: "var(--color-text-secondary)",
224
289
  fontSize: "var(--font-size-body-sm)"
225
290
  },
226
- children: [j("bigconsole.fleet.children.counts", "{{total}} copies: {{active}} active, {{pending}} waiting for an owner, {{behind}} behind the master.", {
227
- total: I.total,
228
- active: I.active,
229
- pending: I.pending,
230
- behind: I.behind
231
- }), I.hiddenCount > 0 && /* @__PURE__ */ S(b, { children: [" ", j("bigconsole.fleet.children.hidden", "{{count}} you cannot open are not listed.", { count: I.hiddenCount })] })]
291
+ children: [k("bigconsole.fleet.children.counts", "{{total}} copies: {{active}} active, {{pending}} waiting for an owner, {{behind}} behind the master.", {
292
+ total: P.total,
293
+ active: P.active,
294
+ pending: P.pending,
295
+ behind: P.behind
296
+ }), P.hiddenCount > 0 && /* @__PURE__ */ C(x, { children: [" ", k("bigconsole.fleet.children.hidden", "{{count}} you cannot open are not listed.", { count: P.hiddenCount })] })]
232
297
  }),
233
- /* @__PURE__ */ S("ul", {
298
+ /* @__PURE__ */ C("ul", {
234
299
  className: "flex flex-col gap-1",
235
300
  style: {
236
301
  listStyle: "none",
237
302
  margin: 0,
238
303
  padding: 0
239
304
  },
240
- children: [I.children.length === 0 && I.total === 0 && /* @__PURE__ */ x("li", {
305
+ children: [P.children.length === 0 && P.total === 0 && /* @__PURE__ */ S("li", {
241
306
  style: {
242
307
  color: "var(--color-text-secondary)",
243
308
  fontSize: "var(--font-size-body-sm)"
244
309
  },
245
- children: j("bigconsole.fleet.children.none", "No copies yet. Create one, or link a board from the dashboards list.")
246
- }), I.children.map((e) => /* @__PURE__ */ S("li", {
310
+ children: k("bigconsole.fleet.children.none", "No copies yet. Create one, or link a board from the dashboards list.")
311
+ }), P.children.map((e) => /* @__PURE__ */ C("li", {
247
312
  "data-testid": "fleet-child",
248
313
  className: "flex items-center justify-between gap-form-gap rounded-input border px-3 py-2",
249
314
  style: { borderColor: "var(--color-border-subtle)" },
250
- children: [/* @__PURE__ */ x("button", {
315
+ children: [/* @__PURE__ */ S("button", {
251
316
  type: "button",
252
- onClick: () => A(e.dashboardId),
317
+ onClick: () => fe(e.dashboardId),
253
318
  className: "min-w-0 truncate text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
254
319
  style: {
255
320
  color: "var(--color-text-primary)",
@@ -259,79 +324,98 @@ var C = {
259
324
  cursor: "pointer"
260
325
  },
261
326
  children: e.name
262
- }), ge(e)]
327
+ }), /* @__PURE__ */ C("span", {
328
+ className: "flex shrink-0 items-center gap-2",
329
+ children: [Ee(e), e.status === "ACTIVE" && /* @__PURE__ */ S(_, {
330
+ permission: t.DASHBOARD_UPDATE,
331
+ deniedBehavior: "hide",
332
+ children: /* @__PURE__ */ S(y, {
333
+ variant: "ghost",
334
+ size: "sm",
335
+ onClick: () => void Se(e),
336
+ disabled: Z,
337
+ "aria-label": k("bigconsole.fleet.children.detachCopy", "Detach {{name}}", { name: e.name }),
338
+ title: k("bigconsole.fleet.children.detachCopy", "Detach {{name}}", { name: e.name }),
339
+ "data-testid": "fleet-child-detach",
340
+ children: /* @__PURE__ */ S(se, { style: {
341
+ height: "var(--size-icon-sm)",
342
+ width: "var(--size-icon-sm)"
343
+ } })
344
+ })
345
+ })]
346
+ })]
263
347
  }, e.dashboardId))]
264
348
  }),
265
- /* @__PURE__ */ S("div", {
349
+ /* @__PURE__ */ C("div", {
266
350
  className: "flex flex-wrap items-center gap-2",
267
351
  children: [
268
- /* @__PURE__ */ x(h, {
352
+ /* @__PURE__ */ S(_, {
269
353
  permission: t.DASHBOARD_CREATE,
270
354
  deniedBehavior: "hide",
271
- children: /* @__PURE__ */ x(v, {
355
+ children: /* @__PURE__ */ S(y, {
272
356
  variant: "outline",
273
357
  onClick: () => {
274
- K(null), U(!0);
358
+ W(null), H(!0);
275
359
  },
276
- disabled: Q,
360
+ disabled: Z,
277
361
  "data-testid": "fleet-create-copy",
278
- children: j("bigconsole.fleet.children.createCopy", "Create linked copy…")
362
+ children: k("bigconsole.fleet.children.createCopy", "Create linked copy…")
279
363
  })
280
364
  }),
281
- /* @__PURE__ */ x(h, {
365
+ /* @__PURE__ */ S(_, {
282
366
  permission: t.DASHBOARD_UPDATE,
283
367
  deniedBehavior: "hide",
284
- children: /* @__PURE__ */ x(v, {
368
+ children: /* @__PURE__ */ S(y, {
285
369
  onClick: () => $("DIRECT_COPIES"),
286
- disabled: Q || I.total === 0 || B.phase === "preview",
370
+ disabled: Z || P.total === 0 || B.phase === "preview",
287
371
  "data-testid": "fleet-push",
288
- children: j("bigconsole.fleet.children.push", "Push to copies…")
372
+ children: k("bigconsole.fleet.children.push", "Push to copies…")
289
373
  })
290
374
  }),
291
- /* @__PURE__ */ x(h, {
375
+ /* @__PURE__ */ S(_, {
292
376
  permission: t.DASHBOARD_UPDATE,
293
377
  deniedBehavior: "hide",
294
- children: /* @__PURE__ */ x(v, {
378
+ children: /* @__PURE__ */ S(y, {
295
379
  variant: "outline",
296
- onClick: () => G(!0),
297
- disabled: Q || z.length === 0,
380
+ onClick: () => U(!0),
381
+ disabled: Z || z.length === 0,
298
382
  "data-testid": "fleet-bindings",
299
- children: j("bigconsole.fleet.children.bindings", "Data sources…")
383
+ children: k("bigconsole.fleet.children.bindings", "Data sources…")
300
384
  })
301
385
  }),
302
- /* @__PURE__ */ x(h, {
386
+ /* @__PURE__ */ S(_, {
303
387
  permission: t.DASHBOARD_UPDATE,
304
388
  deniedBehavior: "hide",
305
- children: /* @__PURE__ */ x(v, {
389
+ children: /* @__PURE__ */ S(y, {
306
390
  variant: "ghost",
307
- onClick: pe,
308
- disabled: Q || I.total > 0,
309
- title: I.total > 0 ? j("bigconsole.fleet.children.unsetBlocked", "Detach or remove every copy first.") : void 0,
391
+ onClick: () => void Ce(),
392
+ disabled: Z,
393
+ title: P.active > 0 ? k("bigconsole.fleet.children.unsetHint", "Detaches its copies first, after asking, and then stops being a master.") : void 0,
310
394
  "data-testid": "fleet-unset-master",
311
- children: j("bigconsole.fleet.children.unsetMaster", "Stop being a master")
395
+ children: k("bigconsole.fleet.children.unsetMaster", "Stop being a master")
312
396
  })
313
397
  })
314
398
  ]
315
399
  })
316
400
  ] }),
317
- B.phase === "preview" && /* @__PURE__ */ S("div", {
401
+ B.phase === "preview" && /* @__PURE__ */ C("div", {
318
402
  className: "flex flex-col gap-form-gap rounded-input border p-3",
319
403
  style: { borderColor: "var(--color-border-subtle)" },
320
404
  "data-testid": "fleet-push-preview",
321
405
  children: [
322
- /* @__PURE__ */ x("strong", {
406
+ /* @__PURE__ */ S("strong", {
323
407
  style: { color: "var(--color-text-primary)" },
324
- children: j("bigconsole.fleet.push.previewTitle", "Preview: nothing has been changed yet")
408
+ children: k("bigconsole.fleet.push.previewTitle", "Preview: nothing has been changed yet")
325
409
  }),
326
- /* @__PURE__ */ x("div", {
410
+ /* @__PURE__ */ S("div", {
327
411
  role: "radiogroup",
328
- "aria-label": j("bigconsole.fleet.push.scopeLabel", "How far to push"),
412
+ "aria-label": k("bigconsole.fleet.push.scopeLabel", "How far to push"),
329
413
  className: "flex flex-wrap gap-2",
330
- children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */ x("button", {
414
+ children: ["DIRECT_COPIES", "ALL_UNDER"].map((e) => /* @__PURE__ */ S("button", {
331
415
  type: "button",
332
416
  role: "radio",
333
417
  "aria-checked": B.scope === e,
334
- disabled: Q,
418
+ disabled: Z,
335
419
  onClick: () => B.scope !== e && $(e),
336
420
  className: "rounded-input border px-3 py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
337
421
  style: {
@@ -340,72 +424,72 @@ var C = {
340
424
  color: "var(--color-text-primary)"
341
425
  },
342
426
  "data-testid": `fleet-push-scope-${e}`,
343
- children: e === "DIRECT_COPIES" ? j("bigconsole.fleet.push.scopeDirect", "Direct copies") : j("bigconsole.fleet.push.scopeAll", "Copies of copies too")
427
+ children: e === "DIRECT_COPIES" ? k("bigconsole.fleet.push.scopeDirect", "Direct copies") : k("bigconsole.fleet.push.scopeAll", "Copies of copies too")
344
428
  }, e))
345
429
  }),
346
- /* @__PURE__ */ x(l, { result: B.result }),
347
- a(B.result) && /* @__PURE__ */ x("p", {
430
+ /* @__PURE__ */ S(p, { result: B.result }),
431
+ l(B.result) && /* @__PURE__ */ S("p", {
348
432
  style: {
349
433
  margin: 0,
350
434
  color: "var(--color-text-secondary)",
351
435
  fontSize: "var(--font-size-body-sm)"
352
436
  },
353
- children: j("bigconsole.fleet.push.nothing", "Nothing to push: every copy already has what this board has.")
437
+ children: k("bigconsole.fleet.push.nothing", "Nothing to push: every copy already has what this board has.")
354
438
  }),
355
- /* @__PURE__ */ S("div", {
439
+ /* @__PURE__ */ C("div", {
356
440
  className: "flex gap-2",
357
- children: [/* @__PURE__ */ S(v, {
358
- onClick: () => he(B.scope),
359
- disabled: Q || a(B.result),
441
+ children: [/* @__PURE__ */ C(y, {
442
+ onClick: () => Te(B.scope),
443
+ disabled: Z || l(B.result),
360
444
  "data-testid": "fleet-push-confirm",
361
- children: [Q && /* @__PURE__ */ x(y, { style: {
445
+ children: [Z && /* @__PURE__ */ S(b, { style: {
362
446
  height: "var(--size-icon-sm)",
363
447
  width: "var(--size-icon-sm)"
364
- } }), j("bigconsole.fleet.push.confirm", "Push now")]
365
- }), /* @__PURE__ */ x(v, {
448
+ } }), k("bigconsole.fleet.push.confirm", "Push now")]
449
+ }), /* @__PURE__ */ S(y, {
366
450
  variant: "outline",
367
451
  onClick: () => V({ phase: "idle" }),
368
- disabled: Q,
369
- children: j("bigconsole.fleet.link.cancel", "Cancel")
452
+ disabled: Z,
453
+ children: k("bigconsole.fleet.link.cancel", "Cancel")
370
454
  })]
371
455
  })
372
456
  ]
373
457
  }),
374
- B.phase === "done" && /* @__PURE__ */ S("div", {
458
+ B.phase === "done" && /* @__PURE__ */ C("div", {
375
459
  className: "flex flex-col gap-form-gap rounded-input border p-3",
376
460
  style: { borderColor: "var(--color-border-subtle)" },
377
461
  "data-testid": "fleet-push-done",
378
462
  children: [
379
- /* @__PURE__ */ x("strong", {
463
+ /* @__PURE__ */ S("strong", {
380
464
  style: { color: "var(--color-text-primary)" },
381
- children: j("bigconsole.fleet.push.doneTitle", "Pushed")
465
+ children: k("bigconsole.fleet.push.doneTitle", "Pushed")
382
466
  }),
383
- /* @__PURE__ */ x(l, { result: B.result }),
384
- /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x(v, {
467
+ /* @__PURE__ */ S(p, { result: B.result }),
468
+ /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(y, {
385
469
  variant: "outline",
386
470
  onClick: () => V({ phase: "idle" }),
387
- children: j("bigconsole.fleet.push.done", "Done")
471
+ children: k("bigconsole.fleet.push.done", "Done")
388
472
  }) })
389
473
  ]
390
474
  }),
391
- W && /* @__PURE__ */ x(s, {
475
+ _e && /* @__PURE__ */ S(d, {
392
476
  isOpen: !0,
393
- masterId: u,
394
- masterName: E,
477
+ masterId: m,
478
+ masterName: D,
395
479
  copies: z,
396
- lock: Y,
397
- onClose: () => G(!1),
398
- onChanged: L
399
- }),
400
- /* @__PURE__ */ x(o, {
401
- isOpen: H,
402
- masterName: E,
403
- busy: Q,
404
- error: ce,
480
+ lock: q,
405
481
  onClose: () => U(!1),
406
- onCreate: me
482
+ onChanged: F
483
+ }),
484
+ /* @__PURE__ */ S(u, {
485
+ isOpen: ge,
486
+ masterName: D,
487
+ busy: Z,
488
+ error: ve,
489
+ onClose: () => H(!1),
490
+ onCreate: we
407
491
  })
408
492
  ]
409
493
  });
410
494
  });
411
- export { E as FleetChildrenPanel, E as default };
495
+ export { D as FleetChildrenPanel, D as default };