Fix lint errors.

This commit is contained in:
Lauri Ojansivu 2018-08-13 20:01:08 +03:00
parent 0b9748dff6
commit 3f937764cb

View file

@ -64,7 +64,7 @@ class SetFilter {
_getMongoSelector() {
this._dep.depend();
return {
$in: this._selectedElements
$in: this._selectedElements,
};
}
@ -77,7 +77,7 @@ class SetFilter {
}
});
return includeEmpty ? {
$eq: []
$eq: [],
} : null;
}
}
@ -141,7 +141,7 @@ class AdvancedFilter {
commands.push({
'cmd': current,
'string': wasString,
regex
regex,
});
wasString = false;
current = '';
@ -153,7 +153,7 @@ class AdvancedFilter {
commands.push({
'cmd': current,
'string': wasString,
regex
regex,
});
}
return commands;
@ -161,14 +161,14 @@ class AdvancedFilter {
_fieldNameToId(field) {
const found = CustomFields.findOne({
'name': field
'name': field,
});
return found._id;
}
_fieldValueToId(field, value) {
const found = CustomFields.findOne({
'name': field
'name': field,
});
if (found.settings.dropdownItems && found.settings.dropdownItems.length > 0) {
for (let i = 0; i < found.settings.dropdownItems.length; i++) {
@ -188,10 +188,10 @@ class AdvancedFilter {
return this._lastValide;
}
this._lastValide = {
$or: commands
$or: commands,
};
return {
$or: commands
$or: commands,
};
}
@ -257,14 +257,14 @@ class AdvancedFilter {
regex = new RegExp(match[1]);
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': regex
'customFields.value': regex,
};
} else {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$in: [this._fieldValueToId(field, str), parseInt(str, 10)]
}
$in: [this._fieldValueToId(field, str), parseInt(str, 10)],
},
};
}
commands.splice(i - 1, 1);
@ -288,17 +288,17 @@ class AdvancedFilter {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$not: regex
}
$not: regex,
},
};
} else {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$not: {
$in: [this._fieldValueToId(field, str), parseInt(str, 10)]
}
}
$in: [this._fieldValueToId(field, str), parseInt(str, 10)],
},
},
};
}
commands.splice(i - 1, 1);
@ -317,8 +317,8 @@ class AdvancedFilter {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$gt: parseInt(str, 10)
}
$gt: parseInt(str, 10),
},
};
commands.splice(i - 1, 1);
commands.splice(i, 1);
@ -337,8 +337,8 @@ class AdvancedFilter {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$gte: parseInt(str, 10)
}
$gte: parseInt(str, 10),
},
};
commands.splice(i - 1, 1);
commands.splice(i, 1);
@ -356,8 +356,8 @@ class AdvancedFilter {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$lt: parseInt(str, 10)
}
$lt: parseInt(str, 10),
},
};
commands.splice(i - 1, 1);
commands.splice(i, 1);
@ -376,8 +376,8 @@ class AdvancedFilter {
commands[i] = {
'customFields._id': this._fieldNameToId(field),
'customFields.value': {
$lte: parseInt(str, 10)
}
$lte: parseInt(str, 10),
},
};
commands.splice(i - 1, 1);
commands.splice(i, 1);
@ -403,7 +403,7 @@ class AdvancedFilter {
const op1 = commands[i - 1];
const op2 = commands[i + 1];
commands[i] = {
$or: [op1, op2]
$or: [op1, op2],
};
commands.splice(i - 1, 1);
commands.splice(i, 1);
@ -420,7 +420,7 @@ class AdvancedFilter {
const op1 = commands[i - 1];
const op2 = commands[i + 1];
commands[i] = {
$and: [op1, op2]
$and: [op1, op2],
};
commands.splice(i - 1, 1);
commands.splice(i, 1);
@ -435,7 +435,7 @@ class AdvancedFilter {
{
const op1 = commands[i + 1];
commands[i] = {
$not: op1
$not: op1,
};
commands.splice(i + 1, 1);
//changed = true;
@ -506,8 +506,8 @@ Filter = {
const exceptionsSelector = {
_id: {
$in: this._exceptions
}
$in: this._exceptions,
},
};
this._exceptionsDep.depend();
@ -520,7 +520,7 @@ Filter = {
if (this.advanced._isActive()) selectors.push(this.advanced._getMongoSelector());
return {
$or: selectors
$or: selectors,
};
},
@ -530,7 +530,7 @@ Filter = {
return filterSelector;
else
return {
$and: [filterSelector, additionalSelector]
$and: [filterSelector, additionalSelector],
};
},