@@ -66,7 +66,7 @@ export default UserAction;
const getActionButton = (option, i, props) => {
const {user, onClickShowBanDialog, onClickAction, menuOptionsMap, action} = props;
const status = user.status;
- const banned = (user.status === 'banned');
+ const banned = (user.status === 'BANNED');
if (option === 'flag' && status) {
return null;
diff --git a/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js b/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js
index 3d4451efe..90cd0560c 100644
--- a/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js
+++ b/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js
@@ -14,6 +14,15 @@ export default (props) => (
+
{
+ e.preventDefault();
+ props.onTabClick('all');
+ }}
+ className={`mdl-tabs__tab ${styles.tab} ${props.activeTab === 'all' ? styles.active : ''}`}
+ >
+ {lang.t('modqueue.all')}
+
{
e.preventDefault();
diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js
index e376d8ff5..ec62f5396 100644
--- a/client/coral-plugin-flags/FlagButton.js
+++ b/client/coral-plugin-flags/FlagButton.js
@@ -14,6 +14,7 @@ class FlagButton extends Component {
reason: '',
note: '',
step: 0,
+ posted: false,
localPost: null,
localDelete: false
}
@@ -38,7 +39,7 @@ class FlagButton extends Component {
onPopupContinue = () => {
const {postAction, id, author_id} = this.props;
- const {itemType, reason, step, localPost} = this.state;
+ const {itemType, reason, step, posted} = this.state;
// Proceed to the next step or close the menu if we've reached the end
if (step + 1 >= this.props.getPopupMenu.length) {
@@ -48,7 +49,8 @@ class FlagButton extends Component {
}
// If itemType and reason are both set, post the action
- if (itemType && reason && !localPost) {
+ if (itemType && reason && !posted) {
+ this.setState({posted: true});
// Set the text from the "other" field if it exists.
let item_id;
diff --git a/graph/mutators/action.js b/graph/mutators/action.js
index cf80c496d..5e1db3fd8 100644
--- a/graph/mutators/action.js
+++ b/graph/mutators/action.js
@@ -1,8 +1,10 @@
const ActionModel = require('../../models/action');
const ActionsService = require('../../services/actions');
+const UsersService = require('../../services/users');
/**
- * Creates an action on a item.
+ * Creates an action on a item. If the item is a user flag, sets the user's status to
+ * pending.
* @param {Object} user the user performing the request
* @param {String} item_id id of the item to add the action to
* @param {String} item_type type of the item
@@ -16,7 +18,10 @@ const createAction = ({user = {}}, {item_id, item_type, action_type, metadata =
user_id: user.id,
action_type,
metadata
- });
+ }).then((result) =>
+ item_type === 'USERS' && action_type === 'FLAG' ?
+ UsersService.setStatus(user.id, 'PENDING').then(() => result)
+ : result);
};
/**