From be42b8d4cbdfa547ca019ab2dc9a590a115cc0e2 Mon Sep 17 00:00:00 2001 From: Chuck McAndrew Date: Tue, 9 Oct 2018 15:05:57 +0000 Subject: Add route to get cards by swimlaneid --- models/cards.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'models') diff --git a/models/cards.js b/models/cards.js index 66bfbcf3..974385d6 100644 --- a/models/cards.js +++ b/models/cards.js @@ -1304,6 +1304,29 @@ if (Meteor.isServer) { cardRemover(userId, doc); }); } +//SWIMLANES REST API +if (Meteor.isServer) { + JsonRoutes.add('GET', '/api/boards/:boardId/swimlanes/:swimlaneId/cards', function(req, res) { + const paramBoardId = req.params.boardId; + const paramSwimlaneId = req.params.swimlaneId; + Authentication.checkBoardAccess(req.userId, paramBoardId); + JsonRoutes.sendResult(res, { + code: 200, + data: Cards.find({ + boardId: paramBoardId, + swimlaneId: paramSwimlaneId, + archived: false, + }).map(function(doc) { + return { + _id: doc._id, + title: doc.title, + description: doc.description, + listId: doc.listId, + }; + }), + }); + }); +} //LISTS REST API if (Meteor.isServer) { JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(req, res) { -- cgit v1.2.3-1-g7c22 From 3a7ae7c5f240287a4fc58eb3a321129be718d40c Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 9 Oct 2018 21:16:47 +0300 Subject: Fix lint errors. --- models/users.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'models') diff --git a/models/users.js b/models/users.js index 9a195850..f8ccb030 100644 --- a/models/users.js +++ b/models/users.js @@ -499,7 +499,7 @@ if (Meteor.isServer) { user.emails = [{ address: email, verified: true }]; const initials = user.services.oidc.fullname.match(/\b[a-zA-Z]/g).join('').toUpperCase(); user.profile = { initials, fullname: user.services.oidc.fullname }; - user['authenticationMethod'] = 'oauth2'; + user.authenticationMethod = 'oauth2'; // see if any existing user has this email address or username, otherwise create new const existingUser = Meteor.users.findOne({$or: [{'emails.address': email}, {'username':user.username}]}); @@ -512,7 +512,7 @@ if (Meteor.isServer) { existingUser.emails = user.emails; existingUser.username = user.username; existingUser.profile = user.profile; - existingUser['authenticationMethod'] = user['authenticationMethod']; + existingUser.authenticationMethod = user.authenticationMethod; Meteor.users.remove({_id: existingUser._id}); // remove existing record return existingUser; @@ -527,7 +527,7 @@ if (Meteor.isServer) { // If ldap, bypass the inviation code if the self registration isn't allowed. // TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type if (options.ldap || !disableRegistration) { - user['authenticationMethod'] = 'ldap'; + user.authenticationMethod = 'ldap'; return user; } @@ -647,7 +647,7 @@ if (Meteor.isServer) { const disableRegistration = Settings.findOne().disableRegistration; // If ldap, bypass the inviation code if the self registration isn't allowed. // TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type - if (doc['authenticationMethod'] !== 'ldap' && disableRegistration) { + if (doc.authenticationMethod !== 'ldap' && disableRegistration) { const invitationCode = InvitationCodes.findOne({code: doc.profile.icode, valid: true}); if (!invitationCode) { throw new Meteor.Error('error-invitation-code-not-exist'); -- cgit v1.2.3-1-g7c22 From d4774d398e20b50afb40112426f1ab7a997a81d6 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 10 Oct 2018 00:40:42 +0300 Subject: - Fix lint error: tab to spaces. Thanks to xet7 ! --- models/cards.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models') diff --git a/models/cards.js b/models/cards.js index 974385d6..25692c25 100644 --- a/models/cards.js +++ b/models/cards.js @@ -1321,7 +1321,7 @@ if (Meteor.isServer) { _id: doc._id, title: doc.title, description: doc.description, - listId: doc.listId, + listId: doc.listId, }; }), }); -- cgit v1.2.3-1-g7c22 From 178beee47634337f5868ac2c110015a87e608673 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Thu, 11 Oct 2018 23:41:50 +0300 Subject: - Fix lint errors. Note: variable trackingUsers is not used anywhere, so it was removed. Thanks to xet7 ! --- models/activities.js | 1 - 1 file changed, 1 deletion(-) (limited to 'models') diff --git a/models/activities.js b/models/activities.js index aad5d412..f3dabc6a 100644 --- a/models/activities.js +++ b/models/activities.js @@ -151,7 +151,6 @@ if (Meteor.isServer) { } if (board) { const watchingUsers = _.pluck(_.where(board.watchers, {level: 'watching'}), 'userId'); - const trackingUsers = _.pluck(_.where(board.watchers, {level: 'tracking'}), 'userId'); watchers = _.union(watchers, watchingUsers || []); } -- cgit v1.2.3-1-g7c22