summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-24 16:47:09 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-25 11:04:40 +0100
commit03efeaeb1abae0c8c39ad5644d44bad36f415d99 (patch)
treebe24b13d24bbcf400c26ca88923383abe6d86993 /models
parentc075187088e69d30db31489d75b22f991e1972ff (diff)
downloadwekan-03efeaeb1abae0c8c39ad5644d44bad36f415d99.tar.gz
wekan-03efeaeb1abae0c8c39ad5644d44bad36f415d99.tar.bz2
wekan-03efeaeb1abae0c8c39ad5644d44bad36f415d99.zip
Add colors to swimlanes
fixes #1688
Diffstat (limited to 'models')
-rw-r--r--models/swimlanes.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/models/swimlanes.js b/models/swimlanes.js
index fa5245da..93057362 100644
--- a/models/swimlanes.js
+++ b/models/swimlanes.js
@@ -49,6 +49,21 @@ Swimlanes.attachSchema(new SimpleSchema({
// XXX We should probably provide a default
optional: true,
},
+ color: {
+ /**
+ * the color of the swimlane
+ */
+ type: String,
+ optional: true,
+ // silver is the default, so it is left out
+ allowedValues: [
+ 'white', 'green', 'yellow', 'orange', 'red', 'purple',
+ 'blue', 'sky', 'lime', 'pink', 'black',
+ 'peachpuff', 'crimson', 'plum', 'darkgreen',
+ 'slateblue', 'magenta', 'gold', 'navy', 'gray',
+ 'saddlebrown', 'paleturquoise', 'mistyrose', 'indigo',
+ ],
+ },
updatedAt: {
/**
* when was the swimlane last edited
@@ -93,6 +108,12 @@ Swimlanes.helpers({
board() {
return Boards.findOne(this.boardId);
},
+
+ colorClass() {
+ if (this.color)
+ return this.color;
+ return '';
+ },
});
Swimlanes.mutations({
@@ -107,6 +128,17 @@ Swimlanes.mutations({
restore() {
return { $set: { archived: false } };
},
+
+ setColor(newColor) {
+ if (newColor === 'silver') {
+ newColor = null;
+ }
+ return {
+ $set: {
+ color: newColor,
+ },
+ };
+ },
});
Swimlanes.hookOptions.after.update = { fetchPrevious: false };