mirror of
https://github.com/wekan/wekan.git
synced 2026-02-04 15:41:52 +01:00
Merge branch 'feature-rules' of https://github.com/Angtrim/wekan into Angtrim-feature-rules
This commit is contained in:
commit
d91e0358f3
12 changed files with 76 additions and 30 deletions
|
|
@ -14,5 +14,9 @@ template(name="ruleDetails")
|
|||
div.trigger-content
|
||||
div.trigger-text
|
||||
= action
|
||||
div.rules-back
|
||||
button.js-goback
|
||||
i.fa.fa-chevron-left
|
||||
| {{{_ 'r-back'}}}
|
||||
|
||||
|
||||
|
|
@ -14,7 +14,9 @@ BlazeComponent.extendComponent({
|
|||
const trigger = Triggers.findOne({
|
||||
_id: rule.triggerId,
|
||||
});
|
||||
return trigger.description();
|
||||
const desc = trigger.description();
|
||||
const upperdesc = desc.charAt(0).toUpperCase() + desc.substr(1);
|
||||
return upperdesc;
|
||||
},
|
||||
action() {
|
||||
const ruleId = this.data().ruleId;
|
||||
|
|
@ -24,7 +26,9 @@ BlazeComponent.extendComponent({
|
|||
const action = Actions.findOne({
|
||||
_id: rule.actionId,
|
||||
});
|
||||
return action.description();
|
||||
const desc = action.description();
|
||||
const upperdesc = desc.charAt(0).toUpperCase() + desc.substr(1);
|
||||
return upperdesc;
|
||||
},
|
||||
|
||||
events() {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,17 @@
|
|||
display: inline-block
|
||||
float: right
|
||||
margin: auto
|
||||
.rules-back
|
||||
display: block
|
||||
overflow: auto
|
||||
margin-top: 15px
|
||||
margin-bottom: 5px
|
||||
button
|
||||
display: inline-block
|
||||
float: right
|
||||
margin: auto
|
||||
margin-right:14px
|
||||
|
||||
.flex
|
||||
display: -webkit-box
|
||||
display: -moz-box
|
||||
|
|
|
|||
|
|
@ -22,4 +22,8 @@ template(name="rulesActions")
|
|||
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)
|
||||
+mailActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
div.rules-back
|
||||
button.js-goback
|
||||
i.fa.fa-chevron-left
|
||||
| {{{_ 'r-back'}}}
|
||||
|
|
@ -41,16 +41,16 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-set-board-actions' (event) {
|
||||
'click .js-set-board-actions'(){
|
||||
this.setBoardActions();
|
||||
},
|
||||
'click .js-set-card-actions' (event) {
|
||||
'click .js-set-card-actions'() {
|
||||
this.setCardActions();
|
||||
},
|
||||
'click .js-set-mail-actions' (event) {
|
||||
'click .js-set-mail-actions'() {
|
||||
this.setMailActions();
|
||||
},
|
||||
'click .js-set-checklist-actions' (event) {
|
||||
'click .js-set-checklist-actions'() {
|
||||
this.setChecklistActions();
|
||||
},
|
||||
}];
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
events() {
|
||||
return [{
|
||||
'click .js-delete-rule' (event) {
|
||||
'click .js-delete-rule' () {
|
||||
const rule = this.currentData();
|
||||
Rules.remove(rule._id);
|
||||
Actions.remove(rule.actionId);
|
||||
|
|
@ -34,9 +34,11 @@ BlazeComponent.extendComponent({
|
|||
'click .js-goto-trigger' (event) {
|
||||
event.preventDefault();
|
||||
const ruleTitle = this.find('#ruleTitle').value;
|
||||
this.find('#ruleTitle').value = '';
|
||||
this.ruleName.set(ruleTitle);
|
||||
this.setTrigger();
|
||||
if(ruleTitle != undefined && ruleTitle != ''){
|
||||
this.find('#ruleTitle').value = '';
|
||||
this.ruleName.set(ruleTitle);
|
||||
this.setTrigger();
|
||||
}
|
||||
},
|
||||
'click .js-goto-action' (event) {
|
||||
event.preventDefault();
|
||||
|
|
@ -46,6 +48,15 @@ BlazeComponent.extendComponent({
|
|||
event.preventDefault();
|
||||
this.setRulesList();
|
||||
},
|
||||
'click .js-goback' (event) {
|
||||
event.preventDefault();
|
||||
if(this.rulesCurrentTab.get() === 'trigger' || this.rulesCurrentTab.get() === 'ruleDetails' ){
|
||||
this.setRulesList();
|
||||
}
|
||||
if(this.rulesCurrentTab.get() === 'action'){
|
||||
this.setTrigger();
|
||||
}
|
||||
},
|
||||
'click .js-goto-details' (event) {
|
||||
event.preventDefault();
|
||||
const rule = this.currentData();
|
||||
|
|
|
|||
|
|
@ -18,4 +18,8 @@ template(name="rulesTriggers")
|
|||
else if showCardTrigger.get
|
||||
+cardTriggers
|
||||
else if showChecklistTrigger.get
|
||||
+checklistTriggers
|
||||
+checklistTriggers
|
||||
div.rules-back
|
||||
button.js-goback
|
||||
i.fa.fa-chevron-left
|
||||
| {{{_ 'r-back'}}}
|
||||
|
|
@ -39,13 +39,13 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
events() {
|
||||
return [{
|
||||
'click .js-set-board-triggers' (event) {
|
||||
'click .js-set-board-triggers' () {
|
||||
this.setBoardTriggers();
|
||||
},
|
||||
'click .js-set-card-triggers' (event) {
|
||||
'click .js-set-card-triggers' () {
|
||||
this.setCardTriggers();
|
||||
},
|
||||
'click .js-set-checklist-triggers' (event) {
|
||||
'click .js-set-checklist-triggers' () {
|
||||
this.setChecklistTriggers();
|
||||
},
|
||||
}];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue