Fix lint errors in lint error fix.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2020-04-22 21:00:31 +03:00
parent e7603298d7
commit 9e95c06415
9 changed files with 47 additions and 49 deletions

View file

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

View file

@ -86,7 +86,9 @@ BlazeComponent.extendComponent({
query['members.userId'] = Meteor.userId(); query['members.userId'] = Meteor.userId();
else query.permission = 'public'; 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() { isStarred() {
const user = Meteor.user(); const user = Meteor.user();

View file

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

View file

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

View file

@ -1297,7 +1297,10 @@ if (Meteor.isServer) {
// Insert new board at last position in sort order. // Insert new board at last position in sort order.
Boards.before.insert((userId, doc) => { 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') { if (lastBoard && typeof lastBoard.sort !== 'undefined') {
doc.sort = lastBoard.sort + 1; doc.sort = lastBoard.sort + 1;
} }

View file

@ -732,7 +732,7 @@ Cards.helpers({
parentString(sep) { parentString(sep) {
return this.parentList() return this.parentList()
.map(function (elem) { .map(function(elem) {
return elem.title; return elem.title;
}) })
.join(sep); .join(sep);
@ -1050,13 +1050,13 @@ Cards.helpers({
voteMemberPositive() { voteMemberPositive() {
if (this.vote && this.vote.positive) if (this.vote && this.vote.positive)
return Users.find({ _id: { $in: this.vote.positive } }) return Users.find({ _id: { $in: this.vote.positive } });
return [] return [];
}, },
voteMemberNegative() { voteMemberNegative() {
if (this.vote && this.vote.negative) if (this.vote && this.vote.negative)
return Users.find({ _id: { $in: this.vote.negative } }) return Users.find({ _id: { $in: this.vote.negative } });
return [] return [];
}, },
getId() { getId() {
@ -1475,12 +1475,12 @@ Cards.mutations({
}, },
}; };
}, },
setVoteQuestion(question, public_) { setVoteQuestion(question, public) {
return { return {
$set: { $set: {
vote: { vote: {
question, question,
public_, public,
positive: [], positive: [],
negative: [], negative: [],
}, },
@ -1929,7 +1929,7 @@ if (Meteor.isServer) {
}); });
//New activity for card moves //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 oldListId = this.previous.listId;
const oldSwimlaneId = this.previous.swimlaneId; const oldSwimlaneId = this.previous.swimlaneId;
const oldBoardId = this.previous.boardId; 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 // 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( const modifiedAt = new Date(
new Date(value).getTime() - new Date(value).getTime() -
(action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0), (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
); // set it as 1 year before ); // set it as 1 year before
const boardId = list.boardId; const boardId = list.boardId;
Lists.direct.update( Lists.direct.update(
@ -2029,7 +2029,7 @@ if (Meteor.isServer) {
JsonRoutes.add( JsonRoutes.add(
'GET', 'GET',
'/api/boards/:boardId/swimlanes/:swimlaneId/cards', '/api/boards/:boardId/swimlanes/:swimlaneId/cards',
function (req, res) { function(req, res) {
const paramBoardId = req.params.boardId; const paramBoardId = req.params.boardId;
const paramSwimlaneId = req.params.swimlaneId; const paramSwimlaneId = req.params.swimlaneId;
Authentication.checkBoardAccess(req.userId, paramBoardId); Authentication.checkBoardAccess(req.userId, paramBoardId);
@ -2039,7 +2039,7 @@ if (Meteor.isServer) {
boardId: paramBoardId, boardId: paramBoardId,
swimlaneId: paramSwimlaneId, swimlaneId: paramSwimlaneId,
archived: false, archived: false,
}).map(function (doc) { }).map(function(doc) {
return { return {
_id: doc._id, _id: doc._id,
title: doc.title, title: doc.title,
@ -2063,7 +2063,7 @@ if (Meteor.isServer) {
* title: string, * title: string,
* description: string}] * description: string}]
*/ */
JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function ( JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(
req, req,
res, res,
) { ) {
@ -2076,7 +2076,7 @@ if (Meteor.isServer) {
boardId: paramBoardId, boardId: paramBoardId,
listId: paramListId, listId: paramListId,
archived: false, archived: false,
}).map(function (doc) { }).map(function(doc) {
return { return {
_id: doc._id, _id: doc._id,
title: doc.title, title: doc.title,
@ -2098,7 +2098,7 @@ if (Meteor.isServer) {
JsonRoutes.add( JsonRoutes.add(
'GET', 'GET',
'/api/boards/:boardId/lists/:listId/cards/:cardId', '/api/boards/:boardId/lists/:listId/cards/:cardId',
function (req, res) { function(req, res) {
const paramBoardId = req.params.boardId; const paramBoardId = req.params.boardId;
const paramListId = req.params.listId; const paramListId = req.params.listId;
const paramCardId = req.params.cardId; 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 * @param {string} [assignees] the array of maximum one ID of assignee of the new card
* @return_type {_id: string} * @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, req,
res, res,
) { ) {
@ -2237,7 +2237,7 @@ if (Meteor.isServer) {
JsonRoutes.add( JsonRoutes.add(
'PUT', 'PUT',
'/api/boards/:boardId/lists/:listId/cards/:cardId', '/api/boards/:boardId/lists/:listId/cards/:cardId',
function (req, res) { function(req, res) {
Authentication.checkUserId(req.userId); Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId; const paramBoardId = req.params.boardId;
const paramCardId = req.params.cardId; const paramCardId = req.params.cardId;
@ -2536,7 +2536,7 @@ if (Meteor.isServer) {
JsonRoutes.add( JsonRoutes.add(
'DELETE', 'DELETE',
'/api/boards/:boardId/lists/:listId/cards/:cardId', '/api/boards/:boardId/lists/:listId/cards/:cardId',
function (req, res) { function(req, res) {
Authentication.checkUserId(req.userId); Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId; const paramBoardId = req.params.boardId;
const paramListId = req.params.listId; const paramListId = req.params.listId;

View file

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

View file

@ -1,4 +1,4 @@
const DateString = Match.Where(function (dateAsString) { const DateString = Match.Where(function(dateAsString) {
check(dateAsString, String); check(dateAsString, String);
return moment(dateAsString, moment.ISO_8601).isValid(); return moment(dateAsString, moment.ISO_8601).isValid();
}); });
@ -299,13 +299,13 @@ export class TrelloCreator {
} }
} }
return true; return true;
}) });
if (positiveVotes.length > 0) { if (positiveVotes.length > 0) {
cardToCreate.vote = { cardToCreate.vote = {
question: cardToCreate.title, question: cardToCreate.title,
public: true, public: true,
positive: positiveVotes, 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. // so we make it server only, and let UI catch up once it is done, forget about latency comp.
const self = this; const self = this;
if (Meteor.isServer) { if (Meteor.isServer) {
file.attachData(att.url, function (error) { file.attachData(att.url, function(error) {
file.boardId = boardId; file.boardId = boardId;
file.cardId = cardId; file.cardId = cardId;
file.userId = self._user(att.idMemberCreator); file.userId = self._user(att.idMemberCreator);

View file

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