Updated with User-Status-Refactor API

This commit is contained in:
Belen Curcio
2017-12-11 08:49:22 -03:00
parent 8e582bff45
commit 26abd02032
2 changed files with 12 additions and 4 deletions
@@ -121,7 +121,9 @@ class UserDetail extends React.Component {
hideUserDetail,
viewUserDetail,
loadMore,
toggleSelectAll
toggleSelectAll,
unBanUser,
unSuspendUser,
} = this.props;
let rejectedPercent = (rejectedComments / totalComments) * 100;
@@ -156,7 +158,7 @@ class UserDetail extends React.Component {
label={this.getActionMenuLabel()}>
{suspended ? <ActionsMenuItem
onClick={this.showSuspenUserDialog}>
onClick={() => unSuspendUser({id: user.id})}>
Remove Suspension
</ActionsMenuItem> : <ActionsMenuItem
onClick={this.showSuspenUserDialog}>
@@ -164,7 +166,7 @@ class UserDetail extends React.Component {
</ActionsMenuItem>}
{banned ? <ActionsMenuItem
onClick={this.showSuspenUserDialog}>
onClick={() => unBanUser({id: user.id})}>
Remove Ban
</ActionsMenuItem> : <ActionsMenuItem
onClick={this.showBanUserDialog}>
@@ -348,6 +350,8 @@ UserDetail.propTypes = {
notify: PropTypes.func.isRequired,
showSuspendUserDialog: PropTypes.func,
showBanUserDialog: PropTypes.func,
unBanUser: PropTypes.func.isRequired,
unSuspendUser: PropTypes.func.isRequired,
};
export default UserDetail;
@@ -14,7 +14,7 @@ import {
toggleSelectCommentInUserDetail,
toggleSelectAllCommentInUserDetail
} from 'coral-admin/src/actions/userDetail';
import {withSetCommentStatus} from 'coral-framework/graphql/mutations';
import {withSetCommentStatus, withUnBanUser, withUnSuspendUser} from 'coral-framework/graphql/mutations';
import UserDetailComment from './UserDetailComment';
import update from 'immutability-helper';
import {notify} from 'coral-framework/actions/notification';
@@ -137,6 +137,8 @@ UserDetailContainer.propTypes = {
setCommentStatus: PropTypes.func,
clearUserDetailSelections: PropTypes.func,
selectedCommentIds: PropTypes.array,
unBanUser: PropTypes.func.isRequired,
unSuspendUser: PropTypes.func.isRequired,
};
const LOAD_MORE_QUERY = gql`
@@ -245,4 +247,6 @@ export default compose(
connect(mapStateToProps, mapDispatchToProps),
withUserDetailQuery,
withSetCommentStatus,
withUnBanUser,
withUnSuspendUser,
)(UserDetailContainer);