suspect words are marked up

This commit is contained in:
Riley Davis
2016-12-20 16:56:16 -07:00
parent ef0055e689
commit 9315337ce6
3 changed files with 13 additions and 9 deletions
@@ -26,7 +26,7 @@ export default class CommentList extends React.Component {
// list of actions (flags, etc) associated with the comments
actions: PropTypes.shape({
ids: PropTypes.arrayOf(PropTypes.string)
}).isRequired,
}),
suspectWords: PropTypes.arrayOf(PropTypes.string)
}
@@ -13,6 +13,7 @@ import {
fetchModerationQueueComments
} from 'actions/comments';
import {userStatusUpdate} from 'actions/users';
import {fetchSettings} from 'actions/settings';
import styles from './ModerationQueue.css';
import I18n from 'coral-framework/modules/i18n/i18n';
@@ -36,6 +37,7 @@ class ModerationQueue extends React.Component {
// Fetch comments and bind singleView key before render
componentWillMount () {
this.props.dispatch(fetchSettings());
this.props.dispatch(fetchModerationQueueComments());
key('s', () => this.setState({singleView: !this.state.singleView}));
key('shift+/', () => this.setState({modalOpen: true}));
@@ -110,8 +112,7 @@ class ModerationQueue extends React.Component {
</div>
<div className={`mdl-tabs__panel is-active ${styles.listContainer}`} id='pending'>
<CommentList
suspectWords={['fishy', 'shady']}
actions={actions}
suspectWords={settings.settings.wordlist.suspect}
isActive={activeTab === 'pending'}
singleView={singleView}
commentIds={premodIds}
@@ -129,8 +130,7 @@ class ModerationQueue extends React.Component {
</div>
<div className={`mdl-tabs__panel ${styles.listContainer}`} id='rejected'>
<CommentList
actions={actions}
suspectWords={[]}
suspectWords={settings.settings.wordlist.suspect}
isActive={activeTab === 'rejected'}
singleView={singleView}
commentIds={rejectedIds}
@@ -143,8 +143,7 @@ class ModerationQueue extends React.Component {
<div className={`mdl-tabs__panel ${styles.listContainer}`} id='flagged'>
<CommentList
isActive={activeTab === 'rejected'}
actions={actions}
suspectWords={[]}
suspectWords={settings.settings.wordlist.suspect}
singleView={singleView}
commentIds={flaggedIds}
comments={comments.byId}
+7 -2
View File
@@ -1,8 +1,13 @@
import {Map} from 'immutable';
import {Map, List} from 'immutable';
import * as types from '../actions/settings';
const initialState = Map({
settings: Map(),
settings: Map({
wordlist: Map({
banned: List(),
suspect: List()
})
}),
saveSettingsError: null,
fetchSettingsError: null,
fetchingSettings: false