summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-10-08 00:26:25 +0300
committerLauri Ojansivu <x@xet7.org>2018-10-08 00:26:25 +0300
commit9cd980d9e6283ed15c24a01b4f7ed2bc06d6f54f (patch)
treed5a87bc2ceb3733cadcf05712fc123495acb6886 /client/components
parent4c6c6ffb164027c5a5f29d213be9858c23efd3bf (diff)
parentd516ecb20ceaa21d5687ae093317473774843510 (diff)
downloadwekan-9cd980d9e6283ed15c24a01b4f7ed2bc06d6f54f.tar.gz
wekan-9cd980d9e6283ed15c24a01b4f7ed2bc06d6f54f.tar.bz2
wekan-9cd980d9e6283ed15c24a01b4f7ed2bc06d6f54f.zip
Merge branch 'Angtrim-feature-rules' into edge
Closes #1912
Diffstat (limited to 'client/components')
-rw-r--r--client/components/rules/ruleDetails.jade4
-rw-r--r--client/components/rules/ruleDetails.js8
-rw-r--r--client/components/rules/rules.styl11
-rw-r--r--client/components/rules/rulesActions.jade6
-rw-r--r--client/components/rules/rulesActions.js8
-rw-r--r--client/components/rules/rulesMain.js19
-rw-r--r--client/components/rules/rulesTriggers.jade6
-rw-r--r--client/components/rules/rulesTriggers.js6
8 files changed, 53 insertions, 15 deletions
diff --git a/client/components/rules/ruleDetails.jade b/client/components/rules/ruleDetails.jade
index b9a1351c..1f351357 100644
--- a/client/components/rules/ruleDetails.jade
+++ b/client/components/rules/ruleDetails.jade
@@ -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'}}}
\ No newline at end of file
diff --git a/client/components/rules/ruleDetails.js b/client/components/rules/ruleDetails.js
index 386b2b48..17c86dc3 100644
--- a/client/components/rules/ruleDetails.js
+++ b/client/components/rules/ruleDetails.js
@@ -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() {
diff --git a/client/components/rules/rules.styl b/client/components/rules/rules.styl
index 45ce4003..b52f84a7 100644
--- a/client/components/rules/rules.styl
+++ b/client/components/rules/rules.styl
@@ -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
diff --git a/client/components/rules/rulesActions.jade b/client/components/rules/rulesActions.jade
index 8dfceeeb..4bcff769 100644
--- a/client/components/rules/rulesActions.jade
+++ b/client/components/rules/rulesActions.jade
@@ -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) \ No newline at end of file
+ +mailActions(ruleName=data.ruleName triggerVar=data.triggerVar)
+ div.rules-back
+ button.js-goback
+ i.fa.fa-chevron-left
+ | {{{_ 'r-back'}}} \ No newline at end of file
diff --git a/client/components/rules/rulesActions.js b/client/components/rules/rulesActions.js
index ecba857b..64a5c70e 100644
--- a/client/components/rules/rulesActions.js
+++ b/client/components/rules/rulesActions.js
@@ -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();
},
}];
diff --git a/client/components/rules/rulesMain.js b/client/components/rules/rulesMain.js
index 65cc3d98..3e871c69 100644
--- a/client/components/rules/rulesMain.js
+++ b/client/components/rules/rulesMain.js
@@ -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();
diff --git a/client/components/rules/rulesTriggers.jade b/client/components/rules/rulesTriggers.jade
index 0ef5edfa..01c0cad5 100644
--- a/client/components/rules/rulesTriggers.jade
+++ b/client/components/rules/rulesTriggers.jade
@@ -18,4 +18,8 @@ template(name="rulesTriggers")
else if showCardTrigger.get
+cardTriggers
else if showChecklistTrigger.get
- +checklistTriggers \ No newline at end of file
+ +checklistTriggers
+ div.rules-back
+ button.js-goback
+ i.fa.fa-chevron-left
+ | {{{_ 'r-back'}}} \ No newline at end of file
diff --git a/client/components/rules/rulesTriggers.js b/client/components/rules/rulesTriggers.js
index 506e63b2..e3c16221 100644
--- a/client/components/rules/rulesTriggers.js
+++ b/client/components/rules/rulesTriggers.js
@@ -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();
},
}];