diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-08-15 00:29:00 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-08-15 00:29:00 +0300 |
commit | b8c527d52bec7272c890385f11e26acec65822ae (patch) | |
tree | 52f3fc66612b362e5cc06e773b7cc83e41dd1c70 /client | |
parent | a8ab7b15d80c252f7d4838828a8505a290f23809 (diff) | |
download | wekan-b8c527d52bec7272c890385f11e26acec65822ae.tar.gz wekan-b8c527d52bec7272c890385f11e26acec65822ae.tar.bz2 wekan-b8c527d52bec7272c890385f11e26acec65822ae.zip |
Add setting CARD_OPENED_WEBHOOK_ENABLED=false as default.
Thanks to xet7 !
Related https://github.com/wekan/wekan/commit/843478ac40b7718f1096a75295522487f0ca6dbe ,
related #2518
Diffstat (limited to 'client')
-rw-r--r-- | client/components/cards/cardDetails.js | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index f52661b7..cd8813f5 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -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(() => { |