diff options
author | nztqa <nztqa@users.noreply.github.com> | 2017-07-09 15:14:33 +0900 |
---|---|---|
committer | nztqa <nztqa@users.noreply.github.com> | 2017-07-09 15:14:33 +0900 |
commit | e66c99499fa9b1efeff00e5b6f0024678672d720 (patch) | |
tree | 116f1ad147f958a9f2c79c2070867d91ef7f2d30 /client/components/boards/boardHeader.js | |
parent | 429e2f9992c94248c54f1f77127f8d0b003e7a7c (diff) | |
download | wekan-e66c99499fa9b1efeff00e5b6f0024678672d720.tar.gz wekan-e66c99499fa9b1efeff00e5b6f0024678672d720.tar.bz2 wekan-e66c99499fa9b1efeff00e5b6f0024678672d720.zip |
Add input form in board menu
Diffstat (limited to 'client/components/boards/boardHeader.js')
-rw-r--r-- | client/components/boards/boardHeader.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js index 06defbfa..3d6f14be 100644 --- a/client/components/boards/boardHeader.js +++ b/client/components/boards/boardHeader.js @@ -13,6 +13,7 @@ Template.boardMenuPopup.events({ // confirm that the board was successfully archived. FlowRouter.go('home'); }), + 'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'), }); Template.boardMenuPopup.helpers({ @@ -227,3 +228,45 @@ BlazeComponent.extendComponent({ }]; }, }).register('boardChangeWatchPopup'); + +BlazeComponent.extendComponent({ + integration() { + const boardId = Session.get('currentBoard'); + return Integrations.findOne({ boardId: `${boardId}` }); + }, + + events() { + return [{ + 'submit'(evt) { + evt.preventDefault(); + const url = this.find('.js-outgoing-webhooks-url').value.trim(); + const boardId = Session.get('currentBoard'); + const integration = this.integration(); + if (integration) { + if (url) { + Integrations.update(integration._id, { + $set: { + enabled: true, + url: `${url}`, + }, + }); + } else { + Integrations.update(integration._id, { + $set: { + enabled: false, + }, + }); + } + } else if (url) { + Integrations.insert({ + enabled: true, + type: 'outgoing-webhooks', + url: `${url}`, + boardId: `${boardId}`, + }); + } + Popup.close(); + }, + }]; + }, +}).register('outgoingWebhooksPopup'); |