diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..13d68a35a --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +packages/_* diff --git a/.eslintrc b/.eslintrc index beb34f54e..6414651fe 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,8 @@ { "extends": [ - "eslint:recommended" + "eslint:recommended", + "plugin:meteor/recommended", + "plugin:react/recommended" ], "parser": "babel-eslint", "parserOptions": { @@ -10,7 +12,17 @@ }, "rules": { "babel/generator-star-spacing": 0, - "babel/new-cap": 1, + "babel/new-cap": [1, { + "capIsNewExceptions": [ + "Optional", + "OneOf", + "Maybe", + "MailChimpAPI", + "Juice", + "Run", + "AppComposer" + ] + }], "babel/array-bracket-spacing": 0, "babel/object-curly-spacing": 0, "babel/object-shorthand": 0, @@ -20,8 +32,14 @@ "key-spacing": 0, "no-extra-boolean-cast": 0, "no-undef": 1, - "no-unused-vars": 1, - "no-console": 1 + "no-unused-vars": [1, { + "vars": "all", + "args": "none", + "varsIgnorePattern": "React|PropTypes|Component" + }], + "no-console": 1, + "react/prop-types": 0, + "meteor/audit-argument-checks": 0 }, "env": { "browser": true, @@ -32,7 +50,8 @@ }, "plugins": [ "babel", - "meteor" + "meteor", + "react" ], "settings": { "import/resolver": "meteor" diff --git a/packages/my-custom-package/lib/components/CustomNewsletter.jsx b/packages/my-custom-package/lib/components/CustomNewsletter.jsx index 50cfd455e..c7a5fb550 100644 --- a/packages/my-custom-package/lib/components/CustomNewsletter.jsx +++ b/packages/my-custom-package/lib/components/CustomNewsletter.jsx @@ -1,7 +1,7 @@ /* -The original Newsletter components is defined using an +The original Newsletter components is defined using an ES6 class, so we use the "class foo extends bar" syntax -to extend it. This way, we can simply redefine the +to extend it. This way, we can simply redefine the render method to change it, while preserving all of the class's other methods (other render functions, event handlers, etc.). @@ -9,7 +9,7 @@ functions, event handlers, etc.). import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; -import { FormattedMessage, intlShape } from 'react-intl'; +import { FormattedMessage /*, intlShape */ } from 'react-intl'; class CustomNewsletter extends Telescope.components.Newsletter { @@ -27,4 +27,4 @@ class CustomNewsletter extends Telescope.components.Newsletter { } -export default CustomNewsletter; \ No newline at end of file +export default CustomNewsletter; diff --git a/packages/my-custom-package/lib/components/CustomPostsItem.jsx b/packages/my-custom-package/lib/components/CustomPostsItem.jsx index 672d2fe4e..f3156584a 100644 --- a/packages/my-custom-package/lib/components/CustomPostsItem.jsx +++ b/packages/my-custom-package/lib/components/CustomPostsItem.jsx @@ -1,12 +1,12 @@ import Telescope from 'meteor/nova:lib'; +import Posts from "meteor/nova:posts"; import React, { PropTypes, Component } from 'react'; import { FormattedMessage, FormattedRelative } from 'react-intl'; -import { Button } from 'react-bootstrap'; -import moment from 'moment'; -import { ModalTrigger } from "meteor/nova:core"; import { Link } from 'react-router'; -import Posts from "meteor/nova:posts"; -import Categories from "meteor/nova:categories"; +// import { Button } from 'react-bootstrap'; +// import moment from 'moment'; +// import { ModalTrigger } from "meteor/nova:core"; +// import Categories from "meteor/nova:categories"; class CustomPostsItem extends Telescope.components.PostsItem { @@ -14,7 +14,7 @@ class CustomPostsItem extends Telescope.components.PostsItem { const post = this.props.post; - let postClass = "posts-item"; + let postClass = "posts-item"; if (post.sticky) postClass += " posts-sticky"; // ⭐ custom code starts here ⭐ @@ -25,22 +25,22 @@ class CustomPostsItem extends Telescope.components.PostsItem { return (
- +
- + {post.thumbnailUrl ? : null}
- +

{post.title} {this.renderCategories()}

- +
{post.user?
: null}
@@ -56,13 +56,13 @@ class CustomPostsItem extends Telescope.components.PostsItem {
{this.renderCommenters()} - - + +
) } -}; - +} + CustomPostsItem.propTypes = { post: React.PropTypes.object.isRequired } @@ -71,4 +71,4 @@ CustomPostsItem.contextTypes = { currentUser: React.PropTypes.object }; -export default CustomPostsItem; \ No newline at end of file +export default CustomPostsItem; diff --git a/packages/nova-api/lib/server/routes.js b/packages/nova-api/lib/server/routes.js index 12813b3ed..7d2f32ad5 100644 --- a/packages/nova-api/lib/server/routes.js +++ b/packages/nova-api/lib/server/routes.js @@ -1,3 +1,4 @@ +import { Picker } from 'meteor/meteorhacks:picker'; import { servePostsApi } from './api.js'; // for backwards compatibility's sake, accept a "limit" segment @@ -6,4 +7,4 @@ Picker.route('/api/:limit?', function(params, req, res, next) { params.query.limit = params.limit; } res.end(servePostsApi(params.query)); -}); \ No newline at end of file +}); diff --git a/packages/nova-base-components/lib/categories/CategoriesEditForm.jsx b/packages/nova-base-components/lib/categories/CategoriesEditForm.jsx index ecb453b44..5af054e4a 100644 --- a/packages/nova-base-components/lib/categories/CategoriesEditForm.jsx +++ b/packages/nova-base-components/lib/categories/CategoriesEditForm.jsx @@ -1,9 +1,9 @@ import Telescope from 'meteor/nova:lib'; +import NovaForm from "meteor/nova:forms"; +import Categories from "meteor/nova:categories"; import React, { PropTypes, Component } from 'react'; import { FormattedMessage } from 'react-intl'; -import NovaForm from "meteor/nova:forms"; -import { DocumentContainer } from "meteor/utilities:react-list-container"; -import Categories from "meteor/nova:categories"; +// import { DocumentContainer } from "meteor/utilities:react-list-container"; class CategoriesEditForm extends Component{ @@ -14,7 +14,7 @@ class CategoriesEditForm extends Component{ deleteCategory() { const category = this.props.category; - if (window.confirm(`Delete category “${category.name}”?`)) { + if (window.confirm(`Delete category “${category.name}”?`)) { this.context.actions.call("categories.deleteById", category._id, (error, result) => { if (error) { this.context.messages.flash(error.message, "error"); @@ -30,7 +30,7 @@ class CategoriesEditForm extends Component{ return (
- - + @@ -52,12 +52,12 @@ class CategoriesList extends Component { } renderCategoryNewModal() { - + return ( - + @@ -82,18 +82,18 @@ class CategoriesList extends Component { } render() { - + const categories = this.props.categories; - const context = this.context; + // const context = this.context; const currentQuery = _.clone(this.props.router.location.query); delete currentQuery.cat; - + return (
- } + } id="categories-dropdown" >
@@ -115,7 +115,7 @@ class CategoriesList extends Component { ) } -}; +} CategoriesList.propTypes = { categories: React.PropTypes.array @@ -128,4 +128,4 @@ CategoriesList.contextTypes = { }; module.exports = withRouter(CategoriesList); -export default withRouter(CategoriesList); \ No newline at end of file +export default withRouter(CategoriesList); diff --git a/packages/nova-base-components/lib/categories/Category.jsx b/packages/nova-base-components/lib/categories/Category.jsx index 969bbc452..721bed65d 100644 --- a/packages/nova-base-components/lib/categories/Category.jsx +++ b/packages/nova-base-components/lib/categories/Category.jsx @@ -1,11 +1,11 @@ import Telescope from 'meteor/nova:lib'; +import Users from 'meteor/nova:users'; import React, { PropTypes, Component } from 'react'; -import { Button, DropdownButton, MenuItem } from 'react-bootstrap'; -import classNames from "classnames"; -//import { Messages, ModalTrigger } from 'meteor/nova:core'; import { LinkContainer } from 'react-router-bootstrap'; import { withRouter } from 'react-router' -import Users from 'meteor/nova:users'; +import { /* Button, DropdownButton, */ MenuItem } from 'react-bootstrap'; +// import classNames from "classnames"; +// import { Messages, ModalTrigger } from 'meteor/nova:core'; class Category extends Component { @@ -26,7 +26,7 @@ class Category extends Component { const {category, index, router} = this.props; - const currentQuery = router.location.query; + // const currentQuery = router.location.query; const currentCategorySlug = router.location.query.cat; const newQuery = _.clone(router.location.query); newQuery.cat = category.slug; @@ -34,9 +34,9 @@ class Category extends Component { return (
- {currentCategorySlug === category.slug ? : null} {category.name} @@ -60,4 +60,4 @@ Category.contextTypes = { }; module.exports = withRouter(Category); -export default withRouter(Category); \ No newline at end of file +export default withRouter(Category); diff --git a/packages/nova-base-components/lib/comments/CommentsItem.jsx b/packages/nova-base-components/lib/comments/CommentsItem.jsx index c22ff30db..08a18b2b6 100644 --- a/packages/nova-base-components/lib/comments/CommentsItem.jsx +++ b/packages/nova-base-components/lib/comments/CommentsItem.jsx @@ -1,8 +1,8 @@ import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; -import moment from 'moment'; import { intlShape, FormattedMessage, FormattedRelative } from 'react-intl'; -import Users from 'meteor/nova:users'; +// import moment from 'moment'; +// import Users from 'meteor/nova:users'; class CommentsItem extends Component{ @@ -33,7 +33,7 @@ class CommentsItem extends Component{ event.preventDefault(); this.setState({showEdit: true}); } - + editCancelCallback(event) { event.preventDefault(); this.setState({showEdit: false}); @@ -44,11 +44,11 @@ class CommentsItem extends Component{ } deleteComment() { - + const comment = this.props.comment; const deleteConfirmMessage = this.context.intl.formatMessage({id: "comments.delete_confirm"}, {body: Telescope.utils.trimWords(comment.body, 20)}); const deleteSuccessMessage = this.context.intl.formatMessage({id: "comments.delete_success"}, {body: Telescope.utils.trimWords(comment.body, 20)}); - + if (window.confirm(deleteConfirmMessage)) { this.context.actions.call('comments.deleteById', comment._id, (error, result) => { this.context.messages.flash(deleteSuccessMessage, "success"); @@ -70,7 +70,7 @@ class CommentsItem extends Component{ : null} -
+
) } @@ -78,12 +78,12 @@ class CommentsItem extends Component{ return (
-
) @@ -92,9 +92,9 @@ class CommentsItem extends Component{ renderEdit() { return ( - ) diff --git a/packages/nova-base-components/lib/comments/CommentsList.jsx b/packages/nova-base-components/lib/comments/CommentsList.jsx index c569cf1ab..4c052388a 100644 --- a/packages/nova-base-components/lib/comments/CommentsList.jsx +++ b/packages/nova-base-components/lib/comments/CommentsList.jsx @@ -1,6 +1,6 @@ import Telescope from 'meteor/nova:lib'; import React from 'react'; -import {injectIntl, FormattedMessage} from 'react-intl'; +import {/* injectIntl, */ FormattedMessage} from 'react-intl'; const CommentsList = ({results, hasMore, ready, count, totalCount, loadMore}) => { @@ -24,11 +24,11 @@ const CommentsList = ({results, hasMore, ready, count, totalCount, loadMore}) =>

- ) + ) } - + }; CommentsList.displayName = "CommentsList"; -module.exports = CommentsList; \ No newline at end of file +module.exports = CommentsList; diff --git a/packages/nova-base-components/lib/comments/CommentsNew.jsx b/packages/nova-base-components/lib/comments/CommentsNew.jsx index e7e192e62..0e996d2f9 100644 --- a/packages/nova-base-components/lib/comments/CommentsNew.jsx +++ b/packages/nova-base-components/lib/comments/CommentsNew.jsx @@ -18,8 +18,8 @@ class CommentsNew extends Component { return (
- ) @@ -22,7 +22,7 @@ class CommentsNode extends Component { const comment = this.props.comment; const children = this.props.comment.childrenResults; - + return (
{this.renderComment(comment)} @@ -31,7 +31,7 @@ class CommentsNode extends Component { ) } -}; +} CommentsNode.propTypes = { comment: React.PropTypes.object.isRequired, // the current comment @@ -41,4 +41,4 @@ CommentsNode.contextTypes = { currentUser: React.PropTypes.object, // the current user }; -module.exports = CommentsNode; \ No newline at end of file +module.exports = CommentsNode; diff --git a/packages/nova-base-components/lib/common/App.jsx b/packages/nova-base-components/lib/common/App.jsx index a229fac00..fc0960c6d 100644 --- a/packages/nova-base-components/lib/common/App.jsx +++ b/packages/nova-base-components/lib/common/App.jsx @@ -10,10 +10,10 @@ class App extends Component { } getChildContext() { - + const messages = Telescope.strings[this.getLocale()] || {}; const intlProvider = new IntlProvider({locale: this.getLocale()}, messages); - + const {intl} = intlProvider.getChildContext(); return { @@ -29,8 +29,8 @@ class App extends Component { return ( { - this.props.ready ? - {this.props.children} + this.props.ready ? + {this.props.children} : } @@ -56,4 +56,4 @@ App.childContextTypes = { } module.exports = AppComposer(App); -export default AppComposer(App); \ No newline at end of file +export default AppComposer(App); diff --git a/packages/nova-base-components/lib/common/Newsletter.jsx b/packages/nova-base-components/lib/common/Newsletter.jsx index 3095e8e5d..4df17ff96 100644 --- a/packages/nova-base-components/lib/common/Newsletter.jsx +++ b/packages/nova-base-components/lib/common/Newsletter.jsx @@ -29,7 +29,7 @@ class Newsletter extends Component { subscribeEmail(data) { this.context.actions.call("newsletter.addEmail", data.email, (error, result) => { if (error) { - console.log(error); + console.log(error); // eslint-disable-line this.context.messages.flash(error.message, "error"); } else { this.successCallbackSubscription(result); diff --git a/packages/nova-base-components/lib/common/NewsletterButton.jsx b/packages/nova-base-components/lib/common/NewsletterButton.jsx index 14105df00..cf8c91573 100644 --- a/packages/nova-base-components/lib/common/NewsletterButton.jsx +++ b/packages/nova-base-components/lib/common/NewsletterButton.jsx @@ -1,7 +1,7 @@ import React, { PropTypes, Component } from 'react'; import { FormattedMessage } from 'react-intl'; import { Button } from 'react-bootstrap'; -import { Messages } from 'meteor/nova:core'; +// import { Messages } from 'meteor/nova:core'; import Users from 'meteor/nova:users'; class NewsletterButton extends Component { @@ -15,7 +15,7 @@ class NewsletterButton extends Component { 'newsletter.removeUser' : 'newsletter.addUser'; this.context.actions.call(action, this.props.user, (error, result) => { if (error) { - console.log(error); + console.log(error); // eslint-disable-line this.context.messages.flash(error.message, "error"); } else { this.props.successCallback(result); diff --git a/packages/nova-base-components/lib/config.js b/packages/nova-base-components/lib/config.js index 71abdd889..632020124 100644 --- a/packages/nova-base-components/lib/config.js +++ b/packages/nova-base-components/lib/config.js @@ -1,5 +1,6 @@ import Telescope from 'meteor/nova:lib'; import Users from 'meteor/nova:users'; +import { T9n } from 'meteor/softwarerero:accounts-t9n'; // import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions'; // checkNpmVersions({ @@ -16,4 +17,4 @@ Users.avatar.setOptions({ }); // https://github.com/softwarerero/meteor-accounts-t9n -T9n.setLanguage(Telescope.settings.get("locale", "en")); \ No newline at end of file +T9n.setLanguage(Telescope.settings.get("locale", "en")); diff --git a/packages/nova-base-components/lib/posts/PostsDaily.jsx b/packages/nova-base-components/lib/posts/PostsDaily.jsx index 4ea722f27..507babd3e 100644 --- a/packages/nova-base-components/lib/posts/PostsDaily.jsx +++ b/packages/nova-base-components/lib/posts/PostsDaily.jsx @@ -1,6 +1,6 @@ import Telescope from "meteor/nova:lib"; import React, { PropTypes, Component } from "react"; -import { Button } from "react-bootstrap"; +// import { Button } from "react-bootstrap"; import moment from "moment"; import { FormattedMessage } from "react-intl"; diff --git a/packages/nova-base-components/lib/posts/PostsDay.jsx b/packages/nova-base-components/lib/posts/PostsDay.jsx index a6d602d17..871879fcd 100644 --- a/packages/nova-base-components/lib/posts/PostsDay.jsx +++ b/packages/nova-base-components/lib/posts/PostsDay.jsx @@ -1,8 +1,8 @@ import Telescope from 'meteor/nova:lib'; -import React, { PropTypes, Component } from 'react'; -import { ListContainer } from "meteor/utilities:react-list-container"; -import moment from 'moment'; import Posts from "meteor/nova:posts"; +import { ListContainer } from "meteor/utilities:react-list-container"; +import React, { PropTypes, Component } from 'react'; +import moment from 'moment'; class PostsDay extends Component { @@ -19,19 +19,19 @@ class PostsDay extends Component { listId: `posts.list.${moment(date).format("YYYY-MM-DD")}` }; - ({selector, options} = Posts.parameters.get(terms)); + const {selector, options} = Posts.parameters.get(terms); const postsPerPage = Telescope.settings.get("postsPerPage", 10); return (

{moment(date).format("dddd, MMMM Do YYYY")}

- { this.context.messages.flash(deletePostSuccess, "success"); this.context.events.track("post deleted", {'_id': post._id}); @@ -41,13 +41,13 @@ class PostsEditForm extends Component{ render() { - + return (
{this.renderAdminArea()} - { + successCallback: (post) => { this.context.messages.flash(this.context.intl.formatMessage({id: "posts.edit_success"}, {title: post.title}), 'success') } }} @@ -82,4 +82,4 @@ PostsEditForm.contextTypes = { } module.exports = PostsEditForm; -export default PostsEditForm; \ No newline at end of file +export default PostsEditForm; diff --git a/packages/nova-base-components/lib/posts/PostsHome.jsx b/packages/nova-base-components/lib/posts/PostsHome.jsx index 6edca4747..6d6ba67d8 100644 --- a/packages/nova-base-components/lib/posts/PostsHome.jsx +++ b/packages/nova-base-components/lib/posts/PostsHome.jsx @@ -1,6 +1,6 @@ import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; -import { ListContainer, DocumentContainer } from "meteor/utilities:react-list-container"; +import { ListContainer /* , DocumentContainer */ } from "meteor/utilities:react-list-container"; import Posts from "meteor/nova:posts"; class PostsHome extends Component { @@ -8,19 +8,19 @@ class PostsHome extends Component { getDefaultView() { return {view: 'top'} } - + render() { const params = {...this.getDefaultView(), ...this.props.location.query, listId: "posts.list.main"}; const {selector, options} = Posts.parameters.get(params); return ( - ) } -}; +} -module.exports = PostsHome; \ No newline at end of file +module.exports = PostsHome; diff --git a/packages/nova-base-components/lib/posts/PostsItem.jsx b/packages/nova-base-components/lib/posts/PostsItem.jsx index aeaecde2a..563ca4d6d 100644 --- a/packages/nova-base-components/lib/posts/PostsItem.jsx +++ b/packages/nova-base-components/lib/posts/PostsItem.jsx @@ -1,12 +1,12 @@ import Telescope from 'meteor/nova:lib'; +import { ModalTrigger } from "meteor/nova:core"; +import Posts from "meteor/nova:posts"; import React, { PropTypes, Component } from 'react'; import { FormattedMessage, FormattedRelative } from 'react-intl'; -import { Button } from 'react-bootstrap'; -import moment from 'moment'; -import { ModalTrigger } from "meteor/nova:core"; import { Link } from 'react-router'; -import Posts from "meteor/nova:posts"; -import Users from 'meteor/nova:users'; +// import { Button } from 'react-bootstrap'; +// import moment from 'moment'; +// import Users from 'meteor/nova:users'; class PostsItem extends Component { @@ -32,12 +32,12 @@ class PostsItem extends Component {
) } - + render() { const post = this.props.post; - let postClass = "posts-item"; + let postClass = "posts-item"; if (post.sticky) postClass += " posts-sticky"; // console.log(post) @@ -45,22 +45,22 @@ class PostsItem extends Component { return (
- +
- + {post.thumbnailUrl ? : null}
- +

{post.title} {this.renderCategories()}

- +
{post.user?
: null}
{post.postedAt ? : }
@@ -76,13 +76,13 @@ class PostsItem extends Component {
{this.renderCommenters()} - - + +
) } -}; - +} + PostsItem.propTypes = { post: React.PropTypes.object.isRequired } @@ -92,4 +92,4 @@ PostsItem.contextTypes = { }; module.exports = PostsItem; -export default PostsItem; \ No newline at end of file +export default PostsItem; diff --git a/packages/nova-base-components/lib/posts/PostsViews.jsx b/packages/nova-base-components/lib/posts/PostsViews.jsx index e5193d140..c2b8526bc 100644 --- a/packages/nova-base-components/lib/posts/PostsViews.jsx +++ b/packages/nova-base-components/lib/posts/PostsViews.jsx @@ -1,6 +1,6 @@ import React, { PropTypes, Component } from 'react'; import { FormattedMessage, intlShape } from 'react-intl'; -import { Button, ButtonGroup, DropdownButton, MenuItem } from 'react-bootstrap'; +import { /* Button, ButtonGroup, */ DropdownButton, MenuItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; import { withRouter } from 'react-router' import Users from 'meteor/nova:users'; @@ -9,7 +9,7 @@ const PostsViews = (props, context) => { let views = ["top", "new", "best"]; const adminViews = ["pending", "rejected", "scheduled"]; - + if (Users.canDo(context.currentUser, "posts.edit.all")) { views = views.concat(adminViews); } @@ -18,13 +18,13 @@ const PostsViews = (props, context) => { return (
- - {views.map(view => + {views.map(view => diff --git a/packages/nova-base-components/lib/users/UsersAccountForm.jsx b/packages/nova-base-components/lib/users/UsersAccountForm.jsx index 2dd3bdb4d..4f0174717 100644 --- a/packages/nova-base-components/lib/users/UsersAccountForm.jsx +++ b/packages/nova-base-components/lib/users/UsersAccountForm.jsx @@ -5,7 +5,7 @@ import { Accounts } from 'meteor/std:accounts-ui'; const UsersAccountForm = () => { return ( - ) + ) }; module.exports = UsersAccountForm; @@ -23,12 +23,12 @@ class AccountsButton extends Accounts.ui.Button { render () { const {label, href, type, disabled, className, onClick} = this.props; if (type === 'link') { - return { label }; + return { label }; } - return ; @@ -44,13 +44,13 @@ class AccountsField extends Accounts.ui.Field { onChange({ target: { value: this.input.value } }) } } - + render() { - const { id, hint, label, type = 'text', onChange, className = "field", defaultValue = "" } = this.props; + const { id, hint, /* label, */ type = 'text', onChange, className = "field", defaultValue = "" } = this.props; const { mount = true } = this.state; return mount ? (
- +
) : null; } @@ -99,4 +99,4 @@ class AccountsField extends Accounts.ui.Field { Accounts.ui.Button = AccountsButton; Accounts.ui.Field = AccountsField; // Accounts.ui.SocialButtons = AccountsSocialButtons; -// Accounts.ui.PasswordOrService = AccountsPasswordOrService; \ No newline at end of file +// Accounts.ui.PasswordOrService = AccountsPasswordOrService; diff --git a/packages/nova-base-components/lib/users/UsersAccountMenu.jsx b/packages/nova-base-components/lib/users/UsersAccountMenu.jsx index 024b30463..a807aeeec 100644 --- a/packages/nova-base-components/lib/users/UsersAccountMenu.jsx +++ b/packages/nova-base-components/lib/users/UsersAccountMenu.jsx @@ -1,7 +1,7 @@ import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import { FormattedMessage } from 'react-intl'; -import { Dropdown, Button } from 'react-bootstrap'; +import { Dropdown /* , Button */ } from 'react-bootstrap'; const UsersAccountMenu = () => { @@ -14,10 +14,10 @@ const UsersAccountMenu = () => { - ) + ) }; UsersAccountMenu.displayName = "UsersAccountMenu"; module.exports = UsersAccountMenu; -export default UsersAccountMenu; \ No newline at end of file +export default UsersAccountMenu; diff --git a/packages/nova-base-components/lib/users/UsersEdit.jsx b/packages/nova-base-components/lib/users/UsersEdit.jsx index d8d2b2f85..f0669fc54 100644 --- a/packages/nova-base-components/lib/users/UsersEdit.jsx +++ b/packages/nova-base-components/lib/users/UsersEdit.jsx @@ -1,7 +1,7 @@ import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import { FormattedMessage, intlShape } from 'react-intl'; -import { Row, Col } from 'react-bootstrap'; +// import { Row, Col } from 'react-bootstrap'; import NovaForm from "meteor/nova:forms"; //import { Messages } from "meteor/nova:core"; import Users from 'meteor/nova:users'; @@ -9,21 +9,21 @@ import Users from 'meteor/nova:users'; const UsersEdit = (props, context) => { const user = props.user; - const currentUser = props.currentUser; + // const currentUser = props.currentUser; //const label = `Edit profile for ${Users.getDisplayName(user)}`; return ( -

- { 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 => {
- +
) } module.exports = Groups -export default Groups \ No newline at end of file +export default Groups diff --git a/packages/nova-debug/lib/globals.js b/packages/nova-debug/lib/globals.js index 63cd6ccee..29ea6b18c 100644 --- a/packages/nova-debug/lib/globals.js +++ b/packages/nova-debug/lib/globals.js @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ + import TelescopeImport from 'meteor/nova:lib'; import PostsImport from "meteor/nova:posts"; import CommentsImport from "meteor/nova:comments"; diff --git a/packages/nova-debug/lib/server/methods.js b/packages/nova-debug/lib/server/methods.js index a91014e11..885814b33 100644 --- a/packages/nova-debug/lib/server/methods.js +++ b/packages/nova-debug/lib/server/methods.js @@ -4,14 +4,14 @@ import Users from 'meteor/nova:users'; Meteor.methods({ "email.test": function (emailName) { - + const email = NovaEmail.emails[emailName]; - + if(Users.isAdminById(this.userId)){ - console.log("// testing email ["+emailName+"]"); + console.log("// testing email ["+emailName+"]"); // eslint-disable-line let html, properties; - + // if email has a custom way of generating its HTML, use it if (typeof email.getTestHTML !== "undefined") { @@ -33,11 +33,11 @@ Meteor.methods({ const subject = "[Test] " + email.subject.bind(email)(properties); NovaEmail.send (Telescope.settings.get('defaultEmail'), subject, html) - + return subject; - + } else { throw new Meteor.Error("must_be_admin", "You must be an admin to send test emails"); } } -}); \ No newline at end of file +}); diff --git a/packages/nova-demo/demo-app.jsx b/packages/nova-demo/demo-app.jsx index 7a49d47f9..d0e0b1b67 100644 --- a/packages/nova-demo/demo-app.jsx +++ b/packages/nova-demo/demo-app.jsx @@ -1,10 +1,13 @@ +/* global Movies:true */ + import Telescope from 'meteor/nova:lib'; -import React, { PropTypes, Component } from 'react'; -import {mount} from 'react-mounter'; -import MoviesWrapper from './demo-components.jsx'; -import Core from 'meteor/nova:core'; -import { Route } from 'react-router'; import Users from 'meteor/nova:users'; +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import React, { PropTypes, Component } from 'react'; +import MoviesWrapper from './demo-components.jsx'; +// import {mount} from 'react-mounter'; +// import Core from 'meteor/nova:core'; +// import { Route } from 'react-router'; ////////////////////////////////////////////////////// // Collection & Schema // diff --git a/packages/nova-demo/demo-components.jsx b/packages/nova-demo/demo-components.jsx index 6e94f992f..8d449693e 100644 --- a/packages/nova-demo/demo-components.jsx +++ b/packages/nova-demo/demo-components.jsx @@ -1,10 +1,12 @@ +/* global Movies */ + import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import { ListContainer } from "meteor/utilities:react-list-container"; import NovaForm from "meteor/nova:forms"; import { Button } from 'react-bootstrap'; import { Accounts } from 'meteor/std:accounts-ui'; -import { ModalTrigger, Messages, FlashContainer } from "meteor/nova:core"; +import { ModalTrigger, /* Messages, */ FlashContainer } from "meteor/nova:core"; const FlashMessages = Telescope.components.FlashMessages; @@ -24,8 +26,8 @@ class MoviesWrapper extends Component {
- - Add Movie} > -
) - + return !!this.props.currentUser ? component : ""; } @@ -78,7 +80,7 @@ class MoviesList extends Component {
) } -}; +} ////////////////////////////////////////////////////// // Movie // @@ -91,14 +93,14 @@ class Movie extends Component { const movie = this.props; const component = ( - Edit Movie} + Edit Movie} > - @@ -112,7 +114,7 @@ class Movie extends Component { } render() { - + const movie = this.props; return ( @@ -124,8 +126,8 @@ class Movie extends Component { ) } -}; +} const LoadMore = props => Load More ({props.count}/{props.totalCount}) -export default MoviesWrapper \ No newline at end of file +export default MoviesWrapper diff --git a/packages/nova-email-templates/lib/server/routes.js b/packages/nova-email-templates/lib/server/routes.js index a166add13..2e365d96c 100644 --- a/packages/nova-email-templates/lib/server/routes.js +++ b/packages/nova-email-templates/lib/server/routes.js @@ -1,3 +1,5 @@ +import { Picker } from 'meteor/meteorhacks:picker'; + import NovaEmail from 'meteor/nova:email'; Meteor.startup(function () { @@ -29,7 +31,7 @@ Meteor.startup(function () { // return html res.end(html); - + }); // raw template @@ -38,5 +40,5 @@ Meteor.startup(function () { }); }); - -}); \ No newline at end of file + +}); diff --git a/packages/nova-email/lib/server/email.js b/packages/nova-email/lib/server/email.js index 6fc619e86..8e0bd8ee3 100644 --- a/packages/nova-email/lib/server/email.js +++ b/packages/nova-email/lib/server/email.js @@ -77,10 +77,10 @@ NovaEmail.send = function(to, subject, html, text){ }); } - console.log('//////// sending email…'); - console.log('from: '+from); - console.log('to: '+to); - console.log('subject: '+subject); + console.log('//////// sending email…'); // eslint-disable-line + console.log('from: '+from); // eslint-disable-line + console.log('to: '+to); // eslint-disable-line + console.log('subject: '+subject); // eslint-disable-line // console.log('html: '+html); // console.log('text: '+text); @@ -95,8 +95,8 @@ NovaEmail.send = function(to, subject, html, text){ try { Email.send(email); } catch (error) { - console.log("// error while sending email:") - console.log(error) + console.log("// error while sending email:"); // eslint-disable-line + console.log(error); // eslint-disable-line } return email; diff --git a/packages/nova-embedly/lib/components/EmbedlyURL.jsx b/packages/nova-embedly/lib/components/EmbedlyURL.jsx index 88a31c0bd..2095a7e65 100644 --- a/packages/nova-embedly/lib/components/EmbedlyURL.jsx +++ b/packages/nova-embedly/lib/components/EmbedlyURL.jsx @@ -24,16 +24,16 @@ class EmbedlyURL extends Component { // the URL has changed, get a new thumbnail this.context.actions.call("getEmbedlyData", url, (error, result) => { - - console.log("querying Embedly…"); - + + console.log("querying Embedly…"); // eslint-disable-line + this.setState({loading: false}); if (error) { - console.log(error) + console.log(error); // eslint-disable-line this.context.throwError({content: error.message, type: "error"}); } else { - console.log(result) + console.log(result); // eslint-disable-line this.context.addToAutofilledValues({ title: result.title, body: result.description, @@ -46,7 +46,7 @@ class EmbedlyURL extends Component { } render() { - + const Loading = Telescope.components.Loading; const wrapperStyle = { @@ -61,16 +61,16 @@ class EmbedlyURL extends Component { }; loadingStyle.display = this.state.loading ? "block" : "none"; - + // see https://facebook.github.io/react/warnings/unknown-prop.html - const {document, updateCurrentValue, control, ...rest} = this.props; + const {document, updateCurrentValue, control, ...rest} = this.props; // eslint-disable-line return (
- this.input = ref} />
@@ -93,4 +93,4 @@ EmbedlyURL.contextTypes = { actions: React.PropTypes.object, } -export default EmbedlyURL; \ No newline at end of file +export default EmbedlyURL; diff --git a/packages/nova-embedly/lib/components/ThumbnailURL.jsx b/packages/nova-embedly/lib/components/ThumbnailURL.jsx index 43dc027c5..88b1494ef 100644 --- a/packages/nova-embedly/lib/components/ThumbnailURL.jsx +++ b/packages/nova-embedly/lib/components/ThumbnailURL.jsx @@ -1,7 +1,7 @@ import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import { FormattedMessage } from 'react-intl'; -import Formsy from 'formsy-react'; +// import Formsy from 'formsy-react'; import FRC from 'formsy-react-components'; const Input = FRC.Input; @@ -29,9 +29,9 @@ class ThumbnailURL extends Component { renderThumbnail() { return (
- '+"go_to_post"+''); + // Messages.flash(error.reason + '. '+"go_to_post"+''); } }); return data; diff --git a/packages/nova-embedly/lib/server/get_embedly_data.js b/packages/nova-embedly/lib/server/get_embedly_data.js index bcd98f08b..476433ba7 100644 --- a/packages/nova-embedly/lib/server/get_embedly_data.js +++ b/packages/nova-embedly/lib/server/get_embedly_data.js @@ -2,8 +2,8 @@ import Telescope from 'meteor/nova:lib'; import Posts from "meteor/nova:posts"; import Users from 'meteor/nova:users'; -getEmbedlyData = function (url) { - var data = {}; +var getEmbedlyData = function (url) { + // var data = {}; var extractBase = 'http://api.embed.ly/1/extract'; var embedlyKey = Telescope.settings.get('embedlyKey'); var thumbnailWidth = Telescope.settings.get('thumbnailWidth', 200); @@ -11,7 +11,7 @@ getEmbedlyData = function (url) { if(!embedlyKey) { // fail silently to still let the post be submitted as usual - console.log("Couldn't find an Embedly API key! Please add it to your Telescope settings or remove the Embedly module."); + console.log("Couldn't find an Embedly API key! Please add it to your Telescope settings or remove the Embedly module."); // eslint-disable-line return null; } @@ -42,7 +42,7 @@ getEmbedlyData = function (url) { return embedlyData; } catch (error) { - console.log(error) + console.log(error); // eslint-disable-line // the first 13 characters of the Embedly errors are "failed [400] ", so remove them and parse the rest var errorObject = JSON.parse(error.message.substring(13)); throw new Meteor.Error(errorObject.error_code, errorObject.error_message); @@ -111,7 +111,7 @@ var regenerateThumbnail = function (post) { Meteor.methods({ testGetEmbedlyData: function (url) { check(url, String); - console.log(getEmbedlyData(url)); + console.log(getEmbedlyData(url)); // eslint-disable-line }, getEmbedlyData: function (url) { check(url, String); @@ -129,11 +129,11 @@ Meteor.methods({ generateThumbnails: function (limit = 20, mode = "generate") { // mode = "generate" : generate thumbnails only for all posts that don't have one // mode = "all" : regenerate thumbnais for all posts - + if (Users.isAdmin(Meteor.user())) { - - console.log("// Generating thumbnails…") - + + console.log("// Generating thumbnails…"); // eslint-disable-line + const selector = {url: {$exists: true}}; if (mode === "generate") { selector.thumbnailUrl = {$exists: false}; @@ -143,11 +143,11 @@ Meteor.methods({ posts.forEach((post, index) => { Meteor.setTimeout(function () { - console.log(`// ${index}. fetching thumbnail for “${post.title}” (_id: ${post._id})`); + console.log(`// ${index}. fetching thumbnail for “${post.title}” (_id: ${post._id})`); // eslint-disable-line try { regenerateThumbnail(post); } catch (error) { - console.log(error); + console.log(error); // eslint-disable-line } }, index * 1000); }); diff --git a/packages/nova-events/lib/collection.js b/packages/nova-events/lib/collection.js index 4d93dd084..40b2d739f 100644 --- a/packages/nova-events/lib/collection.js +++ b/packages/nova-events/lib/collection.js @@ -1,3 +1,5 @@ +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; + const Events = new Mongo.Collection('events'); Events.schema = new SimpleSchema({ @@ -63,4 +65,4 @@ Events.track = function(event, properties){ // } }; -export default Events; \ No newline at end of file +export default Events; diff --git a/packages/nova-forms-tags/lib/components/Tags.jsx b/packages/nova-forms-tags/lib/components/Tags.jsx index 70c3a749a..beca30113 100644 --- a/packages/nova-forms-tags/lib/components/Tags.jsx +++ b/packages/nova-forms-tags/lib/components/Tags.jsx @@ -31,7 +31,7 @@ class Tags extends Component { const tags = this.state.tags; tags.splice(i, 1); - + const value = this.state.value; value.splice(i,1); @@ -42,7 +42,7 @@ class Tags extends Component { } handleAddition(tag) { - + // first, check if added tag is part of the possible options const option = _.findWhere(this.props.options, {label: tag}); @@ -69,14 +69,14 @@ class Tags extends Component { render() { - const {name, value, label} = this.props; + const {name, /* value, */ label} = this.props; return (
-
- { this.context.addToAutofilledValues({[this.props.name]: newDate._d}) }} - format={"x"} + format={"x"} inputProps={{name: this.props.name}} />
diff --git a/packages/nova-forms/lib/FormComponent.jsx b/packages/nova-forms/lib/FormComponent.jsx index a9815cf9e..704dc1ef0 100644 --- a/packages/nova-forms/lib/FormComponent.jsx +++ b/packages/nova-forms/lib/FormComponent.jsx @@ -4,7 +4,7 @@ import FRC from 'formsy-react-components'; import DateTime from './DateTime.jsx'; -import Utils from './utils.js'; +// import Utils from './utils.js'; const Checkbox = FRC.Checkbox; // const CheckboxGroup = FRC.CheckboxGroup; @@ -30,7 +30,7 @@ class FormComponent extends Component { renderComponent() { // see https://facebook.github.io/react/warnings/unknown-prop.html - const { control, group, updateCurrentValue, document, ...rest } = this.props; + const { control, group, updateCurrentValue, document, ...rest } = this.props; // eslint-disable-line const base = this.props.control === "function" ? this.props : rest; @@ -53,7 +53,7 @@ class FormComponent extends Component { case "textarea": return