summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-22 10:39:30 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-22 11:10:29 +0100
commitf4f0f489ebf9e23dc8150d5a94239484256b0beb (patch)
treed2ff8a4493e24b76331dd2f83af57b4413e70df3 /client/components
parent3368ebf067779d1f306a2447e2357e34213f0126 (diff)
downloadwekan-f4f0f489ebf9e23dc8150d5a94239484256b0beb.tar.gz
wekan-f4f0f489ebf9e23dc8150d5a94239484256b0beb.tar.bz2
wekan-f4f0f489ebf9e23dc8150d5a94239484256b0beb.zip
add action: set card color
Diffstat (limited to 'client/components')
-rw-r--r--client/components/rules/actions/cardActions.jade39
-rw-r--r--client/components/rules/actions/cardActions.js20
2 files changed, 53 insertions, 6 deletions
diff --git a/client/components/rules/actions/cardActions.jade b/client/components/rules/actions/cardActions.jade
index 74ad9ab5..dd92d8fe 100644
--- a/client/components/rules/actions/cardActions.jade
+++ b/client/components/rules/actions/cardActions.jade
@@ -35,9 +35,36 @@ template(name="cardActions")
div.trigger-button.js-add-removeall-action.js-goto-rules
i.fa.fa-plus
-
-
-
-
-
-
+ div.trigger-item
+ div.trigger-content
+ div.trigger-text
+ | {{{_'r-set-color'}}}
+ div.trigger-dropdown
+ select(id="color-action")
+ option(value="white") {{{_'color-white'}}}
+ option(value="green") {{{_'color-green'}}}
+ option(value="yellow") {{{_'color-yellow'}}}
+ option(value="orange") {{{_'color-orange'}}}
+ option(value="red") {{{_'color-red'}}}
+ option(value="purple") {{{_'color-purple'}}}
+ option(value="blue") {{{_'color-blue'}}}
+ option(value="sky") {{{_'color-sky'}}}
+ option(value="lime") {{{_'color-lime'}}}
+ option(value="pink") {{{_'color-pink'}}}
+ option(value="black") {{{_'color-black'}}}
+ option(value="silver") {{{_'color-silver'}}}
+ option(value="peachpuff") {{{_'color-peachpuff'}}}
+ option(value="crimson") {{{_'color-crimson'}}}
+ option(value="plum") {{{_'color-plum'}}}
+ option(value="darkgreen") {{{_'color-darkgreen'}}}
+ option(value="slateblue") {{{_'color-slateblue'}}}
+ option(value="magenta") {{{_'color-magenta'}}}
+ option(value="gold") {{{_'color-gold'}}}
+ option(value="navy") {{{_'color-navy'}}}
+ option(value="gray") {{{_'color-gray'}}}
+ option(value="saddlebrown") {{{_'color-saddlebrown'}}}
+ option(value="paleturquoise") {{{_'color-paleturquoise'}}}
+ option(value="mistyrose") {{{_'color-mistyrose'}}}
+ option(value="indigo") {{{_'color-indigo'}}}
+ div.trigger-button.js-set-color-action.js-goto-rules
+ i.fa.fa-plus
diff --git a/client/components/rules/actions/cardActions.js b/client/components/rules/actions/cardActions.js
index b04440bd..b66556b4 100644
--- a/client/components/rules/actions/cardActions.js
+++ b/client/components/rules/actions/cardActions.js
@@ -112,6 +112,26 @@ BlazeComponent.extendComponent({
boardId,
});
},
+ 'click .js-set-color-action' (event) {
+ const ruleName = this.data().ruleName.get();
+ const trigger = this.data().triggerVar.get();
+ const selectedColor = this.find('#color-action').value;
+ const boardId = Session.get('currentBoard');
+ const desc = Utils.getTriggerActionDesc(event, this);
+ const triggerId = Triggers.insert(trigger);
+ const actionId = Actions.insert({
+ actionType: 'setColor',
+ selectedColor,
+ boardId,
+ desc,
+ });
+ Rules.insert({
+ title: ruleName,
+ triggerId,
+ actionId,
+ boardId,
+ });
+ },
}];
},