mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 07:28:29 +08:00
Updated with User-Status-Refactor API
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user