mirror of
https://github.com/wekan/wekan.git
synced 2026-01-28 04:06:10 +01:00
Add eslint-plugin-meteor
Add rules for eslint-plugin-meteor. Use local version of eslint and eslint-plugin-meteor, instead of relying on global versions. Ensures consistent versions of eslint and eslint-plugin-meteor for all developers.
This commit is contained in:
parent
3ad672a20b
commit
3956a6ec20
6 changed files with 80 additions and 54 deletions
|
|
@ -1,4 +1,4 @@
|
|||
Users = Meteor.users;
|
||||
Users = Meteor.users; // eslint-disable-line meteor/collections
|
||||
|
||||
// Search a user in the complete server database by its name or username. This
|
||||
// is used for instance to add a new user to a board.
|
||||
|
|
@ -8,6 +8,24 @@ Users.initEasySearch(searchInFields, {
|
|||
returnFields: [...searchInFields, 'profile.avatarUrl'],
|
||||
});
|
||||
|
||||
if (Meteor.isClient) {
|
||||
Users.helpers({
|
||||
isBoardMember() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board &&
|
||||
_.contains(_.pluck(board.members, 'userId'), this._id) &&
|
||||
_.where(board.members, {userId: this._id})[0].isActive;
|
||||
},
|
||||
|
||||
isBoardAdmin() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board &&
|
||||
this.isBoardMember(board) &&
|
||||
_.where(board.members, {userId: this._id})[0].isAdmin;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Users.helpers({
|
||||
boards() {
|
||||
return Boards.find({ userId: this._id });
|
||||
|
|
@ -23,18 +41,6 @@ Users.helpers({
|
|||
return _.contains(starredBoards, boardId);
|
||||
},
|
||||
|
||||
isBoardMember() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board && _.contains(_.pluck(board.members, 'userId'), this._id) &&
|
||||
_.where(board.members, {userId: this._id})[0].isActive;
|
||||
},
|
||||
|
||||
isBoardAdmin() {
|
||||
const board = Boards.findOne(Session.get('currentBoard'));
|
||||
return board && this.isBoardMember(board) &&
|
||||
_.where(board.members, {userId: this._id})[0].isAdmin;
|
||||
},
|
||||
|
||||
getAvatarUrl() {
|
||||
// Although we put the avatar picture URL in the `profile` object, we need
|
||||
// to support Sandstorm which put in the `picture` attribute by default.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue