From fddc69ee2c2324aff783172c959af9e40ad89696 Mon Sep 17 00:00:00 2001 From: Michael Kret <88898367+michael-radency@users.noreply.github.com> Date: Fri, 16 Jun 2023 11:44:37 +0300 Subject: [PATCH 01/17] feat(Gmail Node): Add reply to email (#6453) Co-authored-by: Matthias Stallmann --- .../nodes/Google/Gmail/GenericFunctions.ts | 4 +++- .../nodes/Google/Gmail/v2/DraftDescription.ts | 8 ++++++++ .../nodes/Google/Gmail/v2/GmailV2.node.ts | 18 +++++++++++++++--- .../Google/Gmail/v2/MessageDescription.ts | 13 +++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index 86ffb2eda9..d88d25e2c1 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -24,6 +24,7 @@ export interface IEmail { to?: string; cc?: string; bcc?: string; + replyTo?: string; inReplyTo?: string; reference?: string; subject: string; @@ -222,6 +223,7 @@ export async function encodeEmail(email: IEmail) { to: email.to, cc: email.cc, bcc: email.bcc, + replyTo: email.replyTo, inReplyTo: email.inReplyTo, references: email.reference, subject: email.subject, @@ -509,7 +511,7 @@ export function unescapeSnippets(items: INodeExecutionData[]) { return result; } -export async function replayToEmail( +export async function replyToEmail( this: IExecuteFunctions, items: INodeExecutionData[], gmailId: string, diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts index 25a42d853e..8a87e40d43 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/DraftDescription.ts @@ -143,6 +143,14 @@ export const draftFields: INodeProperties[] = [ placeholder: 'info@example.com', default: '', }, + { + displayName: 'Send Replies To', + name: 'replyTo', + type: 'string', + placeholder: 'reply@example.com', + default: '', + description: 'The email address that the reply message is sent to', + }, { displayName: 'Attachments', name: 'attachmentsUi', diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts index 2d1b0b787a..ca4fcc0b58 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts @@ -21,7 +21,7 @@ import { prepareEmailBody, prepareEmailsInput, prepareQuery, - replayToEmail, + replyToEmail, simplifyOutput, unescapeSnippets, } from '../GenericFunctions'; @@ -282,6 +282,7 @@ export class GmailV2 implements INodeType { const to = prepareEmailsInput.call(this, sendTo, 'To', i); let cc = ''; let bcc = ''; + let replyTo = ''; if (options.ccList) { cc = prepareEmailsInput.call(this, options.ccList as string, 'CC', i); @@ -291,6 +292,10 @@ export class GmailV2 implements INodeType { bcc = prepareEmailsInput.call(this, options.bccList as string, 'BCC', i); } + if (options.replyTo) { + replyTo = prepareEmailsInput.call(this, options.replyTo as string, 'ReplyTo', i); + } + let attachments: IDataObject[] = []; if (options.attachmentsUi) { @@ -323,6 +328,7 @@ export class GmailV2 implements INodeType { to, cc, bcc, + replyTo, subject: this.getNodeParameter('subject', i) as string, ...prepareEmailBody.call(this, i), attachments, @@ -340,7 +346,7 @@ export class GmailV2 implements INodeType { const messageIdGmail = this.getNodeParameter('messageId', i) as string; const options = this.getNodeParameter('options', i); - responseData = await replayToEmail.call(this, items, messageIdGmail, options, i); + responseData = await replyToEmail.call(this, items, messageIdGmail, options, i); } if (operation === 'get') { //https://developers.google.com/gmail/api/v1/reference/users/messages/get @@ -514,6 +520,7 @@ export class GmailV2 implements INodeType { let to = ''; let cc = ''; let bcc = ''; + let replyTo = ''; if (options.sendTo) { to += prepareEmailsInput.call(this, options.sendTo as string, 'To', i); @@ -527,6 +534,10 @@ export class GmailV2 implements INodeType { bcc = prepareEmailsInput.call(this, options.bccList as string, 'BCC', i); } + if (options.replyTo) { + replyTo = prepareEmailsInput.call(this, options.replyTo as string, 'ReplyTo', i); + } + let attachments: IDataObject[] = []; if (options.attachmentsUi) { attachments = await prepareEmailAttachments.call( @@ -547,6 +558,7 @@ export class GmailV2 implements INodeType { to, cc, bcc, + replyTo, subject: this.getNodeParameter('subject', i) as string, ...prepareEmailBody.call(this, i), attachments, @@ -741,7 +753,7 @@ export class GmailV2 implements INodeType { const messageIdGmail = this.getNodeParameter('messageId', i) as string; const options = this.getNodeParameter('options', i); - responseData = await replayToEmail.call(this, items, messageIdGmail, options, i); + responseData = await replyToEmail.call(this, items, messageIdGmail, options, i); } if (operation === 'trash') { //https://developers.google.com/gmail/api/reference/rest/v1/users.threads/trash diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/MessageDescription.ts b/packages/nodes-base/nodes/Google/Gmail/v2/MessageDescription.ts index d824d66ace..d42296cd2b 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/MessageDescription.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/MessageDescription.ts @@ -225,6 +225,19 @@ export const messageFields: INodeProperties[] = [ default: '', description: "The name that will be shown in recipients' inboxes", }, + { + displayName: 'Send Replies To', + name: 'replyTo', + type: 'string', + placeholder: 'reply@example.com', + default: '', + description: 'The email address that the reply message is sent to', + displayOptions: { + hide: { + '/operation': ['reply'], + }, + }, + }, { displayName: 'Reply to Sender Only', name: 'replyToSenderOnly', From ffd13f4541794832792ecf33e24d5dc4960ff005 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 16 Jun 2023 11:06:46 +0200 Subject: [PATCH 02/17] fix(Split In Batches Node): Add "done" context to allow simple reset (#6437) * fix(Split In Batches Nodes): Make "noItemsLeft" work as expected * :zap: Simplified things and just added "done" context --- ...itInBatches.workflow_v2_done_variable.json | 738 ++++++++++++++++++ .../v2/SplitInBatchesV2.node.ts | 3 + 2 files changed, 741 insertions(+) create mode 100644 packages/nodes-base/nodes/SplitInBatches/test/SplitInBatches.workflow_v2_done_variable.json diff --git a/packages/nodes-base/nodes/SplitInBatches/test/SplitInBatches.workflow_v2_done_variable.json b/packages/nodes-base/nodes/SplitInBatches/test/SplitInBatches.workflow_v2_done_variable.json new file mode 100644 index 0000000000..d9d239adc0 --- /dev/null +++ b/packages/nodes-base/nodes/SplitInBatches/test/SplitInBatches.workflow_v2_done_variable.json @@ -0,0 +1,738 @@ +{ + "name": "My workflow 91", + "nodes": [ + { + "parameters": {}, + "id": "75920640-6f1e-41dc-b8c0-bc2f21c823a5", + "name": "When clicking \"Execute Workflow\"", + "type": "n8n-nodes-base.manualTrigger", + "typeVersion": 1, + "position": [740, 1100] + }, + { + "parameters": { + "conditions": { + "boolean": [ + { + "value1": "={{ $node[\"Split In Batches 3_2\"].context[\"noItemsLeft\"] }}", + "value2": true + } + ] + } + }, + "id": "ca59e1fe-83df-4cf8-9cbb-d3ea6a8a7247", + "name": "No Items Left", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [2320, 1560] + }, + { + "parameters": { + "batchSize": 1, + "options": {} + }, + "id": "21991c05-c919-405b-a0d7-e1dafa5a5e74", + "name": "Split In Batches 1", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 2, + "position": [1220, 840] + }, + { + "parameters": { + "batchSize": 1, + "options": { + "reset": "={{ $node[\"Split In Batches 1_2\"].context[\"done\"] }}" + } + }, + "id": "3b3ecf28-b865-4995-a34d-587047b9887a", + "name": "Split In Batches 1_2", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 2, + "position": [1840, 900] + }, + { + "parameters": { + "content": "# V2 with done branch and \"done\" variable", + "height": 221.18781425126934 + }, + "id": "558ca8c2-1d75-44c1-81ee-8614e1bdc36a", + "name": "Sticky Note", + "type": "n8n-nodes-base.stickyNote", + "typeVersion": 1, + "position": [660, 816.8121857487308] + }, + { + "parameters": { + "content": "# V2 with IF", + "height": 113.61217587373169 + }, + "id": "08957c26-00d4-459b-9497-7b0636086575", + "name": "Sticky Note4", + "type": "n8n-nodes-base.stickyNote", + "typeVersion": 1, + "position": [660, 1320] + }, + { + "parameters": { + "conditions": { + "boolean": [ + { + "value1": "={{ $node[\"Split In Batches 2_2\"].context[\"noItemsLeft\"] }}", + "value2": true + } + ] + } + }, + "id": "a38109ba-672e-4bd0-ac66-e243d53d2252", + "name": "No Items Left2", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [2320, 1320] + }, + { + "parameters": { + "content": "# V1 with IF", + "height": 113.61217587373169 + }, + "id": "d5f45e34-21f6-4dc0-bf54-2bbbea561aed", + "name": "Sticky Note8", + "type": "n8n-nodes-base.stickyNote", + "typeVersion": 1, + "position": [660, 1560] + }, + { + "parameters": { + "conditions": { + "boolean": [ + { + "value1": "={{ $node[\"Split In Batches 3\"].context[\"noItemsLeft\"] }}", + "value2": true + } + ] + } + }, + "id": "1787b55b-4e33-4034-8043-33d21e78cd30", + "name": "IF", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [2540, 1540] + }, + { + "parameters": { + "conditions": { + "boolean": [ + { + "value1": "={{ $node[\"Split In Batches 2\"].context[\"noItemsLeft\"] }}", + "value2": true + } + ] + } + }, + "id": "e149b5d7-7a7f-4939-88e4-789e987cf280", + "name": "IF1", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [2540, 1300] + }, + { + "parameters": { + "jsCode": "return [\n {\n key: '0'\n },\n {\n key: '1'\n }\n];" + }, + "id": "cf21ca09-ca2e-4334-a6ea-e7453d8598ca", + "name": "Mock Data 1", + "type": "n8n-nodes-base.code", + "typeVersion": 1, + "position": [1000, 840] + }, + { + "parameters": { + "jsCode": "return [\n {\n key: '10_' + $runIndex\n },\n {\n key: '11_' + $runIndex\n },\n {\n key: '12_' + $runIndex\n },\n {\n key: '13_' + $runIndex\n },\n {\n key: '14_' + $runIndex\n },\n];" + }, + "id": "2a62fdd8-5e6c-468b-88af-bddd0475ff4a", + "name": "Mock Data 1_2", + "type": "n8n-nodes-base.code", + "typeVersion": 1, + "position": [1580, 820] + }, + { + "parameters": { + "jsCode": "return [\n {\n key: '0'\n },\n {\n key: '1'\n }\n];" + }, + "id": "f4b7b020-7d07-4aff-a99b-f0d6bfe656ff", + "name": "Mock Data 2", + "type": "n8n-nodes-base.code", + "typeVersion": 1, + "position": [1000, 1280] + }, + { + "parameters": { + "jsCode": "return [\n {\n key: '10_' + $runIndex\n },\n {\n key: '11_' + $runIndex\n },\n {\n key: '12_' + $runIndex\n },\n {\n key: '13_' + $runIndex\n },\n {\n key: '14_' + $runIndex\n },\n];" + }, + "id": "9f9e4c1f-5dfc-45f6-ac48-ccd02d42e54c", + "name": "Mock Data 2_2", + "type": "n8n-nodes-base.code", + "typeVersion": 1, + "position": [1580, 1260] + }, + { + "parameters": { + "jsCode": "return [\n {\n key: '0'\n },\n {\n key: '1'\n }\n];" + }, + "id": "d20015b3-6e15-4094-bd18-c62be7fbcf9e", + "name": "Mock Data 3", + "type": "n8n-nodes-base.code", + "typeVersion": 1, + "position": [1000, 1560] + }, + { + "parameters": { + "jsCode": "return [\n {\n key: '10_' + $runIndex\n },\n {\n key: '11_' + $runIndex\n },\n {\n key: '12_' + $runIndex\n },\n {\n key: '13_' + $runIndex\n },\n {\n key: '14_' + $runIndex\n },\n];" + }, + "id": "9b8f1472-3913-44ae-9e8c-e8bf01d5ea3c", + "name": "Mock Data 3_2", + "type": "n8n-nodes-base.code", + "typeVersion": 1, + "position": [1580, 1560] + }, + { + "parameters": {}, + "id": "11b6d860-ce7b-4e5c-b5eb-5ec4387092c1", + "name": "Results 1", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [1400, 920] + }, + { + "parameters": { + "jsCode": "let results = [],\n i = 0;\n\ndo {\n try {\n results = results.concat($(\"Some Operation 2\").all(0, i));\n } catch (error) {\n return results;\n }\n i++;\n} while (true);\n" + }, + "id": "84277fcb-2749-49f3-83f3-7132848f3a0b", + "name": "Result 2", + "type": "n8n-nodes-base.code", + "position": [2860, 1280], + "typeVersion": 1 + }, + { + "parameters": { + "jsCode": "let results = [],\n i = 0;\n\ndo {\n try {\n results = results.concat($(\"Some Operation 3\").all(0, i));\n } catch (error) {\n return results;\n }\n i++;\n} while (true);\n" + }, + "id": "fd9de431-a537-44a6-a4e2-68825768bb1d", + "name": "Result 3", + "type": "n8n-nodes-base.code", + "position": [2860, 1520], + "typeVersion": 1 + }, + { + "parameters": {}, + "id": "9a62eed8-9c40-4763-92e9-9633b77a37cf", + "name": "Some Operation 1", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [2100, 880] + }, + { + "parameters": {}, + "id": "cb35f9e6-7379-484b-b770-5eecba535a83", + "name": "Some Operation 2", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [2100, 1320] + }, + { + "parameters": {}, + "id": "62a66c9d-2a66-4c77-b4a2-0db89574074d", + "name": "Some Operation 3", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [2100, 1560] + }, + { + "parameters": { + "batchSize": 1, + "options": {} + }, + "id": "2ac3d20c-8891-4854-bca1-188f0e9542ac", + "name": "Split In Batches 3", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 1, + "position": [1220, 1560] + }, + { + "parameters": { + "batchSize": 1, + "options": {} + }, + "id": "d37b3b09-1255-486d-99ed-cffcc9f87548", + "name": "Split In Batches 2", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 2, + "position": [1220, 1280] + }, + { + "parameters": { + "batchSize": 1, + "options": { + "reset": "={{ $node[\"Split In Batches 3_2\"].context[\"noItemsLeft\"] }}" + } + }, + "id": "89a74a96-e3f7-4306-b68b-fa82254ccca3", + "name": "Split In Batches 3_2", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 1, + "position": [1840, 1560] + }, + { + "parameters": { + "batchSize": 1, + "options": { + "reset": "={{ $node[\"Split In Batches 2_2\"].context[\"noItemsLeft\"] }}" + } + }, + "id": "2cc3f863-e388-494f-ba9d-e18ac28df5ee", + "name": "Split In Batches 2_2", + "type": "n8n-nodes-base.splitInBatches", + "typeVersion": 2, + "position": [1840, 1340] + } + ], + "pinData": { + "Results 1": [ + { + "json": { + "key": "10_0" + } + }, + { + "json": { + "key": "11_0" + } + }, + { + "json": { + "key": "12_0" + } + }, + { + "json": { + "key": "13_0" + } + }, + { + "json": { + "key": "14_0" + } + }, + { + "json": { + "key": "10_1" + } + }, + { + "json": { + "key": "11_1" + } + }, + { + "json": { + "key": "12_1" + } + }, + { + "json": { + "key": "13_1" + } + }, + { + "json": { + "key": "14_1" + } + } + ], + "Result 3": [ + { + "json": { + "key": "10_0" + } + }, + { + "json": { + "key": "11_0" + } + }, + { + "json": { + "key": "12_0" + } + }, + { + "json": { + "key": "13_0" + } + }, + { + "json": { + "key": "14_0" + } + }, + { + "json": { + "key": "10_1" + } + }, + { + "json": { + "key": "11_1" + } + }, + { + "json": { + "key": "12_1" + } + }, + { + "json": { + "key": "13_1" + } + }, + { + "json": { + "key": "14_1" + } + } + ], + "Result 2": [ + { + "json": { + "key": "10_0" + } + }, + { + "json": { + "key": "11_0" + } + }, + { + "json": { + "key": "12_0" + } + }, + { + "json": { + "key": "13_0" + } + }, + { + "json": { + "key": "14_0" + } + }, + { + "json": { + "key": "10_1" + } + }, + { + "json": { + "key": "11_1" + } + }, + { + "json": { + "key": "12_1" + } + }, + { + "json": { + "key": "13_1" + } + }, + { + "json": { + "key": "14_1" + } + } + ] + }, + "connections": { + "When clicking \"Execute Workflow\"": { + "main": [ + [ + { + "node": "Mock Data 1", + "type": "main", + "index": 0 + }, + { + "node": "Mock Data 2", + "type": "main", + "index": 0 + }, + { + "node": "Mock Data 3", + "type": "main", + "index": 0 + } + ] + ] + }, + "No Items Left": { + "main": [ + [ + { + "node": "IF", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Split In Batches 3_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches 1": { + "main": [ + [ + { + "node": "Mock Data 1_2", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Results 1", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches 1_2": { + "main": [ + [ + { + "node": "Some Operation 1", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Split In Batches 1", + "type": "main", + "index": 0 + } + ] + ] + }, + "No Items Left2": { + "main": [ + [ + { + "node": "IF1", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Split In Batches 2_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "IF": { + "main": [ + [ + { + "node": "Result 3", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Split In Batches 3", + "type": "main", + "index": 0 + } + ] + ] + }, + "IF1": { + "main": [ + [ + { + "node": "Result 2", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "Split In Batches 2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mock Data 1": { + "main": [ + [ + { + "node": "Split In Batches 1", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mock Data 1_2": { + "main": [ + [ + { + "node": "Split In Batches 1_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mock Data 2": { + "main": [ + [ + { + "node": "Split In Batches 2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mock Data 2_2": { + "main": [ + [ + { + "node": "Split In Batches 2_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mock Data 3": { + "main": [ + [ + { + "node": "Split In Batches 3", + "type": "main", + "index": 0 + } + ] + ] + }, + "Mock Data 3_2": { + "main": [ + [ + { + "node": "Split In Batches 3_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Some Operation 1": { + "main": [ + [ + { + "node": "Split In Batches 1_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Some Operation 2": { + "main": [ + [ + { + "node": "No Items Left2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Some Operation 3": { + "main": [ + [ + { + "node": "No Items Left", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches 3": { + "main": [ + [ + { + "node": "Mock Data 3_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches 2": { + "main": [ + [ + { + "node": "Mock Data 2_2", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches 3_2": { + "main": [ + [ + { + "node": "Some Operation 3", + "type": "main", + "index": 0 + } + ] + ] + }, + "Split In Batches 2_2": { + "main": [ + [ + { + "node": "Some Operation 2", + "type": "main", + "index": 0 + } + ] + ] + } + }, + "active": false, + "settings": {}, + "versionId": "027162aa-0b6a-4cd5-9bf6-345b70c83f2d", + "id": "1124", + "meta": { + "instanceId": "021d3c82ba2d3bc090cbf4fc81c9312668bcc34297e022bb3438c5c88a43a5ff" + }, + "tags": [] +} diff --git a/packages/nodes-base/nodes/SplitInBatches/v2/SplitInBatchesV2.node.ts b/packages/nodes-base/nodes/SplitInBatches/v2/SplitInBatchesV2.node.ts index 31252fd483..27405a039c 100644 --- a/packages/nodes-base/nodes/SplitInBatches/v2/SplitInBatchesV2.node.ts +++ b/packages/nodes-base/nodes/SplitInBatches/v2/SplitInBatchesV2.node.ts @@ -153,9 +153,12 @@ export class SplitInBatchesV2 implements INodeType { nodeContext.noItemsLeft = nodeContext.items.length === 0; if (returnItems.length === 0) { + nodeContext.done = true; return [[], nodeContext.processedItems]; } + nodeContext.done = false; + return [returnItems, []]; } } From 529f0e499670450f8cb0dda539176d1b07c39190 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 16 Jun 2023 10:13:54 +0100 Subject: [PATCH 03/17] fix(LinkedIn Node): Remove unsupported description from image posts (#6446) --- packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts | 4 ---- packages/nodes-base/nodes/LinkedIn/PostDescription.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts index 3b0571cd93..1b007fa65a 100644 --- a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts +++ b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts @@ -113,9 +113,6 @@ export class LinkedIn implements INodeType { }; if (shareMediaCategory === 'IMAGE') { - if (additionalFields.description) { - description = additionalFields.description as string; - } if (additionalFields.title) { title = additionalFields.title as string; } @@ -145,7 +142,6 @@ export class LinkedIn implements INodeType { media: { title, id: image, - description, }, }, commentary: text, diff --git a/packages/nodes-base/nodes/LinkedIn/PostDescription.ts b/packages/nodes-base/nodes/LinkedIn/PostDescription.ts index 8eddd70bb1..78a4d1ce3c 100644 --- a/packages/nodes-base/nodes/LinkedIn/PostDescription.ts +++ b/packages/nodes-base/nodes/LinkedIn/PostDescription.ts @@ -156,7 +156,7 @@ export const postFields: INodeProperties[] = [ description: 'Provide a short description for your image or article', displayOptions: { show: { - '/shareMediaCategory': ['ARTICLE', 'IMAGE'], + '/shareMediaCategory': ['ARTICLE'], }, }, }, From 6a7d1aedb1c0bc31b677b1ee07e83cef119dbe54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 16 Jun 2023 12:17:04 +0200 Subject: [PATCH 04/17] ci: Prevent e2e failure on `commented` type review (no-changelog) (#6452) --- .github/workflows/e2e-tests-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests-pr.yml b/.github/workflows/e2e-tests-pr.yml index 0b92e187bd..1d9ead6db8 100644 --- a/.github/workflows/e2e-tests-pr.yml +++ b/.github/workflows/e2e-tests-pr.yml @@ -47,5 +47,5 @@ jobs: run: exit 0 - name: Fail job if run-e2e-tests failed - if: ${{ github.event.review.state != 'approved' || needs.run-e2e-tests.result == 'failure' }} + if: ${{ (github.event.review.state != 'approved' && github.event.review.state != 'commented') || needs.run-e2e-tests.result == 'failure' }} run: exit 1 From 3e5f7adcbff23d7e061bbce9dffaaf35227450ca Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Fri, 16 Jun 2023 14:25:12 +0300 Subject: [PATCH 05/17] feat: Remove vue-fragment (no-changelog) (#6456) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: remove vue-fragment (no-changelog) * Update pnpm-lock.yaml --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ --- packages/editor-ui/package.json | 1 - packages/editor-ui/src/components/Badge.vue | 14 ++++++-------- packages/editor-ui/src/components/PageAlert.vue | 2 +- packages/editor-ui/src/components/Telemetry.vue | 2 +- packages/editor-ui/src/plugins/components.ts | 2 -- pnpm-lock.yaml | 11 ----------- 6 files changed, 8 insertions(+), 24 deletions(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 6f51a6c821..14135f1818 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -70,7 +70,6 @@ "v-click-outside": "^3.1.2", "vue": "^2.7.14", "vue-agile": "^2.0.0", - "vue-fragment": "1.5.1", "vue-i18n": "^8.26.7", "vue-infinite-loading": "^2.4.5", "vue-json-pretty": "1.9.3", diff --git a/packages/editor-ui/src/components/Badge.vue b/packages/editor-ui/src/components/Badge.vue index 0275081a73..1a70af7870 100644 --- a/packages/editor-ui/src/components/Badge.vue +++ b/packages/editor-ui/src/components/Badge.vue @@ -1,12 +1,10 @@ diff --git a/packages/editor-ui/src/components/ParameterInputExpanded.vue b/packages/editor-ui/src/components/ParameterInputExpanded.vue index 334fc6b171..3e2faac1c5 100644 --- a/packages/editor-ui/src/components/ParameterInputExpanded.vue +++ b/packages/editor-ui/src/components/ParameterInputExpanded.vue @@ -32,6 +32,7 @@ :isForCredential="true" :eventSource="eventSource" :hint="!showRequiredErrors ? hint : ''" + :event-bus="eventBus" @focus="onFocus" @blur="onBlur" @textInput="valueChanged" @@ -65,6 +66,7 @@ import { isValueExpression } from '@/utils'; import type { INodeParameterResourceLocator, INodeProperties, IParameterLabel } from 'n8n-workflow'; import { mapStores } from 'pinia'; import { useWorkflowsStore } from '@/stores/workflows.store'; +import { createEventBus } from 'n8n-design-system/utils'; type ParamRef = InstanceType; @@ -100,6 +102,7 @@ export default defineComponent({ focused: false, blurredEver: false, menuExpanded: false, + eventBus: createEventBus(), }; }, computed: { @@ -147,9 +150,7 @@ export default defineComponent({ this.menuExpanded = expanded; }, optionSelected(command: string) { - if (this.$refs.param) { - (this.$refs.param as ParamRef).$emit('optionSelected', command); - } + this.eventBus.emit('optionSelected', command); }, valueChanged(parameterData: IUpdateInformation) { this.$emit('change', parameterData); diff --git a/packages/editor-ui/src/components/ParameterInputFull.vue b/packages/editor-ui/src/components/ParameterInputFull.vue index 7653d3ff65..3ff7e88355 100644 --- a/packages/editor-ui/src/components/ParameterInputFull.vue +++ b/packages/editor-ui/src/components/ParameterInputFull.vue @@ -56,6 +56,7 @@ :hint="hint" :hide-issues="hideIssues" :label="label" + :event-bus="eventBus" @valueChanged="valueChanged" @textInput="onTextInput" @focus="onFocus" @@ -98,6 +99,7 @@ import { useNDVStore } from '@/stores/ndv.store'; import { useSegment } from '@/stores/segment.store'; import { externalHooks } from '@/mixins/externalHooks'; import { getMappedResult } from '@/utils/mappingUtils'; +import { createEventBus } from 'n8n-design-system/utils'; type ParameterInputWrapperRef = InstanceType; @@ -112,7 +114,10 @@ export default defineComponent({ ParameterInputWrapper, }, setup() { + const eventBus = createEventBus(); + return { + eventBus, ...useToast(), }; }, @@ -234,17 +239,14 @@ export default defineComponent({ this.menuExpanded = expanded; }, optionSelected(command: string) { - const paramRef = this.$refs.param as ParameterInputWrapperRef | undefined; - paramRef?.$emit('optionSelected', command); + this.eventBus.emit('optionSelected', command); }, valueChanged(parameterData: IUpdateInformation) { this.$emit('valueChanged', parameterData); }, onTextInput(parameterData: IUpdateInformation) { - const paramRef = this.$refs.param as ParameterInputWrapperRef | undefined; - if (isValueExpression(this.parameter, parameterData.value)) { - paramRef?.$emit('optionSelected', 'addExpression'); + this.eventBus.emit('optionSelected', 'addExpression'); } }, onDrop(newParamValue: string) { diff --git a/packages/editor-ui/src/components/ParameterInputWrapper.vue b/packages/editor-ui/src/components/ParameterInputWrapper.vue index 5f5b221fe6..a8d794eb98 100644 --- a/packages/editor-ui/src/components/ParameterInputWrapper.vue +++ b/packages/editor-ui/src/components/ParameterInputWrapper.vue @@ -18,6 +18,7 @@ :expressionEvaluated="expressionValueComputed" :label="label" :data-test-id="`parameter-input-${parameter.name}`" + :event-bus="internalEventBus" @focus="onFocus" @blur="onBlur" @drop="onDrop" @@ -61,8 +62,8 @@ import type { INodeUi, IUpdateInformation, TargetItem } from '@/Interface'; import { workflowHelpers } from '@/mixins/workflowHelpers'; import { isValueExpression } from '@/utils'; import { useNDVStore } from '@/stores/ndv.store'; - -type ParamRef = InstanceType; +import type { EventBus } from 'n8n-design-system/utils'; +import { createEventBus } from 'n8n-design-system/utils'; export default defineComponent({ name: 'parameter-input-wrapper', @@ -71,8 +72,16 @@ export default defineComponent({ ParameterInput, InputHint, }, + data() { + return { + internalEventBus: createEventBus(), + }; + }, mounted() { - this.$on('optionSelected', this.optionSelected); + this.eventBus.on('optionSelected', this.optionSelected); + }, + beforeDestroy() { + this.eventBus.off('optionSelected', this.optionSelected); }, props: { isReadOnly: { @@ -124,6 +133,10 @@ export default defineComponent({ size: 'small', }), }, + eventBus: { + type: Object as PropType, + default: () => createEventBus(), + }, }, computed: { ...mapStores(useNDVStore), @@ -217,9 +230,7 @@ export default defineComponent({ this.$emit('drop', data); }, optionSelected(command: string) { - const paramRef = this.$refs.param as ParamRef | undefined; - - paramRef?.$emit('optionSelected', command); + this.internalEventBus.emit('optionSelected', command); }, onValueChanged(parameterData: IUpdateInformation) { this.$emit('valueChanged', parameterData); diff --git a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue index d4362c3c27..69af9376dc 100644 --- a/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue +++ b/packages/editor-ui/src/components/ResourceLocator/ResourceLocator.vue @@ -15,11 +15,11 @@ :hasMore="currentQueryHasMore" :errorView="currentQueryError" :width="width" + :event-bus="eventBus" @input="onListItemSelected" @hide="onDropdownHide" @filter="onSearchFilter" @loadMore="loadResourcesDebounced" - ref="dropdown" >