- {
context.messages.flash(context.intl.formatMessage({id: "users.edit_success"}, {name: Users.getDisplayName(user)}), 'success')
@@ -34,7 +34,7 @@ const UsersEdit = (props, context) => {
)
};
-
+
UsersEdit.propTypes = {
user: React.PropTypes.object.isRequired,
};
@@ -48,4 +48,4 @@ UsersEdit.contextTypes = {
UsersEdit.displayName = "UsersEdit";
module.exports = UsersEdit;
-export default UsersEdit;
\ No newline at end of file
+export default UsersEdit;
diff --git a/packages/nova-base-components/lib/users/UsersResetPassword.jsx b/packages/nova-base-components/lib/users/UsersResetPassword.jsx
index c36eb596d..866e6eda3 100644
--- a/packages/nova-base-components/lib/users/UsersResetPassword.jsx
+++ b/packages/nova-base-components/lib/users/UsersResetPassword.jsx
@@ -1,5 +1,6 @@
-import React, { Component } from 'react';
import { Accounts, STATES } from 'meteor/std:accounts-ui';
+import { T9n } from 'meteor/softwarerero:accounts-t9n';
+import React, { Component } from 'react';
import { Link } from 'react-router';
class UsersResetPassword extends Component {
diff --git a/packages/nova-base-routes/lib/routes.jsx b/packages/nova-base-routes/lib/routes.jsx
index 753c8cda2..abec7a71a 100644
--- a/packages/nova-base-routes/lib/routes.jsx
+++ b/packages/nova-base-routes/lib/routes.jsx
@@ -1,16 +1,16 @@
import Telescope from 'meteor/nova:lib';
-import React from 'react';
-import {mount} from 'react-mounter';
import { Messages } from 'meteor/nova:core';
-import { IndexRoute, Route, useRouterHistory, browserHistory, createMemoryHistory } from 'react-router';
-import { ReactRouterSSR } from 'meteor/reactrouter:react-router-ssr';
-import { ListContainer, DocumentContainer } from "meteor/utilities:react-list-container";
-// import useNamedRoutes from 'use-named-routes';
-import createBrowserHistory from 'history/lib/createBrowserHistory';
import Events from "meteor/nova:events";
+import { ReactRouterSSR } from 'meteor/reactrouter:react-router-ssr';
+import React from 'react';
import Helmet from 'react-helmet';
import Cookie from 'react-cookie';
import ReactDOM from 'react-dom';
+// import {mount} from 'react-mounter';
+// import { IndexRoute, Route, useRouterHistory, browserHistory, createMemoryHistory } from 'react-router';
+// import { ListContainer, DocumentContainer } from "meteor/utilities:react-list-container";
+// import useNamedRoutes from 'use-named-routes';
+// import createBrowserHistory from 'history/lib/createBrowserHistory';
Telescope.routes.indexRoute = { name: "posts.list", component: Telescope.components.PostsHome };
@@ -33,13 +33,13 @@ Meteor.startup(() => {
childRoutes: Telescope.routes.routes
}
- let history;
+ // let history;
const clientOptions = {
renderHook: ReactDOM.render,
props: {
onUpdate: () => {
- Events.analyticsRequest();
+ Events.analyticsRequest();
Messages.clearSeen();
}
}
@@ -48,15 +48,15 @@ Meteor.startup(() => {
const serverOptions = {
htmlHook: (html) => {
const head = Helmet.rewind();
- return html.replace('', ''+ head.title + head.meta + head.link);
+ return html.replace('', ''+ head.title + head.meta + head.link);
},
preRender: (req, res) => {
Cookie.plugToRequest(req, res);
},
};
-
+
ReactRouterSSR.Run(AppRoutes, clientOptions, serverOptions);
-
+
// note: we did like this at first
// if (Meteor.isClient) {
// history = useNamedRoutes(useRouterHistory(createBrowserHistory))({ routes: AppRoutes });
@@ -66,4 +66,4 @@ Meteor.startup(() => {
// }
// ReactRouterSSR.Run(AppRoutes, {historyHook: () => history}, {historyHook: () => history});
-});
\ No newline at end of file
+});
diff --git a/packages/nova-categories/lib/helpers.js b/packages/nova-categories/lib/helpers.js
index 0d4be6dcc..a3e35944e 100644
--- a/packages/nova-categories/lib/helpers.js
+++ b/packages/nova-categories/lib/helpers.js
@@ -18,7 +18,8 @@ Categories.getParents = function (category) {
categoriesArray.push(parent);
recurse(parent);
}
- }(category);
+ };
+ getParents(category);
return categoriesArray;
};
@@ -37,7 +38,8 @@ Categories.getChildren = function (category) {
categoriesArray = categoriesArray.concat(children);
recurse(children);
}
- }([category]);
+ };
+ getChildren([category]);
return categoriesArray;
};
diff --git a/packages/nova-categories/lib/schema.js b/packages/nova-categories/lib/schema.js
index 15b7bb83f..6668e94f1 100644
--- a/packages/nova-categories/lib/schema.js
+++ b/packages/nova-categories/lib/schema.js
@@ -1,6 +1,7 @@
import Telescope from 'meteor/nova:lib';
import Categories from "./collection.js";
import Users from 'meteor/nova:users';
+import { SimpleSchema } from 'meteor/aldeed:simple-schema';
const canInsert = user => Users.canDo(user, "categories.new");
const canEdit = user => Users.canDo(user, "categories.edit.all");
@@ -79,7 +80,7 @@ Telescope.settings.collection.addField([
optional: true,
form: {
group: 'categories',
- instructions: 'Let users filter by one or multiple categories at a time.',
+ instructions: 'Let users filter by one or multiple categories at a time.',
options: function () {
return [
{value: "single", label: "categories_behavior_one_at_a_time"},
@@ -100,4 +101,4 @@ Telescope.settings.collection.addField([
}
}
}
-]);
\ No newline at end of file
+]);
diff --git a/packages/nova-categories/lib/server/load_categories.js b/packages/nova-categories/lib/server/load_categories.js
index 980524182..49234dc20 100644
--- a/packages/nova-categories/lib/server/load_categories.js
+++ b/packages/nova-categories/lib/server/load_categories.js
@@ -19,7 +19,7 @@ if (Meteor.settings && Meteor.settings.categories) {
} else {
// if not, create it
Categories.insert(category);
- console.log(`// Creating category “${category.name}”`);
+ console.log(`// Creating category “${category.name}”`); // eslint-disable-line
}
});
}
diff --git a/packages/nova-categories/lib/server/publications.js b/packages/nova-categories/lib/server/publications.js
index d15af778a..1d3b2b519 100644
--- a/packages/nova-categories/lib/server/publications.js
+++ b/packages/nova-categories/lib/server/publications.js
@@ -1,14 +1,16 @@
-import Posts from "meteor/nova:posts";
+// import Posts from "meteor/nova:posts";
import Users from 'meteor/nova:users';
import Categories from "../collection.js";
Meteor.publish('categories', function() {
-
+
const currentUser = this.userId && Users.findOne(this.userId);
if(Users.canDo(currentUser, "posts.view.approved.all")){
-
+
var categories = Categories.find({}, {fields: Categories.publishedFields.list});
+
+ /*
var publication = this;
categories.forEach(function (category) {
@@ -17,8 +19,9 @@ Meteor.publish('categories', function() {
var cursor = Posts.find({$and: [{categories: {$in: categoryIds}}, {status: Posts.config.STATUS_APPROVED}]});
// Counts.publish(publication, category.getCounterName(), cursor, { noReady: true });
});
+ */
return categories;
}
return [];
-});
\ No newline at end of file
+});
diff --git a/packages/nova-cloudinary/lib/custom_fields.js b/packages/nova-cloudinary/lib/custom_fields.js
index bc161c967..873307212 100644
--- a/packages/nova-cloudinary/lib/custom_fields.js
+++ b/packages/nova-cloudinary/lib/custom_fields.js
@@ -1,3 +1,4 @@
+import Telescope from 'meteor/nova:lib';
import Posts from "meteor/nova:posts";
import PublicationUtils from 'meteor/utilities:smart-publications';
@@ -20,7 +21,7 @@ Posts.addField([
]);
if (typeof Settings !== "undefined") {
- Settings.addField([
+ Telescope.settings.collection.addField([
{
fieldName: 'cloudinaryCloudName',
fieldSchema: {
diff --git a/packages/nova-cloudinary/lib/server/cloudinary.js b/packages/nova-cloudinary/lib/server/cloudinary.js
index 88aaab2ec..c5ab1e4cc 100644
--- a/packages/nova-cloudinary/lib/server/cloudinary.js
+++ b/packages/nova-cloudinary/lib/server/cloudinary.js
@@ -14,7 +14,7 @@ Cloudinary.config({
});
const CloudinaryUtils = {
-
+
// send an image URL to Cloudinary and get a cloudinary result object in return
uploadImage(imageUrl) {
try {
@@ -26,8 +26,8 @@ const CloudinaryUtils = {
};
return data;
} catch (error) {
- console.log("// Cloudinary upload failed for URL: "+imageUrl);
- console.log(error.stack);
+ console.log("// Cloudinary upload failed for URL: "+imageUrl); // eslint-disable-line
+ console.log(error.stack); // eslint-disable-line
}
},
@@ -35,8 +35,8 @@ const CloudinaryUtils = {
getUrls(cloudinaryId) {
return Telescope.settings.get("cloudinaryFormats").map(format => {
const url = Cloudinary.url(cloudinaryId, {
- width: format.width,
- height: format.height,
+ width: format.width,
+ height: format.height,
crop: 'fill',
sign_url: true,
fetch_format: "auto",
@@ -56,7 +56,7 @@ Meteor.methods({
if (Users.isAdmin(Meteor.user())) {
thumbnailUrl = typeof thumbnailUrl === "undefined" ? "http://www.telescopeapp.org/images/logo.png" : thumbnailUrl;
const data = CloudinaryUtils.uploadImage(thumbnailUrl);
- console.log(data);
+ console.log(data); // eslint-disable-line
}
},
cachePostThumbnails: function (limit = 20) {
@@ -71,16 +71,16 @@ Meteor.methods({
postsWithUncachedThumbnails.forEach(Meteor.bindEnvironment((post, index) => {
Meteor.setTimeout(function () {
- console.log(`// ${index}. Caching thumbnail for post “${post.title}” (_id: ${post._id})`);
+ console.log(`// ${index}. Caching thumbnail for post “${post.title}” (_id: ${post._id})`); // eslint-disable-line
const data = CloudinaryUtils.uploadImage(post.thumbnailUrl);
Posts.update(post._id, {$set:{
cloudinaryId: data.cloudinaryId,
cloudinaryUrls: data.urls
}});
-
+
}, index * 1000);
-
+
}));
}
}
@@ -106,7 +106,7 @@ Telescope.callbacks.add("posts.new.async", cachePostThumbnailOnSubmit);
function cachePostThumbnailOnEdit (newPost, oldPost) {
if (Telescope.settings.get("cloudinaryAPIKey")) {
if (newPost.thumbnailUrl && newPost.thumbnailUrl !== oldPost.thumbnailUrl) {
-
+
const data = CloudinaryUtils.uploadImage(newPost.thumbnailUrl);
Posts.update(newPost._id, {$set:{
cloudinaryId: data.cloudinaryId,
@@ -118,4 +118,4 @@ function cachePostThumbnailOnEdit (newPost, oldPost) {
}
Telescope.callbacks.add("posts.edit.async", cachePostThumbnailOnEdit);
-export default CloudinaryUtils;
\ No newline at end of file
+export default CloudinaryUtils;
diff --git a/packages/nova-comments/lib/callbacks.js b/packages/nova-comments/lib/callbacks.js
index 093e6a21d..1e1312ac2 100644
--- a/packages/nova-comments/lib/callbacks.js
+++ b/packages/nova-comments/lib/callbacks.js
@@ -232,7 +232,7 @@ function CommentsNewNotifications (comment) {
}
}
-
+
}
}
}
@@ -278,7 +278,7 @@ Telescope.callbacks.add("comments.edit.method", CommentsEditSubmittedPropertiesC
function UsersRemoveDeleteComments (user, options) {
if (options && options.deleteComments) {
- Comments.remove({userId: userId});
+ Comments.remove({userId: user._id});
} else {
// not sure if anything should be done in that scenario yet
// Comments.update({userId: userId}, {$set: {author: "\[deleted\]"}}, {multi: true});
diff --git a/packages/nova-comments/lib/collection.js b/packages/nova-comments/lib/collection.js
index 0f2b8c26e..e47fc6265 100644
--- a/packages/nova-comments/lib/collection.js
+++ b/packages/nova-comments/lib/collection.js
@@ -2,6 +2,6 @@
* @summary The global namespace for Comments.
* @namespace Comments
*/
-Comments = new Mongo.Collection("comments");
+const Comments = new Mongo.Collection("comments");
-export default Comments;
\ No newline at end of file
+export default Comments;
diff --git a/packages/nova-comments/lib/custom_fields.js b/packages/nova-comments/lib/custom_fields.js
index dc869355a..283275832 100644
--- a/packages/nova-comments/lib/custom_fields.js
+++ b/packages/nova-comments/lib/custom_fields.js
@@ -1,6 +1,6 @@
import PublicationUtils from 'meteor/utilities:smart-publications';
-import Posts from "meteor/nova:posts";
-import Users from "meteor/nova:users";
+import Posts from 'meteor/nova:posts';
+import Users from 'meteor/nova:users';
Posts.addField([
/**
diff --git a/packages/nova-comments/lib/helpers.js b/packages/nova-comments/lib/helpers.js
index e79b6a6cd..0af881f8f 100644
--- a/packages/nova-comments/lib/helpers.js
+++ b/packages/nova-comments/lib/helpers.js
@@ -1,4 +1,4 @@
-import Telescope from 'meteor/nova:lib';
+// import Telescope from 'meteor/nova:lib';
import Comments from './collection.js';
import Posts from 'meteor/nova:posts';
import Users from 'meteor/nova:users';
diff --git a/packages/nova-comments/lib/published_fields.js b/packages/nova-comments/lib/published_fields.js
index 0d094ecf6..c4064cf05 100644
--- a/packages/nova-comments/lib/published_fields.js
+++ b/packages/nova-comments/lib/published_fields.js
@@ -1,6 +1,6 @@
import Comments from './collection.js';
import PublicationsUtils from 'meteor/utilities:smart-publications';
-import Posts from "meteor/nova:posts";
+// import Posts from "meteor/nova:posts";
Comments.publishedFields = {};
@@ -26,4 +26,4 @@ Comments.publishedFields.list = PublicationsUtils.arrayToFields([
* @summary Specify which fields should be published by the posts.single publication
* @array Posts.publishedFields.single
*/
-Comments.publishedFields.single = PublicationsUtils.arrayToFields(Comments.getPublishedFields());
\ No newline at end of file
+Comments.publishedFields.single = PublicationsUtils.arrayToFields(Comments.getPublishedFields());
diff --git a/packages/nova-comments/lib/schema.js b/packages/nova-comments/lib/schema.js
index 0bc9e633c..19b90b518 100644
--- a/packages/nova-comments/lib/schema.js
+++ b/packages/nova-comments/lib/schema.js
@@ -1,7 +1,7 @@
import Telescope from 'meteor/nova:lib';
-import Comments from './collection.js';
import Users from 'meteor/nova:users';
-
+import { SimpleSchema } from 'meteor/aldeed:simple-schema';
+import Comments from './collection.js';
// check if user can create a new comment
const canInsert = user => Users.canDo(user, "comments.new");
@@ -10,7 +10,7 @@ const canInsert = user => Users.canDo(user, "comments.new");
const canEdit = Users.canEdit;
// check if user can edit *all* comments
-const canEditAll = user => Users.canDo(user, "comments.edit.all");
+// const canEditAll = user => Users.canDo(user, "comments.edit.all");
/**
* @summary Comments schema
@@ -126,7 +126,7 @@ Comments.schema = new SimpleSchema({
}
},
/**
- Whether the comment is deleted. Delete comments' content doesn't appear on the site.
+ Whether the comment is deleted. Delete comments' content doesn't appear on the site.
*/
isDeleted: {
type: Boolean,
diff --git a/packages/nova-comments/lib/server/publications.js b/packages/nova-comments/lib/server/publications.js
index 948b85008..6047e0238 100644
--- a/packages/nova-comments/lib/server/publications.js
+++ b/packages/nova-comments/lib/server/publications.js
@@ -1,5 +1,6 @@
import Posts from "meteor/nova:posts";
import Users from 'meteor/nova:users';
+import Comments from '../collection.js';
Comments._ensureIndex({postId: 1});
Comments._ensureIndex({parentCommentId: 1});
@@ -9,11 +10,11 @@ Comments._ensureIndex({parentCommentId: 1});
* @param {Object} terms
*/
Meteor.publish('comments.list', function (terms) {
-
+
const currentUser = this.userId && Users.findOne(this.userId);
terms.currentUserId = this.userId; // add currentUserId to terms
- ({selector, options} = Comments.parameters.get(terms));
+ const {selector, options} = Comments.parameters.get(terms);
// commenting this because of FR-SSR issue
// Counts.publish(this, 'comments.list', Comments.find(selector, options));
@@ -41,12 +42,12 @@ Meteor.publish('comments.list', function (terms) {
// check(terms, {_id: String});
-//
-
+//
+
// let commentIds = [terms._id];
// const childCommentIds = _.pluck(Comments.find({parentCommentId: terms._id}, {fields: {_id: 1}}).fetch(), '_id');
// commentIds = commentIds.concat(childCommentIds);
-
+
// return Users.canView(currentUser) ? Comments.find({_id: {$in: commentIds}}, {sort: {score: -1, postedAt: -1}}) : [];
// });
@@ -60,7 +61,7 @@ Meteor.publish('comments.list', function (terms) {
// check(commentId, String);
-//
+//
// if(Users.canViewById(this.userId)){
// var comment = Comments.findOne(commentId);
@@ -75,8 +76,8 @@ Meteor.publish('comments.list', function (terms) {
// check(commentId, String);
-//
-
+//
+
// var userIds = [];
// if(Users.canViewById(this.userId)){
@@ -92,11 +93,11 @@ Meteor.publish('comments.list', function (terms) {
// }
// return Users.find({_id: {$in: userIds}}, {fields: Users.pubsub.publicProperties});
-
+
// }
// }
// return [];
-// });
\ No newline at end of file
+// });
diff --git a/packages/nova-core/lib/callbacks.js b/packages/nova-core/lib/callbacks.js
index f546dd44a..0eb359732 100644
--- a/packages/nova-core/lib/callbacks.js
+++ b/packages/nova-core/lib/callbacks.js
@@ -1,4 +1,4 @@
-import Telescope from 'meteor/nova:lib';
+// import Telescope from 'meteor/nova:lib';
/**
* @summary Update an item's (post or comment) score
@@ -7,6 +7,8 @@ import Telescope from 'meteor/nova:lib';
* @param {object} collection - The collection the item belongs to
* @param {string} operation - The operation being performed
*/
+
+/*
function updateScore (item, user, collection, operation) {
Telescope.updateScore({collection: collection, item: item, forceUpdate: true});
}
@@ -14,6 +16,7 @@ Telescope.callbacks.add("upvote.async", updateScore);
Telescope.callbacks.add("downvote.async", updateScore);
Telescope.callbacks.add("cancelUpvote.async", updateScore);
Telescope.callbacks.add("cancelDownvote.async", updateScore);
+*/
/**
* @summary Update the profile of the user doing the operation
@@ -22,6 +25,8 @@ Telescope.callbacks.add("cancelDownvote.async", updateScore);
* @param {object} collection - The collection the item belongs to
* @param {string} operation - The operation being performed
*/
+
+/*
function updateUser (item, user, collection, operation) {
var update = {};
@@ -39,10 +44,10 @@ function updateUser (item, user, collection, operation) {
case "downvote":
update.$addToSet = {'telescope.downvotedPosts': vote};
break;
- case "cancelUpvote":
+ case "cancelUpvote":
update.$pull = {'telescope.upvotedPosts': {itemId: item._id}};
break;
- case "cancelDownvote":
+ case "cancelDownvote":
update.$pull = {'telescope.downvotedPosts': {itemId: item._id}};
break;
}
@@ -54,6 +59,7 @@ Telescope.callbacks.add("upvote.async", updateUser);
Telescope.callbacks.add("downvote.async", updateUser);
Telescope.callbacks.add("cancelUpvote.async", updateUser);
Telescope.callbacks.add("cancelDownvote.async", updateUser);
+*/
/**
* @summary Update the karma of the item's owner
@@ -62,11 +68,13 @@ Telescope.callbacks.add("cancelDownvote.async", updateUser);
* @param {object} collection - The collection the item belongs to
* @param {string} operation - The operation being performed
*/
+
+/*
function updateKarma (item, user, collection, operation) {
var votePower = Telescope.getVotePower(user);
var karmaAmount = (operation === "upvote" || operation === "cancelDownvote") ? votePower : -votePower;
-
+
// only update karma is the operation isn't done by the item's author
if (item.userId !== user._id) {
Users.update({_id: item.userId}, {$inc: {"telescope.karma": karmaAmount}});
@@ -76,4 +84,5 @@ function updateKarma (item, user, collection, operation) {
Telescope.callbacks.add("upvote.async", updateKarma);
Telescope.callbacks.add("downvote.async", updateKarma);
Telescope.callbacks.add("cancelUpvote.async", updateKarma);
-Telescope.callbacks.add("cancelDownvote.async", updateKarma);
\ No newline at end of file
+Telescope.callbacks.add("cancelDownvote.async", updateKarma);
+*/
diff --git a/packages/nova-core/lib/components/ModalTrigger.jsx b/packages/nova-core/lib/components/ModalTrigger.jsx
index 888344c49..047827179 100644
--- a/packages/nova-core/lib/components/ModalTrigger.jsx
+++ b/packages/nova-core/lib/components/ModalTrigger.jsx
@@ -48,7 +48,7 @@ class ModalTrigger extends Component {
{this.props.title ? this.renderHeader() : null}
-
)
}
-};
+}
ModalTrigger.propTypes = {
component: React.PropTypes.object.isRequired,
@@ -86,4 +86,4 @@ ModalTrigger.contextTypes = {
// }
module.exports = ModalTrigger;
-export default ModalTrigger;
\ No newline at end of file
+export default ModalTrigger;
diff --git a/packages/nova-core/lib/server/start.js b/packages/nova-core/lib/server/start.js
index fe6b9f3db..5b030ad1e 100644
--- a/packages/nova-core/lib/server/start.js
+++ b/packages/nova-core/lib/server/start.js
@@ -1,6 +1,7 @@
import Telescope from 'meteor/nova:lib';
-import {Inject} from 'meteor/meteorhacks:inject-initial';
import Events from "meteor/nova:events";
+import { Inject } from 'meteor/meteorhacks:inject-initial';
+import { SyncedCron } from 'meteor/percolatestudio:synced-cron';
Meteor.startup(function () {
Events.log({
@@ -20,4 +21,4 @@ Meteor.startup(function() {
}
});
-Inject.obj('serverTimezoneOffset', {offset: new Date().getTimezoneOffset()});
\ No newline at end of file
+Inject.obj('serverTimezoneOffset', {offset: new Date().getTimezoneOffset()});
diff --git a/packages/nova-debug/lib/components/Groups.jsx b/packages/nova-debug/lib/components/Groups.jsx
index ccb3dca15..71d37dd9e 100644
--- a/packages/nova-debug/lib/components/Groups.jsx
+++ b/packages/nova-debug/lib/components/Groups.jsx
@@ -1,6 +1,6 @@
import React from 'react';
-import Posts from "meteor/nova:posts";
-import Comments from "meteor/nova:comments";
+// import Posts from "meteor/nova:posts";
+// import Comments from "meteor/nova:comments";
import Users from 'meteor/nova:users';
const Group = ({name, actions}) => {
@@ -32,11 +32,11 @@ const Groups = props => {
-
+