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