mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
add 2001
This commit is contained in:
parent
cc52ed596e
commit
031827e315
|
@ -571,9 +571,8 @@ export class Mattermost implements INodeType {
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Icon which should appear next to footer.',
|
description: 'Icon which should appear next to footer.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Actions',
|
||||||
{ displayName: 'Actions',
|
|
||||||
name: 'actions',
|
name: 'actions',
|
||||||
placeholder: 'Add Actions',
|
placeholder: 'Add Actions',
|
||||||
description: 'Actions to add to message.',
|
description: 'Actions to add to message.',
|
||||||
|
@ -594,8 +593,6 @@ export class Mattermost implements INodeType {
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Name of the Action.',
|
description: 'Name of the Action.',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
displayName: 'Integration',
|
displayName: 'Integration',
|
||||||
name: 'integration',
|
name: 'integration',
|
||||||
|
@ -619,8 +616,6 @@ export class Mattermost implements INodeType {
|
||||||
default: '',
|
default: '',
|
||||||
description: 'URL of the Integration.',
|
description: 'URL of the Integration.',
|
||||||
},
|
},
|
||||||
// context
|
|
||||||
|
|
||||||
{
|
{
|
||||||
displayName: 'Context',
|
displayName: 'Context',
|
||||||
name: 'context',
|
name: 'context',
|
||||||
|
@ -655,44 +650,14 @@ export class Mattermost implements INodeType {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
displayName: 'Fields',
|
displayName: 'Fields',
|
||||||
name: 'fields',
|
name: 'fields',
|
||||||
|
@ -997,9 +962,7 @@ export class Mattermost implements INodeType {
|
||||||
body.message = this.getNodeParameter('message', i) as string;
|
body.message = this.getNodeParameter('message', i) as string;
|
||||||
|
|
||||||
const attachments = this.getNodeParameter('attachments', i, []) as unknown as IAttachment[];
|
const attachments = this.getNodeParameter('attachments', i, []) as unknown as IAttachment[];
|
||||||
console.log('----');
|
|
||||||
console.dir(attachments);
|
|
||||||
console.log('----');
|
|
||||||
// The node does save the fields data differently than the API
|
// The node does save the fields data differently than the API
|
||||||
// expects so fix the data befre we send the request
|
// expects so fix the data befre we send the request
|
||||||
for (const attachment of attachments) {
|
for (const attachment of attachments) {
|
||||||
|
@ -1020,21 +983,14 @@ export class Mattermost implements INodeType {
|
||||||
// Move the field-content up
|
// Move the field-content up
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
attachment.actions = attachment.actions.item;
|
attachment.actions = attachment.actions.item;
|
||||||
console.log(attachment.actions );
|
|
||||||
} else {
|
} else {
|
||||||
// If it does not have any items set remove it
|
// If it does not have any items set remove it
|
||||||
delete attachment.actions;
|
delete attachment.actions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const util = require('util');
|
|
||||||
console.log('&&&&');
|
|
||||||
//console.dir(attachments);
|
|
||||||
console.log(util.inspect(attachments, false, null, true /* enable colors */));
|
|
||||||
console.log('&&&&');
|
|
||||||
|
|
||||||
const arr = attachments;
|
const arr = attachments;
|
||||||
|
|
||||||
for (const att of arr) {
|
for (const att of arr) {
|
||||||
if (Array.isArray(att.actions))
|
if (Array.isArray(att.actions))
|
||||||
for (const attaction of att.actions) {
|
for (const attaction of att.actions) {
|
||||||
|
@ -1052,26 +1008,10 @@ export class Mattermost implements INodeType {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('****111');
|
|
||||||
console.log(JSON.stringify(arr, null, 4));
|
|
||||||
console.log('****222');
|
|
||||||
console.log(JSON.stringify(attachments, null, 4));
|
|
||||||
console.log('****222aaa');
|
|
||||||
|
|
||||||
|
|
||||||
body.props = {
|
body.props = {
|
||||||
attachments,
|
attachments,
|
||||||
};
|
};
|
||||||
|
|
||||||
//console.log('####');
|
|
||||||
//console.dir(body);
|
|
||||||
//console.log('####');
|
|
||||||
console.log('****');
|
|
||||||
console.log(util.inspect(body, false, null, true /* enable colors */));
|
|
||||||
//console.dir(body);
|
|
||||||
//console.log('****111');
|
|
||||||
//console.log(JSON.stringify(body, null, 4));
|
|
||||||
console.log('****');
|
|
||||||
// Add all the other options to the request
|
// Add all the other options to the request
|
||||||
const otherOptions = this.getNodeParameter('otherOptions', i) as IDataObject;
|
const otherOptions = this.getNodeParameter('otherOptions', i) as IDataObject;
|
||||||
Object.assign(body, otherOptions);
|
Object.assign(body, otherOptions);
|
||||||
|
|
Loading…
Reference in a new issue