summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-04-22 21:00:31 +0300
committerLauri Ojansivu <x@xet7.org>2020-04-22 21:00:31 +0300
commit9e95c06415e614e587d684ff9660cc53c5f8c8d3 (patch)
tree6ae4347dd76a814e58b86b3bd062ed68c7c3c4c0
parente7603298d7a67c928bb20d26d57268b2c0b715d3 (diff)
downloadwekan-9e95c06415e614e587d684ff9660cc53c5f8c8d3.tar.gz
wekan-9e95c06415e614e587d684ff9660cc53c5f8c8d3.tar.bz2
wekan-9e95c06415e614e587d684ff9660cc53c5f8c8d3.zip
Fix lint errors in lint error fix.
Thanks to xet7 !
-rw-r--r--client/components/boards/boardArchive.js2
-rw-r--r--client/components/boards/boardsList.js4
-rw-r--r--client/components/cards/cardDetails.js17
-rw-r--r--client/components/sidebar/sidebar.js17
-rw-r--r--models/boards.js5
-rw-r--r--models/cards.js34
-rw-r--r--models/settings.js1
-rw-r--r--models/trelloCreator.js8
-rw-r--r--server/migrations.js8
9 files changed, 47 insertions, 49 deletions
diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js
index 9f4d60a1..5a5cf772 100644
--- a/client/components/boards/boardArchive.js
+++ b/client/components/boards/boardArchive.js
@@ -7,7 +7,7 @@ BlazeComponent.extendComponent({
return Boards.find(
{ archived: true },
{
- sort: { sort: 1 /* boards default sorting */ }
+ sort: { sort: 1 /* boards default sorting */ },
},
);
},
diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js
index 847ea395..9208fdb2 100644
--- a/client/components/boards/boardsList.js
+++ b/client/components/boards/boardsList.js
@@ -86,7 +86,9 @@ BlazeComponent.extendComponent({
query['members.userId'] = Meteor.userId();
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() {
const user = Meteor.user();
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index a578ba7c..b958d5bf 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -56,9 +56,8 @@ BlazeComponent.extendComponent({
},
votePublic() {
const card = this.currentData();
- if (card.vote)
- return card.vote.public
- return null
+ if (card.vote) return card.vote.public;
+ return null;
},
voteCountPositive() {
const card = this.currentData();
@@ -380,7 +379,7 @@ BlazeComponent.extendComponent({
}
},
'click .js-go-to-linked-card'() {
- Utils.goCardId(this.data().linkedId)
+ Utils.goCardId(this.data().linkedId);
},
'click .js-member': Popup.open('cardMember'),
'click .js-add-members': Popup.open('cardMembers'),
@@ -391,7 +390,7 @@ BlazeComponent.extendComponent({
'click .js-start-date': Popup.open('editCardStartDate'),
'click .js-due-date': Popup.open('editCardDueDate'),
'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'),
'mouseenter .js-card-details'() {
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'));
});
@@ -672,7 +671,7 @@ Template.editCardTitleForm.events({
},
});
-Template.editCardRequesterForm.onRendered(function () {
+Template.editCardRequesterForm.onRendered(function() {
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'));
});
@@ -825,7 +824,7 @@ Template.copyChecklistToManyCardsPopup.events({
// copy subtasks
cursor = Cards.find({ parentId: oldId });
- cursor.forEach(function () {
+ cursor.forEach(function() {
'use strict';
const subtask = arguments[0];
subtask.parentId = _id;
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 11471c2f..cbe00797 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -196,14 +196,14 @@ Template.boardMenuPopup.events({
},
'click .js-change-board-color': Popup.open('boardChangeColor'),
'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'));
currentBoard.archive();
// XXX We should have some kind of notification on top of the page to
// confirm that the board was successfully archived.
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'));
Popup.close();
Boards.remove(currentBoard._id);
@@ -215,17 +215,16 @@ Template.boardMenuPopup.events({
'click .js-card-settings': Popup.open('boardCardSettings'),
});
-
-Template.boardMenuPopup.onCreated(function () {
+Template.boardMenuPopup.onCreated(function() {
this.apiEnabled = new ReactiveVar(false);
Meteor.call('_isApiEnabled', (e, result) => {
- this.apiEnabled.set(result)
- })
-})
+ this.apiEnabled.set(result);
+ });
+});
Template.boardMenuPopup.helpers({
withApi() {
- return Template.instance().apiEnabled.get()
+ return Template.instance().apiEnabled.get();
},
exportUrl() {
const params = {
@@ -248,7 +247,7 @@ Template.memberPopup.events({
Popup.close();
},
'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 memberId = this.userId;
Cards.find({ boardId, members: memberId }).forEach(card => {
diff --git a/models/boards.js b/models/boards.js
index 170ebc5a..26dc6127 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -1297,7 +1297,10 @@ if (Meteor.isServer) {
// Insert new board at last position in sort order.
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') {
doc.sort = lastBoard.sort + 1;
}
diff --git a/models/cards.js b/models/cards.js
index 485837ef..72153132 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -732,7 +732,7 @@ Cards.helpers({
parentString(sep) {
return this.parentList()
- .map(function (elem) {
+ .map(function(elem) {
return elem.title;
})
.join(sep);
@@ -1050,13 +1050,13 @@ Cards.helpers({
voteMemberPositive() {
if (this.vote && this.vote.positive)
- return Users.find({ _id: { $in: this.vote.positive } })
- return []
+ return Users.find({ _id: { $in: this.vote.positive } });
+ return [];
},
voteMemberNegative() {
if (this.vote && this.vote.negative)
- return Users.find({ _id: { $in: this.vote.negative } })
- return []
+ return Users.find({ _id: { $in: this.vote.negative } });
+ return [];
},
getId() {
@@ -1475,12 +1475,12 @@ Cards.mutations({
},
};
},
- setVoteQuestion(question, public_) {
+ setVoteQuestion(question, public) {
return {
$set: {
vote: {
question,
- public_,
+ public,
positive: [],
negative: [],
},
@@ -1929,7 +1929,7 @@ if (Meteor.isServer) {
});
//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 oldSwimlaneId = this.previous.swimlaneId;
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
const modifiedAt = new Date(
new Date(value).getTime() -
- (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
+ (action === 'endAt' ? 365 * 24 * 3600 * 1e3 : 0),
); // set it as 1 year before
const boardId = list.boardId;
Lists.direct.update(
@@ -2029,7 +2029,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'GET',
'/api/boards/:boardId/swimlanes/:swimlaneId/cards',
- function (req, res) {
+ function(req, res) {
const paramBoardId = req.params.boardId;
const paramSwimlaneId = req.params.swimlaneId;
Authentication.checkBoardAccess(req.userId, paramBoardId);
@@ -2039,7 +2039,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
swimlaneId: paramSwimlaneId,
archived: false,
- }).map(function (doc) {
+ }).map(function(doc) {
return {
_id: doc._id,
title: doc.title,
@@ -2063,7 +2063,7 @@ if (Meteor.isServer) {
* title: string,
* description: string}]
*/
- JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function (
+ JsonRoutes.add('GET', '/api/boards/:boardId/lists/:listId/cards', function(
req,
res,
) {
@@ -2076,7 +2076,7 @@ if (Meteor.isServer) {
boardId: paramBoardId,
listId: paramListId,
archived: false,
- }).map(function (doc) {
+ }).map(function(doc) {
return {
_id: doc._id,
title: doc.title,
@@ -2098,7 +2098,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'GET',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
- function (req, res) {
+ function(req, res) {
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
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
* @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,
res,
) {
@@ -2237,7 +2237,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'PUT',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
- function (req, res) {
+ function(req, res) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramCardId = req.params.cardId;
@@ -2536,7 +2536,7 @@ if (Meteor.isServer) {
JsonRoutes.add(
'DELETE',
'/api/boards/:boardId/lists/:listId/cards/:cardId',
- function (req, res) {
+ function(req, res) {
Authentication.checkUserId(req.userId);
const paramBoardId = req.params.boardId;
const paramListId = req.params.listId;
diff --git a/models/settings.js b/models/settings.js
index 03ef9052..fb823205 100644
--- a/models/settings.js
+++ b/models/settings.js
@@ -338,7 +338,6 @@ if (Meteor.isServer) {
isPasswordLoginDisabled() {
return process.env.PASSWORD_LOGIN_ENABLED === 'false';
},
-
});
}
diff --git a/models/trelloCreator.js b/models/trelloCreator.js
index 28982f43..1c5bcd93 100644
--- a/models/trelloCreator.js
+++ b/models/trelloCreator.js
@@ -1,4 +1,4 @@
-const DateString = Match.Where(function (dateAsString) {
+const DateString = Match.Where(function(dateAsString) {
check(dateAsString, String);
return moment(dateAsString, moment.ISO_8601).isValid();
});
@@ -299,13 +299,13 @@ export class TrelloCreator {
}
}
return true;
- })
+ });
if (positiveVotes.length > 0) {
cardToCreate.vote = {
question: cardToCreate.title,
public: true,
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.
const self = this;
if (Meteor.isServer) {
- file.attachData(att.url, function (error) {
+ file.attachData(att.url, function(error) {
file.boardId = boardId;
file.cardId = cardId;
file.userId = self._user(att.idMemberCreator);
diff --git a/server/migrations.js b/server/migrations.js
index 21b54bda..a6c945fa 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -1036,12 +1036,8 @@ Migrations.add('add-description-text-allowed', () => {
Migrations.add('add-sort-field-to-boards', () => {
Boards.find().forEach((board, index) => {
- if (!board.hasOwnProperty('sort')) {
- Boards.direct.update(
- board._id,
- { $set: { sort: index } },
- noValidate
- );
+ if (!board.hasOwnProperty('sort')) {
+ Boards.direct.update(board._id, { $set: { sort: index } }, noValidate);
}
});
});