mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Add setting CARD_OPENED_WEBHOOK_ENABLED=false as default.
Thanks to xet7 !
Related 843478ac40 ,
related #2518
This commit is contained in:
parent
a8ab7b15d8
commit
b8c527d52b
9 changed files with 59 additions and 28 deletions
|
|
@ -117,34 +117,36 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
onRendered() {
|
||||
// Send Webhook but not create Activities records ---
|
||||
const card = this.currentData();
|
||||
const userId = Meteor.userId();
|
||||
//console.log(`userId: ${userId}`);
|
||||
//console.log(`cardId: ${card._id}`);
|
||||
//console.log(`boardId: ${card.boardId}`);
|
||||
//console.log(`listId: ${card.listId}`);
|
||||
//console.log(`swimlaneId: ${card.swimlaneId}`);
|
||||
const params = {
|
||||
userId,
|
||||
cardId: card._id,
|
||||
boardId: card.boardId,
|
||||
listId: card.listId,
|
||||
user: Meteor.user().username,
|
||||
url: '',
|
||||
};
|
||||
//console.log('looking for integrations...');
|
||||
const integrations = Integrations.find({
|
||||
boardId: card.boardId,
|
||||
type: 'outgoing-webhooks',
|
||||
enabled: true,
|
||||
activities: { $in: ['CardDetailsRendered', 'all'] },
|
||||
}).fetch();
|
||||
//console.log(`Investigation length: ${integrations.length}`);
|
||||
if (integrations.length > 0) {
|
||||
Meteor.call('outgoingWebhooks', integrations, 'CardSelected', params);
|
||||
if (Meteor.settings.public.CARD_OPENED_WEBHOOK_ENABLED) {
|
||||
// Send Webhook but not create Activities records ---
|
||||
const card = this.currentData();
|
||||
const userId = Meteor.userId();
|
||||
//console.log(`userId: ${userId}`);
|
||||
//console.log(`cardId: ${card._id}`);
|
||||
//console.log(`boardId: ${card.boardId}`);
|
||||
//console.log(`listId: ${card.listId}`);
|
||||
//console.log(`swimlaneId: ${card.swimlaneId}`);
|
||||
const params = {
|
||||
userId,
|
||||
cardId: card._id,
|
||||
boardId: card.boardId,
|
||||
listId: card.listId,
|
||||
user: Meteor.user().username,
|
||||
url: '',
|
||||
};
|
||||
//console.log('looking for integrations...');
|
||||
const integrations = Integrations.find({
|
||||
boardId: card.boardId,
|
||||
type: 'outgoing-webhooks',
|
||||
enabled: true,
|
||||
activities: { $in: ['CardDetailsRendered', 'all'] },
|
||||
}).fetch();
|
||||
//console.log(`Investigation length: ${integrations.length}`);
|
||||
if (integrations.length > 0) {
|
||||
Meteor.call('outgoingWebhooks', integrations, 'CardSelected', params);
|
||||
}
|
||||
//-------------
|
||||
}
|
||||
//-------------
|
||||
|
||||
if (!Utils.isMiniScreen()) {
|
||||
Meteor.setTimeout(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue