diff --git a/pyproject.toml b/pyproject.toml index 85c30b8..0d38e00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-dev" -version = "0.0.39" +version = "0.0.40" description = "UiPath Developer Console" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath/dev/server/frontend/src/components/graph/GraphPanel.tsx b/src/uipath/dev/server/frontend/src/components/graph/GraphPanel.tsx index 0c4b4cd..ce343b6 100644 --- a/src/uipath/dev/server/frontend/src/components/graph/GraphPanel.tsx +++ b/src/uipath/dev/server/frontend/src/components/graph/GraphPanel.tsx @@ -350,6 +350,7 @@ export default function GraphPanel({ entrypoint, traces, runId, breakpointNode, const [nodes, setNodes, onNodesChange] = useNodesState([]); const [edges, setEdges, onEdgesChange] = useEdgesState([]); const [loading, setLoading] = useState(true); + const [graphUnavailable, setGraphUnavailable] = useState(false); const layoutRef = useRef(0); const rfInstance = useRef(null); @@ -527,9 +528,14 @@ export default function GraphPanel({ entrypoint, traces, runId, breakpointNode, const layoutId = ++layoutRef.current; setLoading(true); + setGraphUnavailable(false); getEntrypointGraph(entrypoint) .then(async (graphData) => { if (layoutRef.current !== layoutId) return; + if (!graphData.nodes.length) { + setGraphUnavailable(true); + return; + } const { nodes: laidNodes, edges: laidEdges } = await runElkLayout(graphData); if (layoutRef.current !== layoutId) return; @@ -549,7 +555,9 @@ export default function GraphPanel({ entrypoint, traces, runId, breakpointNode, rfInstance.current?.fitView({ padding: 0.1, duration: 200 }); }, 100); }) - .catch(console.error) + .catch(() => { + if (layoutRef.current === layoutId) setGraphUnavailable(true); + }) .finally(() => { if (layoutRef.current === layoutId) setLoading(false); }); @@ -604,6 +612,38 @@ export default function GraphPanel({ entrypoint, traces, runId, breakpointNode, ); } + if (graphUnavailable) { + return ( +
+ + {/* Top node */} + + + {/* Middle-left node */} + + {/* Middle-right node */} + + {/* Lines from top to middle nodes */} + + + {/* Lines from middle to bottom */} + + + {/* Converge lines */} + + + + {/* Bottom node */} + + + No graph schema available +
+ ); + } + return (