From 9e95c06415e614e587d684ff9660cc53c5f8c8d3 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Wed, 22 Apr 2020 21:00:31 +0300 Subject: Fix lint errors in lint error fix. Thanks to xet7 ! --- models/boards.js | 5 ++++- models/cards.js | 34 +++++++++++++++++----------------- models/settings.js | 1 - models/trelloCreator.js | 8 ++++---- 4 files changed, 25 insertions(+), 23 deletions(-) (limited to 'models') diff --git a/models/boards.js b/models/boards.js index 170ebc5a..26dc6127 100644 --- a/models/boards.js +++ b/models/boards.js @@ -1297,7 +1297,10 @@ if (Meteor.isServer) { // Insert new board at last position in sort order. Boards.before.insert((userId, doc) => { - const lastBoard = Boards.findOne({ sort: { $exists: true } }, { sort: { sort: -1 } }); + const lastBoard = Boards.findOne( + { sort: { $exists: true } }, + { sort: { sort: -1 } }, + ); if (lastBoard && typeof lastBoard.sort !== 'undefined') { doc.sort = lastBoard.sort + 1; } diff --git a/models/cards.js b/models/cards.js index 485837ef..72153132 100644 --- a/models/cards.js +++ b/models/cards.js @@ -732,7 +732,7 @@ Cards.helpers({ parentString(sep) { return this.parentList() - .map(function (elem) { + .map(function(elem) { return elem.title; }) .join(sep); @@ -1050,13 +1050,13 @@ Cards.helpers({ voteMemberPositive() { if (this.vote && this.vote.positive) - return Users.find({ _id: { $in: this.vote.positive } }) - return [] + return Users.find({ _id: { $in: this.vote.positive } }); + return []; }, voteMemberNegative() { if (this.vote && this.vote.negative) - return Users.find({ _id: { $in: this.vote.negative } }) - return [] + return Users.find({ _id: { $in: this.vote.negative } }); + return []; }, getId() { @@ -1475,12 +1475,12 @@ Cards.mutations({ }, }; }, - setVoteQuestion(question, public_) { + setVoteQuestion(question, public) { return { $set: { vote: { question, - public_, + public, positive: [], negative: [], }, @@ -1929,7 +1929,7 @@ if (Meteor.isServer) { }); //New activity for card moves - Cards.after.update(function (userId, doc, fieldNames) { + Cards.after.update(function(userId, doc, fieldNames) { const oldListId = this.previous.listId; const oldSwimlaneId = this.previous.swimlaneId; const oldBoardId = this.previous.boardId; @@ -1975,7 +1975,7 @@ if (Meteor.isServer) { // change list modifiedAt, when user modified the key values in timingaction array, if it's endAt, put the modifiedAt of list back to one year ago for sorting purpose const modifiedAt = new Date( new Date(value).getTime() - - (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0), + (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0), ); // set it as 1 year before const boardId = list.boardId; Lists.direct.update( @@ -2029,7 +2029,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'GET', '/api/boards/:boardId/swimlanes/:swimlaneId/cards', - function (req, res) { + function(req, res) { const paramBoardId = req.params.boardId; const paramSwimlaneId = req.params.swimlaneId; Authentication.checkBoardAccess(req.userId, paramBoardId); @@ -2039,7 +2039,7 @@ if (Meteor.isServer) { boardId: paramBoardId, swimlaneId: paramSwimlaneId, archived: false, - }).map(function (doc) { + }).map(function(doc) { return { _id: doc._id, title: doc.title, @@ -2063,7 +2063,7 @@ if (Meteor.isServer) { * title: string, * description: string}] */ - JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function ( + JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function( req, res, ) { @@ -2076,7 +2076,7 @@ if (Meteor.isServer) { boardId: paramBoardId, listId: paramListId, archived: false, - }).map(function (doc) { + }).map(function(doc) { return { _id: doc._id, title: doc.title, @@ -2098,7 +2098,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'GET', '/api/boards/:boardId/lists/:listId/cards/:cardId', - function (req, res) { + function(req, res) { const paramBoardId = req.params.boardId; const paramListId = req.params.listId; const paramCardId = req.params.cardId; @@ -2130,7 +2130,7 @@ if (Meteor.isServer) { * @param {string} [assignees] the array of maximum one ID of assignee of the new card * @return_type {_id: string} */ - JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function ( + JsonRoutes.add('POST', '/api/boards/:boardId/lists/:listId/cards', function( req, res, ) { @@ -2237,7 +2237,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'PUT', '/api/boards/:boardId/lists/:listId/cards/:cardId', - function (req, res) { + function(req, res) { Authentication.checkUserId(req.userId); const paramBoardId = req.params.boardId; const paramCardId = req.params.cardId; @@ -2536,7 +2536,7 @@ if (Meteor.isServer) { JsonRoutes.add( 'DELETE', '/api/boards/:boardId/lists/:listId/cards/:cardId', - function (req, res) { + function(req, res) { Authentication.checkUserId(req.userId); const paramBoardId = req.params.boardId; const paramListId = req.params.listId; diff --git a/models/settings.js b/models/settings.js index 03ef9052..fb823205 100644 --- a/models/settings.js +++ b/models/settings.js @@ -338,7 +338,6 @@ if (Meteor.isServer) { isPasswordLoginDisabled() { return process.env.PASSWORD_LOGIN_ENABLED === 'false'; }, - }); } diff --git a/models/trelloCreator.js b/models/trelloCreator.js index 28982f43..1c5bcd93 100644 --- a/models/trelloCreator.js +++ b/models/trelloCreator.js @@ -1,4 +1,4 @@ -const DateString = Match.Where(function (dateAsString) { +const DateString = Match.Where(function(dateAsString) { check(dateAsString, String); return moment(dateAsString, moment.ISO_8601).isValid(); }); @@ -299,13 +299,13 @@ export class TrelloCreator { } } return true; - }) + }); if (positiveVotes.length > 0) { cardToCreate.vote = { question: cardToCreate.title, public: true, positive: positiveVotes, - } + }; } } @@ -369,7 +369,7 @@ export class TrelloCreator { // so we make it server only, and let UI catch up once it is done, forget about latency comp. const self = this; if (Meteor.isServer) { - file.attachData(att.url, function (error) { + file.attachData(att.url, function(error) { file.boardId = boardId; file.cardId = cardId; file.userId = self._user(att.idMemberCreator); -- cgit v1.2.3-1-g7c22