summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-09-06 00:17:45 +0200
committerAndrés Manelli <andresmanelli@gmail.com>2018-09-06 00:23:50 +0200
commite74fb2f5b08b4e033dca71cbfb4b99e91ee142eb (patch)
tree3bffc7f201aa0269a027429b8133d63bf6b63be6 /models/cards.js
parentf346ce04f58c1e44ec2d58df409b7558fd33b91e (diff)
downloadwekan-e74fb2f5b08b4e033dca71cbfb4b99e91ee142eb.tar.gz
wekan-e74fb2f5b08b4e033dca71cbfb4b99e91ee142eb.tar.bz2
wekan-e74fb2f5b08b4e033dca71cbfb4b99e91ee142eb.zip
Add swimlaneId in activity. Create default swimlaneId in API
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/models/cards.js b/models/cards.js
index 11f08283..927ca9ce 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -914,8 +914,9 @@ Cards.mutations({
//FUNCTIONS FOR creation of Activities
-function cardMove(userId, doc, fieldNames, oldListId) {
- if (_.contains(fieldNames, 'listId') && doc.listId !== oldListId) {
+function cardMove(userId, doc, fieldNames, oldListId, oldSwimlaneId) {
+ if ((_.contains(fieldNames, 'listId') && doc.listId !== oldListId) ||
+ (_.contains(fieldNames, 'swimlaneId') && doc.swimlaneId !== oldSwimlaneId)){
Activities.insert({
userId,
oldListId,
@@ -923,6 +924,8 @@ function cardMove(userId, doc, fieldNames, oldListId) {
listId: doc.listId,
boardId: doc.boardId,
cardId: doc._id,
+ swimlaneId: doc.swimlaneId,
+ oldSwimlaneId,
});
}
}
@@ -990,6 +993,7 @@ function cardCreation(userId, doc) {
boardId: doc.boardId,
listId: doc.listId,
cardId: doc._id,
+ swimlaneId: doc.swimlaneId,
});
}
@@ -1037,7 +1041,8 @@ if (Meteor.isServer) {
//New activity for card moves
Cards.after.update(function (userId, doc, fieldNames) {
const oldListId = this.previous.listId;
- cardMove(userId, doc, fieldNames, oldListId);
+ const oldSwimlaneId = this.previous.swimlaneId;
+ cardMove(userId, doc, fieldNames, oldListId, oldSwimlaneId);
});
// Add a new activity if we add or remove a member to the card