Browse Source

Fix lint errors in lint error fix.

Thanks to xet7 !
Lauri Ojansivu 5 years ago
parent
commit
9e95c06415

+ 1 - 1
client/components/boards/boardArchive.js

@@ -7,7 +7,7 @@ BlazeComponent.extendComponent({
     return Boards.find(
       { archived: true },
       {
-        sort: { sort: 1 /* boards default sorting */ }
+        sort: { sort: 1 /* boards default sorting */ },
       },
     );
   },

+ 3 - 1
client/components/boards/boardsList.js

@@ -86,7 +86,9 @@ BlazeComponent.extendComponent({
       query['members.userId'] = Meteor.userId();
     else query.permission = 'public';
 
-    return Boards.find(query, { sort: { sort: 1 /* boards default sorting */ } });
+    return Boards.find(query, {
+      sort: { sort: 1 /* boards default sorting */ },
+    });
   },
   isStarred() {
     const user = Meteor.user();

+ 8 - 9
client/components/cards/cardDetails.js

@@ -56,9 +56,8 @@ BlazeComponent.extendComponent({
   },
   votePublic() {
     const card = this.currentData();
-    if (card.vote)
-      return card.vote.public
-    return null
+    if (card.vote) return card.vote.public;
+    return null;
   },
   voteCountPositive() {
     const card = this.currentData();
@@ -380,7 +379,7 @@ BlazeComponent.extendComponent({
           }
         },
         'click .js-go-to-linked-card'() {
-           Utils.goCardId(this.data().linkedId)
+          Utils.goCardId(this.data().linkedId);
         },
         'click .js-member': Popup.open('cardMember'),
         'click .js-add-members': Popup.open('cardMembers'),
@@ -391,7 +390,7 @@ BlazeComponent.extendComponent({
         'click .js-start-date': Popup.open('editCardStartDate'),
         'click .js-due-date': Popup.open('editCardDueDate'),
         'click .js-end-date': Popup.open('editCardEndDate'),
-        'click .js-show-positive-votes':Popup.open('positiveVoteMembers'),
+        'click .js-show-positive-votes': Popup.open('positiveVoteMembers'),
         'click .js-show-negative-votes': Popup.open('negativeVoteMembers'),
         'mouseenter .js-card-details'() {
           const parentComponent = this.parentComponent().parentComponent();
@@ -658,7 +657,7 @@ Template.cardDetailsActionsPopup.events({
   },
 });
 
-Template.editCardTitleForm.onRendered(function () {
+Template.editCardTitleForm.onRendered(function() {
   autosize(this.$('.js-edit-card-title'));
 });
 
@@ -672,7 +671,7 @@ Template.editCardTitleForm.events({
   },
 });
 
-Template.editCardRequesterForm.onRendered(function () {
+Template.editCardRequesterForm.onRendered(function() {
   autosize(this.$('.js-edit-card-requester'));
 });
 
@@ -685,7 +684,7 @@ Template.editCardRequesterForm.events({
   },
 });
 
-Template.editCardAssignerForm.onRendered(function () {
+Template.editCardAssignerForm.onRendered(function() {
   autosize(this.$('.js-edit-card-assigner'));
 });
 
@@ -825,7 +824,7 @@ Template.copyChecklistToManyCardsPopup.events({
 
         // copy subtasks
         cursor = Cards.find({ parentId: oldId });
-        cursor.forEach(function () {
+        cursor.forEach(function() {
           'use strict';
           const subtask = arguments[0];
           subtask.parentId = _id;

+ 8 - 9
client/components/sidebar/sidebar.js

@@ -196,14 +196,14 @@ Template.boardMenuPopup.events({
   },
   'click .js-change-board-color': Popup.open('boardChangeColor'),
   'click .js-change-language': Popup.open('changeLanguage'),
-  'click .js-archive-board ': Popup.afterConfirm('archiveBoard', function () {
+  'click .js-archive-board ': Popup.afterConfirm('archiveBoard', function() {
     const currentBoard = Boards.findOne(Session.get('currentBoard'));
     currentBoard.archive();
     // XXX We should have some kind of notification on top of the page to
     // confirm that the board was successfully archived.
     FlowRouter.go('home');
   }),
-  'click .js-delete-board': Popup.afterConfirm('deleteBoard', function () {
+  'click .js-delete-board': Popup.afterConfirm('deleteBoard', function() {
     const currentBoard = Boards.findOne(Session.get('currentBoard'));
     Popup.close();
     Boards.remove(currentBoard._id);
@@ -215,17 +215,16 @@ Template.boardMenuPopup.events({
   'click .js-card-settings': Popup.open('boardCardSettings'),
 });
 
-
-Template.boardMenuPopup.onCreated(function () {
+Template.boardMenuPopup.onCreated(function() {
   this.apiEnabled = new ReactiveVar(false);
   Meteor.call('_isApiEnabled', (e, result) => {
-    this.apiEnabled.set(result)
-  })
-})
+    this.apiEnabled.set(result);
+  });
+});
 
 Template.boardMenuPopup.helpers({
   withApi() {
-    return Template.instance().apiEnabled.get()
+    return Template.instance().apiEnabled.get();
   },
   exportUrl() {
     const params = {
@@ -248,7 +247,7 @@ Template.memberPopup.events({
     Popup.close();
   },
   'click .js-change-role': Popup.open('changePermissions'),
-  'click .js-remove-member': Popup.afterConfirm('removeMember', function () {
+  'click .js-remove-member': Popup.afterConfirm('removeMember', function() {
     const boardId = Session.get('currentBoard');
     const memberId = this.userId;
     Cards.find({ boardId, members: memberId }).forEach(card => {

+ 4 - 1
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;
   }

+ 17 - 17
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;

+ 0 - 1
models/settings.js

@@ -338,7 +338,6 @@ if (Meteor.isServer) {
     isPasswordLoginDisabled() {
       return process.env.PASSWORD_LOGIN_ENABLED === 'false';
     },
-
   });
 }
 

+ 4 - 4
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);

+ 2 - 6
server/migrations.js

@@ -1036,12 +1036,8 @@ Migrations.add('add-description-text-allowed', () => {
 
 Migrations.add('add-sort-field-to-boards', () => {
   Boards.find().forEach((board, index) => {
-  if (!board.hasOwnProperty('sort')) {
-      Boards.direct.update(
-        board._id,
-        { $set: { sort: index } },
-        noValidate
-      );
+    if (!board.hasOwnProperty('sort')) {
+      Boards.direct.update(board._id, { $set: { sort: index } }, noValidate);
     }
   });
 });