summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/activities.js3
-rw-r--r--models/boards.js5
-rw-r--r--models/cards.js11
3 files changed, 16 insertions, 3 deletions
diff --git a/models/activities.js b/models/activities.js
index 5b54759c..2228f66e 100644
--- a/models/activities.js
+++ b/models/activities.js
@@ -117,6 +117,9 @@ if (Meteor.isServer) {
params.url = card.absoluteUrl();
params.cardId = activity.cardId;
}
+ if (activity.swimlaneId) {
+ params.swimlaneId = activity.swimlaneId;
+ }
if (activity.commentId) {
const comment = activity.comment();
params.comment = comment.text;
diff --git a/models/boards.js b/models/boards.js
index 71049bd9..8d6c773f 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -855,10 +855,15 @@ if (Meteor.isServer) {
permission: 'public',
color: 'belize',
});
+ const swimlaneId = Swimlanes.insert({
+ title: TAPi18n.__('default'),
+ boardId: id,
+ });
JsonRoutes.sendResult(res, {
code: 200,
data: {
_id: id,
+ defaultSwimlaneId: swimlaneId,
},
});
}
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