mirror of
https://github.com/wekan/wekan.git
synced 2026-03-11 08:02:33 +01:00
Add link card feature to rules
This commit is contained in:
parent
25f85db453
commit
6e3f25c771
4 changed files with 69 additions and 1 deletions
|
|
@ -77,6 +77,29 @@ template(name="boardActions")
|
|||
div.trigger-button.js-create-card-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{_'r-link-card'}}
|
||||
div.trigger-text
|
||||
| {{_'r-the-board'}}
|
||||
div.trigger-dropdown
|
||||
select(id="board-id-link")
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||
else
|
||||
option(value="{{_id}}") {{title}}
|
||||
div.trigger-text
|
||||
| {{_'r-in-list'}}
|
||||
div.trigger-dropdown
|
||||
input(id="listName-link",type=text,placeholder="{{_'r-name'}}")
|
||||
div.trigger-text
|
||||
| {{_'r-in-swimlane'}}
|
||||
div.trigger-dropdown
|
||||
input(id="swimlaneName-link",type=text,placeholder="{{_'r-name'}}")
|
||||
div.trigger-button.js-link-card-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -178,6 +178,29 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
}
|
||||
},
|
||||
'click .js-link-card-action'(event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const swimlaneName = this.find('#swimlaneName-link').value || '*';
|
||||
const listName = this.find('#listName-link').value || '*';
|
||||
const boardId = Session.get('currentBoard');
|
||||
const destBoardId = this.find('#board-id-link').value;
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: 'linkCard',
|
||||
listName,
|
||||
swimlaneName,
|
||||
boardId: destBoardId,
|
||||
desc,
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId,
|
||||
actionId,
|
||||
boardId,
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue