+
| - {row.username} + {row.profiles.map(({id}) => id)} |
diff --git a/client/coral-admin/src/routes/Community/components/User.js b/client/coral-admin/src/routes/Community/components/User.js
index 5aea161b5..2d921a1c7 100644
--- a/client/coral-admin/src/routes/Community/components/User.js
+++ b/client/coral-admin/src/routes/Community/components/User.js
@@ -38,9 +38,7 @@ const User = (props) => {
-
- {user.username}
-
+
{props.currentUser.id !== user.id &&
- {action.user && action.user.username}: {action.message ? action.message : 'n/a'} + {action.user && + + } + : {action.message ? action.message : 'n/a'} ; } return null; diff --git a/client/coral-admin/src/routes/Community/containers/Community.js b/client/coral-admin/src/routes/Community/containers/Community.js index ee2f874a8..a9a164ac9 100644 --- a/client/coral-admin/src/routes/Community/containers/Community.js +++ b/client/coral-admin/src/routes/Community/containers/Community.js @@ -17,6 +17,7 @@ import { showRejectUsernameDialog, hideRejectUsernameDialog } from '../../../actions/community'; +import {viewUserDetail} from '../../../actions/userDetail'; import Community from '../components/Community'; @@ -99,6 +100,7 @@ const mapDispatchToProps = (dispatch) => hideRejectUsernameDialog, updateSorting, newPage, + viewUserDetail, }, dispatch); export default compose( diff --git a/client/coral-admin/src/routes/Community/containers/Table.js b/client/coral-admin/src/routes/Community/containers/Table.js index 499e0718a..8bd5395e4 100644 --- a/client/coral-admin/src/routes/Community/containers/Table.js +++ b/client/coral-admin/src/routes/Community/containers/Table.js @@ -4,6 +4,7 @@ import {bindActionCreators} from 'redux'; import {compose} from 'react-apollo'; import {setRole, setCommenterStatus} from '../../../actions/community'; import Table from '../components/Table'; +import {viewUserDetail} from '../../../actions/userDetail'; class TableContainer extends Component { @@ -29,6 +30,7 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ setCommenterStatus, setRole, + viewUserDetail, }, dispatch); export default compose( diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.js b/client/coral-admin/src/routes/Moderation/components/Comment.js index 26543be6e..e37fa887c 100644 --- a/client/coral-admin/src/routes/Moderation/components/Comment.js +++ b/client/coral-admin/src/routes/Moderation/components/Comment.js @@ -1,22 +1,20 @@ import React, {PropTypes} from 'react'; import {Link} from 'react-router'; -import Linkify from 'react-linkify'; import {Icon} from 'coral-ui'; -import FlagBox from './FlagBox'; +import FlagBox from 'coral-admin/src/components/FlagBox'; import styles from './styles.css'; -import CommentType from './CommentType'; -import Highlighter from 'react-highlight-words'; +import CommentType from 'coral-admin/src/components/CommentType'; +import CommentAnimatedEdit from 'coral-admin/src/components/CommentAnimatedEdit'; import Slot from 'coral-framework/components/Slot'; import {getActionSummary} from 'coral-framework/utils'; import ActionButton from 'coral-admin/src/components/ActionButton'; import ActionsMenu from 'coral-admin/src/components/ActionsMenu'; import ActionsMenuItem from 'coral-admin/src/components/ActionsMenuItem'; +import CommentBodyHighlighter from 'coral-admin/src/components/CommentBodyHighlighter'; +import IfHasLink from 'coral-admin/src/components/IfHasLink'; import cn from 'classnames'; -import {murmur3} from 'murmurhash-js'; -import {CSSTransitionGroup} from 'react-transition-group'; - -const linkify = new Linkify(); +import {getCommentType} from 'coral-admin/src/utils/comment'; import t, {timeago} from 'coral-framework/services/i18n'; @@ -29,41 +27,16 @@ class Comment extends React.Component { viewUserDetail, suspectWords, bannedWords, - minimal, selected, - toggleSelect, className, ...props } = this.props; - const links = linkify.getMatches(comment.body); - const linkText = links ? links.map((link) => link.raw) : []; const flagActionSummaries = getActionSummary('FlagActionSummary', comment); - const flagActions = - comment.actions && - comment.actions.filter((a) => a.__typename === 'FlagAction'); - let commentType = ''; - if (comment.status === 'PREMOD') { - commentType = 'premod'; - } else if (flagActions && flagActions.length) { - commentType = 'flagged'; - } + const flagActions = comment.actions && comment.actions.filter((a) => a.__typename === 'FlagAction'); + const commentType = getCommentType(comment); - // since words are checked against word boundaries on the backend, - // should be the behavior on the front end as well. - // currently the highlighter plugin does not support out of the box. - const searchWords = [...suspectWords, ...bannedWords] - .filter((w) => { - return new RegExp(`(^|\\s)${w}(\\s|$)`, 'i').test(comment.body); - }) - .concat(linkText); - - let selectionStateCSS; - if (minimal) { - selectionStateCSS = selected ? styles.minimalSelection : ''; - } else { - selectionStateCSS = selected ? 'mdl-shadow--16dp' : 'mdl-shadow--2dp'; - } + let selectionStateCSS = selected ? 'mdl-shadow--16dp' : 'mdl-shadow--2dp'; const showSuspenUserDialog = () => props.showSuspendUserDialog({ userId: comment.user.id, @@ -81,31 +54,21 @@ class Comment extends React.Component { return (
{
- !minimal && (
+ (
viewUserDetail(comment.user.id)}>
{comment.user.username}
)
}
- {
- minimal && typeof selected === 'boolean' && typeof toggleSelect === 'function' && (
- toggleSelect(e.target.value, e.target.checked)} />
- )
- }
- {timeago(comment.created_at || Date.now() - props.index * 60 * 1000)}
+ {timeago(comment.created_at)}
{
(comment.editing && comment.editing.edited)
@@ -125,45 +88,27 @@ class Comment extends React.Component {
}
-
- {comment.user.status === 'banned'
- ?
-
Story: {comment.asset.title}
{!props.currentAsset &&
{t('modqueue.moderate')}}
-
+
- {links
- ?
-
-
+
{actions.map((action, i) => {
const active =
@@ -193,7 +138,6 @@ class Comment extends React.Component {
(action === 'APPROVE' && comment.status === 'ACCEPTED');
return (
|