diff --git a/client/coral-admin/src/components/UserDetail.js b/client/coral-admin/src/components/UserDetail.js index 275503085..4d9ed3cc6 100644 --- a/client/coral-admin/src/components/UserDetail.js +++ b/client/coral-admin/src/components/UserDetail.js @@ -23,6 +23,14 @@ export default class UserDetail extends React.Component { toggleSelect: PropTypes.func.isRequired, bulkAccept: PropTypes.func.isRequired, bulkReject: PropTypes.func.isRequired, + loading: PropTypes.bool.isRequired, + data: PropTypes.shape({ + refetch: PropTypes.func.isRequired, + }), + activeTab: PropTypes.string.isRequired, + selectedCommentIds: PropTypes.array.isRequired, + viewUserDetail: PropTypes.any.isRequired, + loadMore: PropTypes.any.isRequired } rejectThenReload = async (info) => { @@ -116,24 +124,22 @@ export default class UserDetail extends React.Component { - -

- Data represents the last six months of activity -

- {`${selectedCommentIds.length} comments selected`} + {selectedCommentIds.length} comments selected ) } diff --git a/client/coral-admin/src/containers/UserDetail.js b/client/coral-admin/src/containers/UserDetail.js index ffc661150..5d9ef0537 100644 --- a/client/coral-admin/src/containers/UserDetail.js +++ b/client/coral-admin/src/containers/UserDetail.js @@ -152,7 +152,7 @@ export const withUserDetailQuery = withQuery(gql` } ${getSlotFragmentSpreads(slots, 'user')} } - totalComments: commentCount(query: {author_id: $author_id}) + totalComments: commentCount(query: {author_id: $author_id, statuses: []}) rejectedComments: commentCount(query: {author_id: $author_id, statuses: [REJECTED]}) comments: comments(query: { author_id: $author_id, diff --git a/graph/loaders/comments.js b/graph/loaders/comments.js index b6a347b8e..2ad94deac 100644 --- a/graph/loaders/comments.js +++ b/graph/loaders/comments.js @@ -92,7 +92,7 @@ const getCommentCountByQuery = (context, {ids, statuses, asset_id, parent_id, au let query = CommentModel.find(); // If user queries for statuses other than NONE and/or ACCEPTED statuses, it needs - // special priviledges. + // special privileges. if ( (!statuses || statuses.some((status) => !['NONE', 'ACCEPTED'].includes(status))) && (context.user == null || !context.user.can(SEARCH_NON_NULL_OR_ACCEPTED_COMMENTS)) @@ -100,7 +100,7 @@ const getCommentCountByQuery = (context, {ids, statuses, asset_id, parent_id, au return null; } - if (statuses) { + if (statuses && statuses.length > 0) { query = query.where({status: {$in: statuses}}); }