Fix lint errors

This commit is contained in:
Andrés Manelli 2019-02-24 00:13:35 +01:00
parent 60be4df76e
commit eb62c9ce6a
9 changed files with 163 additions and 163 deletions

View file

@ -471,7 +471,7 @@ Boards.helpers({
query.type = 'template-swimlane';
query.archived = false;
} else {
query.type = {$nin: ['template-swimlane']};
query.type = {$nin: ['template-swimlane']};
}
const projection = { limit: 10, sort: { createdAt: -1 } };
@ -495,7 +495,7 @@ Boards.helpers({
query.type = 'template-list';
query.archived = false;
} else {
query.type = {$nin: ['template-list']};
query.type = {$nin: ['template-list']};
}
const projection = { limit: 10, sort: { createdAt: -1 } };
@ -522,7 +522,7 @@ Boards.helpers({
query.type = 'template-card';
query.archived = false;
} else {
query.type = {$nin: ['template-card']};
query.type = {$nin: ['template-card']};
}
const projection = { limit: 10, sort: { createdAt: -1 } };
@ -975,7 +975,7 @@ if (Meteor.isServer) {
* @param {string} userId the ID of the user to retrieve the data
* @return_type [{_id: string,
title: string}]
*/
*/
JsonRoutes.add('GET', '/api/users/:userId/boards', function (req, res) {
try {
Authentication.checkLoggedIn(req.userId);
@ -1012,7 +1012,7 @@ if (Meteor.isServer) {
*
* @return_type [{_id: string,
title: string}]
*/
*/
JsonRoutes.add('GET', '/api/boards', function (req, res) {
try {
Authentication.checkUserId(req.userId);
@ -1083,7 +1083,7 @@ if (Meteor.isServer) {
*
* @return_type {_id: string,
defaultSwimlaneId: string}
*/
*/
JsonRoutes.add('POST', '/api/boards', function (req, res) {
try {
Authentication.checkUserId(req.userId);

View file

@ -273,28 +273,28 @@ Cards.allow({
Cards.helpers({
copy() {
const oldId = this._id;
this._id = null;
const _id = Cards.insert(this);
const oldId = this._id;
this._id = null;
const _id = Cards.insert(this);
// copy checklists
Checklists.find({cardId: oldId}).forEach((ch) => {
ch.copy(_id);
});
// copy checklists
Checklists.find({cardId: oldId}).forEach((ch) => {
ch.copy(_id);
});
// copy subtasks
Cards.find({parentId: oldId}).forEach((subtask) => {
subtask.parentId = _id;
subtask._id = null;
Cards.insert(subtask);
});
// copy subtasks
Cards.find({parentId: oldId}).forEach((subtask) => {
subtask.parentId = _id;
subtask._id = null;
Cards.insert(subtask);
});
// copy card comments
CardComments.find({cardId: oldId}).forEach((cmt) => {
cmt.copy(_id);
});
// copy card comments
CardComments.find({cardId: oldId}).forEach((cmt) => {
cmt.copy(_id);
});
return _id;
return _id;
},
list() {
@ -1259,7 +1259,7 @@ Cards.mutations({
function cardMove(userId, doc, fieldNames, oldListId, oldSwimlaneId) {
if ((_.contains(fieldNames, 'listId') && doc.listId !== oldListId) ||
(_.contains(fieldNames, 'swimlaneId') && doc.swimlaneId !== oldSwimlaneId)){
(_.contains(fieldNames, 'swimlaneId') && doc.swimlaneId !== oldSwimlaneId)){
Activities.insert({
userId,
oldListId,

View file

@ -49,16 +49,16 @@ Checklists.attachSchema(new SimpleSchema({
Checklists.helpers({
copy(newCardId) {
const oldChecklistId = this._id;
this._id = null;
this.cardId = newCardId;
const newChecklistId = Checklists.insert(this);
ChecklistItems.find({checklistId: oldChecklistId}).forEach((item) => {
item._id = null;
item.checklistId = newChecklistId;
item.cardId = newCardId;
ChecklistItems.insert(item);
});
const oldChecklistId = this._id;
this._id = null;
this.cardId = newCardId;
const newChecklistId = Checklists.insert(this);
ChecklistItems.find({checklistId: oldChecklistId}).forEach((item) => {
item._id = null;
item.checklistId = newChecklistId;
item.cardId = newCardId;
ChecklistItems.insert(item);
});
},
itemCount() {

View file

@ -138,30 +138,30 @@ Lists.allow({
Lists.helpers({
copy() {
const oldId = this._id;
let _id = null;
existingListWithSameName = Lists.findOne({
boardId: this.boardId,
title: this.title,
});
if (existingListWithSameName) {
_id = existingListWithSameName._id;
} else {
this._id = null;
_id = Lists.insert(this);
}
const oldId = this._id;
let _id = null;
existingListWithSameName = Lists.findOne({
boardId: this.boardId,
title: this.title,
});
if (existingListWithSameName) {
_id = existingListWithSameName._id;
} else {
this._id = null;
_id = Lists.insert(this);
}
// Copy all cards in list
Cards.find({
listId: oldId,
archived: false,
}).forEach((card) => {
card.type = 'cardType-card';
card.listId = _id;
card.boardId = this.boardId;
card.swimlaneId = this.swimlaneId;
card.copy();
});
// Copy all cards in list
Cards.find({
listId: oldId,
archived: false,
}).forEach((card) => {
card.type = 'cardType-card';
card.listId = _id;
card.boardId = this.boardId;
card.swimlaneId = this.swimlaneId;
card.copy();
});
},
cards(swimlaneId) {
@ -224,7 +224,7 @@ Lists.mutations({
archive() {
if (this.isTemplateList()) {
this.cards().forEach((card) => {
return card.archive();
return card.archive();
});
}
return { $set: { archived: true } };
@ -233,7 +233,7 @@ Lists.mutations({
restore() {
if (this.isTemplateList()) {
this.allCards().forEach((card) => {
return card.restore();
return card.restore();
});
}
return { $set: { archived: false } };

View file

@ -102,20 +102,20 @@ Swimlanes.allow({
Swimlanes.helpers({
copy() {
const oldId = this._id;
this._id = null;
const _id = Swimlanes.insert(this);
const oldId = this._id;
this._id = null;
const _id = Swimlanes.insert(this);
// Copy all lists in swimlane
Lists.find({
swimlaneId: oldId,
archived: false,
}).forEach((list) => {
list.type = 'list';
list.swimlaneId = _id;
list.boardId = this.boardId;
list.copy();
});
// Copy all lists in swimlane
Lists.find({
swimlaneId: oldId,
archived: false,
}).forEach((list) => {
list.type = 'list';
list.swimlaneId = _id;
list.boardId = this.boardId;
list.copy();
});
},
cards() {
@ -127,8 +127,8 @@ Swimlanes.helpers({
lists() {
return Lists.find(Filter.mongoSelector({
swimlaneId: this._id,
archived: false,
swimlaneId: this._id,
archived: false,
}), { sort: ['sort'] });
},
@ -155,22 +155,22 @@ Swimlanes.helpers({
},
isTemplateContainer() {
return this.type === 'template-container';
return this.type === 'template-container';
},
isListTemplatesSwimlane() {
const user = Users.findOne(Meteor.userId());
return user.profile.listTemplatesSwimlaneId === this._id;
const user = Users.findOne(Meteor.userId());
return user.profile.listTemplatesSwimlaneId === this._id;
},
isCardTemplatesSwimlane() {
const user = Users.findOne(Meteor.userId());
return user.profile.cardTemplatesSwimlaneId === this._id;
const user = Users.findOne(Meteor.userId());
return user.profile.cardTemplatesSwimlaneId === this._id;
},
isBoardTemplatesSwimlane() {
const user = Users.findOne(Meteor.userId());
return user.profile.boardTemplatesSwimlaneId === this._id;
const user = Users.findOne(Meteor.userId());
return user.profile.boardTemplatesSwimlaneId === this._id;
},
});
@ -182,7 +182,7 @@ Swimlanes.mutations({
archive() {
if (this.isTemplateSwimlane()) {
this.lists().forEach((list) => {
return list.archive();
return list.archive();
});
}
return { $set: { archived: true } };
@ -191,7 +191,7 @@ Swimlanes.mutations({
restore() {
if (this.isTemplateSwimlane()) {
this.allLists().forEach((list) => {
return list.restore();
return list.restore();
});
}
return { $set: { archived: false } };

View file

@ -358,11 +358,11 @@ Users.helpers({
},
getTemplatesBoardId() {
return this.profile.templatesBoardId;
return this.profile.templatesBoardId;
},
getTemplatesBoardSlug() {
return Boards.findOne(this.profile.templatesBoardId).slug;
return Boards.findOne(this.profile.templatesBoardId).slug;
},
});
@ -741,47 +741,47 @@ if (Meteor.isServer) {
Boards.insert({
title: TAPi18n.__('templates'),
permission: 'private',
type: 'template-container'
type: 'template-container',
}, fakeUser, (err, boardId) => {
// Insert the reference to our templates board
Users.update(fakeUserId.get(), {$set: {'profile.templatesBoardId': boardId}});
// Insert the reference to our templates board
Users.update(fakeUserId.get(), {$set: {'profile.templatesBoardId': boardId}});
// Insert the card templates swimlane
Swimlanes.insert({
title: TAPi18n.__('card-templates-swimlane'),
boardId,
sort: 1,
type: 'template-container',
}, fakeUser, (err, swimlaneId) => {
// Insert the card templates swimlane
Swimlanes.insert({
title: TAPi18n.__('card-templates-swimlane'),
boardId,
sort: 1,
type: 'template-container',
}, fakeUser, (err, swimlaneId) => {
// Insert the reference to out card templates swimlane
Users.update(fakeUserId.get(), {$set: {'profile.cardTemplatesSwimlaneId': swimlaneId}});
});
// Insert the reference to out card templates swimlane
Users.update(fakeUserId.get(), {$set: {'profile.cardTemplatesSwimlaneId': swimlaneId}});
});
// Insert the list templates swimlane
Swimlanes.insert({
title: TAPi18n.__('list-templates-swimlane'),
boardId,
sort: 2,
type: 'template-container',
}, fakeUser, (err, swimlaneId) => {
// Insert the list templates swimlane
Swimlanes.insert({
title: TAPi18n.__('list-templates-swimlane'),
boardId,
sort: 2,
type: 'template-container',
}, fakeUser, (err, swimlaneId) => {
// Insert the reference to out list templates swimlane
Users.update(fakeUserId.get(), {$set: {'profile.listTemplatesSwimlaneId': swimlaneId}});
});
// Insert the reference to out list templates swimlane
Users.update(fakeUserId.get(), {$set: {'profile.listTemplatesSwimlaneId': swimlaneId}});
});
// Insert the board templates swimlane
Swimlanes.insert({
title: TAPi18n.__('board-templates-swimlane'),
boardId,
sort: 3,
type: 'template-container',
}, fakeUser, (err, swimlaneId) => {
// Insert the board templates swimlane
Swimlanes.insert({
title: TAPi18n.__('board-templates-swimlane'),
boardId,
sort: 3,
type: 'template-container',
}, fakeUser, (err, swimlaneId) => {
// Insert the reference to out board templates swimlane
Users.update(fakeUserId.get(), {$set: {'profile.boardTemplatesSwimlaneId': swimlaneId}});
});
// Insert the reference to out board templates swimlane
Users.update(fakeUserId.get(), {$set: {'profile.boardTemplatesSwimlaneId': swimlaneId}});
});
});
});
});