mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Allow jumping into sub-workflow with shortkey (#15200)
This commit is contained in:
@@ -59,7 +59,7 @@ const emit = defineEmits<{
|
||||
'update:modelValue': [elements: CanvasNode[]];
|
||||
'update:node:position': [id: string, position: XYPosition];
|
||||
'update:nodes:position': [events: CanvasNodeMoveEvent[]];
|
||||
'update:node:activated': [id: string];
|
||||
'update:node:activated': [id: string, event?: MouseEvent];
|
||||
'update:node:deactivated': [id: string];
|
||||
'update:node:enabled': [id: string];
|
||||
'update:node:selected': [id?: string];
|
||||
@@ -95,6 +95,7 @@ const emit = defineEmits<{
|
||||
'create:workflow': [];
|
||||
'drag-and-drop': [position: XYPosition, event: DragEvent];
|
||||
'tidy-up': [CanvasLayoutEvent];
|
||||
'open:sub-workflow': [nodeId: string];
|
||||
}>();
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -266,6 +267,7 @@ function selectUpstreamNodes(id: string) {
|
||||
|
||||
const keyMap = computed(() => {
|
||||
const readOnlyKeymap = {
|
||||
ctrl_shift_o: emitWithLastSelectedNode((id) => emit('open:sub-workflow', id)),
|
||||
ctrl_c: emitWithSelectedNodes((ids) => emit('copy:nodes', ids)),
|
||||
enter: emitWithLastSelectedNode((id) => onSetNodeActivated(id)),
|
||||
ctrl_a: () => addSelectedNodes(graphNodes.value),
|
||||
@@ -368,9 +370,9 @@ function onSelectionEnd() {
|
||||
}
|
||||
}
|
||||
|
||||
function onSetNodeActivated(id: string) {
|
||||
function onSetNodeActivated(id: string, event?: MouseEvent) {
|
||||
props.eventBus.emit('nodes:action', { ids: [id], action: 'update:node:activated' });
|
||||
emit('update:node:activated', id);
|
||||
emit('update:node:activated', id, event);
|
||||
}
|
||||
|
||||
function onSetNodeDeactivated(id: string) {
|
||||
@@ -661,6 +663,9 @@ async function onContextMenuAction(action: ContextMenuAction, nodeIds: string[])
|
||||
return props.eventBus.emit('nodes:action', { ids: nodeIds, action: 'update:sticky:color' });
|
||||
case 'tidy_up':
|
||||
return await onTidyUp({ source: 'context-menu' });
|
||||
case 'open_sub_workflow': {
|
||||
return emit('open:sub-workflow', nodeIds[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user