mirror of
https://github.com/wekan/wekan.git
synced 2026-02-08 17:34:19 +01:00
Merge branch 'feature-rules' of https://github.com/Angtrim/wekan into Angtrim-feature-rules
This commit is contained in:
commit
6673b79738
60 changed files with 3074 additions and 259 deletions
|
|
@ -14,6 +14,9 @@ template(name="boardActivities")
|
|||
p.activity-desc
|
||||
+memberName(user=user)
|
||||
|
||||
if($eq activityType 'deleteAttachment')
|
||||
| {{{_ 'activity-delete-attach' cardLink}}}.
|
||||
|
||||
if($eq activityType 'addAttachment')
|
||||
| {{{_ 'activity-attached' attachmentLink cardLink}}}.
|
||||
|
||||
|
|
@ -31,12 +34,28 @@ template(name="boardActivities")
|
|||
.activity-checklist(href="{{ card.absoluteUrl }}")
|
||||
+viewer
|
||||
= checklist.title
|
||||
if($eq activityType 'removeChecklist')
|
||||
| {{{_ 'activity-checklist-removed' cardLink}}}.
|
||||
|
||||
if($eq activityType 'checkedItem')
|
||||
| {{{_ 'activity-checked-item' checkItem checklist.title cardLink}}}.
|
||||
|
||||
if($eq activityType 'uncheckedItem')
|
||||
| {{{_ 'activity-unchecked-item' checkItem checklist.title cardLink}}}.
|
||||
|
||||
if($eq activityType 'checklistCompleted')
|
||||
| {{{_ 'activity-checklist-completed' checklist.title cardLink}}}.
|
||||
|
||||
if($eq activityType 'checklistUncompleted')
|
||||
| {{{_ 'activity-checklist-uncompleted' checklist.title cardLink}}}.
|
||||
|
||||
if($eq activityType 'addChecklistItem')
|
||||
| {{{_ 'activity-checklist-item-added' checklist.title cardLink}}}.
|
||||
.activity-checklist(href="{{ card.absoluteUrl }}")
|
||||
+viewer
|
||||
= checklistItem.title
|
||||
if($eq activityType 'removedChecklistItem')
|
||||
| {{{_ 'activity-checklist-item-removed' checklist.title cardLink}}}.
|
||||
|
||||
if($eq activityType 'archivedCard')
|
||||
| {{{_ 'activity-archived' cardLink}}}.
|
||||
|
|
@ -89,6 +108,12 @@ template(name="boardActivities")
|
|||
if($eq activityType 'restoredCard')
|
||||
| {{{_ 'activity-sent' cardLink boardLabel}}}.
|
||||
|
||||
if($eq activityType 'addedLabel')
|
||||
| {{{_ 'activity-added-label' lastLabel cardLink}}}.
|
||||
|
||||
if($eq activityType 'removedLabel')
|
||||
| {{{_ 'activity-removed-label' lastLabel cardLink}}}.
|
||||
|
||||
if($eq activityType 'unjoinMember')
|
||||
if($eq user._id member._id)
|
||||
| {{{_ 'activity-unjoined' cardLink}}}.
|
||||
|
|
@ -119,6 +144,28 @@ template(name="cardActivities")
|
|||
| {{{_ 'activity-removed' cardLabel memberLink}}}.
|
||||
if($eq activityType 'archivedCard')
|
||||
| {{_ 'activity-archived' cardLabel}}.
|
||||
|
||||
if($eq activityType 'addedLabel')
|
||||
| {{{_ 'activity-added-label-card' lastLabel }}}.
|
||||
|
||||
if($eq activityType 'removedLabel')
|
||||
| {{{_ 'activity-removed-label-card' lastLabel }}}.
|
||||
|
||||
if($eq activityType 'removeChecklist')
|
||||
| {{{_ 'activity-checklist-removed' cardLabel}}}.
|
||||
|
||||
if($eq activityType 'checkedItem')
|
||||
| {{{_ 'activity-checked-item-card' checkItem checklist.title }}}.
|
||||
|
||||
if($eq activityType 'uncheckedItem')
|
||||
| {{{_ 'activity-unchecked-item-card' checkItem checklist.title }}}.
|
||||
|
||||
if($eq activityType 'checklistCompleted')
|
||||
| {{{_ 'activity-checklist-completed-card' checklist.title }}}.
|
||||
|
||||
if($eq activityType 'checklistUncompleted')
|
||||
| {{{_ 'activity-checklist-uncompleted-card' checklist.title }}}.
|
||||
|
||||
if($eq activityType 'restoredCard')
|
||||
| {{_ 'activity-sent' cardLabel boardLabel}}.
|
||||
if($eq activityType 'moveCard')
|
||||
|
|
@ -127,6 +174,10 @@ template(name="cardActivities")
|
|||
| {{{_ 'activity-attached' attachmentLink cardLabel}}}.
|
||||
if attachment.isImage
|
||||
img.attachment-image-preview(src=attachment.url)
|
||||
if($eq activityType 'deleteAttachment')
|
||||
| {{{_ 'activity-delete-attach' cardLabel}}}.
|
||||
if($eq activityType 'removedChecklist')
|
||||
| {{{_ 'activity-checklist-removed' cardLabel}}}.
|
||||
if($eq activityType 'addChecklist')
|
||||
| {{{_ 'activity-checklist-added' cardLabel}}}.
|
||||
.activity-checklist
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@ BlazeComponent.extendComponent({
|
|||
this.loadNextPageLocked = true;
|
||||
}
|
||||
},
|
||||
|
||||
checkItem(){
|
||||
const checkItemId = this.currentData().checklistItemId;
|
||||
const checkItem = ChecklistItems.findOne({_id:checkItemId});
|
||||
return checkItem.title;
|
||||
},
|
||||
|
||||
boardLabel() {
|
||||
return TAPi18n.__('this-board');
|
||||
|
|
@ -66,6 +72,16 @@ BlazeComponent.extendComponent({
|
|||
}, card.title));
|
||||
},
|
||||
|
||||
lastLabel(){
|
||||
const lastLabelId = this.currentData().labelId;
|
||||
const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(lastLabelId);
|
||||
if(lastLabel.name == undefined || lastLabel.name == ""){
|
||||
return lastLabel.color;
|
||||
}else{
|
||||
return lastLabel.name;
|
||||
}
|
||||
},
|
||||
|
||||
listLabel() {
|
||||
return this.currentData().list().title;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -88,6 +88,10 @@ template(name="boardHeaderBar")
|
|||
a.board-header-btn-close.js-filter-reset(title="{{_ 'filter-clear'}}")
|
||||
i.fa.fa-times-thin
|
||||
|
||||
a.board-header-btn.js-open-rules-view(title="{{_ 'rules'}}")
|
||||
i.fa.fa-magic
|
||||
span {{_ 'rules'}}
|
||||
|
||||
a.board-header-btn.js-open-search-view(title="{{_ 'search'}}")
|
||||
i.fa.fa-search
|
||||
span {{_ 'search'}}
|
||||
|
|
@ -290,6 +294,11 @@ template(name="boardChangeTitlePopup")
|
|||
textarea.js-board-desc= description
|
||||
input.primary.wide(type="submit" value="{{_ 'rename'}}")
|
||||
|
||||
template(name="boardCreateRulePopup")
|
||||
p {{_ 'close-board-pop'}}
|
||||
button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
|
||||
|
||||
|
||||
template(name="archiveBoardPopup")
|
||||
p {{_ 'close-board-pop'}}
|
||||
button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,9 @@ BlazeComponent.extendComponent({
|
|||
'click .js-open-search-view'() {
|
||||
Sidebar.setView('search');
|
||||
},
|
||||
'click .js-open-rules-view'() {
|
||||
Modal.openWide('rulesMain');
|
||||
},
|
||||
'click .js-multiselection-activate'() {
|
||||
const currentCard = Session.get('currentCard');
|
||||
MultiSelection.activate();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
@import 'nib'
|
||||
|
||||
select,
|
||||
textarea,
|
||||
input:not([type=file]),
|
||||
button
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ BlazeComponent.extendComponent({
|
|||
evt.preventDefault();
|
||||
Utils.goBoardId(Session.get('currentBoard'));
|
||||
}
|
||||
console.log(evt)
|
||||
|
||||
},
|
||||
|
||||
cardIsSelected() {
|
||||
|
|
|
|||
|
|
@ -36,11 +36,18 @@ template(name="defaultLayout")
|
|||
if (Modal.isOpen)
|
||||
#modal
|
||||
.overlay
|
||||
.modal-content
|
||||
a.modal-close-btn.js-close-modal
|
||||
i.fa.fa-times-thin
|
||||
+Template.dynamic(template=Modal.getHeaderName)
|
||||
+Template.dynamic(template=Modal.getTemplateName)
|
||||
if (Modal.isWide)
|
||||
.modal-content-wide.modal-container
|
||||
a.modal-close-btn.js-close-modal
|
||||
i.fa.fa-times-thin
|
||||
+Template.dynamic(template=Modal.getHeaderName)
|
||||
+Template.dynamic(template=Modal.getTemplateName)
|
||||
else
|
||||
.modal-content.modal-container
|
||||
a.modal-close-btn.js-close-modal
|
||||
i.fa.fa-times-thin
|
||||
+Template.dynamic(template=Modal.getHeaderName)
|
||||
+Template.dynamic(template=Modal.getTemplateName)
|
||||
|
||||
template(name="notFound")
|
||||
+message(label='page-not-found')
|
||||
|
|
|
|||
|
|
@ -61,6 +61,23 @@ body
|
|||
display: block
|
||||
float: right
|
||||
font-size: 24px
|
||||
|
||||
.modal-content-wide
|
||||
width: 800px
|
||||
min-height: 0px
|
||||
margin: 42px auto
|
||||
padding: 12px
|
||||
border-radius: 4px
|
||||
background: darken(white, 13%)
|
||||
z-index: 110
|
||||
|
||||
h2
|
||||
margin-bottom: 25px
|
||||
|
||||
.modal-close-btn
|
||||
display: block
|
||||
float: right
|
||||
font-size: 24px
|
||||
|
||||
h1
|
||||
font-size: 22px
|
||||
|
|
|
|||
BIN
client/components/rules/.DS_Store
vendored
Normal file
BIN
client/components/rules/.DS_Store
vendored
Normal file
Binary file not shown.
46
client/components/rules/actions/boardActions.jade
Normal file
46
client/components/rules/actions/boardActions.jade
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
template(name="boardActions")
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-move-card-to'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="move-gen-action")
|
||||
option(value="top") {{{_'r-top-of'}}}
|
||||
option(value="bottom") {{{_'r-bottom-of'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-its-list'}}}
|
||||
div.trigger-button.js-add-gen-move-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-move-card-to'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="move-spec-action")
|
||||
option(value="top") {{{_'r-top-of'}}}
|
||||
option(value="bottom") {{{_'r-bottom-of'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-list'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="listName",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-button.js-add-spec-move-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-dropdown
|
||||
select(id="arch-action")
|
||||
option(value="archive") {{{_'r-archive'}}}
|
||||
option(value="unarchive") {{{_'r-unarchive'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-card'}}}
|
||||
div.trigger-button.js-add-arch-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
121
client/components/rules/actions/boardActions.js
Normal file
121
client/components/rules/actions/boardActions.js
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'click .js-add-spec-move-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-spec-action').value;
|
||||
const listTitle = this.find('#listName').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "top") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToTop",
|
||||
"listTitle": listTitle,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "bottom") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToBottom",
|
||||
"listTitle": listTitle,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-move-action' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-gen-action').value;
|
||||
if (actionSelected == "top") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToTop",
|
||||
"listTitle": "*",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "bottom") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "moveCardToBottom",
|
||||
"listTitle": "*",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-arch-action' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#arch-action').value;
|
||||
if (actionSelected == "archive") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "archive",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unarchive") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "unarchive",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('boardActions');
|
||||
43
client/components/rules/actions/cardActions.jade
Normal file
43
client/components/rules/actions/cardActions.jade
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
template(name="cardActions")
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-dropdown
|
||||
select(id="label-action")
|
||||
option(value="add") {{{_'r-add'}}}
|
||||
option(value="remove") {{{_'r-remove'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-label'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="label-id")
|
||||
each labels
|
||||
option(value="#{_id}")
|
||||
= name
|
||||
div.trigger-button.js-add-label-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-dropdown
|
||||
select(id="member-action")
|
||||
option(value="add") {{{_'r-add'}}}
|
||||
option(value="remove") {{{_'r-remove'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-member'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="member-name",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-button.js-add-member-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-remove-all'}}}
|
||||
div.trigger-button.js-add-removeall-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
119
client/components/rules/actions/cardActions.js
Normal file
119
client/components/rules/actions/cardActions.js
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
},
|
||||
|
||||
labels() {
|
||||
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
||||
for (let i = 0; i < labels.length; i++) {
|
||||
if (labels[i].name == "" || labels[i].name == undefined) {
|
||||
labels[i].name = labels[i].color.toUpperCase();
|
||||
}
|
||||
}
|
||||
console.log(labels);
|
||||
return labels;
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'click .js-add-label-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#label-action').value;
|
||||
const labelId = this.find('#label-id').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "add") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "addLabel",
|
||||
"labelId": labelId,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "remove") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeLabel",
|
||||
"labelId": labelId,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-member-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#member-action').value;
|
||||
const memberName = this.find('#member-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "add") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "addMember",
|
||||
"memberName": memberName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "remove") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeMember",
|
||||
"memberName": memberName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-removeall-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeMember",
|
||||
"memberName": "*",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('cardActions');
|
||||
51
client/components/rules/actions/checklistActions.jade
Normal file
51
client/components/rules/actions/checklistActions.jade
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
template(name="checklistActions")
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-dropdown
|
||||
select(id="check-action")
|
||||
option(value="add") {{{_'r-add'}}}
|
||||
option(value="remove") {{{_'r-remove'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-checklist'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="checklist-name",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-button.js-add-checklist-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-dropdown
|
||||
select(id="checkall-action")
|
||||
option(value="check") {{{_'r-check-all'}}}
|
||||
option(value="uncheck") {{{_'r-uncheck-all'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-items-check'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="checklist-name2",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-button.js-add-checkall-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-dropdown
|
||||
select(id="check-item-action")
|
||||
option(value="check") {{{_'r-check'}}}
|
||||
option(value="uncheck") {{{_'r-uncheck'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-item'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="checkitem-name",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-text
|
||||
| {{{_'r-of-checklist'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="checklist-name3",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-button.js-add-check-item-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
128
client/components/rules/actions/checklistActions.js
Normal file
128
client/components/rules/actions/checklistActions.js
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-add-checklist-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#check-action').value;
|
||||
const checklistName = this.find('#checklist-name').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "add") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "addChecklist",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "remove") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "removeChecklist",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-checkall-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#checkall-action').value;
|
||||
const checklistName = this.find('#checklist-name2').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "check") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "checkAll",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "uncheck") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "uncheckAll",
|
||||
"checklistName": checklistName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-check-item-action' (event) {
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const checkItemName = this.find("#checkitem-name");
|
||||
const checklistName = this.find("#checklist-name3");
|
||||
const actionSelected = this.find('#check-item-action').value;
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
if (actionSelected == "check") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "checkItem",
|
||||
"checklistName": checklistName,
|
||||
"checkItemName": checkItemName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
if (actionSelected == "uncheck") {
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "uncheckItem",
|
||||
"checklistName": checklistName,
|
||||
"checkItemName": checkItemName,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('checklistActions');
|
||||
11
client/components/rules/actions/mailActions.jade
Normal file
11
client/components/rules/actions/mailActions.jade
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
template(name="mailActions")
|
||||
div.trigger-item.trigger-item-mail
|
||||
div.trigger-content.trigger-content-mail
|
||||
div.trigger-text.trigger-text-email
|
||||
| {{{_'r-send-email'}}}
|
||||
div.trigger-dropdown-mail
|
||||
input(id="email-to",type=text,placeholder="{{{_'r-to'}}}")
|
||||
input(id="email-subject",type=text,placeholder="{{{_'r-subject'}}}")
|
||||
textarea(id="email-msg")
|
||||
div.trigger-button.trigger-button-email.js-mail-action.js-goto-rules
|
||||
i.fa.fa-plus
|
||||
35
client/components/rules/actions/mailActions.js
Normal file
35
client/components/rules/actions/mailActions.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'click .js-mail-action' (event) {
|
||||
const emailTo = this.find('#email-to').value;
|
||||
const emailSubject = this.find('#email-subject').value;
|
||||
const emailMsg = this.find('#email-msg').value;
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const triggerId = Triggers.insert(trigger);
|
||||
const boardId = Session.get('currentBoard');
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const actionId = Actions.insert({
|
||||
actionType: "sendEmail",
|
||||
"emailTo": emailTo,
|
||||
"emailSubject": emailSubject,
|
||||
"emailMsg": emailMsg,
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
Rules.insert({
|
||||
title: ruleName,
|
||||
triggerId: triggerId,
|
||||
actionId: actionId,
|
||||
"boardId": boardId
|
||||
});
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('mailActions');
|
||||
18
client/components/rules/ruleDetails.jade
Normal file
18
client/components/rules/ruleDetails.jade
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
template(name="ruleDetails")
|
||||
.rules
|
||||
h2
|
||||
i.fa.fa-magic
|
||||
| {{{_ 'r-rule-details' }}}
|
||||
.triggers-content
|
||||
.triggers-body
|
||||
.triggers-main-body
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
= trigger
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
= action
|
||||
|
||||
|
||||
36
client/components/rules/ruleDetails.js
Normal file
36
client/components/rules/ruleDetails.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
this.subscribe('allTriggers');
|
||||
this.subscribe('allActions');
|
||||
|
||||
},
|
||||
|
||||
trigger() {
|
||||
const ruleId = this.data().ruleId;
|
||||
const rule = Rules.findOne({
|
||||
_id: ruleId.get()
|
||||
});
|
||||
const trigger = Triggers.findOne({
|
||||
_id: rule.triggerId
|
||||
});
|
||||
console.log(trigger);
|
||||
return trigger.description();
|
||||
},
|
||||
action() {
|
||||
const ruleId = this.data().ruleId;
|
||||
const rule = Rules.findOne({
|
||||
_id: ruleId.get()
|
||||
});
|
||||
const action = Actions.findOne({
|
||||
_id: rule.actionId
|
||||
});
|
||||
console.log(action);
|
||||
return action.description();
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{}];
|
||||
},
|
||||
|
||||
}).register('ruleDetails');
|
||||
156
client/components/rules/rules.styl
Normal file
156
client/components/rules/rules.styl
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
.rules-list
|
||||
overflow:hidden
|
||||
overflow-y:scroll
|
||||
max-height: 400px
|
||||
.rules-lists-item
|
||||
display: block
|
||||
position: relative
|
||||
overflow: auto
|
||||
p
|
||||
display: inline-block
|
||||
float: left
|
||||
margin: revert
|
||||
|
||||
.rules-btns-group
|
||||
position: absolute
|
||||
right: 0
|
||||
top: 50%
|
||||
transform: translateY(-50%)
|
||||
button
|
||||
margin: auto
|
||||
.rules-add
|
||||
display: block
|
||||
overflow: auto
|
||||
margin-top: 15px
|
||||
margin-bottom: 5px
|
||||
input
|
||||
display: inline-block
|
||||
float: right
|
||||
margin: auto
|
||||
margin-right: 10px
|
||||
button
|
||||
display: inline-block
|
||||
float: right
|
||||
margin: auto
|
||||
.flex
|
||||
display: -webkit-box
|
||||
display: -moz-box
|
||||
display: -webkit-flex
|
||||
display: -moz-flex
|
||||
display: -ms-flexbox
|
||||
display: flex
|
||||
|
||||
|
||||
|
||||
.triggers-content
|
||||
color: #727479
|
||||
background: #dedede
|
||||
.triggers-body
|
||||
display flex
|
||||
padding-top 15px
|
||||
height 100%
|
||||
|
||||
.triggers-side-menu
|
||||
background-color: #f7f7f7
|
||||
border: 1px solid #f0f0f0
|
||||
border-radius: 4px
|
||||
height: intrinsic
|
||||
box-shadow: inset -1px -1px 3px rgba(0,0,0,.05)
|
||||
|
||||
ul
|
||||
|
||||
li
|
||||
margin: 0.1rem 0.2rem;
|
||||
width:50px
|
||||
height:50px
|
||||
text-align:center
|
||||
font-size: 25px
|
||||
position: relative
|
||||
|
||||
i
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
box-shadow: none
|
||||
transform: translate(-50%,-50%);
|
||||
|
||||
|
||||
&.active
|
||||
background #fff
|
||||
box-shadow 0 1px 2px rgba(0,0,0,0.15);
|
||||
|
||||
&:hover
|
||||
background #fff
|
||||
box-shadow 0 1px 2px rgba(0,0,0,0.15);
|
||||
a
|
||||
@extends .flex
|
||||
padding: 1rem 0 1rem 1rem
|
||||
width: 100% - 5rem
|
||||
|
||||
|
||||
span
|
||||
font-size: 13px
|
||||
.triggers-main-body
|
||||
padding: 0.1em 1em
|
||||
width:100%
|
||||
.trigger-item
|
||||
overflow:auto
|
||||
padding:10px
|
||||
height:40px
|
||||
margin-bottom:5px
|
||||
border-radius: 3px
|
||||
position: relative
|
||||
background-color: white
|
||||
.trigger-content
|
||||
position:absolute
|
||||
top:50%
|
||||
transform: translateY(-50%)
|
||||
left:10px
|
||||
.trigger-text
|
||||
font-size: 16px
|
||||
display:inline-block
|
||||
.trigger-text.trigger-text-email
|
||||
margin-left: 5px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
.trigger-dropdown
|
||||
display:inline-block
|
||||
select
|
||||
width:100px
|
||||
height:30px
|
||||
margin:0px
|
||||
margin-left:5px
|
||||
input
|
||||
display: inline-block
|
||||
width: 80px;
|
||||
margin: 0;
|
||||
.trigger-content-mail
|
||||
left:20px
|
||||
right:100px
|
||||
.trigger-button
|
||||
position:absolute
|
||||
top:50%
|
||||
transform: translateY(-50%)
|
||||
width:30px
|
||||
height:30px
|
||||
border: 1px solid #eee
|
||||
border-radius: 4px
|
||||
box-shadow: inset -1px -1px 3px rgba(0,0,0,.05)
|
||||
text-align:center
|
||||
font-size: 20px
|
||||
right:10px
|
||||
i
|
||||
position: absolute
|
||||
top: 50%
|
||||
left: 50%
|
||||
box-shadow: none
|
||||
transform: translate(-50%,-50%)
|
||||
&:hover, &.is-active
|
||||
box-shadow: 0 0 0 2px darken(white, 60%) inset
|
||||
.trigger-button.trigger-button-email
|
||||
top:30px
|
||||
.trigger-item.trigger-item-mail
|
||||
height:300px
|
||||
|
||||
|
||||
|
||||
25
client/components/rules/rulesActions.jade
Normal file
25
client/components/rules/rulesActions.jade
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
template(name="rulesActions")
|
||||
h2
|
||||
i.fa.fa-magic
|
||||
| {{{_ 'r-rule' }}} "#{data.ruleName.get}" - {{{_ 'r-add-action'}}}
|
||||
.triggers-content
|
||||
.triggers-body
|
||||
.triggers-side-menu
|
||||
ul
|
||||
li.active.js-set-board-actions
|
||||
i.fa.fa-columns
|
||||
li.js-set-card-actions
|
||||
i.fa.fa-sticky-note
|
||||
li.js-set-checklist-actions
|
||||
i.fa.fa-check
|
||||
li.js-set-mail-actions
|
||||
i.fa.fa-at
|
||||
.triggers-main-body
|
||||
if ($eq currentActions.get 'board')
|
||||
+boardActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
else if ($eq currentActions.get 'card')
|
||||
+cardActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
else if ($eq currentActions.get 'checklist')
|
||||
+checklistActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
else if ($eq currentActions.get 'mail')
|
||||
+mailActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
58
client/components/rules/rulesActions.js
Normal file
58
client/components/rules/rulesActions.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.currentActions = new ReactiveVar("board");
|
||||
},
|
||||
|
||||
setBoardActions() {
|
||||
this.currentActions.set("board");
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
$('.js-set-board-actions').addClass('active');
|
||||
$('.js-set-checklist-actions').removeClass('active');
|
||||
$('.js-set-mail-actions').removeClass('active');
|
||||
},
|
||||
setCardActions() {
|
||||
this.currentActions.set("card");
|
||||
$('.js-set-card-actions').addClass('active');
|
||||
$('.js-set-board-actions').removeClass('active');
|
||||
$('.js-set-checklist-actions').removeClass('active');
|
||||
$('.js-set-mail-actions').removeClass('active');
|
||||
},
|
||||
setChecklistActions() {
|
||||
this.currentActions.set("checklist");
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
$('.js-set-board-actions').removeClass('active');
|
||||
$('.js-set-checklist-actions').addClass('active');
|
||||
$('.js-set-mail-actions').removeClass('active');
|
||||
},
|
||||
setMailActions() {
|
||||
this.currentActions.set("mail");
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
$('.js-set-board-actions').removeClass('active');
|
||||
$('.js-set-checklist-actions').removeClass('active');
|
||||
$('.js-set-mail-actions').addClass('active');
|
||||
},
|
||||
|
||||
rules() {
|
||||
return Rules.find({});
|
||||
},
|
||||
|
||||
name() {
|
||||
console.log(this.data());
|
||||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-set-board-actions' (event) {
|
||||
this.setBoardActions();
|
||||
},
|
||||
'click .js-set-card-actions' (event) {
|
||||
this.setCardActions();
|
||||
},
|
||||
'click .js-set-mail-actions' (event) {
|
||||
this.setMailActions();
|
||||
},
|
||||
'click .js-set-checklist-actions' (event) {
|
||||
this.setChecklistActions();
|
||||
},
|
||||
}];
|
||||
},
|
||||
}).register('rulesActions');
|
||||
27
client/components/rules/rulesList.jade
Normal file
27
client/components/rules/rulesList.jade
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
template(name="rulesList")
|
||||
.rules
|
||||
h2
|
||||
i.fa.fa-magic
|
||||
| {{{_ 'r-board-rules' }}}
|
||||
|
||||
ul.rules-list
|
||||
each rules
|
||||
li.rules-lists-item
|
||||
p
|
||||
= title
|
||||
div.rules-btns-group
|
||||
button.js-goto-details
|
||||
i.fa.fa-eye
|
||||
| {{{_ 'r-view-rule'}}}
|
||||
if currentUser.isAdmin
|
||||
button.js-delete-rule
|
||||
i.fa.fa-trash-o
|
||||
| {{{_ 'r-delete-rule'}}}
|
||||
else
|
||||
li.no-items-message {{{_ 'r-no-rules' }}}
|
||||
if currentUser.isAdmin
|
||||
div.rules-add
|
||||
button.js-goto-trigger
|
||||
i.fa.fa-plus
|
||||
| {{{_ 'r-add-rule'}}}
|
||||
input(type=text,placeholder="{{{_ 'r-new-rule-name' }}}",id="ruleTitle")
|
||||
15
client/components/rules/rulesList.js
Normal file
15
client/components/rules/rulesList.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
},
|
||||
|
||||
rules() {
|
||||
const boardId = Session.get('currentBoard');
|
||||
return Rules.find({
|
||||
"boardId": boardId
|
||||
});
|
||||
},
|
||||
events() {
|
||||
return [{}];
|
||||
},
|
||||
}).register('rulesList');
|
||||
9
client/components/rules/rulesMain.jade
Normal file
9
client/components/rules/rulesMain.jade
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
template(name="rulesMain")
|
||||
if($eq rulesCurrentTab.get 'rulesList')
|
||||
+rulesList
|
||||
if($eq rulesCurrentTab.get 'trigger')
|
||||
+rulesTriggers(ruleName=ruleName triggerVar=triggerVar)
|
||||
if($eq rulesCurrentTab.get 'action')
|
||||
+rulesActions(ruleName=ruleName triggerVar=triggerVar)
|
||||
if($eq rulesCurrentTab.get 'ruleDetails')
|
||||
+ruleDetails(ruleId=ruleId)
|
||||
58
client/components/rules/rulesMain.js
Normal file
58
client/components/rules/rulesMain.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.rulesCurrentTab = new ReactiveVar("rulesList")
|
||||
this.ruleName = new ReactiveVar("");
|
||||
this.triggerVar = new ReactiveVar();
|
||||
this.ruleId = new ReactiveVar();
|
||||
},
|
||||
|
||||
setTrigger() {
|
||||
this.rulesCurrentTab.set("trigger")
|
||||
},
|
||||
|
||||
setRulesList() {
|
||||
this.rulesCurrentTab.set("rulesList")
|
||||
},
|
||||
|
||||
setAction() {
|
||||
this.rulesCurrentTab.set("action")
|
||||
},
|
||||
setRuleDetails() {
|
||||
this.rulesCurrentTab.set("ruleDetails")
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'click .js-delete-rule' (event) {
|
||||
const rule = this.currentData();
|
||||
Rules.remove(rule._id);
|
||||
Actions.remove(rule.actionId);
|
||||
Triggers.remove(rule.triggerId);
|
||||
|
||||
},
|
||||
'click .js-goto-trigger' (event) {
|
||||
event.preventDefault();
|
||||
const ruleTitle = this.find('#ruleTitle').value;
|
||||
this.find('#ruleTitle').value = "";
|
||||
this.ruleName.set(ruleTitle)
|
||||
this.setTrigger();
|
||||
},
|
||||
'click .js-goto-action' (event) {
|
||||
event.preventDefault();
|
||||
this.setAction();
|
||||
},
|
||||
'click .js-goto-rules' (event) {
|
||||
event.preventDefault();
|
||||
this.setRulesList();
|
||||
},
|
||||
'click .js-goto-details' (event) {
|
||||
event.preventDefault();
|
||||
const rule = this.currentData();
|
||||
this.ruleId.set(rule._id)
|
||||
this.setRuleDetails();
|
||||
},
|
||||
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('rulesMain');
|
||||
21
client/components/rules/rulesTriggers.jade
Normal file
21
client/components/rules/rulesTriggers.jade
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
template(name="rulesTriggers")
|
||||
h2
|
||||
i.fa.fa-magic
|
||||
| {{{_ 'r-rule' }}} "#{data.ruleName.get}" - {{{_ 'r-add-trigger'}}}
|
||||
.triggers-content
|
||||
.triggers-body
|
||||
.triggers-side-menu
|
||||
ul
|
||||
li.active.js-set-board-triggers
|
||||
i.fa.fa-columns
|
||||
li.js-set-card-triggers
|
||||
i.fa.fa-sticky-note
|
||||
li.js-set-checklist-triggers
|
||||
i.fa.fa-check
|
||||
.triggers-main-body
|
||||
if showBoardTrigger.get
|
||||
+boardTriggers
|
||||
else if showCardTrigger.get
|
||||
+cardTriggers
|
||||
else if showChecklistTrigger.get
|
||||
+checklistTriggers
|
||||
53
client/components/rules/rulesTriggers.js
Normal file
53
client/components/rules/rulesTriggers.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.showBoardTrigger = new ReactiveVar(true);
|
||||
this.showCardTrigger = new ReactiveVar(false);
|
||||
this.showChecklistTrigger = new ReactiveVar(false);
|
||||
},
|
||||
|
||||
setBoardTriggers() {
|
||||
this.showBoardTrigger.set(true);
|
||||
this.showCardTrigger.set(false);
|
||||
this.showChecklistTrigger.set(false);
|
||||
$('.js-set-card-triggers').removeClass('active');
|
||||
$('.js-set-board-triggers').addClass('active');
|
||||
$('.js-set-checklist-triggers').removeClass('active');
|
||||
},
|
||||
setCardTriggers() {
|
||||
this.showBoardTrigger.set(false);
|
||||
this.showCardTrigger.set(true);
|
||||
this.showChecklistTrigger.set(false);
|
||||
$('.js-set-card-triggers').addClass('active');
|
||||
$('.js-set-board-triggers').removeClass('active');
|
||||
$('.js-set-checklist-triggers').removeClass('active');
|
||||
},
|
||||
setChecklistTriggers() {
|
||||
this.showBoardTrigger.set(false);
|
||||
this.showCardTrigger.set(false);
|
||||
this.showChecklistTrigger.set(true);
|
||||
$('.js-set-card-triggers').removeClass('active');
|
||||
$('.js-set-board-triggers').removeClass('active');
|
||||
$('.js-set-checklist-triggers').addClass('active');
|
||||
},
|
||||
|
||||
rules() {
|
||||
return Rules.find({});
|
||||
},
|
||||
|
||||
name() {
|
||||
console.log(this.data());
|
||||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-set-board-triggers' (event) {
|
||||
this.setBoardTriggers();
|
||||
},
|
||||
'click .js-set-card-triggers' (event) {
|
||||
this.setCardTriggers();
|
||||
},
|
||||
'click .js-set-checklist-triggers' (event) {
|
||||
this.setChecklistTriggers();
|
||||
},
|
||||
}];
|
||||
},
|
||||
}).register('rulesTriggers');
|
||||
61
client/components/rules/triggers/boardTriggers.jade
Normal file
61
client/components/rules/triggers/boardTriggers.jade
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
template(name="boardTriggers")
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-card-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="gen-action")
|
||||
option(value="created") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-the-board'}}}
|
||||
div.trigger-button.js-add-gen-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-card-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="create-action")
|
||||
option(value="created") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-list'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="create-list-name",type=text,placeholder="{{{_'r-list-name'}}}")
|
||||
div.trigger-button.js-add-create-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-card-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="move-action")
|
||||
option(value="moved-to") {{{_'r-moved-to'}}}
|
||||
option(value="moved-from") {{{_'r-moved-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-list'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="move-list-name",type=text,placeholder="{{{_'r-list-name'}}}")
|
||||
div.trigger-button.js-add-moved-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-card-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="arch-action")
|
||||
option(value="archived") {{{_'r-archived'}}}
|
||||
option(value="unarchived") {{{_'r-unarchived'}}}
|
||||
div.trigger-button.js-add-arch-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
103
client/components/rules/triggers/boardTriggers.js
Normal file
103
client/components/rules/triggers/boardTriggers.js
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
|
||||
},
|
||||
|
||||
events() {
|
||||
return [{
|
||||
'click .js-add-gen-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "createCard",
|
||||
"boardId": boardId,
|
||||
"listName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeCard",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
'click .js-add-create-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#create-action').value;
|
||||
const listName = this.find('#create-list-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "createCard",
|
||||
"boardId": boardId,
|
||||
"listName": listName,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeCard",
|
||||
"boardId": boardId,
|
||||
"listName": listName,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-moved-trigger' (event) {
|
||||
let datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
|
||||
const actionSelected = this.find('#move-action').value;
|
||||
const listName = this.find('#move-list-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "moved-to") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "moveCard",
|
||||
"boardId": boardId,
|
||||
"listName": listName,
|
||||
"oldListName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "moved-from") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "moveCard",
|
||||
"boardId": boardId,
|
||||
"listName": "*",
|
||||
"oldListName": listName,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-arc-trigger' (event) {
|
||||
let datas = this.data();
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
const actionSelected = this.find('#arch-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "archived") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "archivedCard",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unarchived") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "restoredCard",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('boardTriggers');
|
||||
79
client/components/rules/triggers/cardTriggers.jade
Normal file
79
client/components/rules/triggers/cardTriggers.jade
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
template(name="cardTriggers")
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-label-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="label-action")
|
||||
option(value="added") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-gen-label-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-the-label-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="spec-label")
|
||||
each labels
|
||||
option(value="#{_id}")
|
||||
= name
|
||||
div.trigger-text
|
||||
| {{{_'r-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="spec-label-action")
|
||||
option(value="added") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-spec-label-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-member'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="gen-member-action")
|
||||
option(value="added") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-gen-member-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-the-member'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="spec-member",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-text
|
||||
| {{{_'r-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="spec-member-action")
|
||||
option(value="added") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-spec-member-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-attach'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="attach-action")
|
||||
option(value="added") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-attachment-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
130
client/components/rules/triggers/cardTriggers.js
Normal file
130
client/components/rules/triggers/cardTriggers.js
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
},
|
||||
labels() {
|
||||
const labels = Boards.findOne(Session.get('currentBoard')).labels;
|
||||
console.log(labels);
|
||||
for (let i = 0; i < labels.length; i++) {
|
||||
if (labels[i].name == "" || labels[i].name == undefined) {
|
||||
labels[i].name = labels[i].color.toUpperCase();
|
||||
}
|
||||
}
|
||||
console.log(labels);
|
||||
return labels;
|
||||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-add-gen-label-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#label-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addedLabel",
|
||||
"boardId": boardId,
|
||||
"labelId": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removedLabel",
|
||||
"boardId": boardId,
|
||||
"labelId": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-label-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-label-action').value;
|
||||
const labelId = this.find('#spec-label').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addedLabel",
|
||||
"boardId": boardId,
|
||||
"labelId": labelId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removedLabel",
|
||||
"boardId": boardId,
|
||||
"labelId": labelId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-member-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-member-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "joinMember",
|
||||
"boardId": boardId,
|
||||
"memberId": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "unjoinMember",
|
||||
"boardId": boardId,
|
||||
"memberId": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-member-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-member-action').value;
|
||||
const memberId = this.find('#spec-member').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "joinMember",
|
||||
"boardId": boardId,
|
||||
"memberId": memberId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "unjoinMember",
|
||||
"boardId": boardId,
|
||||
"memberId": memberId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-attachment-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#attach-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addAttachment",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "deleteAttachment",
|
||||
"boardId": boardId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
}).register('cardTriggers');
|
||||
83
client/components/rules/triggers/checklistTriggers.jade
Normal file
83
client/components/rules/triggers/checklistTriggers.jade
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
template(name="checklistTriggers")
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-checklist'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="gen-check-action")
|
||||
option(value="created") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-gen-check-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-the-checklist'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="check-name",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-text
|
||||
| {{{_'r-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="spec-check-action")
|
||||
option(value="created") {{{_'r-added-to'}}}
|
||||
option(value="removed") {{{_'r-removed-from'}}}
|
||||
div.trigger-text
|
||||
| {{{_'r-a-card'}}}
|
||||
div.trigger-button.js-add-spec-check-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-checklist'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="gen-comp-check-action")
|
||||
option(value="completed") {{{_'r-completed'}}}
|
||||
option(value="uncompleted") {{{_'r-made-incomplete'}}}
|
||||
div.trigger-button.js-add-gen-comp-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-the-checklist'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="spec-comp-check-name",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-text
|
||||
| {{{_'r-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="spec-comp-check-action")
|
||||
option(value="completed") {{{_'r-completed'}}}
|
||||
option(value="uncompleted") {{{_'r-made-incomplete'}}}
|
||||
div.trigger-button.js-add-spec-comp-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-a-item'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="check-item-gen-action")
|
||||
option(value="checked") {{{_'r-checked'}}}
|
||||
option(value="unchecked") {{{_'r-unchecked'}}}
|
||||
div.trigger-button.js-add-gen-check-item-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
|
||||
div.trigger-item
|
||||
div.trigger-content
|
||||
div.trigger-text
|
||||
| {{{_'r-when-the-item'}}}
|
||||
div.trigger-dropdown
|
||||
input(id="check-item-name",type=text,placeholder="{{{_'r-name'}}}")
|
||||
div.trigger-text
|
||||
| {{{_'r-is'}}}
|
||||
div.trigger-dropdown
|
||||
select(id="check-item-spec-action")
|
||||
option(value="checked") {{{_'r-checked'}}}
|
||||
option(value="unchecked") {{{_'r-unchecked'}}}
|
||||
div.trigger-button.js-add-spec-check-item-trigger.js-goto-action
|
||||
i.fa.fa-plus
|
||||
146
client/components/rules/triggers/checklistTriggers.js
Normal file
146
client/components/rules/triggers/checklistTriggers.js
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-add-gen-check-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-check-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-check-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-check-action').value;
|
||||
const checklistId = this.find('#check-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "created") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "addChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "removeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-comp-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#gen-comp-check-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "completed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "completeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "uncompleted") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncompleteChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-comp-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#spec-comp-check-action').value;
|
||||
const checklistId = this.find('#spec-comp-check-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "added") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "completeChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "removed") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncompleteChecklist",
|
||||
"boardId": boardId,
|
||||
"checklistName": checklistId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-gen-check-item-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#check-item-gen-action').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "checked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "checkedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unchecked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncheckedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": "*",
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
'click .js-add-spec-check-item-trigger' (event) {
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
let datas = this.data();
|
||||
const actionSelected = this.find('#check-item-spec-action').value;
|
||||
const checklistItemId = this.find('#check-item-name').value;
|
||||
const boardId = Session.get('currentBoard')
|
||||
if (actionSelected == "checked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "checkedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": checklistItemId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
if (actionSelected == "unchecked") {
|
||||
datas.triggerVar.set({
|
||||
activityType: "uncheckedItem",
|
||||
"boardId": boardId,
|
||||
"checklistItemName": checklistItemId,
|
||||
"desc": desc
|
||||
});
|
||||
}
|
||||
},
|
||||
}];
|
||||
},
|
||||
|
||||
}).register('checklistTriggers');
|
||||
Loading…
Add table
Add a link
Reference in a new issue