Skip to content

Commit

Permalink
fix: disable graph node dragging and connectors (#4180)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Jan 24, 2025
1 parent d484ee9 commit 965232d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/console/src/features/graph/DeclNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const DeclNode = ({ data }: Props) => {

return (
<div className={`rounded-md overflow-hidden ${data.selected ? 'ring-2 ring-pink-400 dark:ring-pink-600' : ''}`}>
<Handle id={`${data.id}-target`} type='target' position={Position.Left} style={{ border: 0, backgroundColor: handleColor }} isConnectable={true} />
<Handle id={`${data.id}-target`} type='target' position={Position.Left} style={{ border: 0, backgroundColor: handleColor }} isConnectable={false} />

<div className='flex' style={{ backgroundColor: data.style?.backgroundColor }}>
<div className='flex items-center text-gray-100 px-3 py-2 gap-2 w-full'>
Expand All @@ -53,7 +53,7 @@ export const DeclNode = ({ data }: Props) => {
</div>
</div>

<Handle id={`${data.id}-source`} type='source' position={Position.Right} style={{ border: 0, backgroundColor: handleColor }} isConnectable={true} />
<Handle id={`${data.id}-source`} type='source' position={Position.Right} style={{ border: 0, backgroundColor: handleColor }} isConnectable={false} />
</div>
)
}
2 changes: 2 additions & 0 deletions frontend/console/src/features/graph/GraphPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ export const GraphPane: React.FC<GraphPaneProps> = ({ onTapped }) => {
minZoom={0.1}
maxZoom={2}
proOptions={{ hideAttribution: true }}
nodesDraggable={false}
nodesConnectable={false}
>
<Background />
<Controls />
Expand Down

0 comments on commit 965232d

Please sign in to comment.