Assemblies: Point-and-click Clone (#6478)
* WIP: Assemblies: Point-and-click Clone Fixes #6209 * Make assemblies commands available for release Fixes #6497 * Break insert out of the group, new icon, add Clone disabled * Add rotate thanks to @franknoirot * Update relevant snapshots * Fix pathToNode * Add clone to stdlibmap * Cleaned more things * Add custom icon * Add variable name for clone * Add e2e test for import and translated import * Remove stale comment * Add test for selection based extrude clone * First batch of suggestions from @lee-at-zoo-corp, tysm! * Clean up test names * Second batch of @lee-at-zoo-corp's suggestion for modelingMachine error handling
This commit is contained in:
@ -376,6 +376,22 @@ const OperationItem = (props: {
|
||||
}
|
||||
}
|
||||
|
||||
function enterCloneFlow() {
|
||||
if (
|
||||
props.item.type === 'StdLibCall' ||
|
||||
props.item.type === 'KclStdLibCall' ||
|
||||
props.item.type === 'GroupBegin'
|
||||
) {
|
||||
props.send({
|
||||
type: 'enterCloneFlow',
|
||||
data: {
|
||||
targetSourceRange: sourceRangeFromRust(props.item.sourceRange),
|
||||
currentOperation: props.item,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function deleteOperation() {
|
||||
if (
|
||||
props.item.type === 'StdLibCall' ||
|
||||
@ -479,6 +495,16 @@ const OperationItem = (props: {
|
||||
>
|
||||
Set rotate
|
||||
</ContextMenuItem>,
|
||||
<ContextMenuItem
|
||||
onClick={enterCloneFlow}
|
||||
data-testid="context-menu-clone"
|
||||
disabled={
|
||||
props.item.type !== 'GroupBegin' &&
|
||||
!stdLibMap[props.item.name]?.supportsTransform
|
||||
}
|
||||
>
|
||||
Clone
|
||||
</ContextMenuItem>,
|
||||
<ContextMenuItem
|
||||
onClick={deleteOperation}
|
||||
hotkey="Delete"
|
||||
|
Reference in New Issue
Block a user