refactor: Add node IDs (#3788)

* update type

* add id to new nodes

* update paste/import behavior

* update duplicate/copy

* update duplicate workflow

* update import functions + templates

* add instance id on copy

* on download add instance id

* simplify for testing

* update telemetry events

* add ids to nodegraph

* not if same instance

* update spacing

* fix tests

* update tests

* add uuid

* fix tests

update tests

add uuid

fix ts issue

* fix telemetry event

* update workflow import

* update public api

* add sqlit migration

* on workflow update

* add psql migration

* add mysql migration

* revert to title

* fix telemetry bug

* remove console log

* remove migration logs

* fix copy/paste bug

* replace node index with node id

* remove console log

* address PR feedback

* address comment

* fix type issue

* fix select

* update schema

* fix ts issue

* update tel helpers

* fix eslint issues
This commit is contained in:
Mutasem Aldmour
2022-08-03 13:06:53 +02:00
committed by GitHub
parent b5ea666ecf
commit 679a443a0c
40 changed files with 602 additions and 157 deletions

View File

@@ -37,6 +37,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -44,6 +45,7 @@ describe('WorkflowExecute', () => {
position: [100, 300],
},
{
id: 'uuid-2',
parameters: {
values: {
number: [
@@ -96,6 +98,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -103,6 +106,7 @@ describe('WorkflowExecute', () => {
position: [100, 300],
},
{
id: 'uuid-2',
parameters: {
values: {
number: [
@@ -119,6 +123,7 @@ describe('WorkflowExecute', () => {
position: [300, 250],
},
{
id: 'uuid-3',
parameters: {
values: {
number: [
@@ -200,6 +205,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {
mode: 'passThrough',
},
@@ -209,6 +215,7 @@ describe('WorkflowExecute', () => {
position: [1150, 500],
},
{
id: 'uuid-2',
parameters: {
values: {
number: [
@@ -225,6 +232,7 @@ describe('WorkflowExecute', () => {
position: [290, 400],
},
{
id: 'uuid-3',
parameters: {
values: {
number: [
@@ -241,6 +249,7 @@ describe('WorkflowExecute', () => {
position: [850, 200],
},
{
id: 'uuid-4',
parameters: {
values: {
number: [
@@ -257,6 +266,7 @@ describe('WorkflowExecute', () => {
position: [650, 200],
},
{
id: 'uuid-5',
parameters: {
mode: 'passThrough',
},
@@ -266,6 +276,7 @@ describe('WorkflowExecute', () => {
position: [1150, 500],
},
{
id: 'uuid-6',
parameters: {},
name: 'Merge3',
type: 'n8n-nodes-base.merge',
@@ -273,6 +284,7 @@ describe('WorkflowExecute', () => {
position: [1000, 400],
},
{
id: 'uuid-7',
parameters: {
mode: 'passThrough',
output: 'input2',
@@ -283,6 +295,7 @@ describe('WorkflowExecute', () => {
position: [700, 400],
},
{
id: 'uuid-8',
parameters: {},
name: 'Merge1',
type: 'n8n-nodes-base.merge',
@@ -290,6 +303,7 @@ describe('WorkflowExecute', () => {
position: [500, 300],
},
{
id: 'uuid-9',
parameters: {
values: {
number: [
@@ -306,6 +320,7 @@ describe('WorkflowExecute', () => {
position: [300, 200],
},
{
id: 'uuid-10',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -526,6 +541,7 @@ describe('WorkflowExecute', () => {
name: 'Start',
type: 'n8n-nodes-base.start',
typeVersion: 1,
id: 'uuid-1',
position: [250, 450],
},
{
@@ -543,6 +559,7 @@ describe('WorkflowExecute', () => {
name: 'IF',
type: 'n8n-nodes-base.if',
typeVersion: 1,
id: 'uuid-2',
position: [650, 350],
},
{
@@ -550,6 +567,7 @@ describe('WorkflowExecute', () => {
name: 'Merge1',
type: 'n8n-nodes-base.merge',
typeVersion: 1,
id: 'uuid-3',
position: [1150, 450],
},
{
@@ -567,6 +585,7 @@ describe('WorkflowExecute', () => {
name: 'Set1',
type: 'n8n-nodes-base.set',
typeVersion: 1,
id: 'uuid-4',
position: [450, 450],
},
{
@@ -584,6 +603,7 @@ describe('WorkflowExecute', () => {
name: 'Set2',
type: 'n8n-nodes-base.set',
typeVersion: 1,
id: 'uuid-1',
position: [800, 250],
},
],
@@ -672,6 +692,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -679,6 +700,7 @@ describe('WorkflowExecute', () => {
position: [250, 300],
},
{
id: 'uuid-2',
parameters: {},
name: 'Merge',
type: 'n8n-nodes-base.merge',
@@ -686,6 +708,7 @@ describe('WorkflowExecute', () => {
position: [800, 450],
},
{
id: 'uuid-3',
parameters: {},
name: 'Merge1',
type: 'n8n-nodes-base.merge',
@@ -693,6 +716,7 @@ describe('WorkflowExecute', () => {
position: [1000, 300],
},
{
id: 'uuid-4',
parameters: {
conditions: {
boolean: [
@@ -716,6 +740,7 @@ describe('WorkflowExecute', () => {
alwaysOutputData: false,
},
{
id: 'uuid-5',
parameters: {
values: {
number: [
@@ -738,6 +763,7 @@ describe('WorkflowExecute', () => {
position: [450, 300],
},
{
id: 'uuid-6',
parameters: {
values: {
number: [
@@ -761,6 +787,7 @@ describe('WorkflowExecute', () => {
position: [450, 450],
},
{
id: 'uuid-7',
parameters: {
values: {
number: [
@@ -889,6 +916,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -896,6 +924,7 @@ describe('WorkflowExecute', () => {
position: [250, 300],
},
{
id: 'uuid-2',
parameters: {
conditions: {
number: [
@@ -913,6 +942,7 @@ describe('WorkflowExecute', () => {
position: [650, 300],
},
{
id: 'uuid-3',
parameters: {
values: {
string: [],
@@ -931,6 +961,7 @@ describe('WorkflowExecute', () => {
position: [850, 450],
},
{
id: 'uuid-4',
parameters: {
values: {
number: [
@@ -948,6 +979,7 @@ describe('WorkflowExecute', () => {
position: [450, 300],
},
{
id: 'uuid-5',
parameters: {},
name: 'Merge',
type: 'n8n-nodes-base.merge',
@@ -1034,6 +1066,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -1041,6 +1074,7 @@ describe('WorkflowExecute', () => {
position: [250, 300],
},
{
id: 'uuid-2',
parameters: {
values: {
number: [
@@ -1057,6 +1091,7 @@ describe('WorkflowExecute', () => {
position: [450, 300],
},
{
id: 'uuid-3',
parameters: {},
name: 'Merge',
type: 'n8n-nodes-base.merge',
@@ -1064,6 +1099,7 @@ describe('WorkflowExecute', () => {
position: [1050, 250],
},
{
id: 'uuid-4',
parameters: {
conditions: {
number: [
@@ -1081,6 +1117,7 @@ describe('WorkflowExecute', () => {
position: [650, 300],
},
{
id: 'uuid-5',
parameters: {},
name: 'NoOpTrue',
type: 'n8n-nodes-base.noOp',
@@ -1088,6 +1125,7 @@ describe('WorkflowExecute', () => {
position: [850, 150],
},
{
id: 'uuid-6',
parameters: {},
name: 'NoOpFalse',
type: 'n8n-nodes-base.noOp',
@@ -1177,6 +1215,7 @@ describe('WorkflowExecute', () => {
workflowData: {
nodes: [
{
id: 'uuid-1',
parameters: {},
name: 'Start',
type: 'n8n-nodes-base.start',
@@ -1184,6 +1223,7 @@ describe('WorkflowExecute', () => {
position: [240, 300],
},
{
id: 'uuid-2',
parameters: {},
name: 'VersionTest1a',
type: 'n8n-nodes-base.versionTest',
@@ -1191,6 +1231,7 @@ describe('WorkflowExecute', () => {
position: [460, 300],
},
{
id: 'uuid-3',
parameters: {
versionTest: 11,
},
@@ -1200,6 +1241,7 @@ describe('WorkflowExecute', () => {
position: [680, 300],
},
{
id: 'uuid-4',
parameters: {},
name: 'VersionTest2a',
type: 'n8n-nodes-base.versionTest',
@@ -1207,6 +1249,7 @@ describe('WorkflowExecute', () => {
position: [880, 300],
},
{
id: 'uuid-5',
parameters: {
versionTest: 22,
},