mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 21:17:18 -04:00
commit
aae5030b53
8 changed files with 87 additions and 58 deletions
77
.eslintrc
77
.eslintrc
|
@ -1,7 +1,14 @@
|
||||||
ecmaFeatures:
|
ecmaFeatures:
|
||||||
experimentalObjectRestSpread: true
|
experimentalObjectRestSpread: true
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- meteor
|
||||||
|
|
||||||
|
parser: babel-eslint
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
|
strict: 0
|
||||||
|
no-undef: 2
|
||||||
accessor-pairs: 2
|
accessor-pairs: 2
|
||||||
comma-dangle: [2, 'always-multiline']
|
comma-dangle: [2, 'always-multiline']
|
||||||
consistent-return: 2
|
consistent-return: 2
|
||||||
|
@ -43,36 +50,39 @@ rules:
|
||||||
prefer-spread: 2
|
prefer-spread: 2
|
||||||
prefer-template: 2
|
prefer-template: 2
|
||||||
|
|
||||||
globals:
|
# eslint-plugin-meteor
|
||||||
# Meteor globals
|
## Meteor API
|
||||||
Meteor: false
|
meteor/globals: 2
|
||||||
DDP: false
|
meteor/core: 2
|
||||||
Mongo: false
|
meteor/pubsub: 2
|
||||||
Session: false
|
meteor/methods: 2
|
||||||
Accounts: false
|
meteor/check: 2
|
||||||
Template: false
|
meteor/connections: 2
|
||||||
Blaze: false
|
meteor/collections: 2
|
||||||
UI: false
|
meteor/session: [2, 'no-equal']
|
||||||
Match: false
|
|
||||||
check: false
|
|
||||||
Tracker: false
|
|
||||||
Deps: false
|
|
||||||
ReactiveVar: false
|
|
||||||
EJSON: false
|
|
||||||
HTTP: false
|
|
||||||
Email: false
|
|
||||||
Assets: false
|
|
||||||
Handlebars: false
|
|
||||||
Package: false
|
|
||||||
App: false
|
|
||||||
Npm: false
|
|
||||||
Tinytest: false
|
|
||||||
Random: false
|
|
||||||
HTML: false
|
|
||||||
|
|
||||||
|
## Best practices
|
||||||
|
meteor/no-session: 0
|
||||||
|
meteor/no-zero-timeout: 2
|
||||||
|
meteor/no-blaze-lifecycle-assignment: 2
|
||||||
|
|
||||||
|
settings:
|
||||||
|
meteor:
|
||||||
|
|
||||||
|
# Our collections
|
||||||
|
collections:
|
||||||
|
- AccountsTemplates
|
||||||
|
- Activities
|
||||||
|
- Attachments
|
||||||
|
- Boards
|
||||||
|
- CardComments
|
||||||
|
- Cards
|
||||||
|
- Lists
|
||||||
|
- UnsavedEditCollection
|
||||||
|
- Users
|
||||||
|
|
||||||
|
globals:
|
||||||
# Exported by packages we use
|
# Exported by packages we use
|
||||||
'$': false
|
|
||||||
_: false
|
|
||||||
autosize: false
|
autosize: false
|
||||||
Avatar: true
|
Avatar: true
|
||||||
Avatars: true
|
Avatars: true
|
||||||
|
@ -97,17 +107,6 @@ globals:
|
||||||
T9n: false
|
T9n: false
|
||||||
TAPi18n: false
|
TAPi18n: false
|
||||||
|
|
||||||
# Our collections
|
|
||||||
AccountsTemplates: true
|
|
||||||
Activities: true
|
|
||||||
Attachments: true
|
|
||||||
Boards: true
|
|
||||||
CardComments: true
|
|
||||||
Cards: true
|
|
||||||
Lists: true
|
|
||||||
UnsavedEditCollection: true
|
|
||||||
Users: true
|
|
||||||
|
|
||||||
# Our objects
|
# Our objects
|
||||||
CSSEvents: true
|
CSSEvents: true
|
||||||
EscapeActions: true
|
EscapeActions: true
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@
|
||||||
.tx/
|
.tx/
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
tmp/
|
tmp/
|
||||||
|
node_modules/
|
||||||
|
|
|
@ -3,7 +3,6 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.10.40"
|
- "0.10.40"
|
||||||
install:
|
install:
|
||||||
- "npm install -g eslint"
|
- "npm install"
|
||||||
- "npm install -g eslint-plugin-meteor"
|
|
||||||
script:
|
script:
|
||||||
- "eslint ./"
|
- "npm test"
|
||||||
|
|
|
@ -23,7 +23,7 @@ BlazeComponent.extendComponent({
|
||||||
commentFormIsOpen.set(true);
|
commentFormIsOpen.set(true);
|
||||||
},
|
},
|
||||||
'submit .js-new-comment-form'(evt) {
|
'submit .js-new-comment-form'(evt) {
|
||||||
const input = this.getInput()
|
const input = this.getInput();
|
||||||
const text = input.val().trim();
|
const text = input.val().trim();
|
||||||
if (text) {
|
if (text) {
|
||||||
CardComments.insert({
|
CardComments.insert({
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Attachments = new FS.Collection('attachments', {
|
Attachments = new FS.Collection('attachments', { // eslint-disable-line meteor/collections
|
||||||
stores: [
|
stores: [
|
||||||
|
|
||||||
// XXX Add a new store for cover thumbnails so we don't load big images in
|
// XXX Add a new store for cover thumbnails so we don't load big images in
|
||||||
|
|
|
@ -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
|
// 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.
|
// is used for instance to add a new user to a board.
|
||||||
|
@ -8,6 +8,24 @@ Users.initEasySearch(searchInFields, {
|
||||||
returnFields: [...searchInFields, 'profile.avatarUrl'],
|
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({
|
Users.helpers({
|
||||||
boards() {
|
boards() {
|
||||||
return Boards.find({ userId: this._id });
|
return Boards.find({ userId: this._id });
|
||||||
|
@ -23,18 +41,6 @@ Users.helpers({
|
||||||
return _.contains(starredBoards, boardId);
|
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() {
|
getAvatarUrl() {
|
||||||
// Although we put the avatar picture URL in the `profile` object, we need
|
// Although we put the avatar picture URL in the `profile` object, we need
|
||||||
// to support Sandstorm which put in the `picture` attribute by default.
|
// to support Sandstorm which put in the `picture` attribute by default.
|
||||||
|
|
24
package.json
Normal file
24
package.json
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"name": "wekan",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "The open-source Trello-like kanban",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
|
"test": "npm run lint"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/wekan/wekan.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/wekan/wekan/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/wekan/wekan#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-eslint": "4.1.3",
|
||||||
|
"eslint": "1.7.3",
|
||||||
|
"eslint-plugin-meteor": "1.5.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -109,7 +109,7 @@ if (isSandstorm && Meteor.isClient) {
|
||||||
// sandstorm client to return relative paths instead of absolutes.
|
// sandstorm client to return relative paths instead of absolutes.
|
||||||
const _absoluteUrl = Meteor.absoluteUrl;
|
const _absoluteUrl = Meteor.absoluteUrl;
|
||||||
const _defaultOptions = Meteor.absoluteUrl.defaultOptions;
|
const _defaultOptions = Meteor.absoluteUrl.defaultOptions;
|
||||||
Meteor.absoluteUrl = (path, options) => {
|
Meteor.absoluteUrl = (path, options) => { // eslint-disable-line meteor/core
|
||||||
const url = _absoluteUrl(path, options);
|
const url = _absoluteUrl(path, options);
|
||||||
return url.replace(/^https?:\/\/127\.0\.0\.1:[0-9]{2,5}/, '');
|
return url.replace(/^https?:\/\/127\.0\.0\.1:[0-9]{2,5}/, '');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue