diff options
author | Andrés Manelli <andresmanelli@gmail.com> | 2019-02-24 00:13:35 +0100 |
---|---|---|
committer | Andrés Manelli <andresmanelli@gmail.com> | 2019-02-24 00:13:35 +0100 |
commit | eb62c9ce6ad0fa0d5de7889ec087db8cdc579339 (patch) | |
tree | 23fb755a2c54fd4cd153af9ab3e7d391449547e7 | |
parent | 60be4df76e02afdf4dd62f8e03505d55c0ed119e (diff) | |
download | wekan-eb62c9ce6ad0fa0d5de7889ec087db8cdc579339.tar.gz wekan-eb62c9ce6ad0fa0d5de7889ec087db8cdc579339.tar.bz2 wekan-eb62c9ce6ad0fa0d5de7889ec087db8cdc579339.zip |
Fix lint errors
-rw-r--r-- | client/components/boards/boardsList.js | 4 | ||||
-rw-r--r-- | client/components/lists/listBody.js | 80 | ||||
-rw-r--r-- | client/components/users/userHeader.js | 4 | ||||
-rw-r--r-- | models/boards.js | 12 | ||||
-rw-r--r-- | models/cards.js | 38 | ||||
-rw-r--r-- | models/checklists.js | 20 | ||||
-rw-r--r-- | models/lists.js | 50 | ||||
-rw-r--r-- | models/swimlanes.js | 48 | ||||
-rw-r--r-- | models/users.js | 82 |
9 files changed, 169 insertions, 169 deletions
diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 3fd2d889..df495bb1 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -8,10 +8,10 @@ Template.boardListHeaderBar.events({ Template.boardListHeaderBar.helpers({ templatesBoardId() { - return Meteor.user().getTemplatesBoardId(); + return Meteor.user().getTemplatesBoardId(); }, templatesBoardSlug() { - return Meteor.user().getTemplatesBoardSlug(); + return Meteor.user().getTemplatesBoardSlug(); }, }); diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index f8634c0b..befcf72f 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -81,16 +81,16 @@ BlazeComponent.extendComponent({ cardType = 'template-card'; // If this is the board templates swimlane, insert a board template and a linked card else if (swimlane.isBoardTemplatesSwimlane()) { - linkedId = Boards.insert({ - title, - permission: 'private', - type: 'template-board', - }); - Swimlanes.insert({ - title: TAPi18n.__('default'), - boardId: linkedId, - }); - cardType = 'cardType-linkedBoard'; + linkedId = Boards.insert({ + title, + permission: 'private', + type: 'template-board', + }); + Swimlanes.insert({ + title: TAPi18n.__('default'), + boardId: linkedId, + }); + cardType = 'cardType-linkedBoard'; } } else if (boardView === 'board-view-swimlanes') swimlaneId = this.parentComponent().parentComponent().data()._id; @@ -149,9 +149,9 @@ BlazeComponent.extendComponent({ const methodName = evt.shiftKey ? 'toggleRange' : 'toggle'; MultiSelection[methodName](this.currentData()._id); - // If the card is already selected, we want to de-select it. - // XXX We should probably modify the minicard href attribute instead of - // overwriting the event in case the card is already selected. + // If the card is already selected, we want to de-select it. + // XXX We should probably modify the minicard href attribute instead of + // overwriting the event in case the card is already selected. } else if (Session.equals('currentCard', this.currentData()._id)) { evt.stopImmediatePropagation(); evt.preventDefault(); @@ -171,8 +171,8 @@ BlazeComponent.extendComponent({ idOrNull(swimlaneId) { const currentUser = Meteor.user(); - if (currentUser.profile.boardView === 'board-view-swimlanes' - || this.data().board().isTemplatesBoard()) + if (currentUser.profile.boardView === 'board-view-swimlanes' || + this.data().board().isTemplatesBoard()) return swimlaneId; return undefined; }, @@ -292,8 +292,8 @@ BlazeComponent.extendComponent({ // work. $form.find('button[type=submit]').click(); - // Pressing Tab should open the form of the next column, and Maj+Tab go - // in the reverse order + // Pressing Tab should open the form of the next column, and Maj+Tab go + // in the reverse order } else if (evt.keyCode === 9) { evt.preventDefault(); const isReverse = evt.shiftKey; @@ -354,7 +354,7 @@ BlazeComponent.extendComponent({ const currentBoard = Boards.findOne(Session.get('currentBoard')); callback($.map(currentBoard.labels, (label) => { if (label.name.indexOf(term) > -1 || - label.color.indexOf(term) > -1) { + label.color.indexOf(term) > -1) { return label; } return null; @@ -530,7 +530,7 @@ BlazeComponent.extendComponent({ this.isTemplateSearch = this.isCardTemplateSearch || this.isListTemplateSearch || this.isSwimlaneTemplateSearch; let board = {}; if (this.isTemplateSearch) { - board = Boards.findOne(Meteor.user().profile.templatesBoardId); + board = Boards.findOne(Meteor.user().profile.templatesBoardId); } else { // Prefetch first non-current board id board = Boards.findOne({ @@ -582,13 +582,13 @@ BlazeComponent.extendComponent({ } const board = Boards.findOne(this.selectedBoardId.get()); if (!this.isTemplateSearch || this.isCardTemplateSearch) { - return board.searchCards(this.term.get(), false); + return board.searchCards(this.term.get(), false); } else if (this.isListTemplateSearch) { - return board.searchLists(this.term.get()); + return board.searchLists(this.term.get()); } else if (this.isSwimlaneTemplateSearch) { - return board.searchSwimlanes(this.term.get()); + return board.searchSwimlanes(this.term.get()); } else { - return []; + return []; } }, @@ -604,7 +604,7 @@ BlazeComponent.extendComponent({ }, 'click .js-minicard'(evt) { // 0. Common - let element = Blaze.getData(evt.currentTarget); + const element = Blaze.getData(evt.currentTarget); element.boardId = this.boardId; let _id = ''; if (!this.isTemplateSearch || this.isCardTemplateSearch) { @@ -615,27 +615,27 @@ BlazeComponent.extendComponent({ element.sort = Lists.findOne(this.listId).cards().count(); // 1.A From template if (this.isTemplateSearch) { - element.type = 'cardType-card'; - element.linkedId = ''; - _id = element.copy(); - // 1.B Linked card + element.type = 'cardType-card'; + element.linkedId = ''; + _id = element.copy(); + // 1.B Linked card } else { - element._id = null; - element.type = 'cardType-linkedCard'; - element.linkedId = element.linkedId || element._id; - _id = Cards.insert(element); + element._id = null; + element.type = 'cardType-linkedCard'; + element.linkedId = element.linkedId || element._id; + _id = Cards.insert(element); } Filter.addException(_id); - // List insertion + // List insertion } else if (this.isListTemplateSearch) { - element.sort = Swimlanes.findOne(this.swimlaneId).lists().count(); - element.type = 'list'; - element.swimlaneId = this.swimlaneId; - _id = element.copy(); + element.sort = Swimlanes.findOne(this.swimlaneId).lists().count(); + element.type = 'list'; + element.swimlaneId = this.swimlaneId; + _id = element.copy(); } else if (this.isSwimlaneTemplateSearch) { - element.sort = Boards.findOne(this.boardId).swimlanes().count(); - element.type = 'swimlalne'; - _id = element.copy(); + element.sort = Boards.findOne(this.boardId).swimlanes().count(); + element.type = 'swimlalne'; + _id = element.copy(); } Popup.close(); }, diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 29b29534..6a2397a4 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -5,10 +5,10 @@ Template.headerUserBar.events({ Template.memberMenuPopup.helpers({ templatesBoardId() { - return Meteor.user().getTemplatesBoardId(); + return Meteor.user().getTemplatesBoardId(); }, templatesBoardSlug() { - return Meteor.user().getTemplatesBoardSlug(); + return Meteor.user().getTemplatesBoardSlug(); }, }); diff --git a/models/boards.js b/models/boards.js index d81ded15..0d3213bc 100644 --- a/models/boards.js +++ b/models/boards.js @@ -471,7 +471,7 @@ Boards.helpers({ query.type = 'template-swimlane'; query.archived = false; } else { - query.type = {$nin: ['template-swimlane']}; + query.type = {$nin: ['template-swimlane']}; } const projection = { limit: 10, sort: { createdAt: -1 } }; @@ -495,7 +495,7 @@ Boards.helpers({ query.type = 'template-list'; query.archived = false; } else { - query.type = {$nin: ['template-list']}; + query.type = {$nin: ['template-list']}; } const projection = { limit: 10, sort: { createdAt: -1 } }; @@ -522,7 +522,7 @@ Boards.helpers({ query.type = 'template-card'; query.archived = false; } else { - query.type = {$nin: ['template-card']}; + query.type = {$nin: ['template-card']}; } const projection = { limit: 10, sort: { createdAt: -1 } }; @@ -975,7 +975,7 @@ if (Meteor.isServer) { * @param {string} userId the ID of the user to retrieve the data * @return_type [{_id: string, title: string}] - */ + */ JsonRoutes.add('GET', '/api/users/:userId/boards', function (req, res) { try { Authentication.checkLoggedIn(req.userId); @@ -1012,7 +1012,7 @@ if (Meteor.isServer) { * * @return_type [{_id: string, title: string}] - */ + */ JsonRoutes.add('GET', '/api/boards', function (req, res) { try { Authentication.checkUserId(req.userId); @@ -1083,7 +1083,7 @@ if (Meteor.isServer) { * * @return_type {_id: string, defaultSwimlaneId: string} - */ + */ JsonRoutes.add('POST', '/api/boards', function (req, res) { try { Authentication.checkUserId(req.userId); diff --git a/models/cards.js b/models/cards.js index c7b4a366..e91f0af5 100644 --- a/models/cards.js +++ b/models/cards.js @@ -273,28 +273,28 @@ Cards.allow({ Cards.helpers({ copy() { - const oldId = this._id; - this._id = null; - const _id = Cards.insert(this); + const oldId = this._id; + this._id = null; + const _id = Cards.insert(this); - // copy checklists - Checklists.find({cardId: oldId}).forEach((ch) => { - ch.copy(_id); - }); + // copy checklists + Checklists.find({cardId: oldId}).forEach((ch) => { + ch.copy(_id); + }); - // copy subtasks - Cards.find({parentId: oldId}).forEach((subtask) => { - subtask.parentId = _id; - subtask._id = null; - Cards.insert(subtask); - }); + // copy subtasks + Cards.find({parentId: oldId}).forEach((subtask) => { + subtask.parentId = _id; + subtask._id = null; + Cards.insert(subtask); + }); - // copy card comments - CardComments.find({cardId: oldId}).forEach((cmt) => { - cmt.copy(_id); - }); + // copy card comments + CardComments.find({cardId: oldId}).forEach((cmt) => { + cmt.copy(_id); + }); - return _id; + return _id; }, list() { @@ -1259,7 +1259,7 @@ Cards.mutations({ function cardMove(userId, doc, fieldNames, oldListId, oldSwimlaneId) { if ((_.contains(fieldNames, 'listId') && doc.listId !== oldListId) || - (_.contains(fieldNames, 'swimlaneId') && doc.swimlaneId !== oldSwimlaneId)){ + (_.contains(fieldNames, 'swimlaneId') && doc.swimlaneId !== oldSwimlaneId)){ Activities.insert({ userId, oldListId, diff --git a/models/checklists.js b/models/checklists.js index 99e9f25e..9e763f1a 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -49,16 +49,16 @@ Checklists.attachSchema(new SimpleSchema({ Checklists.helpers({ copy(newCardId) { - const oldChecklistId = this._id; - this._id = null; - this.cardId = newCardId; - const newChecklistId = Checklists.insert(this); - ChecklistItems.find({checklistId: oldChecklistId}).forEach((item) => { - item._id = null; - item.checklistId = newChecklistId; - item.cardId = newCardId; - ChecklistItems.insert(item); - }); + const oldChecklistId = this._id; + this._id = null; + this.cardId = newCardId; + const newChecklistId = Checklists.insert(this); + ChecklistItems.find({checklistId: oldChecklistId}).forEach((item) => { + item._id = null; + item.checklistId = newChecklistId; + item.cardId = newCardId; + ChecklistItems.insert(item); + }); }, itemCount() { diff --git a/models/lists.js b/models/lists.js index 76708ffd..453e0be1 100644 --- a/models/lists.js +++ b/models/lists.js @@ -138,30 +138,30 @@ Lists.allow({ Lists.helpers({ copy() { - const oldId = this._id; - let _id = null; - existingListWithSameName = Lists.findOne({ - boardId: this.boardId, - title: this.title, - }); - if (existingListWithSameName) { - _id = existingListWithSameName._id; - } else { - this._id = null; - _id = Lists.insert(this); - } + const oldId = this._id; + let _id = null; + existingListWithSameName = Lists.findOne({ + boardId: this.boardId, + title: this.title, + }); + if (existingListWithSameName) { + _id = existingListWithSameName._id; + } else { + this._id = null; + _id = Lists.insert(this); + } - // Copy all cards in list - Cards.find({ - listId: oldId, - archived: false, - }).forEach((card) => { - card.type = 'cardType-card'; - card.listId = _id; - card.boardId = this.boardId; - card.swimlaneId = this.swimlaneId; - card.copy(); - }); + // Copy all cards in list + Cards.find({ + listId: oldId, + archived: false, + }).forEach((card) => { + card.type = 'cardType-card'; + card.listId = _id; + card.boardId = this.boardId; + card.swimlaneId = this.swimlaneId; + card.copy(); + }); }, cards(swimlaneId) { @@ -224,7 +224,7 @@ Lists.mutations({ archive() { if (this.isTemplateList()) { this.cards().forEach((card) => { - return card.archive(); + return card.archive(); }); } return { $set: { archived: true } }; @@ -233,7 +233,7 @@ Lists.mutations({ restore() { if (this.isTemplateList()) { this.allCards().forEach((card) => { - return card.restore(); + return card.restore(); }); } return { $set: { archived: false } }; diff --git a/models/swimlanes.js b/models/swimlanes.js index 205f1498..6f679a8d 100644 --- a/models/swimlanes.js +++ b/models/swimlanes.js @@ -102,20 +102,20 @@ Swimlanes.allow({ Swimlanes.helpers({ copy() { - const oldId = this._id; - this._id = null; - const _id = Swimlanes.insert(this); + const oldId = this._id; + this._id = null; + const _id = Swimlanes.insert(this); - // Copy all lists in swimlane - Lists.find({ - swimlaneId: oldId, - archived: false, - }).forEach((list) => { - list.type = 'list'; - list.swimlaneId = _id; - list.boardId = this.boardId; - list.copy(); - }); + // Copy all lists in swimlane + Lists.find({ + swimlaneId: oldId, + archived: false, + }).forEach((list) => { + list.type = 'list'; + list.swimlaneId = _id; + list.boardId = this.boardId; + list.copy(); + }); }, cards() { @@ -127,8 +127,8 @@ Swimlanes.helpers({ lists() { return Lists.find(Filter.mongoSelector({ - swimlaneId: this._id, - archived: false, + swimlaneId: this._id, + archived: false, }), { sort: ['sort'] }); }, @@ -155,22 +155,22 @@ Swimlanes.helpers({ }, isTemplateContainer() { - return this.type === 'template-container'; + return this.type === 'template-container'; }, isListTemplatesSwimlane() { - const user = Users.findOne(Meteor.userId()); - return user.profile.listTemplatesSwimlaneId === this._id; + const user = Users.findOne(Meteor.userId()); + return user.profile.listTemplatesSwimlaneId === this._id; }, isCardTemplatesSwimlane() { - const user = Users.findOne(Meteor.userId()); - return user.profile.cardTemplatesSwimlaneId === this._id; + const user = Users.findOne(Meteor.userId()); + return user.profile.cardTemplatesSwimlaneId === this._id; }, isBoardTemplatesSwimlane() { - const user = Users.findOne(Meteor.userId()); - return user.profile.boardTemplatesSwimlaneId === this._id; + const user = Users.findOne(Meteor.userId()); + return user.profile.boardTemplatesSwimlaneId === this._id; }, }); @@ -182,7 +182,7 @@ Swimlanes.mutations({ archive() { if (this.isTemplateSwimlane()) { this.lists().forEach((list) => { - return list.archive(); + return list.archive(); }); } return { $set: { archived: true } }; @@ -191,7 +191,7 @@ Swimlanes.mutations({ restore() { if (this.isTemplateSwimlane()) { this.allLists().forEach((list) => { - return list.restore(); + return list.restore(); }); } return { $set: { archived: false } }; diff --git a/models/users.js b/models/users.js index 87f2b860..9bc4f175 100644 --- a/models/users.js +++ b/models/users.js @@ -358,11 +358,11 @@ Users.helpers({ }, getTemplatesBoardId() { - return this.profile.templatesBoardId; + return this.profile.templatesBoardId; }, getTemplatesBoardSlug() { - return Boards.findOne(this.profile.templatesBoardId).slug; + return Boards.findOne(this.profile.templatesBoardId).slug; }, }); @@ -741,47 +741,47 @@ if (Meteor.isServer) { Boards.insert({ title: TAPi18n.__('templates'), permission: 'private', - type: 'template-container' + type: 'template-container', }, fakeUser, (err, boardId) => { - // Insert the reference to our templates board - Users.update(fakeUserId.get(), {$set: {'profile.templatesBoardId': boardId}}); - - // Insert the card templates swimlane - Swimlanes.insert({ - title: TAPi18n.__('card-templates-swimlane'), - boardId, - sort: 1, - type: 'template-container', - }, fakeUser, (err, swimlaneId) => { - - // Insert the reference to out card templates swimlane - Users.update(fakeUserId.get(), {$set: {'profile.cardTemplatesSwimlaneId': swimlaneId}}); - }); - - // Insert the list templates swimlane - Swimlanes.insert({ - title: TAPi18n.__('list-templates-swimlane'), - boardId, - sort: 2, - type: 'template-container', - }, fakeUser, (err, swimlaneId) => { - - // Insert the reference to out list templates swimlane - Users.update(fakeUserId.get(), {$set: {'profile.listTemplatesSwimlaneId': swimlaneId}}); - }); - - // Insert the board templates swimlane - Swimlanes.insert({ - title: TAPi18n.__('board-templates-swimlane'), - boardId, - sort: 3, - type: 'template-container', - }, fakeUser, (err, swimlaneId) => { - - // Insert the reference to out board templates swimlane - Users.update(fakeUserId.get(), {$set: {'profile.boardTemplatesSwimlaneId': swimlaneId}}); - }); + // Insert the reference to our templates board + Users.update(fakeUserId.get(), {$set: {'profile.templatesBoardId': boardId}}); + + // Insert the card templates swimlane + Swimlanes.insert({ + title: TAPi18n.__('card-templates-swimlane'), + boardId, + sort: 1, + type: 'template-container', + }, fakeUser, (err, swimlaneId) => { + + // Insert the reference to out card templates swimlane + Users.update(fakeUserId.get(), {$set: {'profile.cardTemplatesSwimlaneId': swimlaneId}}); + }); + + // Insert the list templates swimlane + Swimlanes.insert({ + title: TAPi18n.__('list-templates-swimlane'), + boardId, + sort: 2, + type: 'template-container', + }, fakeUser, (err, swimlaneId) => { + + // Insert the reference to out list templates swimlane + Users.update(fakeUserId.get(), {$set: {'profile.listTemplatesSwimlaneId': swimlaneId}}); + }); + + // Insert the board templates swimlane + Swimlanes.insert({ + title: TAPi18n.__('board-templates-swimlane'), + boardId, + sort: 3, + type: 'template-container', + }, fakeUser, (err, swimlaneId) => { + + // Insert the reference to out board templates swimlane + Users.update(fakeUserId.get(), {$set: {'profile.boardTemplatesSwimlaneId': swimlaneId}}); + }); }); }); }); |