diff --git a/client/coral-admin/src/actions/userDetail.js b/client/coral-admin/src/actions/userDetail.js
index f6d0d563e..fe9aa2df5 100644
--- a/client/coral-admin/src/actions/userDetail.js
+++ b/client/coral-admin/src/actions/userDetail.js
@@ -1,4 +1,4 @@
-import * as actions from 'constants/moderation';
+import * as actions from 'constants/userDetail';
export const viewUserDetail = (userId) => ({type: actions.VIEW_USER_DETAIL, userId});
export const hideUserDetail = () => ({type: actions.HIDE_USER_DETAIL});
diff --git a/client/coral-admin/src/components/UserDetail.js b/client/coral-admin/src/components/UserDetail.js
index a7051b0ec..eab25c41d 100644
--- a/client/coral-admin/src/components/UserDetail.js
+++ b/client/coral-admin/src/components/UserDetail.js
@@ -10,7 +10,7 @@ import ClickOutside from 'coral-framework/components/ClickOutside';
export default class UserDetail extends React.Component {
static propTypes = {
- id: PropTypes.string.isRequired,
+ userId: PropTypes.string.isRequired,
hideUserDetail: PropTypes.func.isRequired,
root: PropTypes.object.isRequired,
bannedWords: PropTypes.array.isRequired,
@@ -62,7 +62,7 @@ export default class UserDetail extends React.Component {
comments: {nodes}
},
activeTab,
- selectedIds,
+ selectedCommentIds,
bannedWords,
suspectWords,
toggleSelect,
@@ -119,7 +119,7 @@ export default class UserDetail extends React.Component {
{
- selectedIds.length === 0
+ selectedCommentIds.length === 0
? (
- All
@@ -140,7 +140,7 @@ export default class UserDetail extends React.Component {
cStyle='reject'
icon='close'>
- {`${selectedIds.length} comments selected`}
+ {`${selectedCommentIds.length} comments selected`}
)
}
@@ -149,7 +149,7 @@ export default class UserDetail extends React.Component {
{
nodes.map((comment) => {
const status = comment.action_summaries ? 'FLAGGED' : comment.status;
- const selected = selectedIds.indexOf(comment.id) !== -1;
+ const selected = selectedCommentIds.indexOf(comment.id) !== -1;
return {
- const changes = this.props.selectedIds.map((commentId) => {
+ const changes = this.props.selectedCommentIds.map((commentId) => {
return this.props.setCommentStatus({commentId, status});
});
@@ -62,11 +62,11 @@ class UserDetailContainer extends React.Component {
}
render () {
- if (!this.props.id) {
+ if (!this.props.userId) {
return null;
}
- const loading = !('user' in this.props.root) || this.props.root.user.id !== this.props.id;
+ const loading = !('user' in this.props.root) || this.props.root.user.id !== this.props.userId;
return {
+ options: ({userId, statuses}) => {
return {
- variables: {author_id: id, statuses}
+ variables: {author_id: userId, statuses}
};
},
- skip: (ownProps) => !ownProps.id,
+ skip: (ownProps) => !ownProps.userId,
});
const mapStateToProps = (state) => ({
- id: state.userDetail.userDetailId,
- selectedIds: state.userDetail.userDetailSelectedIds,
- statuses: state.userDetail.userDetailStatuses,
- activeTab: state.userDetail.userDetailActiveTab,
+ userId: state.userDetail.userId,
+ selectedCommentIds: state.userDetail.selectedCommentIds,
+ statuses: state.userDetail.statuses,
+ activeTab: state.userDetail.activeTab,
bannedWords: state.settings.toJS().wordlist.banned,
suspectWords: state.settings.toJS().wordlist.suspect,
});
diff --git a/client/coral-admin/src/reducers/userDetail.js b/client/coral-admin/src/reducers/userDetail.js
index bb7bed441..8e1d35885 100644
--- a/client/coral-admin/src/reducers/userDetail.js
+++ b/client/coral-admin/src/reducers/userDetail.js
@@ -1,10 +1,10 @@
import * as actions from '../constants/userDetail';
const initialState = {
- userDetailId: null,
- userDetailActiveTab: 'all',
- userDetailStatuses: ['NONE', 'ACCEPTED', 'REJECTED', 'PREMOD'],
- userDetailSelectedIds: [],
+ userId: null,
+ activeTab: 'all',
+ statuses: ['NONE', 'ACCEPTED', 'REJECTED', 'PREMOD'],
+ selectedCommentIds: [],
};
export default function banUserDialog(state = initialState, action) {
@@ -12,34 +12,34 @@ export default function banUserDialog(state = initialState, action) {
case actions.VIEW_USER_DETAIL:
return {
...state,
- userDetailId: action.userId,
+ userId: action.userId,
};
case actions.HIDE_USER_DETAIL:
return {
...state,
- userDetailId: null,
- userDetailSelectedIds: [],
+ userId: null,
+ selectedCommentIds: [],
};
case actions.CLEAR_USER_DETAIL_SELECTIONS:
return {
...state,
- userDetailSelectedIds: [],
+ selectedCommentIds: [],
};
case actions.CHANGE_USER_DETAIL_STATUSES:
return {
...state,
- userDetailActiveTab: action.tab,
- userDetailStatuses: action.statuses,
+ activeTab: action.tab,
+ statuses: action.statuses,
};
case actions.SELECT_USER_DETAIL_COMMENT:
return {
...state,
- userDetailSelectedIds: [...state.userDetailSelectedIds, action.id],
+ selectedCommentIds: [...state.selectedCommentIds, action.id],
};
case actions.UNSELECT_USER_DETAIL_COMMENT:
return {
...state,
- userDetailSelectedIds: state.userDetailSelectedIds.filter((id) => id !== action.id),
+ selectedCommentIds: state.selectedCommentIds.filter((id) => id !== action.id),
};
default:
return state;