diff --git a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts index ce802c4f0d305..2fd68fa3eec7a 100644 --- a/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts +++ b/packages/nodes-base/nodes/LinkedIn/LinkedIn.node.ts @@ -19,10 +19,10 @@ export class LinkedIn implements INodeType { description: INodeTypeDescription = { displayName: 'LinkedIn', name: 'linkedIn', - // eslint-disable-next-line n8n-nodes-base/node-class-description-icon-not-svg - icon: 'file:linkedin.png', + icon: 'file:linkedin.svg', group: ['input'], version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Consume LinkedIn API', defaults: { name: 'LinkedIn', @@ -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 = {}; + + let body:any = {};// tslint:disable-line:no-any for (let i = 0; i < items.length; i++) { try { @@ -220,6 +221,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, 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 be815e9ed97cc..0000000000000 Binary files a/packages/nodes-base/nodes/LinkedIn/linkedin.png and /dev/null differ 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