mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Allow jumping into sub-workflow with shortkey (#15200)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import get from 'lodash/get';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
|
||||
import { EXECUTE_WORKFLOW_NODE_TYPE } from './Constants';
|
||||
import { ApplicationError } from './errors/application.error';
|
||||
import { NodeConnectionTypes } from './Interfaces';
|
||||
import type {
|
||||
@@ -39,6 +40,7 @@ import type {
|
||||
import { validateFilterParameter } from './NodeParameters/FilterParameter';
|
||||
import {
|
||||
isFilterValue,
|
||||
isResourceLocatorValue,
|
||||
isResourceMapperValue,
|
||||
isValidResourceLocatorParameterValue,
|
||||
} from './type-guards';
|
||||
@@ -1562,3 +1564,17 @@ export function isExecutable(workflow: Workflow, node: INode, nodeTypeData: INod
|
||||
isTriggerNode(nodeTypeData)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to retrieve the ID of a subworkflow from a execute workflow node.
|
||||
*/
|
||||
export function getSubworkflowId(node: INode): string | undefined {
|
||||
if (
|
||||
node &&
|
||||
node.type === EXECUTE_WORKFLOW_NODE_TYPE &&
|
||||
isResourceLocatorValue(node.parameters.workflowId)
|
||||
) {
|
||||
return node.parameters.workflowId.value as string;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -22,25 +22,19 @@ import type {
|
||||
ITaskData,
|
||||
IWorkflowDataProxyAdditionalKeys,
|
||||
IWorkflowDataProxyData,
|
||||
INodeParameterResourceLocator,
|
||||
NodeParameterValueType,
|
||||
WorkflowExecuteMode,
|
||||
ProxyInput,
|
||||
INode,
|
||||
} from './Interfaces';
|
||||
import * as NodeHelpers from './NodeHelpers';
|
||||
import { isResourceLocatorValue } from './type-guards';
|
||||
import { deepCopy, isObjectEmpty } from './utils';
|
||||
import type { Workflow } from './Workflow';
|
||||
import type { EnvProviderState } from './WorkflowDataProxyEnvProvider';
|
||||
import { createEnvProvider, createEnvProviderState } from './WorkflowDataProxyEnvProvider';
|
||||
import { getPinDataIfManualExecution } from './WorkflowDataProxyHelpers';
|
||||
|
||||
export function isResourceLocatorValue(value: unknown): value is INodeParameterResourceLocator {
|
||||
return Boolean(
|
||||
typeof value === 'object' && value && 'mode' in value && 'value' in value && '__rl' in value,
|
||||
);
|
||||
}
|
||||
|
||||
const isScriptingNode = (nodeName: string, workflow: Workflow) => {
|
||||
const node = workflow.getNode(nodeName);
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ export {
|
||||
isINodePropertyCollectionList,
|
||||
isINodePropertyOptionsList,
|
||||
isResourceMapperValue,
|
||||
isResourceLocatorValue,
|
||||
isFilterValue,
|
||||
} from './type-guards';
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@ import type {
|
||||
FilterValue,
|
||||
} from './Interfaces';
|
||||
|
||||
export function isResourceLocatorValue(value: unknown): value is INodeParameterResourceLocator {
|
||||
return Boolean(
|
||||
typeof value === 'object' && value && 'mode' in value && 'value' in value && '__rl' in value,
|
||||
);
|
||||
}
|
||||
|
||||
export const isINodeProperties = (
|
||||
item: INodePropertyOptions | INodeProperties | INodePropertyCollection,
|
||||
): item is INodeProperties => 'name' in item && 'type' in item && !('value' in item);
|
||||
|
||||
Reference in New Issue
Block a user