mirror of
https://github.com/wekan/wekan.git
synced 2025-12-31 14:48:48 +01:00
fix(jade): simplify rules headers and conditions; add helpers to expose ruleName safely
This commit is contained in:
parent
4408eae158
commit
1808ea7384
4 changed files with 24 additions and 10 deletions
|
|
@ -1,9 +1,7 @@
|
|||
template(name="rulesActions")
|
||||
h2
|
||||
| ✨
|
||||
| {{_ 'r-rule' }} "
|
||||
= ruleName.get()
|
||||
| " - {{_ 'r-add-action'}}
|
||||
| {{_ 'r-rule' }} "{{ruleNameStr}}" - {{_ 'r-add-action'}}
|
||||
.triggers-content
|
||||
.triggers-body
|
||||
.triggers-side-menu
|
||||
|
|
@ -17,13 +15,13 @@ template(name="rulesActions")
|
|||
li.js-set-mail-actions
|
||||
| @
|
||||
.triggers-main-body
|
||||
if ($eq currentActions.get 'board')
|
||||
if $eq currentActions.get 'board'
|
||||
+boardActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
else if ($eq currentActions.get 'card')
|
||||
else if $eq currentActions.get 'card'
|
||||
+cardActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
else if ($eq currentActions.get 'checklist')
|
||||
else if $eq currentActions.get 'checklist'
|
||||
+checklistActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
else if ($eq currentActions.get 'mail')
|
||||
else if $eq currentActions.get 'mail'
|
||||
+mailActions(ruleName=data.ruleName triggerVar=data.triggerVar)
|
||||
div.rules-back
|
||||
button.js-goback
|
||||
|
|
|
|||
|
|
@ -5,6 +5,15 @@ BlazeComponent.extendComponent({
|
|||
this.currentActions = new ReactiveVar('board');
|
||||
},
|
||||
|
||||
ruleNameStr() {
|
||||
const rn = this.data() && this.data().ruleName;
|
||||
try {
|
||||
return rn && typeof rn.get === 'function' ? rn.get() : '';
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
setBoardActions() {
|
||||
this.currentActions.set('board');
|
||||
$('.js-set-card-actions').removeClass('active');
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
template(name="rulesTriggers")
|
||||
h2
|
||||
| ✨
|
||||
| {{_ 'r-rule' }} "
|
||||
= ruleName.get()
|
||||
| " - {{_ 'r-add-trigger'}}
|
||||
| {{_ 'r-rule' }} "{{ruleNameStr}}" - {{_ 'r-add-trigger'}}
|
||||
.triggers-content
|
||||
.triggers-body
|
||||
.triggers-side-menu
|
||||
|
|
|
|||
|
|
@ -7,6 +7,15 @@ BlazeComponent.extendComponent({
|
|||
this.showChecklistTrigger = new ReactiveVar(false);
|
||||
},
|
||||
|
||||
ruleNameStr() {
|
||||
const rn = this.data() && this.data().ruleName;
|
||||
try {
|
||||
return rn && typeof rn.get === 'function' ? rn.get() : '';
|
||||
} catch (_) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
setBoardTriggers() {
|
||||
this.showBoardTrigger.set(true);
|
||||
this.showCardTrigger.set(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue