diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-05-24 12:37:54 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-05-24 12:44:14 +0200 |
commit | b2fee6a6c196f2ed2788444ad2387fba8f6df9cb (patch) | |
tree | d4b90757af23c3afa7e41b15f0bf2f60673d9178 | |
parent | 06515559a62a9caea7e31326c381dac0d40f710b (diff) | |
download | wekan-b2fee6a6c196f2ed2788444ad2387fba8f6df9cb.tar.gz wekan-b2fee6a6c196f2ed2788444ad2387fba8f6df9cb.tar.bz2 wekan-b2fee6a6c196f2ed2788444ad2387fba8f6df9cb.zip |
Use an arrow function inside forEach() instead of an anonymous function
Suggested by deepcode.ai.
-rw-r--r-- | client/components/boards/boardBody.js | 4 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 4 | ||||
-rw-r--r-- | client/components/sidebar/sidebar.js | 2 | ||||
-rw-r--r-- | models/checklists.js | 6 | ||||
-rw-r--r-- | server/rulesHelper.js | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 4e473f18..78418f2a 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -365,12 +365,12 @@ BlazeComponent.extendComponent({ }; currentBoard .cardsInInterval(start.toDate(), end.toDate()) - .forEach(function(card) { + .forEach(card => { pushEvent(card); }); currentBoard .cardsDueInBetween(start.toDate(), end.toDate()) - .forEach(function(card) { + .forEach(card => { pushEvent( card, `${card.title} ${TAPi18n.__('card-due')}`, diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 441068b0..a57eddf9 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -805,9 +805,9 @@ Template.copyChecklistToManyCardsPopup.events({ // copy subtasks cursor = Cards.find({ parentId: oldId }); - cursor.forEach(function() { + cursor.forEach(cur => { 'use strict'; - const subtask = arguments[0]; + const subtask = cur; subtask.parentId = _id; subtask._id = null; /* const newSubtaskId = */ Cards.insert(subtask); diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index 0e535041..7b14c1e0 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -653,7 +653,7 @@ BlazeComponent.extendComponent({ 'subtext-with-parent', 'no-parent', ]; - options.forEach(function(element) { + options.forEach(element => { if (element !== value) { $(`#${element} ${MCB}`).toggleClass(CKCLS, false); $(`#${element}`).toggleClass(CKCLS, false); diff --git a/models/checklists.js b/models/checklists.js index cf73e500..62c71d5f 100644 --- a/models/checklists.js +++ b/models/checklists.js @@ -100,13 +100,13 @@ Checklists.helpers({ }, checkAllItems() { const checkItems = ChecklistItems.find({ checklistId: this._id }); - checkItems.forEach(function(item) { + checkItems.forEach(item => { item.check(); }); }, uncheckAllItems() { const checkItems = ChecklistItems.find({ checklistId: this._id }); - checkItems.forEach(function(item) { + checkItems.forEach(item => { item.uncheck(); }); }, @@ -307,7 +307,7 @@ if (Meteor.isServer) { items = [items]; } } - items.forEach(function(item, idx) { + items.forEach((item, idx) => { ChecklistItems.insert({ cardId: paramCardId, checklistId: id, diff --git a/server/rulesHelper.js b/server/rulesHelper.js index 63e330ab..1dc7b5d3 100644 --- a/server/rulesHelper.js +++ b/server/rulesHelper.js @@ -17,7 +17,7 @@ RulesHelper = { const matchingMap = this.buildMatchingFieldsMap(activity, matchingFields); const matchingTriggers = Triggers.find(matchingMap); const matchingRules = []; - matchingTriggers.forEach(function(trigger) { + matchingTriggers.forEach(trigger => { const rule = trigger.getRule(); // Check that for some unknown reason there are some leftover triggers // not connected to any rules |