mirror of
https://github.com/wekan/wekan.git
synced 2025-12-28 13:18:49 +01:00
Add input form in board menu
This commit is contained in:
parent
429e2f9992
commit
e66c99499f
3 changed files with 57 additions and 1 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue