diff --git a/.eslintrc.json b/.eslintrc.json index eec982dac..5df3444a6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -45,6 +45,19 @@ "space-infix-ops": ["error"], "no-const-assign": [2], "no-duplicate-imports": [2], - "prefer-template": [1] + "prefer-template": [1], + "comma-spacing": [ + "error", + { + "after": true + } + ], + "no-var": [2], + "no-lonely-if": [2], + "curly": [2], + "no-multiple-empty-lines": [ + "error", + {"max": 1} + ] } } diff --git a/.gitignore b/.gitignore index acd1ba775..eff774450 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ node_modules npm-debug.log dist +!dist/coral-admin +dist/coral-admin/bundle.js .DS_Store *.iml .env diff --git a/client/coral-admin/config.sample.json b/client/coral-admin/config.sample.json index 5d23e2576..f5b9ad5f8 100644 --- a/client/coral-admin/config.sample.json +++ b/client/coral-admin/config.sample.json @@ -1,5 +1,3 @@ { - "basePath": "http://localhost:3142", - "talkHost": "http://localhost:16180", - "xeniaHost": "http://localhost:16180" + "base": "client/coral-admin" } diff --git a/client/coral-admin/package.json b/client/coral-admin/package.json index c5a2d4c45..ced6a3512 100644 --- a/client/coral-admin/package.json +++ b/client/coral-admin/package.json @@ -11,7 +11,6 @@ "author": "", "license": "ISC", "dependencies": { - "coral-framework": "0.0.1", "hammerjs": "2.0.8", "immutable": "3.8.1", "keymaster": "1.6.2", @@ -23,8 +22,7 @@ "react-router": "^3.0.0", "redux": "3.6.0", "redux-thunk": "2.1.0", - "timeago.js": "2.0.2", - "xenia-driver": "0.0.4" + "timeago.js": "2.0.2" }, "devDependencies": { "autoprefixer": "6.5.0", diff --git a/client/coral-admin/public/index.html b/client/coral-admin/public/index.html index 707b82ebd..c31c22a6d 100644 --- a/client/coral-admin/public/index.html +++ b/client/coral-admin/public/index.html @@ -17,6 +17,6 @@
- + diff --git a/client/coral-admin/src/components/App.js b/client/coral-admin/src/components/App.js index 044d00989..545cd80a4 100644 --- a/client/coral-admin/src/components/App.js +++ b/client/coral-admin/src/components/App.js @@ -1,7 +1,7 @@ import React from 'react' import { Provider } from 'react-redux' -import { Layout, Content } from 'react-mdl' +import { Layout } from 'react-mdl' import 'material-design-lite' import { Router, Route, browserHistory } from 'react-router' import ModerationQueue from 'containers/ModerationQueue' @@ -10,6 +10,7 @@ import store from 'services/store' import CommentStream from 'containers/CommentStream' import EmbedLink from 'components/EmbedLink' import Configure from 'containers/Configure' +import config from 'services/config' export default class App extends React.Component { render (props) { @@ -19,10 +20,10 @@ export default class App extends React.Component {
- - - - + + + +
diff --git a/client/coral-admin/src/components/Comment.js b/client/coral-admin/src/components/Comment.js index ce4f6686e..7406d42db 100644 --- a/client/coral-admin/src/components/Comment.js +++ b/client/coral-admin/src/components/Comment.js @@ -12,14 +12,14 @@ export default props => (
person - {props.comment.get('data').get('name') || lang.t('comment.anon')} - {timeago().format(props.comment.get('data').get('createdAt') || (Date.now() - props.index * 60 * 1000), lang.getLocale().replace('-', '_'))} - {props.comment.get('data').get('flagged') ?

{lang.t('comment.flagged')}

: null} + {props.comment.get('name') || lang.t('comment.anon')} + {timeago().format(props.comment.get('createdAt') || (Date.now() - props.index * 60 * 1000), lang.getLocale().replace('-', '_'))} + {props.comment.get('flagged') ?

{lang.t('comment.flagged')}

: null}
{props.actions.map(action => canShowAction(action, props.comment) ? ( @@ -27,16 +27,17 @@ export default props => (
- {props.comment.get('data').get('body')} + {props.comment.get('body')}
) // Check if an action can be performed over a comment const canShowAction = (action, comment) => { - const status = comment.get('data').get('status') - const flagged = comment.get('data').get('flagged') - if (action === 'flag' && (status !== 'Untouched' || flagged === true)) { + const status = comment.get('status') + const flagged = comment.get('flagged') + + if (action === 'flag' && (status || flagged === true)) { return false } return true diff --git a/client/coral-admin/src/components/CommentList.js b/client/coral-admin/src/components/CommentList.js index b9a1ba944..f56a1349f 100644 --- a/client/coral-admin/src/components/CommentList.js +++ b/client/coral-admin/src/components/CommentList.js @@ -112,8 +112,9 @@ export default class CommentList extends React.Component { } render () { - const {singleView, actions, commentIds, comments, hideActive} = this.props + const {singleView, commentIds, comments, hideActive} = this.props const {active} = this.state + return (