From ae8228d9cc29fdf52ff60caff74c9888b9ccaf54 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Thu, 16 Jun 2022 16:16:55 +0100 Subject: [PATCH 1/3] Fixed issue with Preview not being generated when description and title is blank --- packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts index 956e0f837346a..7a4919fdc9f72 100644 --- a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts +++ b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts @@ -75,7 +75,7 @@ export class LinkedIn implements INodeType { let responseData; const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; - let body = {}; + let body:any = {}; for (let i = 0; i < items.length; i++) { try { @@ -219,6 +219,15 @@ export class LinkedIn implements INodeType { 'com.linkedin.ugc.MemberNetworkVisibility': visibility, }, }; + + if (description === '') { + delete body.specificContent['com.linkedin.ugc.ShareContent'].media[0].description; + } + + if (title === '') { + delete body.specificContent['com.linkedin.ugc.ShareContent'].media[0].title; + } + } else { body = { author: authorUrn, From baf44c8f0b6a034f2680b93347ee623d754d9d37 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Thu, 16 Jun 2022 16:28:59 +0100 Subject: [PATCH 2/3] Nodelinter fixes --- .../nodes-base/nodes/LinkedIn/LinkedIn.node.ts | 3 ++- .../nodes-base/nodes/LinkedIn/PostDescription.ts | 2 +- packages/nodes-base/nodes/LinkedIn/linkedin.png | Bin 543 -> 0 bytes packages/nodes-base/nodes/LinkedIn/linkedin.svg | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 packages/nodes-base/nodes/LinkedIn/linkedin.png create mode 100644 packages/nodes-base/nodes/LinkedIn/linkedin.svg diff --git a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts index 7a4919fdc9f72..74ac74dda928b 100644 --- a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts +++ b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts @@ -19,9 +19,10 @@ export class LinkedIn implements INodeType { description: INodeTypeDescription = { displayName: 'LinkedIn', name: 'linkedIn', - icon: 'file:linkedin.png', + icon: 'file:linkedin.svg', group: ['input'], version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Consume LinkedIn API', defaults: { name: 'LinkedIn', diff --git a/packages/nodes-base/nodes/LinkedIn/PostDescription.ts b/packages/nodes-base/nodes/LinkedIn/PostDescription.ts index 6980afde61e31..9d9d8e9fbe2aa 100644 --- a/packages/nodes-base/nodes/LinkedIn/PostDescription.ts +++ b/packages/nodes-base/nodes/LinkedIn/PostDescription.ts @@ -32,7 +32,7 @@ export const postFields: INodeProperties[] = [ displayName: 'Post As', name: 'postAs', type: 'options', - default: '', + default: 'person', description: 'If to post on behalf of a user or an organization', options: [ { diff --git a/packages/nodes-base/nodes/LinkedIn/linkedin.png b/packages/nodes-base/nodes/LinkedIn/linkedin.png deleted file mode 100644 index be815e9ed97ccd9d48da926dcced020a6f0ca362..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2Hn0X`wFK$@X^JN=Op_r9q>tJO<_ z{DK+wz1^|9=7*nb?^lI0oGXQ*jIJE*O7eRD;_-tmlPfGWR3zu*xH&u%3t&9Kz`&^Q z>EamTas2I+(|OGX09)AwB+Fr8zyoa zhKhaCQTy^rJ>6i+5vR6qOSay%H20phz4NCfv$%&?k&nhhR@IO4ElU*+?)VpY`l9;c zJpoqhbk^GWcGc|Oq#Jbd`~T#Bk1}t?-kHMJ&fK$oQsc>pdEG%r zb}yW>`0gd{WMj+4JU_m@Oin9tgTe~DWM4f_yX)j diff --git a/packages/nodes-base/nodes/LinkedIn/linkedin.svg b/packages/nodes-base/nodes/LinkedIn/linkedin.svg new file mode 100644 index 0000000000000..1f2df785d3f8d --- /dev/null +++ b/packages/nodes-base/nodes/LinkedIn/linkedin.svg @@ -0,0 +1 @@ + \ No newline at end of file From 4fa381c40df781251b4abb883e523031fbd649b9 Mon Sep 17 00:00:00 2001 From: Jonathan Bennetts Date: Thu, 16 Jun 2022 17:14:23 +0100 Subject: [PATCH 3/3] Fixed lint issue... build should work --- packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts index 74ac74dda928b..2fd68fa3eec7a 100644 --- a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts +++ b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts @@ -76,7 +76,8 @@ export class LinkedIn implements INodeType { let responseData; const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; - let body:any = {}; + + let body:any = {};// tslint:disable-line:no-any for (let i = 0; i < items.length; i++) { try {