mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-01 02:05:18 -05:00
fix(duplicate): unlock all blocks when duplicating workflow
- Server-side workflow duplication now sets locked: false for all blocks - regenerateWorkflowStateIds also unlocks blocks for templates - Client-side regenerateBlockIds already handled this (for paste/import) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -189,6 +189,7 @@ export async function duplicateWorkflow(
|
||||
parentId: newParentId,
|
||||
extent: newExtent,
|
||||
data: updatedData,
|
||||
locked: false, // Duplicated blocks should always be unlocked
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
}
|
||||
|
||||
@@ -629,7 +629,8 @@ export function regenerateWorkflowStateIds(state: RegenerateStateInput): Regener
|
||||
// Regenerate blocks with updated references
|
||||
Object.entries(state.blocks || {}).forEach(([oldId, block]) => {
|
||||
const newId = blockIdMapping.get(oldId)!
|
||||
const newBlock: BlockState = { ...block, id: newId }
|
||||
// Duplicated blocks are always unlocked so users can edit them
|
||||
const newBlock: BlockState = { ...block, id: newId, locked: false }
|
||||
|
||||
// Update parentId reference if it exists
|
||||
if (newBlock.data?.parentId) {
|
||||
|
||||
Reference in New Issue
Block a user