@burdenoff/microfe-bigconsole 2026.1004.2 → 2026.1004.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/BigConsoleRoutes.d.ts +1 -1
- package/dist/bigconsole/BigConsoleRoutes.d.ts.map +1 -1
- package/dist/bigconsole/BigConsoleRoutes.js +15 -1
- package/dist/bigconsole/BigConsoleRoutes.js.map +1 -1
- package/dist/bigconsole/components/DrilldownModal.d.ts.map +1 -1
- package/dist/bigconsole/components/DrilldownModal.js +54 -53
- package/dist/bigconsole/components/DrilldownModal.js.map +1 -1
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.d.ts +3 -1
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.d.ts.map +1 -1
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +40 -39
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardCanvas.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +184 -177
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardGrid.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/DashboardGrid.js +40 -22
- package/dist/bigconsole/components/dashboard/DashboardGrid.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +31 -25
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.d.ts +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +115 -80
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +177 -146
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js.map +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.d.ts +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +375 -325
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
- package/dist/bigconsole/components/datasink/CacheTTLSelector.d.ts.map +1 -1
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +7 -1
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js.map +1 -1
- package/dist/bigconsole/components/parser/ParserSelector.d.ts +3 -1
- package/dist/bigconsole/components/parser/ParserSelector.d.ts.map +1 -1
- package/dist/bigconsole/components/parser/ParserSelector.js +94 -94
- package/dist/bigconsole/components/parser/ParserSelector.js.map +1 -1
- package/dist/bigconsole/components/pipeline/PipelineCard.d.ts.map +1 -1
- package/dist/bigconsole/components/pipeline/PipelineCard.js +111 -89
- package/dist/bigconsole/components/pipeline/PipelineCard.js.map +1 -1
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.d.ts +8 -0
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.d.ts.map +1 -0
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +52 -0
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js.map +1 -0
- package/dist/bigconsole/components/widgets/PropertiesPanel.d.ts.map +1 -1
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +257 -221
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetHeader.d.ts +1 -0
- package/dist/bigconsole/components/widgets/WidgetHeader.d.ts.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetHeader.js +29 -29
- package/dist/bigconsole/components/widgets/WidgetHeader.js.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.d.ts +2 -0
- package/dist/bigconsole/components/widgets/WidgetWrapper.d.ts.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +247 -239
- package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.d.ts.map +1 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +6 -4
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js.map +1 -1
- package/dist/bigconsole/components/widgets/states/EmptyState.d.ts +1 -0
- package/dist/bigconsole/components/widgets/states/EmptyState.d.ts.map +1 -1
- package/dist/bigconsole/components/widgets/states/EmptyState.js +4 -4
- package/dist/bigconsole/components/widgets/states/EmptyState.js.map +1 -1
- package/dist/bigconsole/components/workflow/WorkflowDesignPreview.d.ts +7 -0
- package/dist/bigconsole/components/workflow/WorkflowDesignPreview.d.ts.map +1 -0
- package/dist/bigconsole/components/workflow/WorkflowDesignPreview.js +94 -0
- package/dist/bigconsole/components/workflow/WorkflowDesignPreview.js.map +1 -0
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.d.ts +7 -0
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.d.ts.map +1 -0
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +101 -0
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js.map +1 -0
- package/dist/bigconsole/hooks/useBigConsoleSettings.d.ts +16 -0
- package/dist/bigconsole/hooks/useBigConsoleSettings.d.ts.map +1 -0
- package/dist/bigconsole/hooks/useBigConsoleSettings.js +57 -0
- package/dist/bigconsole/hooks/useBigConsoleSettings.js.map +1 -0
- package/dist/bigconsole/hooks/useDashboardOperations.d.ts.map +1 -1
- package/dist/bigconsole/hooks/useDashboardOperations.js +102 -79
- package/dist/bigconsole/hooks/useDashboardOperations.js.map +1 -1
- package/dist/bigconsole/hooks/useExportDashboard.d.ts +3 -1
- package/dist/bigconsole/hooks/useExportDashboard.d.ts.map +1 -1
- package/dist/bigconsole/hooks/useExportDashboard.js +23 -13
- package/dist/bigconsole/hooks/useExportDashboard.js.map +1 -1
- package/dist/bigconsole/hooks/useFilterUrlSync.d.ts +18 -0
- package/dist/bigconsole/hooks/useFilterUrlSync.d.ts.map +1 -1
- package/dist/bigconsole/hooks/useFilterUrlSync.js +87 -57
- package/dist/bigconsole/hooks/useFilterUrlSync.js.map +1 -1
- package/dist/bigconsole/hooks/useGlobalFilters.d.ts.map +1 -1
- package/dist/bigconsole/hooks/useGlobalFilters.js +39 -29
- package/dist/bigconsole/hooks/useGlobalFilters.js.map +1 -1
- package/dist/bigconsole/hooks/usePageOperations.d.ts.map +1 -1
- package/dist/bigconsole/hooks/usePageOperations.js +1 -0
- package/dist/bigconsole/hooks/usePageOperations.js.map +1 -1
- package/dist/bigconsole/hooks/usePipelineOperations.d.ts.map +1 -1
- package/dist/bigconsole/hooks/usePipelineOperations.js +114 -112
- package/dist/bigconsole/hooks/usePipelineOperations.js.map +1 -1
- package/dist/bigconsole/hooks/useShareRecipients.d.ts +22 -0
- package/dist/bigconsole/hooks/useShareRecipients.d.ts.map +1 -0
- package/dist/bigconsole/hooks/useShareRecipients.js +198 -0
- package/dist/bigconsole/hooks/useShareRecipients.js.map +1 -0
- package/dist/bigconsole/pages/DashboardBuilderPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/DashboardBuilderPage.js +198 -193
- package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/DashboardViewPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/DashboardViewPage.js +171 -167
- package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
- package/dist/bigconsole/pages/DashboardsPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/DashboardsPage.js +313 -266
- package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkBuilderPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +84 -79
- package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/DataSinkViewPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/DataSinkViewPage.js +267 -257
- package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
- package/dist/bigconsole/pages/InsightsPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/InsightsPage.js +465 -402
- package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelineBuilderPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/PipelineBuilderPage.js +169 -157
- package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelineViewPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/PipelineViewPage.js +370 -230
- package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
- package/dist/bigconsole/pages/PipelinesPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/PipelinesPage.js +181 -151
- package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
- package/dist/bigconsole/pages/SettingsPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/SettingsPage.js +188 -208
- package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
- package/dist/bigconsole/pages/WidgetDemoPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/WidgetDemoPage.js +134 -117
- package/dist/bigconsole/pages/WidgetDemoPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowViewPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/WorkflowViewPage.js +315 -267
- package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +4 -3
- package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
- package/dist/bigconsole/types/index.d.ts +4 -0
- package/dist/bigconsole/types/index.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +148 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +172 -133
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +21 -0
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/microfe-bigconsole.css +1 -1
- package/dist/translations/en.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WorkflowData } from '@burdenoff/fluidgrids-fe-sdk';
|
|
2
|
+
|
|
3
|
+
/** Read-only projection of the saved graph. Named ports and labels come from the actual definition. */
|
|
4
|
+
export declare function WorkflowDesignPreview({ workflow }: {
|
|
5
|
+
workflow: WorkflowData;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=WorkflowDesignPreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowDesignPreview.d.ts","sourceRoot":"","sources":["../../../../src/bigconsole/components/workflow/WorkflowDesignPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,8BAA8B,CAAC;AA6CtC,uGAAuG;AACvG,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,+BAqE7E"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useMemo as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { Background as r, Controls as i, Handle as a, Position as o, ReactFlow as s } from "@xyflow/react";
|
|
4
|
+
import "@xyflow/react/dist/style.css";
|
|
5
|
+
//#region src/bigconsole/components/workflow/WorkflowDesignPreview.tsx
|
|
6
|
+
function c(e) {
|
|
7
|
+
return e && typeof e == "object" && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
|
|
8
|
+
}
|
|
9
|
+
function l({ data: e }) {
|
|
10
|
+
return /* @__PURE__ */ n("div", {
|
|
11
|
+
className: "min-w-40 rounded-card border border-[var(--color-border-subtle)] bg-bg-canvas p-3 text-text-primary shadow-sm",
|
|
12
|
+
children: [
|
|
13
|
+
e.inputs.map((n, r) => /* @__PURE__ */ t(a, {
|
|
14
|
+
id: n || void 0,
|
|
15
|
+
type: "target",
|
|
16
|
+
position: o.Left,
|
|
17
|
+
isConnectable: !1,
|
|
18
|
+
style: {
|
|
19
|
+
top: `${(r + 1) / (e.inputs.length + 1) * 100}%`,
|
|
20
|
+
background: "var(--color-text-secondary)"
|
|
21
|
+
}
|
|
22
|
+
}, n)),
|
|
23
|
+
/* @__PURE__ */ t("p", {
|
|
24
|
+
className: "text-sm font-medium",
|
|
25
|
+
children: e.label
|
|
26
|
+
}),
|
|
27
|
+
e.operation && /* @__PURE__ */ t("p", {
|
|
28
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
29
|
+
children: e.operation
|
|
30
|
+
}),
|
|
31
|
+
e.outputs.map((n, r) => /* @__PURE__ */ t(a, {
|
|
32
|
+
id: n || void 0,
|
|
33
|
+
type: "source",
|
|
34
|
+
position: o.Right,
|
|
35
|
+
isConnectable: !1,
|
|
36
|
+
style: {
|
|
37
|
+
top: `${(r + 1) / (e.outputs.length + 1) * 100}%`,
|
|
38
|
+
background: "var(--color-text-secondary)"
|
|
39
|
+
}
|
|
40
|
+
}, n))
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
var u = { design: l };
|
|
45
|
+
function d({ workflow: a }) {
|
|
46
|
+
let { nodes: o, edges: l } = e(() => {
|
|
47
|
+
let e = (a.edges ?? []).flatMap((e) => typeof e.id != "string" || typeof e.source != "string" || typeof e.target != "string" ? [] : [{
|
|
48
|
+
id: e.id,
|
|
49
|
+
source: e.source,
|
|
50
|
+
target: e.target,
|
|
51
|
+
sourceHandle: typeof e.sourceHandle == "string" ? e.sourceHandle : void 0,
|
|
52
|
+
targetHandle: typeof e.targetHandle == "string" ? e.targetHandle : void 0,
|
|
53
|
+
type: "smoothstep",
|
|
54
|
+
style: { stroke: "var(--color-text-secondary)" }
|
|
55
|
+
}]);
|
|
56
|
+
return {
|
|
57
|
+
nodes: (a.nodes ?? []).flatMap((t) => {
|
|
58
|
+
if (typeof t.id != "string") return [];
|
|
59
|
+
let n = c(t.data), r = c(n.nodeData), i = c(t.position), a = [...new Set(e.filter((e) => e.target === t.id).map((e) => e.targetHandle ?? ""))], o = [...new Set(e.filter((e) => e.source === t.id).map((e) => e.sourceHandle ?? ""))];
|
|
60
|
+
return [{
|
|
61
|
+
id: t.id,
|
|
62
|
+
type: "design",
|
|
63
|
+
position: {
|
|
64
|
+
x: typeof i.x == "number" ? i.x : 0,
|
|
65
|
+
y: typeof i.y == "number" ? i.y : 0
|
|
66
|
+
},
|
|
67
|
+
data: {
|
|
68
|
+
label: typeof r.name == "string" ? r.name : typeof n.label == "string" ? n.label : typeof t.type == "string" ? t.type : t.id,
|
|
69
|
+
operation: typeof n.operation_name == "string" ? n.operation_name : void 0,
|
|
70
|
+
inputs: a,
|
|
71
|
+
outputs: o
|
|
72
|
+
}
|
|
73
|
+
}];
|
|
74
|
+
}),
|
|
75
|
+
edges: e
|
|
76
|
+
};
|
|
77
|
+
}, [a]);
|
|
78
|
+
return /* @__PURE__ */ n(s, {
|
|
79
|
+
nodes: o,
|
|
80
|
+
edges: l,
|
|
81
|
+
nodeTypes: u,
|
|
82
|
+
nodesDraggable: !1,
|
|
83
|
+
nodesConnectable: !1,
|
|
84
|
+
elementsSelectable: !1,
|
|
85
|
+
deleteKeyCode: null,
|
|
86
|
+
fitView: !0,
|
|
87
|
+
proOptions: { hideAttribution: !0 },
|
|
88
|
+
children: [/* @__PURE__ */ t(r, {}), /* @__PURE__ */ t(i, { showInteractive: !1 })]
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { d as WorkflowDesignPreview };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=WorkflowDesignPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowDesignPreview.js","names":[],"sources":["../../../../src/bigconsole/components/workflow/WorkflowDesignPreview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { ReactFlow, Background, Controls, Handle, Position, type Node, type Edge, type NodeProps } from '@xyflow/react';\nimport type { WorkflowData } from '@burdenoff/fluidgrids-fe-sdk';\nimport '@xyflow/react/dist/style.css';\n\ntype PreviewNode = Node<{ label: string; operation?: string; inputs: string[]; outputs: string[] }>;\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? Object.fromEntries(Object.entries(value)) : {};\n}\n\nfunction DesignNode({ data }: NodeProps<PreviewNode>) {\n return (\n <div className=\"min-w-40 rounded-card border border-[var(--color-border-subtle)] bg-bg-canvas p-3 text-text-primary shadow-sm\">\n {data.inputs.map((id, index) => (\n <Handle\n key={id}\n id={id || undefined}\n type=\"target\"\n position={Position.Left}\n isConnectable={false}\n style={{\n top: `${((index + 1) / (data.inputs.length + 1)) * 100}%`,\n background: 'var(--color-text-secondary)',\n }}\n />\n ))}\n <p className=\"text-sm font-medium\">{data.label}</p>\n {data.operation && <p className=\"mt-1 text-xs text-text-secondary\">{data.operation}</p>}\n {data.outputs.map((id, index) => (\n <Handle\n key={id}\n id={id || undefined}\n type=\"source\"\n position={Position.Right}\n isConnectable={false}\n style={{\n top: `${((index + 1) / (data.outputs.length + 1)) * 100}%`,\n background: 'var(--color-text-secondary)',\n }}\n />\n ))}\n </div>\n );\n}\n\nconst nodeTypes = { design: DesignNode };\n\n/** Read-only projection of the saved graph. Named ports and labels come from the actual definition. */\nexport function WorkflowDesignPreview({ workflow }: { workflow: WorkflowData }) {\n const { nodes, edges } = useMemo(() => {\n const edges: Edge[] = (workflow.edges ?? []).flatMap((edge) => {\n if (typeof edge.id !== 'string' || typeof edge.source !== 'string' || typeof edge.target !== 'string') return [];\n return [\n {\n id: edge.id,\n source: edge.source,\n target: edge.target,\n sourceHandle: typeof edge.sourceHandle === 'string' ? edge.sourceHandle : undefined,\n targetHandle: typeof edge.targetHandle === 'string' ? edge.targetHandle : undefined,\n type: 'smoothstep',\n style: { stroke: 'var(--color-text-secondary)' },\n },\n ];\n });\n const nodes: PreviewNode[] = (workflow.nodes ?? []).flatMap((node) => {\n if (typeof node.id !== 'string') return [];\n const data = record(node.data);\n const manifest = record(data.nodeData);\n const position = record(node.position);\n const inputs = [\n ...new Set(edges.filter((edge) => edge.target === node.id).map((edge) => edge.targetHandle ?? '')),\n ];\n const outputs = [\n ...new Set(edges.filter((edge) => edge.source === node.id).map((edge) => edge.sourceHandle ?? '')),\n ];\n return [\n {\n id: node.id,\n type: 'design',\n position: {\n x: typeof position.x === 'number' ? position.x : 0,\n y: typeof position.y === 'number' ? position.y : 0,\n },\n data: {\n label:\n typeof manifest.name === 'string'\n ? manifest.name\n : typeof data.label === 'string'\n ? data.label\n : typeof node.type === 'string'\n ? node.type\n : node.id,\n operation: typeof data.operation_name === 'string' ? data.operation_name : undefined,\n inputs,\n outputs,\n },\n },\n ];\n });\n return { nodes, edges };\n }, [workflow]);\n return (\n <ReactFlow\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n nodesDraggable={false}\n nodesConnectable={false}\n elementsSelectable={false}\n deleteKeyCode={null}\n fitView\n proOptions={{ hideAttribution: true }}\n >\n <Background />\n <Controls showInteractive={false} />\n </ReactFlow>\n );\n}\n"],"mappings":";;;;;AAOA,SAAS,EAAO,GAAyC;AACvD,QAAO,KAAS,OAAO,KAAU,YAAY,CAAC,MAAM,QAAQ,EAAM,GAAG,OAAO,YAAY,OAAO,QAAQ,EAAM,CAAC,GAAG,EAAE;;AAGrH,SAAS,EAAW,EAAE,WAAgC;AACpD,QACE,kBAAC,OAAD;E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,EAAO,EAAK,SAAS,EAChC,IAAW,EAAO,EAAK,SAAS,EAChC,IAAS,CACb,GAAG,IAAI,IAAI,EAAM,QAAQ,MAAS,EAAK,WAAW,EAAK,GAAG,CAAC,KAAK,MAAS,EAAK,gBAAgB,GAAG,CAAC,CACnG,EACK,IAAU,CACd,GAAG,IAAI,IAAI,EAAM,QAAQ,MAAS,EAAK,WAAW,EAAK,GAAG,CAAC,KAAK,MAAS,EAAK,gBAAgB,GAAG,CAAC,CACnG;AACD,WAAO,CACL;KACE,IAAI,EAAK;KACT,MAAM;KACN,UAAU;MACR,GAAG,OAAO,EAAS,KAAM,WAAW,EAAS,IAAI;MACjD,GAAG,OAAO,EAAS,KAAM,WAAW,EAAS,IAAI;MAClD;KACD,MAAM;MACJ,OACE,OAAO,EAAS,QAAS,WACrB,EAAS,OACT,OAAO,EAAK,SAAU,WACpB,EAAK,QACL,OAAO,EAAK,QAAS,WACnB,EAAK,OACL,EAAK;MACf,WAAW,OAAO,EAAK,kBAAmB,WAAW,EAAK,iBAAiB,KAAA;MAC3E;MACA;MACD;KACF,CACF;KACD;GACc;GAAO;IACtB,CAAC,EAAS,CAAC;AACd,QACE,kBAAC,GAAD;EACS;EACA;EACI;EACX,gBAAgB;EAChB,kBAAkB;EAClB,oBAAoB;EACpB,eAAe;EACf,SAAA;EACA,YAAY,EAAE,iBAAiB,IAAM;YATvC,CAWE,kBAAC,GAAD,EAAc,CAAA,EACd,kBAAC,GAAD,EAAU,iBAAiB,IAAS,CAAA,CAC1B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Uses existing workspace sinks and the real link mutation; no example links. */
|
|
2
|
+
export declare function WorkflowSinkLinkForm({ workflowId, linkedSinkIds, onLinked, }: {
|
|
3
|
+
workflowId: string;
|
|
4
|
+
linkedSinkIds: string[];
|
|
5
|
+
onLinked: () => Promise<void>;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=WorkflowSinkLinkForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowSinkLinkForm.d.ts","sourceRoot":"","sources":["../../../../src/bigconsole/components/workflow/WorkflowSinkLinkForm.tsx"],"names":[],"mappings":"AAOA,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,EACnC,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B,+BA0GA"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import e from "../../hooks/useWorkflowOperations.js";
|
|
2
|
+
import { SECTION_FOCUS_RING as t } from "../common/sectionStyles.js";
|
|
3
|
+
import "../common/index.js";
|
|
4
|
+
import n from "../../hooks/useDataSinkOperations.js";
|
|
5
|
+
import { useState as r } from "react";
|
|
6
|
+
import { Button as i } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
//#region src/bigconsole/components/workflow/WorkflowSinkLinkForm.tsx
|
|
10
|
+
function c({ workflowId: c, linkedSinkIds: l, onLinked: u }) {
|
|
11
|
+
let { t: d } = s(), { dataSinks: f, loading: p, error: m } = n(), { linkDataSink: h } = e({ skipFetch: !0 }), [g, _] = r(""), [v, y] = r(0), [b, x] = r(""), [S, C] = r(!1), [w, T] = r(null), E = f.filter((e) => e.isActive && !l.includes(e.id)), D = async (e) => {
|
|
12
|
+
if (e.preventDefault(), !E.some((e) => e.key === g) || S) return;
|
|
13
|
+
let t;
|
|
14
|
+
if (b.trim()) try {
|
|
15
|
+
let e = JSON.parse(b);
|
|
16
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("Expected a JSON object");
|
|
17
|
+
t = Object.fromEntries(Object.entries(e));
|
|
18
|
+
} catch {
|
|
19
|
+
T(d("bigconsole.workflows.links.mappingError", "Data mapping must be a JSON object."));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
C(!0), T(null);
|
|
23
|
+
try {
|
|
24
|
+
if (!await h(c, {
|
|
25
|
+
dataSinkKey: g,
|
|
26
|
+
priority: v,
|
|
27
|
+
dataMapping: t
|
|
28
|
+
})) {
|
|
29
|
+
T(d("bigconsole.workflows.links.saveError", "The data sink could not be linked. Try again."));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
await u();
|
|
33
|
+
} finally {
|
|
34
|
+
C(!1);
|
|
35
|
+
}
|
|
36
|
+
}, O = `w-full min-w-0 rounded-input border border-[var(--color-border-subtle)] bg-bg-canvas px-3 py-2 text-sm text-text-primary ${t}`;
|
|
37
|
+
return /* @__PURE__ */ o("form", {
|
|
38
|
+
onSubmit: D,
|
|
39
|
+
className: "mb-form-gap flex min-w-0 flex-col gap-form-gap rounded-card border border-[var(--color-border-subtle)] bg-bg-sunken p-3",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ o("label", {
|
|
42
|
+
className: "block text-sm font-medium text-text-primary",
|
|
43
|
+
children: [d("bigconsole.workflows.links.sinkLabel", "Data sink"), /* @__PURE__ */ o("select", {
|
|
44
|
+
value: g,
|
|
45
|
+
onChange: (e) => _(e.target.value),
|
|
46
|
+
disabled: p || S,
|
|
47
|
+
required: !0,
|
|
48
|
+
className: O,
|
|
49
|
+
children: [/* @__PURE__ */ a("option", {
|
|
50
|
+
value: "",
|
|
51
|
+
children: d("bigconsole.workflows.links.selectSink", "Select a data sink")
|
|
52
|
+
}), E.map((e) => /* @__PURE__ */ a("option", {
|
|
53
|
+
value: e.key,
|
|
54
|
+
children: e.name || e.key
|
|
55
|
+
}, e.id))]
|
|
56
|
+
})]
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ o("label", {
|
|
59
|
+
className: "block text-sm font-medium text-text-primary",
|
|
60
|
+
children: [d("bigconsole.workflows.links.priorityLabel", "Priority"), /* @__PURE__ */ a("input", {
|
|
61
|
+
type: "number",
|
|
62
|
+
min: 0,
|
|
63
|
+
step: 1,
|
|
64
|
+
value: v,
|
|
65
|
+
onChange: (e) => y(Number(e.target.value)),
|
|
66
|
+
disabled: S,
|
|
67
|
+
className: O
|
|
68
|
+
})]
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ o("label", {
|
|
71
|
+
className: "block text-sm font-medium text-text-primary",
|
|
72
|
+
children: [d("bigconsole.workflows.links.mappingLabel", "Data mapping (optional JSON)"), /* @__PURE__ */ a("textarea", {
|
|
73
|
+
value: b,
|
|
74
|
+
onChange: (e) => x(e.target.value),
|
|
75
|
+
disabled: S,
|
|
76
|
+
rows: 3,
|
|
77
|
+
className: `${O} resize-y font-mono`
|
|
78
|
+
})]
|
|
79
|
+
}),
|
|
80
|
+
!p && !m && E.length === 0 && /* @__PURE__ */ a("p", {
|
|
81
|
+
className: "text-sm text-text-secondary",
|
|
82
|
+
children: d("bigconsole.workflows.links.noAvailable", "No unlinked active data sinks are available in this workspace.")
|
|
83
|
+
}),
|
|
84
|
+
(m || w) && /* @__PURE__ */ a("p", {
|
|
85
|
+
role: "alert",
|
|
86
|
+
className: "text-sm text-status-error-text",
|
|
87
|
+
children: w || d("bigconsole.workflows.links.loadError", "Data sinks could not be loaded. Close and reopen the form to retry.")
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ a(i, {
|
|
90
|
+
type: "submit",
|
|
91
|
+
disabled: !g || S || p,
|
|
92
|
+
className: "w-full sm:w-auto",
|
|
93
|
+
children: S ? d("bigconsole.workflows.links.saving", "Linking…") : d("bigconsole.workflows.links.link", "Link sink")
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { c as WorkflowSinkLinkForm };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=WorkflowSinkLinkForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowSinkLinkForm.js","names":[],"sources":["../../../../src/bigconsole/components/workflow/WorkflowSinkLinkForm.tsx"],"sourcesContent":["import { useState, type FormEvent } from 'react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useDataSinkOperations } from '../../hooks/useDataSinkOperations';\nimport { useWorkflowOperations } from '../../hooks/useWorkflowOperations';\nimport { SECTION_FOCUS_RING } from '../common';\n\n/** Uses existing workspace sinks and the real link mutation; no example links. */\nexport function WorkflowSinkLinkForm({\n workflowId,\n linkedSinkIds,\n onLinked,\n}: {\n workflowId: string;\n linkedSinkIds: string[];\n onLinked: () => Promise<void>;\n}) {\n const { t } = useI18n();\n const { dataSinks, loading, error } = useDataSinkOperations();\n const { linkDataSink } = useWorkflowOperations({ skipFetch: true });\n const [key, setKey] = useState('');\n const [priority, setPriority] = useState(0);\n const [mapping, setMapping] = useState('');\n const [saving, setSaving] = useState(false);\n const [failure, setFailure] = useState<string | null>(null);\n const available = dataSinks.filter((sink) => sink.isActive && !linkedSinkIds.includes(sink.id));\n const submit = async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!available.some((sink) => sink.key === key) || saving) return;\n let dataMapping: Record<string, unknown> | undefined;\n if (mapping.trim()) {\n try {\n const parsed: unknown = JSON.parse(mapping);\n if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) throw new Error('Expected a JSON object');\n dataMapping = Object.fromEntries(Object.entries(parsed));\n } catch {\n setFailure(t('bigconsole.workflows.links.mappingError', 'Data mapping must be a JSON object.'));\n return;\n }\n }\n setSaving(true);\n setFailure(null);\n try {\n const result = await linkDataSink(workflowId, { dataSinkKey: key, priority, dataMapping });\n if (!result) {\n setFailure(t('bigconsole.workflows.links.saveError', 'The data sink could not be linked. Try again.'));\n return;\n }\n await onLinked();\n } finally {\n setSaving(false);\n }\n };\n const field = `w-full min-w-0 rounded-input border border-[var(--color-border-subtle)] bg-bg-canvas px-3 py-2 text-sm text-text-primary ${SECTION_FOCUS_RING}`;\n return (\n <form\n onSubmit={submit}\n className=\"mb-form-gap flex min-w-0 flex-col gap-form-gap rounded-card border border-[var(--color-border-subtle)] bg-bg-sunken p-3\"\n >\n <label className=\"block text-sm font-medium text-text-primary\">\n {t('bigconsole.workflows.links.sinkLabel', 'Data sink')}\n <select\n value={key}\n onChange={(event) => setKey(event.target.value)}\n disabled={loading || saving}\n required\n className={field}\n >\n <option value=\"\">{t('bigconsole.workflows.links.selectSink', 'Select a data sink')}</option>\n {available.map((sink) => (\n <option key={sink.id} value={sink.key}>\n {sink.name || sink.key}\n </option>\n ))}\n </select>\n </label>\n <label className=\"block text-sm font-medium text-text-primary\">\n {t('bigconsole.workflows.links.priorityLabel', 'Priority')}\n <input\n type=\"number\"\n min={0}\n step={1}\n value={priority}\n onChange={(event) => setPriority(Number(event.target.value))}\n disabled={saving}\n className={field}\n />\n </label>\n <label className=\"block text-sm font-medium text-text-primary\">\n {t('bigconsole.workflows.links.mappingLabel', 'Data mapping (optional JSON)')}\n <textarea\n value={mapping}\n onChange={(event) => setMapping(event.target.value)}\n disabled={saving}\n rows={3}\n className={`${field} resize-y font-mono`}\n />\n </label>\n {!loading && !error && available.length === 0 && (\n <p className=\"text-sm text-text-secondary\">\n {t(\n 'bigconsole.workflows.links.noAvailable',\n 'No unlinked active data sinks are available in this workspace.'\n )}\n </p>\n )}\n {(error || failure) && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {failure ||\n t(\n 'bigconsole.workflows.links.loadError',\n 'Data sinks could not be loaded. Close and reopen the form to retry.'\n )}\n </p>\n )}\n <Button type=\"submit\" disabled={!key || saving || loading} className=\"w-full sm:w-auto\">\n {saving\n ? t('bigconsole.workflows.links.saving', 'Linking…')\n : t('bigconsole.workflows.links.link', 'Link sink')}\n </Button>\n </form>\n );\n}\n"],"mappings":";;;;;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EAAO,EAAM,OAAO,MAAM;KAC/C,UAAU,KAAW;KACrB,UAAA;KACA,WAAW;eALb,CAOE,kBAAC,UAAD;MAAQ,OAAM;gBAAI,EAAE,yCAAyC,qBAAqB;MAAU,CAAA,EAC3F,EAAU,KAAK,MACd,kBAAC,UAAD;MAAsB,OAAO,EAAK;gBAC/B,EAAK,QAAQ,EAAK;MACZ,EAFI,EAAK,GAET,CACT,CACK;OACH;;GACR,kBAAC,SAAD;IAAO,WAAU;cAAjB,CACG,EAAE,4CAA4C,WAAW,EAC1D,kBAAC,SAAD;KACE,MAAK;KACL,KAAK;KACL,MAAM;KACN,OAAO;KACP,WAAW,MAAU,EAAY,OAAO,EAAM,OAAO,MAAM,CAAC;KAC5D,UAAU;KACV,WAAW;KACX,CAAA,CACI;;GACR,kBAAC,SAAD;IAAO,WAAU;cAAjB,CACG,EAAE,2CAA2C,+BAA+B,EAC7E,kBAAC,YAAD;KACE,OAAO;KACP,WAAW,MAAU,EAAW,EAAM,OAAO,MAAM;KACnD,UAAU;KACV,MAAM;KACN,WAAW,GAAG,EAAM;KACpB,CAAA,CACI;;GACP,CAAC,KAAW,CAAC,KAAS,EAAU,WAAW,KAC1C,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,0CACA,iEACD;IACC,CAAA;IAEJ,KAAS,MACT,kBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;cACvB,KACC,EACE,wCACA,sEACD;IACD,CAAA;GAEN,kBAAC,GAAD;IAAQ,MAAK;IAAS,UAAU,CAAC,KAAO,KAAU;IAAS,WAAU;cAClE,IACG,EAAE,qCAAqC,WAAW,GAClD,EAAE,mCAAmC,YAAY;IAC9C,CAAA;GACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface BigConsoleSettings {
|
|
2
|
+
defaultRefreshInterval: number;
|
|
3
|
+
defaultGridColumns: number;
|
|
4
|
+
defaultWidgetHeight: number;
|
|
5
|
+
cacheEnabled: boolean;
|
|
6
|
+
cacheTTLSeconds: number;
|
|
7
|
+
showWidgetBorders: boolean;
|
|
8
|
+
compactMode: boolean;
|
|
9
|
+
animationsEnabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_SETTINGS: BigConsoleSettings;
|
|
12
|
+
export declare function loadBigConsoleSettings(): BigConsoleSettings;
|
|
13
|
+
/** Returns false when browser storage is unavailable; never reports a failed write as saved. */
|
|
14
|
+
export declare function saveBigConsoleSettings(settings: BigConsoleSettings): boolean;
|
|
15
|
+
export declare function useBigConsoleSettings(): BigConsoleSettings;
|
|
16
|
+
//# sourceMappingURL=useBigConsoleSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBigConsoleSettings.d.ts","sourceRoot":"","sources":["../../../src/bigconsole/hooks/useBigConsoleSettings.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,gBAAgB,EAAE,kBAS9B,CAAC;AA4BF,wBAAgB,sBAAsB,IAAI,kBAAkB,CAO3D;AAED,gGAAgG;AAChG,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAQ5E;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,CAgB1D"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/bigconsole/hooks/useBigConsoleSettings.ts
|
|
3
|
+
var n = {
|
|
4
|
+
defaultRefreshInterval: 0,
|
|
5
|
+
defaultGridColumns: 12,
|
|
6
|
+
defaultWidgetHeight: 4,
|
|
7
|
+
cacheEnabled: !0,
|
|
8
|
+
cacheTTLSeconds: 300,
|
|
9
|
+
showWidgetBorders: !0,
|
|
10
|
+
compactMode: !1,
|
|
11
|
+
animationsEnabled: !0
|
|
12
|
+
}, r = "bigconsole-settings", i = "bigconsole-settings-changed";
|
|
13
|
+
function a(e) {
|
|
14
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return { ...n };
|
|
15
|
+
let t = Object.fromEntries(Object.entries(e)), r = { ...n }, i = (e, n, i) => {
|
|
16
|
+
let a = t[e];
|
|
17
|
+
typeof a == "number" && Number.isInteger(a) && a >= n && a <= i && (r[e] = a);
|
|
18
|
+
};
|
|
19
|
+
i("defaultRefreshInterval", 0, 86400), i("defaultGridColumns", 4, 24), i("defaultWidgetHeight", 1, 12), i("cacheTTLSeconds", 0, 86400);
|
|
20
|
+
for (let e of [
|
|
21
|
+
"cacheEnabled",
|
|
22
|
+
"showWidgetBorders",
|
|
23
|
+
"compactMode",
|
|
24
|
+
"animationsEnabled"
|
|
25
|
+
]) typeof t[e] == "boolean" && (r[e] = t[e]);
|
|
26
|
+
return r;
|
|
27
|
+
}
|
|
28
|
+
function o() {
|
|
29
|
+
try {
|
|
30
|
+
let e = window.localStorage.getItem(r);
|
|
31
|
+
return e ? a(JSON.parse(e)) : { ...n };
|
|
32
|
+
} catch {
|
|
33
|
+
return { ...n };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function s(e) {
|
|
37
|
+
try {
|
|
38
|
+
return window.localStorage.setItem(r, JSON.stringify(a(e))), window.dispatchEvent(new Event(i)), !0;
|
|
39
|
+
} catch {
|
|
40
|
+
return !1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function c() {
|
|
44
|
+
let [n, a] = t(o);
|
|
45
|
+
return e(() => {
|
|
46
|
+
let e = () => a(o()), t = (t) => {
|
|
47
|
+
(t.key === r || t.key === null) && e();
|
|
48
|
+
};
|
|
49
|
+
return window.addEventListener(i, e), window.addEventListener("storage", t), e(), () => {
|
|
50
|
+
window.removeEventListener(i, e), window.removeEventListener("storage", t);
|
|
51
|
+
};
|
|
52
|
+
}, []), n;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { n as DEFAULT_SETTINGS, o as loadBigConsoleSettings, s as saveBigConsoleSettings, c as useBigConsoleSettings };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=useBigConsoleSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBigConsoleSettings.js","names":[],"sources":["../../../src/bigconsole/hooks/useBigConsoleSettings.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport interface BigConsoleSettings {\n defaultRefreshInterval: number;\n defaultGridColumns: number;\n defaultWidgetHeight: number;\n cacheEnabled: boolean;\n cacheTTLSeconds: number;\n showWidgetBorders: boolean;\n compactMode: boolean;\n animationsEnabled: boolean;\n}\n\nexport const DEFAULT_SETTINGS: BigConsoleSettings = {\n defaultRefreshInterval: 0,\n defaultGridColumns: 12,\n defaultWidgetHeight: 4,\n cacheEnabled: true,\n cacheTTLSeconds: 300,\n showWidgetBorders: true,\n compactMode: false,\n animationsEnabled: true,\n};\n\nconst STORAGE_KEY = 'bigconsole-settings';\nconst CHANGE_EVENT = 'bigconsole-settings-changed';\n\nfunction validatedSettings(value: unknown): BigConsoleSettings {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return { ...DEFAULT_SETTINGS };\n const input: Record<string, unknown> = Object.fromEntries(Object.entries(value));\n const result = { ...DEFAULT_SETTINGS };\n const numberSetting = (\n key: 'defaultRefreshInterval' | 'defaultGridColumns' | 'defaultWidgetHeight' | 'cacheTTLSeconds',\n min: number,\n max: number\n ) => {\n const candidate = input[key];\n if (typeof candidate === 'number' && Number.isInteger(candidate) && candidate >= min && candidate <= max)\n result[key] = candidate;\n };\n numberSetting('defaultRefreshInterval', 0, 86400);\n numberSetting('defaultGridColumns', 4, 24);\n numberSetting('defaultWidgetHeight', 1, 12);\n numberSetting('cacheTTLSeconds', 0, 86400);\n for (const key of ['cacheEnabled', 'showWidgetBorders', 'compactMode', 'animationsEnabled'] as const) {\n if (typeof input[key] === 'boolean') result[key] = input[key];\n }\n return result;\n}\n\nexport function loadBigConsoleSettings(): BigConsoleSettings {\n try {\n const stored = window.localStorage.getItem(STORAGE_KEY);\n return stored ? validatedSettings(JSON.parse(stored)) : { ...DEFAULT_SETTINGS };\n } catch {\n return { ...DEFAULT_SETTINGS };\n }\n}\n\n/** Returns false when browser storage is unavailable; never reports a failed write as saved. */\nexport function saveBigConsoleSettings(settings: BigConsoleSettings): boolean {\n try {\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(validatedSettings(settings)));\n window.dispatchEvent(new Event(CHANGE_EVENT));\n return true;\n } catch {\n return false;\n }\n}\n\nexport function useBigConsoleSettings(): BigConsoleSettings {\n const [settings, setSettings] = useState(loadBigConsoleSettings);\n useEffect(() => {\n const sync = () => setSettings(loadBigConsoleSettings());\n const onStorage = (event: StorageEvent) => {\n if (event.key === STORAGE_KEY || event.key === null) sync();\n };\n window.addEventListener(CHANGE_EVENT, sync);\n window.addEventListener('storage', onStorage);\n sync();\n return () => {\n window.removeEventListener(CHANGE_EVENT, sync);\n window.removeEventListener('storage', onStorage);\n };\n }, []);\n return settings;\n}\n"],"mappings":";;AAaA,IAAa,IAAuC;CAClD,wBAAwB;CACxB,oBAAoB;CACpB,qBAAqB;CACrB,cAAc;CACd,iBAAiB;CACjB,mBAAmB;CACnB,aAAa;CACb,mBAAmB;CACpB,EAEK,IAAc,uBACd,IAAe;AAErB,SAAS,EAAkB,GAAoC;AAC7D,KAAI,OAAO,KAAU,aAAY,KAAkB,MAAM,QAAQ,EAAM,CAAE,QAAO,EAAE,GAAG,GAAkB;CACvG,IAAM,IAAiC,OAAO,YAAY,OAAO,QAAQ,EAAM,CAAC,EAC1E,IAAS,EAAE,GAAG,GAAkB,EAChC,KACJ,GACA,GACA,MACG;EACH,I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DashboardOperations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAyB,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useDashboardOperations.d.ts","sourceRoot":"","sources":["../../../src/bigconsole/hooks/useDashboardOperations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAyB,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAiBtF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,UAA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
|
3
3
|
import { CloneDashboardDocument as t, CreateDashboardDocument as n, DeleteDashboardDocument as r, GetDashboardDocument as i, ListDashboardsDocument as a, UpdateDashboardDocument as o } from "../../generated/wspace-operations.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { useBigConsole as s } from "../context/BigConsoleContext.js";
|
|
5
|
+
import "../context/index.js";
|
|
6
|
+
import { createBigConsoleQuotaError as c, isBigConsoleQuotaError as l } from "../utils/quota.js";
|
|
7
|
+
import { useCallback as u, useEffect as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
|
|
8
|
+
import { useApolloClient as h } from "@apollo/client/react";
|
|
7
9
|
//#region src/bigconsole/hooks/useDashboardOperations.ts
|
|
8
|
-
function
|
|
10
|
+
function g(e) {
|
|
9
11
|
let t = e?.toUpperCase();
|
|
10
12
|
return t === "PRIVATE" || t === "WORKSPACE" || t === "PUBLIC" ? t : void 0;
|
|
11
13
|
}
|
|
12
|
-
function
|
|
14
|
+
function _(e) {
|
|
13
15
|
let t = e.pages?.edges?.map((t) => ({
|
|
14
16
|
id: t.node.id,
|
|
15
17
|
dashboardId: t.node.dashboardId || e.id,
|
|
@@ -30,7 +32,7 @@ function m(e) {
|
|
|
30
32
|
slug: e.name?.toLowerCase().replace(/\s+/g, "-") || "",
|
|
31
33
|
isPublished: e.isPublic || !1,
|
|
32
34
|
isTemplate: e.isTemplate || !1,
|
|
33
|
-
visibility:
|
|
35
|
+
visibility: g(e.visibility),
|
|
34
36
|
layoutConfig: e.layout || {
|
|
35
37
|
columns: 12,
|
|
36
38
|
rowHeight: 100,
|
|
@@ -45,18 +47,18 @@ function m(e) {
|
|
|
45
47
|
updatedAt: e.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
46
48
|
};
|
|
47
49
|
}
|
|
48
|
-
function
|
|
50
|
+
function v(e) {
|
|
49
51
|
let t = e?.toUpperCase();
|
|
50
52
|
return t === "DRAFT" || t === "PUBLISHED" || t === "ARCHIVED" ? t : void 0;
|
|
51
53
|
}
|
|
52
|
-
function
|
|
54
|
+
function y(e) {
|
|
53
55
|
return {
|
|
54
56
|
id: e.id,
|
|
55
57
|
name: e.name || "Untitled Dashboard",
|
|
56
58
|
description: e.description,
|
|
57
59
|
category: e.category,
|
|
58
60
|
isPublic: e.isPublic,
|
|
59
|
-
status:
|
|
61
|
+
status: v(e.status),
|
|
60
62
|
viewCount: e.viewCount,
|
|
61
63
|
widgetCount: e.widgetCount,
|
|
62
64
|
createdAt: e.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -64,45 +66,66 @@ function g(e) {
|
|
|
64
66
|
pageCount: e.pages?.totalCount ?? 0
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
function
|
|
68
|
-
let [
|
|
69
|
+
function b({ skipFetch: g = !1 } = {}) {
|
|
70
|
+
let [v, b] = m(!1), [x, S] = m(null), [C, w] = m([]), { workspaceId: T, currentUser: E } = s(), D = `${T ?? ""}:${E?.id ?? ""}`, O = p(D), k = p(0), [A, j] = m(D);
|
|
71
|
+
f(() => (O.current = D, () => {
|
|
72
|
+
O.current = "", k.current += 1;
|
|
73
|
+
}), [D]);
|
|
74
|
+
let M = h(), N = e((e) => e.currentDashboard), P = e((e) => e.setCurrentDashboard), F = u(async (e) => {
|
|
75
|
+
let t = ++k.current, n = () => O.current === D && k.current === t;
|
|
69
76
|
try {
|
|
70
|
-
|
|
77
|
+
b(!0), S(null);
|
|
78
|
+
let t = await M.query({
|
|
71
79
|
query: a,
|
|
72
80
|
variables: {
|
|
73
81
|
first: 50,
|
|
74
82
|
search: e,
|
|
75
83
|
includeArchived: !1
|
|
76
84
|
},
|
|
77
|
-
fetchPolicy: "
|
|
78
|
-
|
|
85
|
+
fetchPolicy: "no-cache",
|
|
86
|
+
errorPolicy: "none",
|
|
87
|
+
context: {
|
|
88
|
+
requiredWorkspaceAuth: !0,
|
|
89
|
+
requiredWorkspaceId: T,
|
|
90
|
+
queryDeduplication: !1
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
if (!n()) return;
|
|
94
|
+
let r = t.data?.listDashboards?.edges || [];
|
|
95
|
+
if (T && r.some((e) => e.node.workspaceId !== T)) throw Error("The active workspace changed. Please try again.");
|
|
96
|
+
w(r.map((e) => y(e.node))), j(D);
|
|
79
97
|
} catch (e) {
|
|
80
|
-
|
|
98
|
+
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch dashboards");
|
|
99
|
+
n() && S(t);
|
|
81
100
|
} finally {
|
|
82
|
-
|
|
101
|
+
n() && b(!1);
|
|
83
102
|
}
|
|
84
|
-
}, [
|
|
103
|
+
}, [
|
|
104
|
+
M,
|
|
105
|
+
D,
|
|
106
|
+
T
|
|
107
|
+
]), I = u(async (e, t) => {
|
|
85
108
|
let n = t?.silent ?? !1;
|
|
86
109
|
try {
|
|
87
|
-
n || (
|
|
88
|
-
let t = await
|
|
110
|
+
n || (b(!0), S(null));
|
|
111
|
+
let t = await M.query({
|
|
89
112
|
query: i,
|
|
90
113
|
variables: { id: e },
|
|
91
114
|
fetchPolicy: "network-only"
|
|
92
115
|
});
|
|
93
116
|
if (t.data?.getDashboard) {
|
|
94
|
-
let e =
|
|
95
|
-
return
|
|
117
|
+
let e = _(t.data.getDashboard);
|
|
118
|
+
return P(e), e;
|
|
96
119
|
}
|
|
97
120
|
return null;
|
|
98
121
|
} catch (e) {
|
|
99
|
-
return n ||
|
|
122
|
+
return n || S(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch dashboard")), null;
|
|
100
123
|
} finally {
|
|
101
|
-
n ||
|
|
124
|
+
n || b(!1);
|
|
102
125
|
}
|
|
103
|
-
}, [
|
|
126
|
+
}, [M, P]), L = u(async (e) => {
|
|
104
127
|
try {
|
|
105
|
-
|
|
128
|
+
b(!0), S(null);
|
|
106
129
|
let t = {
|
|
107
130
|
name: e.name,
|
|
108
131
|
description: e.description,
|
|
@@ -111,64 +134,64 @@ function _({ skipFetch: p = !1 } = {}) {
|
|
|
111
134
|
createDefaultPage: !0
|
|
112
135
|
};
|
|
113
136
|
e.tags && e.tags.length > 0 && (t.metadata = { tags: e.tags });
|
|
114
|
-
let r = await
|
|
137
|
+
let r = await M.mutate({
|
|
115
138
|
mutation: n,
|
|
116
139
|
variables: { input: t }
|
|
117
140
|
});
|
|
118
|
-
if (
|
|
141
|
+
if (l(r)) throw c(r);
|
|
119
142
|
if (r.data?.createBigConsoleDashboard) {
|
|
120
|
-
let e =
|
|
121
|
-
return await
|
|
143
|
+
let e = _(r.data.createBigConsoleDashboard);
|
|
144
|
+
return await F(), e;
|
|
122
145
|
}
|
|
123
146
|
return null;
|
|
124
147
|
} catch (e) {
|
|
125
|
-
if (
|
|
126
|
-
return
|
|
148
|
+
if (l(e)) throw e;
|
|
149
|
+
return S(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create dashboard")), null;
|
|
127
150
|
} finally {
|
|
128
|
-
|
|
151
|
+
b(!1);
|
|
129
152
|
}
|
|
130
|
-
}, [
|
|
153
|
+
}, [M, F]), R = u(async (e) => {
|
|
131
154
|
try {
|
|
132
|
-
|
|
133
|
-
let t = await
|
|
155
|
+
b(!0), S(null);
|
|
156
|
+
let t = await M.mutate({
|
|
134
157
|
mutation: o,
|
|
135
158
|
variables: { input: e }
|
|
136
159
|
});
|
|
137
160
|
if (t.data?.updateBigConsoleDashboard) {
|
|
138
|
-
let n =
|
|
139
|
-
return
|
|
161
|
+
let n = _(t.data.updateBigConsoleDashboard);
|
|
162
|
+
return N?.id === e.id && P(n), await F(), n;
|
|
140
163
|
}
|
|
141
164
|
return null;
|
|
142
165
|
} catch (e) {
|
|
143
|
-
return
|
|
166
|
+
return S(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to update dashboard")), null;
|
|
144
167
|
} finally {
|
|
145
|
-
|
|
168
|
+
b(!1);
|
|
146
169
|
}
|
|
147
170
|
}, [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
]),
|
|
171
|
+
M,
|
|
172
|
+
N?.id,
|
|
173
|
+
P,
|
|
174
|
+
F
|
|
175
|
+
]), z = u(async (e) => {
|
|
153
176
|
try {
|
|
154
|
-
return
|
|
177
|
+
return b(!0), S(null), (await M.mutate({
|
|
155
178
|
mutation: r,
|
|
156
179
|
variables: { id: e }
|
|
157
|
-
})).data?.deleteBigConsoleDashboard ? (
|
|
180
|
+
})).data?.deleteBigConsoleDashboard ? (N?.id === e && P(null), await F(), !0) : !1;
|
|
158
181
|
} catch (e) {
|
|
159
|
-
return
|
|
182
|
+
return S(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete dashboard")), !1;
|
|
160
183
|
} finally {
|
|
161
|
-
|
|
184
|
+
b(!1);
|
|
162
185
|
}
|
|
163
186
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
]),
|
|
187
|
+
M,
|
|
188
|
+
N?.id,
|
|
189
|
+
P,
|
|
190
|
+
F
|
|
191
|
+
]), B = u(async (e, n) => {
|
|
169
192
|
try {
|
|
170
|
-
|
|
171
|
-
let r = await
|
|
193
|
+
b(!0), S(null);
|
|
194
|
+
let r = await M.mutate({
|
|
172
195
|
mutation: t,
|
|
173
196
|
variables: { input: {
|
|
174
197
|
sourceDashboardId: e,
|
|
@@ -176,38 +199,38 @@ function _({ skipFetch: p = !1 } = {}) {
|
|
|
176
199
|
includeWidgets: !0
|
|
177
200
|
} }
|
|
178
201
|
});
|
|
179
|
-
if (
|
|
202
|
+
if (l(r)) throw c(r);
|
|
180
203
|
if (r.data?.cloneDashboard) {
|
|
181
|
-
let e =
|
|
182
|
-
return await
|
|
204
|
+
let e = _(r.data.cloneDashboard);
|
|
205
|
+
return await F(), e;
|
|
183
206
|
}
|
|
184
207
|
return null;
|
|
185
208
|
} catch (e) {
|
|
186
|
-
if (
|
|
187
|
-
return
|
|
209
|
+
if (l(e)) throw e;
|
|
210
|
+
return S(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to clone dashboard")), null;
|
|
188
211
|
} finally {
|
|
189
|
-
|
|
212
|
+
b(!1);
|
|
190
213
|
}
|
|
191
|
-
}, [
|
|
192
|
-
await
|
|
193
|
-
}, [
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
}, [
|
|
197
|
-
loading:
|
|
198
|
-
error:
|
|
199
|
-
dashboards:
|
|
200
|
-
currentDashboard:
|
|
201
|
-
fetchDashboards:
|
|
202
|
-
fetchDashboard:
|
|
203
|
-
createDashboard:
|
|
204
|
-
updateDashboard:
|
|
205
|
-
deleteDashboard:
|
|
206
|
-
cloneDashboard:
|
|
207
|
-
refetch:
|
|
214
|
+
}, [M, F]), V = u(async () => {
|
|
215
|
+
await F();
|
|
216
|
+
}, [F]);
|
|
217
|
+
return d(() => {
|
|
218
|
+
g || F();
|
|
219
|
+
}, [F, g]), {
|
|
220
|
+
loading: v,
|
|
221
|
+
error: x,
|
|
222
|
+
dashboards: A === D ? C : [],
|
|
223
|
+
currentDashboard: N,
|
|
224
|
+
fetchDashboards: F,
|
|
225
|
+
fetchDashboard: I,
|
|
226
|
+
createDashboard: L,
|
|
227
|
+
updateDashboard: R,
|
|
228
|
+
deleteDashboard: z,
|
|
229
|
+
cloneDashboard: B,
|
|
230
|
+
refetch: V
|
|
208
231
|
};
|
|
209
232
|
}
|
|
210
233
|
//#endregion
|
|
211
|
-
export {
|
|
234
|
+
export { b as default };
|
|
212
235
|
|
|
213
236
|
//# sourceMappingURL=useDashboardOperations.js.map
|