diff --git a/client/coral-admin/src/components/ModerationList.js b/client/coral-admin/src/components/ModerationList.js
index c1689b18e..29be06362 100644
--- a/client/coral-admin/src/components/ModerationList.js
+++ b/client/coral-admin/src/components/ModerationList.js
@@ -130,9 +130,9 @@ export default class ModerationList extends React.Component {
}
// Update the status right away if this is a comment
- if (action.item_type === 'comment') {
+ if (action.item_type === 'comments') {
this.props.updateCommentStatus(menuOption, id);
- } else if (action.item_type === 'user') {
+ } else if (action.item_type === 'users') {
// If a user bio or name is rejected, bring up a dialog before suspending them.
if (menuOption === 'rejected') {
@@ -195,11 +195,15 @@ export default class ModerationList extends React.Component {
getModerationIds = () => {
const {commentIds = [], actionIds = [], comments, actions} = this.props;
- return [ ...commentIds, ...actionIds ].sort((a, b) => {
- const itemA = comments[a] || actions[a];
- const itemB = comments[b] || actions[b];
- return itemB.updated_at - itemA.updated_at;
- });
+ if (comments && actions) {
+ return [ ...commentIds, ...actionIds ].sort((a, b) => {
+ const itemA = comments[a] || actions[a];
+ const itemB = comments[b] || actions[b];
+ return itemB.updated_at - itemA.updated_at;
+ });
+ } else {
+ return commentIds || actionIds;
+ }
}
render () {
diff --git a/client/coral-admin/src/components/UserAction.js b/client/coral-admin/src/components/UserAction.js
index 335529ef0..f58ef181b 100644
--- a/client/coral-admin/src/components/UserAction.js
+++ b/client/coral-admin/src/components/UserAction.js
@@ -19,7 +19,6 @@ const UserAction = props => {
const links = user.settings.bio ? linkify.getMatches(user.settings.bio) : [];
//Do not display if the user status is 'active'. This means that they have already been reviewed and approved.
-
return userStatus !== 'active' &&
diff --git a/client/coral-admin/src/containers/ModerationQueue/ModerationContainer.js b/client/coral-admin/src/containers/ModerationQueue/ModerationContainer.js
index e56b8cf6e..4930f4af2 100644
--- a/client/coral-admin/src/containers/ModerationQueue/ModerationContainer.js
+++ b/client/coral-admin/src/containers/ModerationQueue/ModerationContainer.js
@@ -66,7 +66,7 @@ class ModerationContainer extends React.Component {
const premodIds = comments.ids.filter(id => comments.byId[id].status === 'premod');
const rejectedIds = comments.ids.filter(id => comments.byId[id].status === 'rejected');
const flaggedIds = comments.ids.filter(id => comments.byId[id].flagged === true);
- const userActionIds = actions.ids.filter(id => actions.byId[id].item_type === 'user');
+ const userActionIds = actions.ids.filter(id => actions.byId[id].item_type === 'users');
return (
{
return {
header: lang.t('step-2-header'),
- itemType: 'user',
+ itemType: 'users',
field: 'bio',
options: [
{val: 'This bio is offensive', text: lang.t('bio-offensive')},
diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js
index 405d30551..1584f28e8 100644
--- a/client/coral-plugin-flags/FlagButton.js
+++ b/client/coral-plugin-flags/FlagButton.js
@@ -47,7 +47,7 @@ class FlagButton extends Component {
case 'comments':
item_id = id;
break;
- case 'user':
+ case 'users':
item_id = author_id;
break;
}
@@ -72,7 +72,7 @@ class FlagButton extends Component {
onPopupOptionClick = (sets) => (e) => {
// If flagging a user, indicate that this is referencing the username rather than the bio
- if(sets === 'itemType' && e.target.value === 'user') {
+ if(sets === 'itemType' && e.target.value === 'users') {
this.setState({field: 'username'});
}
diff --git a/client/coral-plugin-flags/FlagComment.js b/client/coral-plugin-flags/FlagComment.js
index 57d02f719..54dc954d9 100644
--- a/client/coral-plugin-flags/FlagComment.js
+++ b/client/coral-plugin-flags/FlagComment.js
@@ -10,7 +10,7 @@ const getPopupMenu = [
return {
header: lang.t('step-1-header'),
options: [
- {val: 'user', text: lang.t('flag-username')},
+ {val: 'users', text: lang.t('flag-username')},
{val: 'comments', text: lang.t('flag-comment')}
],
button: lang.t('continue'),