refactor: Use NodeConnectionType consistently across the code base (no-changelog) (#10595)

This commit is contained in:
Ricardo Espinoza
2024-08-29 09:55:53 -04:00
committed by GitHub
parent 1491cbd228
commit c4eb3746d7
521 changed files with 2259 additions and 1999 deletions

View File

@@ -74,7 +74,6 @@ import type {
ITelemetryTrackProperties,
IWorkflowBase,
Workflow,
ConnectionTypes,
INodeOutputConfiguration,
IRun,
} from 'n8n-workflow';
@@ -2289,7 +2288,7 @@ export default defineComponent({
}
}
let outputs: Array<ConnectionTypes | INodeOutputConfiguration> = [];
let outputs: Array<NodeConnectionType | INodeOutputConfiguration> = [];
try {
// It fails when the outputs are an expression. As those nodes have
// normally no outputs by default and the only reason we need the
@@ -2424,7 +2423,7 @@ export default defineComponent({
sourceNodeOutputIndex: number,
targetNodeName: string,
targetNodeOuputIndex: number,
type: ConnectionTypes,
type: NodeConnectionType,
): IConnection | undefined {
const nodeConnections =
this.workflowsStore.outgoingConnectionsByNodeName(sourceNodeName)[type];
@@ -2531,7 +2530,7 @@ export default defineComponent({
lastSelectedEndpoint.scope as NodeConnectionType,
)
) {
const connectionType = lastSelectedEndpoint.scope as ConnectionTypes;
const connectionType = lastSelectedEndpoint.scope as NodeConnectionType;
const newNodeElement = this.instance.getManagedElement(newNodeData.id);
const newNodeConnections = this.instance.getEndpoints(newNodeElement);
const viableConnection = newNodeConnections.find((conn) => {
@@ -2712,7 +2711,7 @@ export default defineComponent({
if (targetNodeType?.inputs?.length) {
const workflow = this.workflowHelpers.getCurrentWorkflow();
const workflowNode = workflow.getNode(targetNode.name);
let inputs: Array<ConnectionTypes | INodeInputConfiguration> = [];
let inputs: Array<NodeConnectionType | INodeInputConfiguration> = [];
if (targetNodeType && workflowNode) {
inputs = NodeHelpers.getNodeInputs(workflow, workflowNode, targetNodeType);
}
@@ -3106,7 +3105,7 @@ export default defineComponent({
NodeViewUtils.hideConnectionActions(connection);
NodeViewUtils.resetConnection(connection);
const scope = connection.scope as ConnectionTypes;
const scope = connection.scope as NodeConnectionType;
const scopedEndpoints = Array.from(
document.querySelectorAll(`[data-jtk-scope-${scope}=true]`),
);
@@ -3609,8 +3608,8 @@ export default defineComponent({
const workflow = this.workflowHelpers.getCurrentWorkflow();
const workflowNode = workflow.getNode(node.name);
let inputs: Array<ConnectionTypes | INodeInputConfiguration> = [];
let outputs: Array<ConnectionTypes | INodeOutputConfiguration> = [];
let inputs: Array<NodeConnectionType | INodeInputConfiguration> = [];
let outputs: Array<NodeConnectionType | INodeOutputConfiguration> = [];
if (nodeType && workflowNode) {
inputs = NodeHelpers.getNodeInputs(workflow, workflowNode, nodeType);
outputs = NodeHelpers.getNodeOutputs(workflow, workflowNode, nodeType);