summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/rules/actions/cardActions.jade39
-rw-r--r--client/components/rules/actions/cardActions.js20
-rw-r--r--i18n/en.i18n.json1
-rw-r--r--server/rulesHelper.js3
4 files changed, 57 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,
+ });
+ },
}];
},
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 36153ff7..a4338363 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -597,6 +597,7 @@
"r-label": "label",
"r-member": "member",
"r-remove-all": "Remove all members from the card",
+ "r-set-color": "Set color to",
"r-checklist": "checklist",
"r-check-all": "Check all",
"r-uncheck-all": "Uncheck all",
diff --git a/server/rulesHelper.js b/server/rulesHelper.js
index ccb5cb3b..163bd41e 100644
--- a/server/rulesHelper.js
+++ b/server/rulesHelper.js
@@ -87,6 +87,9 @@ RulesHelper = {
if(action.actionType === 'unarchive'){
card.restore();
}
+ if(action.actionType === 'setColor'){
+ card.setColor(action.selectedColor);
+ }
if(action.actionType === 'addLabel'){
card.addLabel(action.labelId);
}