File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -225,17 +225,24 @@ export const ActionBar = memo(
225225 variant = 'ghost'
226226 onClick = { ( e ) => {
227227 e . stopPropagation ( )
228- if ( ! disabled ) {
228+ // Can't unlock a block if its parent container is locked
229+ if ( ! disabled && ! ( isLocked && isParentLocked ) ) {
229230 collaborativeBatchToggleLocked ( [ blockId ] )
230231 }
231232 } }
232233 className = { ACTION_BUTTON_STYLES }
233- disabled = { disabled }
234+ disabled = { disabled || ( isLocked && isParentLocked ) }
234235 >
235236 { isLocked ? < Unlock className = { ICON_SIZE } /> : < Lock className = { ICON_SIZE } /> }
236237 </ Button >
237238 </ Tooltip . Trigger >
238- < Tooltip . Content side = 'top' > { isLocked ? 'Unlock Block' : 'Lock Block' } </ Tooltip . Content >
239+ < Tooltip . Content side = 'top' >
240+ { isLocked && isParentLocked
241+ ? 'Parent container is locked'
242+ : isLocked
243+ ? 'Unlock Block'
244+ : 'Lock Block' }
245+ </ Tooltip . Content >
239246 </ Tooltip . Root >
240247 ) }
241248
Original file line number Diff line number Diff line change @@ -368,11 +368,11 @@ export function Editor() {
368368 ) }
369369 </ div >
370370 < div className = 'flex shrink-0 items-center gap-[8px]' >
371- { /* Locked indicator - clickable to unlock if user has admin permissions and block itself is locked */ }
371+ { /* Locked indicator - clickable to unlock if user has admin permissions, block is locked, and parent is not locked */ }
372372 { isLocked && currentBlock && (
373373 < Tooltip . Root >
374374 < Tooltip . Trigger asChild >
375- { userPermissions . canAdmin && currentBlock . locked ? (
375+ { userPermissions . canAdmin && currentBlock . locked && ! isParentLocked ? (
376376 < Button
377377 variant = 'ghost'
378378 className = 'p-0'
@@ -389,10 +389,10 @@ export function Editor() {
389389 </ Tooltip . Trigger >
390390 < Tooltip . Content side = 'top' >
391391 < p >
392- { userPermissions . canAdmin && currentBlock . locked
393- ? 'Unlock block '
394- : isParentLocked
395- ? 'Parent container is locked '
392+ { isParentLocked
393+ ? 'Parent container is locked '
394+ : userPermissions . canAdmin && currentBlock . locked
395+ ? 'Unlock block '
396396 : 'Block is locked' }
397397 </ p >
398398 </ Tooltip . Content >
You can’t perform that action at this time.
0 commit comments