Merge pull request #3112 from marc1006/deepcode

Some fixes suggested by deepcode.ai
This commit is contained in:
Lauri Ojansivu 2020-05-24 18:56:36 +03:00 committed by GitHub
commit 01346152b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 16 additions and 15 deletions

View file

@ -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')}`,
@ -378,8 +378,8 @@ BlazeComponent.extendComponent({
new Date(card.dueAt.getTime() + 36e5),
);
});
events.sort(function(first, second) {
return first.id > second.id ? 1 : -1;
events.sort((first, second) => {
return first.id === second.id ? 0 : first.id > second.id ? 1 : -1;
});
callback(events);
},

View file

@ -812,9 +812,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);

View file

@ -164,6 +164,7 @@ BlazeComponent.extendComponent({
const boardId = Session.get('currentBoard');
const actionId = Actions.insert({
actionType: 'removeMember',
// deepcode ignore NoHardcodedCredentials: it's no credential
username: '*',
boardId,
desc,

View file

@ -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);