mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 05:27:14 -04:00
Merge pull request #3112 from marc1006/deepcode
Some fixes suggested by deepcode.ai
This commit is contained in:
commit
01346152b5
9 changed files with 16 additions and 15 deletions
|
@ -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);
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
};
|
||||
return this.each(function() {
|
||||
const element = this;
|
||||
$(element).bind('dragenter dragover dragleave', stopFn);
|
||||
return $(element).bind('drop', function(event) {
|
||||
$(element).on('dragenter dragover dragleave', stopFn);
|
||||
return $(element).on('drop', function(event) {
|
||||
stopFn(event);
|
||||
const files = event.dataTransfer.files;
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
options = $.extend({}, defaults, options);
|
||||
return this.each(function() {
|
||||
const element = this;
|
||||
return $(element).bind('paste', function(event) {
|
||||
return $(element).on('paste', function(event) {
|
||||
const types = event.clipboardData.types;
|
||||
const items = event.clipboardData.items;
|
||||
for (let i = 0; i < types.length; i++) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -259,7 +259,7 @@ if (Meteor.isServer) {
|
|||
throw new Meteor.Error('invalid-user');
|
||||
}
|
||||
const user = Meteor.user();
|
||||
if (!user.emails && !user.emails[0] && user.emails[0].address) {
|
||||
if (!user.emails || !user.emails[0] || user.emails[0].address) {
|
||||
throw new Meteor.Error('email-invalid');
|
||||
}
|
||||
this.unblock();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue