@burdenoff/microfe-bigconsole 2026.1123.1 → 2026.1123.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/compare/compareEngine.js +79 -66
- package/dist/bigconsole/components/fleet/FleetBadge.d.ts +12 -0
- package/dist/bigconsole/components/fleet/FleetBadge.js +61 -0
- package/dist/bigconsole/components/fleet/FleetBreadcrumb.d.ts +14 -0
- package/dist/bigconsole/components/fleet/FleetBreadcrumb.js +46 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.d.ts +17 -0
- package/dist/bigconsole/components/fleet/FleetCardActions.js +78 -0
- package/dist/bigconsole/components/fleet/LinkToMasterDialog.d.ts +24 -0
- package/dist/bigconsole/components/fleet/LinkToMasterDialog.js +108 -0
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +144 -148
- package/dist/bigconsole/hooks/useDashboardOperations.d.ts +8 -0
- package/dist/bigconsole/hooks/useDashboardOperations.js +2 -0
- package/dist/bigconsole/hooks/useFleetBoardActions.d.ts +18 -0
- package/dist/bigconsole/hooks/useFleetBoardActions.js +54 -0
- package/dist/bigconsole/hooks/useFleetBreadcrumb.d.ts +13 -0
- package/dist/bigconsole/hooks/useFleetBreadcrumb.js +52 -0
- package/dist/bigconsole/hooks/useFleetCopyTotals.d.ts +11 -0
- package/dist/bigconsole/hooks/useFleetCopyTotals.js +52 -0
- package/dist/bigconsole/hooks/useFleetLinks.d.ts +19 -0
- package/dist/bigconsole/hooks/useFleetLinks.js +74 -0
- package/dist/bigconsole/hooks/useFleetMasterSearch.d.ts +13 -0
- package/dist/bigconsole/hooks/useFleetMasterSearch.js +62 -0
- package/dist/bigconsole/pages/DashboardViewPage.js +313 -303
- package/dist/bigconsole/pages/DashboardsPage.js +733 -435
- package/dist/bigconsole/utils/fleetTree.d.ts +50 -0
- package/dist/bigconsole/utils/fleetTree.js +64 -0
- package/dist/bigconsole/utils/legacyChartRows.d.ts +2 -0
- package/dist/bigconsole/utils/legacyChartRows.js +19 -0
- package/dist/generated/global-types.d.ts +39 -7
- package/dist/generated/wspace-operations.d.ts +86 -0
- package/dist/generated/wspace-operations.js +602 -147
- package/dist/generated/wspace-types.d.ts +3847 -23
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFleetBoardActions (BOFF-15410)
|
|
3
|
+
*
|
|
4
|
+
* The actions that link a board under a master and take it out again. The server decides whether an action is
|
|
5
|
+
* allowed (loops, the depth cap, who may write to which board, whether the owner has to accept), so a refusal
|
|
6
|
+
* comes back as an error whose message is already worded for the person, and is shown as it is.
|
|
7
|
+
*/
|
|
8
|
+
/** Where a board stands after an action: linked now, waiting for its owner to accept, or following nothing. */
|
|
9
|
+
export type FleetLinkOutcome = 'ACTIVE' | 'PENDING' | 'NONE';
|
|
10
|
+
interface UseFleetBoardActionsResult {
|
|
11
|
+
busy: boolean;
|
|
12
|
+
linkToMaster: (childDashboardId: string, masterDashboardId: string) => Promise<FleetLinkOutcome>;
|
|
13
|
+
detach: (dashboardId: string) => Promise<void>;
|
|
14
|
+
/** Accept or decline a request to link a board the caller owns. */
|
|
15
|
+
respond: (childDashboardId: string, accept: boolean) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function useFleetBoardActions(): UseFleetBoardActionsResult;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DetachDashboardDocument as e, LinkDashboardToMasterDocument as t, RespondToDashboardLinkDocument as n } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useCallback as r, useState as i } from "react";
|
|
3
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
4
|
+
// src/bigconsole/hooks/useFleetBoardActions.ts
|
|
5
|
+
var o = (e) => e === "ACTIVE" ? "ACTIVE" : e === "PENDING" ? "PENDING" : "NONE";
|
|
6
|
+
function s() {
|
|
7
|
+
let s = a(), [c, l] = i(!1);
|
|
8
|
+
return {
|
|
9
|
+
busy: c,
|
|
10
|
+
linkToMaster: r(async (e, n) => {
|
|
11
|
+
l(!0);
|
|
12
|
+
try {
|
|
13
|
+
return o((await s.mutate({
|
|
14
|
+
mutation: t,
|
|
15
|
+
variables: { input: {
|
|
16
|
+
childDashboardId: e,
|
|
17
|
+
masterDashboardId: n
|
|
18
|
+
} },
|
|
19
|
+
errorPolicy: "none"
|
|
20
|
+
})).data?.linkDashboardToMaster?.linkStatus);
|
|
21
|
+
} finally {
|
|
22
|
+
l(!1);
|
|
23
|
+
}
|
|
24
|
+
}, [s]),
|
|
25
|
+
detach: r(async (t) => {
|
|
26
|
+
l(!0);
|
|
27
|
+
try {
|
|
28
|
+
await s.mutate({
|
|
29
|
+
mutation: e,
|
|
30
|
+
variables: { id: t },
|
|
31
|
+
errorPolicy: "none"
|
|
32
|
+
});
|
|
33
|
+
} finally {
|
|
34
|
+
l(!1);
|
|
35
|
+
}
|
|
36
|
+
}, [s]),
|
|
37
|
+
respond: r(async (e, t) => {
|
|
38
|
+
l(!0);
|
|
39
|
+
try {
|
|
40
|
+
await s.mutate({
|
|
41
|
+
mutation: n,
|
|
42
|
+
variables: {
|
|
43
|
+
childDashboardId: e,
|
|
44
|
+
accept: t
|
|
45
|
+
},
|
|
46
|
+
errorPolicy: "none"
|
|
47
|
+
});
|
|
48
|
+
} finally {
|
|
49
|
+
l(!1);
|
|
50
|
+
}
|
|
51
|
+
}, [s])
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export { s as useFleetBoardActions };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFleetBreadcrumb (BOFF-15410)
|
|
3
|
+
*
|
|
4
|
+
* The masters above a board, from the top down, with their names, for the breadcrumb on the board's page. The
|
|
5
|
+
* ids come from `dashboardLinks`; each name is a small read of its own, so a long chain costs one cheap query
|
|
6
|
+
* per level and the depth cap keeps that to a few. A master the caller cannot read is left out rather than
|
|
7
|
+
* shown by id. Nothing here can break the board's page: any failure just means no breadcrumb.
|
|
8
|
+
*/
|
|
9
|
+
export interface FleetBreadcrumbAncestor {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function useFleetBreadcrumb(dashboardId: string | undefined): FleetBreadcrumbAncestor[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import "../context/index.js";
|
|
2
|
+
import { useBigConsole as e } from "../context/BigConsoleContext.js";
|
|
3
|
+
import { FleetBoardNameDocument as t } from "../../generated/wspace-operations.js";
|
|
4
|
+
import { ancestorIds as n } from "../utils/fleetTree.js";
|
|
5
|
+
import { useFleetLinks as r } from "./useFleetLinks.js";
|
|
6
|
+
import { useEffect as i, useMemo as a, useState as o } from "react";
|
|
7
|
+
import { useApolloClient as s } from "@apollo/client/react";
|
|
8
|
+
// src/bigconsole/hooks/useFleetBreadcrumb.ts
|
|
9
|
+
function c(c) {
|
|
10
|
+
let { links: l } = r({ skip: !c }), { workspaceId: u } = e(), d = s(), f = a(() => c ? n(c, l) : [], [c, l]), p = f.join("|"), [m, h] = o({
|
|
11
|
+
key: "",
|
|
12
|
+
items: []
|
|
13
|
+
});
|
|
14
|
+
return i(() => {
|
|
15
|
+
let e = p ? p.split("|") : [];
|
|
16
|
+
if (e.length === 0) return;
|
|
17
|
+
let n = !0;
|
|
18
|
+
return Promise.all(e.map(async (e) => {
|
|
19
|
+
try {
|
|
20
|
+
let n = (await d.query({
|
|
21
|
+
query: t,
|
|
22
|
+
variables: { id: e },
|
|
23
|
+
fetchPolicy: "no-cache",
|
|
24
|
+
errorPolicy: "none",
|
|
25
|
+
context: {
|
|
26
|
+
requiredWorkspaceAuth: !0,
|
|
27
|
+
requiredWorkspaceId: u,
|
|
28
|
+
queryDeduplication: !1
|
|
29
|
+
}
|
|
30
|
+
})).data?.getDashboard;
|
|
31
|
+
return n ? {
|
|
32
|
+
id: n.id,
|
|
33
|
+
name: n.name
|
|
34
|
+
} : null;
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
})).then((e) => {
|
|
39
|
+
n && h({
|
|
40
|
+
key: p,
|
|
41
|
+
items: e.filter((e) => !!e)
|
|
42
|
+
});
|
|
43
|
+
}), () => {
|
|
44
|
+
n = !1;
|
|
45
|
+
};
|
|
46
|
+
}, [
|
|
47
|
+
d,
|
|
48
|
+
p,
|
|
49
|
+
u
|
|
50
|
+
]), f.length > 0 && m.key === p ? m.items : [];
|
|
51
|
+
}
|
|
52
|
+
export { c as useFleetBreadcrumb };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFleetCopyTotals (BOFF-15410)
|
|
3
|
+
*
|
|
4
|
+
* How many active copies follow each master on the page, from the server's rollup (a pending request is not
|
|
5
|
+
* following yet). The rollup counts copies the caller cannot read, which the list of links leaves out, so the
|
|
6
|
+
* badge on a master reads this and not the links. A master whose count has not arrived (or failed to load) is
|
|
7
|
+
* missing from the map and the page falls back to the readable links.
|
|
8
|
+
*/
|
|
9
|
+
/** One request for up to MASTERS_PER_REQUEST masters: each is an alias of the same rollup field. */
|
|
10
|
+
export declare const batchDocument: (count: number) => import('graphql').DocumentNode;
|
|
11
|
+
export declare function useFleetCopyTotals(masterIds: readonly string[], refreshOn: unknown): Map<string, number>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useBigConsole as e } from "../context/BigConsoleContext.js";
|
|
2
|
+
import "../context/index.js";
|
|
3
|
+
import { useEffect as t, useState as n } from "react";
|
|
4
|
+
import { useApolloClient as r } from "@apollo/client/react";
|
|
5
|
+
import { gql as i } from "@apollo/client";
|
|
6
|
+
// src/bigconsole/hooks/useFleetCopyTotals.ts
|
|
7
|
+
var a = 10, o = (e) => i`query FleetCopyTotals(${Array.from({ length: e }, (e, t) => `$m${t}: ID!`).join(", ")}) {
|
|
8
|
+
${Array.from({ length: e }, (e, t) => `m${t}: dashboardChildren(masterDashboardId: $m${t}) { masterDashboardId active }`).join("\n ")}
|
|
9
|
+
}`, s = (e) => typeof e == "object" && !!e && "masterDashboardId" in e && typeof e.masterDashboardId == "string" && "active" in e && typeof e.active == "number";
|
|
10
|
+
function c(i, c) {
|
|
11
|
+
let [l, u] = n(/* @__PURE__ */ new Map()), { workspaceId: d } = e(), f = r(), p = [...i].sort().join(",");
|
|
12
|
+
return t(() => {
|
|
13
|
+
let e = !1, t = p ? p.split(",") : [];
|
|
14
|
+
if (t.length === 0) {
|
|
15
|
+
u(/* @__PURE__ */ new Map());
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
let n = [];
|
|
19
|
+
for (let e = 0; e < t.length; e += a) n.push(t.slice(e, e + a));
|
|
20
|
+
return Promise.all(n.map(async (e) => {
|
|
21
|
+
try {
|
|
22
|
+
let t = await f.query({
|
|
23
|
+
query: o(e.length),
|
|
24
|
+
variables: Object.fromEntries(e.map((e, t) => [`m${t}`, e])),
|
|
25
|
+
fetchPolicy: "no-cache",
|
|
26
|
+
errorPolicy: "none",
|
|
27
|
+
context: {
|
|
28
|
+
requiredWorkspaceAuth: !0,
|
|
29
|
+
requiredWorkspaceId: d,
|
|
30
|
+
queryDeduplication: !1
|
|
31
|
+
}
|
|
32
|
+
}), n = [];
|
|
33
|
+
return e.forEach((e, r) => {
|
|
34
|
+
let i = t.data?.[`m${r}`];
|
|
35
|
+
s(i) && i.masterDashboardId === e && n.push([e, i.active]);
|
|
36
|
+
}), n;
|
|
37
|
+
} catch {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
})).then((t) => {
|
|
41
|
+
e || u(new Map(t.flat()));
|
|
42
|
+
}), () => {
|
|
43
|
+
e = !0;
|
|
44
|
+
};
|
|
45
|
+
}, [
|
|
46
|
+
f,
|
|
47
|
+
p,
|
|
48
|
+
c,
|
|
49
|
+
d
|
|
50
|
+
]), l;
|
|
51
|
+
}
|
|
52
|
+
export { o as batchDocument, c as useFleetCopyTotals };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FleetLink } from '../utils/fleetTree';
|
|
2
|
+
/** A request to link a board the caller owns under a master, waiting for the caller's answer. */
|
|
3
|
+
export interface FleetLinkRequest {
|
|
4
|
+
childDashboardId: string;
|
|
5
|
+
childName: string;
|
|
6
|
+
masterName: string;
|
|
7
|
+
}
|
|
8
|
+
interface UseFleetLinksResult {
|
|
9
|
+
links: FleetLink[];
|
|
10
|
+
/** Requests the caller has to accept or decline. */
|
|
11
|
+
requests: FleetLinkRequest[];
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: Error | null;
|
|
14
|
+
refetch: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function useFleetLinks({ skip }?: {
|
|
17
|
+
skip?: boolean;
|
|
18
|
+
}): UseFleetLinksResult;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "../context/index.js";
|
|
2
|
+
import { useBigConsole as e } from "../context/BigConsoleContext.js";
|
|
3
|
+
import { FleetLinksDocument as t } from "../../generated/wspace-operations.js";
|
|
4
|
+
import { useCallback as n, useEffect as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
|
|
5
|
+
import { useApolloClient as s } from "@apollo/client/react";
|
|
6
|
+
// src/bigconsole/hooks/useFleetLinks.ts
|
|
7
|
+
var c = [], l = [];
|
|
8
|
+
function u({ skip: u = !1 } = {}) {
|
|
9
|
+
let [d, f] = o({
|
|
10
|
+
owner: "",
|
|
11
|
+
links: [],
|
|
12
|
+
requests: [],
|
|
13
|
+
error: null
|
|
14
|
+
}), [p, m] = o(!u), { workspaceId: h, currentUser: g } = e(), _ = s(), v = `${h ?? ""}:${g?.id ?? ""}`, y = a(v), b = a(0);
|
|
15
|
+
i(() => (y.current = v, () => {
|
|
16
|
+
y.current = "", b.current += 1;
|
|
17
|
+
}), [v]);
|
|
18
|
+
let x = n(async () => {
|
|
19
|
+
let e = ++b.current, n = () => y.current === v && b.current === e;
|
|
20
|
+
try {
|
|
21
|
+
m(!0);
|
|
22
|
+
let e = await _.query({
|
|
23
|
+
query: t,
|
|
24
|
+
fetchPolicy: "no-cache",
|
|
25
|
+
errorPolicy: "none",
|
|
26
|
+
context: {
|
|
27
|
+
requiredWorkspaceAuth: !0,
|
|
28
|
+
requiredWorkspaceId: h,
|
|
29
|
+
queryDeduplication: !1
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
if (!n()) return;
|
|
33
|
+
f({
|
|
34
|
+
owner: v,
|
|
35
|
+
links: (e.data?.dashboardLinks ?? []).map((e) => ({
|
|
36
|
+
childDashboardId: e.childDashboardId,
|
|
37
|
+
masterDashboardId: e.masterDashboardId,
|
|
38
|
+
status: e.status === "PENDING" ? "PENDING" : "ACTIVE"
|
|
39
|
+
})),
|
|
40
|
+
requests: (e.data?.pendingDashboardLinks ?? []).map((e) => ({
|
|
41
|
+
childDashboardId: e.childDashboardId,
|
|
42
|
+
childName: e.childName,
|
|
43
|
+
masterName: e.masterName
|
|
44
|
+
})),
|
|
45
|
+
error: null
|
|
46
|
+
});
|
|
47
|
+
} catch (e) {
|
|
48
|
+
n() && f({
|
|
49
|
+
owner: v,
|
|
50
|
+
links: [],
|
|
51
|
+
requests: [],
|
|
52
|
+
error: e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load linked boards")
|
|
53
|
+
});
|
|
54
|
+
} finally {
|
|
55
|
+
n() && m(!1);
|
|
56
|
+
}
|
|
57
|
+
}, [
|
|
58
|
+
_,
|
|
59
|
+
v,
|
|
60
|
+
h
|
|
61
|
+
]);
|
|
62
|
+
r(() => {
|
|
63
|
+
u || x();
|
|
64
|
+
}, [x, u]);
|
|
65
|
+
let S = d.owner === v;
|
|
66
|
+
return {
|
|
67
|
+
links: S ? d.links : c,
|
|
68
|
+
requests: S ? d.requests : l,
|
|
69
|
+
loading: p || !u && !S,
|
|
70
|
+
error: S ? d.error : null,
|
|
71
|
+
refetch: x
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export { u as useFleetLinks };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useFleetMasterSearch (BOFF-15410)
|
|
3
|
+
*
|
|
4
|
+
* Boards matching what is typed in the "Link to master" dialog, searched on the server. The dashboards list
|
|
5
|
+
* holds only its first page, so a master beyond it could never be chosen from that list alone. A failed search
|
|
6
|
+
* just adds nothing: the boards already loaded stay choosable.
|
|
7
|
+
*/
|
|
8
|
+
export interface FleetMasterMatch {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
isMaster: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function useFleetMasterSearch(query: string, enabled: boolean): FleetMasterMatch[];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "../context/index.js";
|
|
2
|
+
import { useBigConsole as e } from "../context/BigConsoleContext.js";
|
|
3
|
+
import { ListDashboardsDocument as t } from "../../generated/wspace-operations.js";
|
|
4
|
+
import { useEffect as n, useState as r } from "react";
|
|
5
|
+
import { useApolloClient as i } from "@apollo/client/react";
|
|
6
|
+
// src/bigconsole/hooks/useFleetMasterSearch.ts
|
|
7
|
+
var a = 250, o = 20;
|
|
8
|
+
function s(s, c) {
|
|
9
|
+
let [l, u] = r({
|
|
10
|
+
owner: "",
|
|
11
|
+
query: "",
|
|
12
|
+
items: []
|
|
13
|
+
}), { workspaceId: d, currentUser: f } = e(), p = `${d ?? ""}:${f?.id ?? ""}`, m = i(), h = s.trim();
|
|
14
|
+
return n(() => {
|
|
15
|
+
if (!c || !h) return;
|
|
16
|
+
let e = !0, n = setTimeout(() => {
|
|
17
|
+
m.query({
|
|
18
|
+
query: t,
|
|
19
|
+
variables: {
|
|
20
|
+
first: o,
|
|
21
|
+
search: h,
|
|
22
|
+
includeArchived: !1
|
|
23
|
+
},
|
|
24
|
+
fetchPolicy: "no-cache",
|
|
25
|
+
errorPolicy: "none",
|
|
26
|
+
context: {
|
|
27
|
+
requiredWorkspaceAuth: !0,
|
|
28
|
+
requiredWorkspaceId: d,
|
|
29
|
+
queryDeduplication: !1
|
|
30
|
+
}
|
|
31
|
+
}).then((t) => {
|
|
32
|
+
if (!e) return;
|
|
33
|
+
let n = (t.data?.listDashboards?.edges ?? []).map((e) => ({
|
|
34
|
+
id: e.node.id,
|
|
35
|
+
name: e.node.name,
|
|
36
|
+
isMaster: e.node.isMaster === !0
|
|
37
|
+
}));
|
|
38
|
+
u({
|
|
39
|
+
owner: p,
|
|
40
|
+
query: h,
|
|
41
|
+
items: n
|
|
42
|
+
});
|
|
43
|
+
}).catch(() => {
|
|
44
|
+
e && u({
|
|
45
|
+
owner: p,
|
|
46
|
+
query: h,
|
|
47
|
+
items: []
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}, a);
|
|
51
|
+
return () => {
|
|
52
|
+
e = !1, clearTimeout(n);
|
|
53
|
+
};
|
|
54
|
+
}, [
|
|
55
|
+
m,
|
|
56
|
+
c,
|
|
57
|
+
h,
|
|
58
|
+
p,
|
|
59
|
+
d
|
|
60
|
+
]), c && h && l.owner === p && l.query === h ? l.items : [];
|
|
61
|
+
}
|
|
62
|
+
export { s as useFleetMasterSearch };
|