summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/activities.js3
-rw-r--r--models/boards.js17
-rw-r--r--models/cards.js11
-rw-r--r--models/trelloCreator.js2
-rw-r--r--models/wekanCreator.js1
5 files changed, 25 insertions, 9 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..2a21d6da 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -846,19 +846,24 @@ if (Meteor.isServer) {
members: [
{
userId: req.body.owner,
- isAdmin: true,
- isActive: true,
- isNoComments: false,
- isCommentOnly: false,
+ isAdmin: req.body.isAdmin || true,
+ isActive: req.body.isActive || true,
+ isNoComments: req.body.isNoComments || false,
+ isCommentOnly: req.body.isCommentOnly || false,
},
],
- permission: 'public',
- color: 'belize',
+ permission: req.body.permission || 'private',
+ color: req.body.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
diff --git a/models/trelloCreator.js b/models/trelloCreator.js
index 30f0bc2b..b5a255cc 100644
--- a/models/trelloCreator.js
+++ b/models/trelloCreator.js
@@ -150,6 +150,7 @@ export class TrelloCreator {
userId: Meteor.userId(),
isAdmin: true,
isActive: true,
+ isNoComments: false,
isCommentOnly: false,
swimlaneId: false,
}],
@@ -177,6 +178,7 @@ export class TrelloCreator {
userId: wekanId,
isAdmin: this.getAdmin(trelloMembership.memberType),
isActive: true,
+ isNoComments: false,
isCommentOnly: false,
swimlaneId: false,
});
diff --git a/models/wekanCreator.js b/models/wekanCreator.js
index 4551979b..d144821f 100644
--- a/models/wekanCreator.js
+++ b/models/wekanCreator.js
@@ -160,6 +160,7 @@ export class WekanCreator {
wekanId: Meteor.userId(),
isActive: true,
isAdmin: true,
+ isNoComments: false,
isCommentOnly: false,
swimlaneId: false,
}],