Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/main/frontend/app/routes/studio/canvas/flow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
showErrorToast(`Failed to save XML: ${error instanceof Error ? error.message : error}`)
setSaveStatus('idle')
}
}, [project])

Check warning on line 186 in src/main/frontend/app/routes/studio/canvas/flow.tsx

View workflow job for this annotation

GitHub Actions / Build & Run All Tests

React Hook useCallback has an unnecessary dependency: 'project'. Either exclude it or remove the dependency array

const autosaveEnabled = useSettingsStore((s) => s.general.autoSave.enabled)
const autosaveDelay = useSettingsStore((s) => s.general.autoSave.delayMs)
Expand Down Expand Up @@ -591,7 +591,7 @@
addNodeAtPosition(position, parsedData.name)
}

const onDragEnd = (event: React.DragEvent) => {

Check warning on line 594 in src/main/frontend/app/routes/studio/canvas/flow.tsx

View workflow job for this annotation

GitHub Actions / Build & Run All Tests

'event' is defined but never used. Allowed unused args must match /^_/u
setDraggedName(null)
setParentId(null)
}
Expand Down Expand Up @@ -689,11 +689,29 @@
}, [copySelection])

const handleUngroup = useCallback(() => {
const selectedNodes = nodes.filter((n) => n.selected)
const flowStore = useFlowStore.getState()
const selectedNodes = flowStore.nodes.filter((n) => n.selected)

if (selectedNodes.length === 0) return
const selectedGroupNodes = selectedNodes.filter((n) => n.type === 'groupNode')

if (selectedGroupNodes.length > 0) {
let updatedNodes = [...flowStore.nodes]
for (const groupNode of selectedGroupNodes) {
const groupId = groupNode.id

const children = updatedNodes.filter((n) => n.parentId === groupId)

updatedNodes = degroupNodes(children, groupId, updatedNodes)
}
flowStore.setNodes(updatedNodes)
return
}

if (!allSelectedInSameGroup(selectedNodes)) return

handleDegroupSingleGroup(selectedNodes)
}, [nodes, allSelectedInSameGroup, handleDegroupSingleGroup])
}, [allSelectedInSameGroup, handleDegroupSingleGroup, degroupNodes])

const handleRightMouseButtonClick = useCallback(
(event: React.MouseEvent) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function GroupNodeComponent({ id, data, selected }: NodeProps<Gro
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
<HamburgerMenu />
</div>

<div className="flex max-w-1/2 gap-1 px-2 py-1 text-sm font-bold">
{isEditing ? (
<input
Expand Down
Loading