From d92c2d9744d5cef86f21704bbc3999ecf24e7f0a Mon Sep 17 00:00:00 2001 From: David Jay Date: Fri, 3 Feb 2017 10:18:29 -0800 Subject: [PATCH] Updating user queue routes. --- client/coral-admin/src/actions/comments.js | 4 ++-- client/coral-admin/src/components/User.js | 7 ------- routes/api/queue/index.js | 2 +- test/routes/api/queue/index.js | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/client/coral-admin/src/actions/comments.js b/client/coral-admin/src/actions/comments.js index 3c1437de7..ac7af12fd 100644 --- a/client/coral-admin/src/actions/comments.js +++ b/client/coral-admin/src/actions/comments.js @@ -15,7 +15,7 @@ export const fetchModerationQueueComments = () => { return Promise.all([ coralApi('/queue/comments/premod'), - coralApi('/queue/users/pending'), + coralApi('/queue/users/flagged'), coralApi('/queue/comments/rejected'), coralApi('/queue/comments/flagged') ]) @@ -46,7 +46,7 @@ export const fetchPendingUsersQueue = () => { return dispatch => { dispatch({type: commentTypes.COMMENTS_MODERATION_QUEUE_FETCH_REQUEST}); - return coralApi('/queue/users/pending') + return coralApi('/queue/users/flagged') .then(addUsersCommentsActions.bind(this, dispatch)); }; }; diff --git a/client/coral-admin/src/components/User.js b/client/coral-admin/src/components/User.js index c8a056699..54de0375e 100644 --- a/client/coral-admin/src/components/User.js +++ b/client/coral-admin/src/components/User.js @@ -1,6 +1,4 @@ import React from 'react'; -import Linkify from 'react-linkify'; - import styles from './ModerationList.css'; import I18n from 'coral-framework/modules/i18n/i18n'; @@ -9,13 +7,10 @@ import translations from '../translations.json'; import {Icon} from 'react-mdl'; import ActionButton from './ActionButton'; -const linkify = new Linkify(); - // Render a single comment for the list const User = props => { const {action, user} = props; let userStatus = user.status; - const links = user.settings.bio ? linkify.getMatches(user.settings.bio) : []; // Do not display unless the user status is 'pending' or 'banned'. // This means that they have already been reviewed and approved. @@ -26,8 +21,6 @@ const User = props => { {user.displayName}
- {links ? - Contains Link : null}
{props.modActions.map( (action, i) => diff --git a/routes/api/queue/index.js b/routes/api/queue/index.js index 2373b808f..b3cbb1a52 100644 --- a/routes/api/queue/index.js +++ b/routes/api/queue/index.js @@ -79,7 +79,7 @@ router.get('/comments/flagged', authorization.needed('ADMIN'), (req, res, next) }); // Returns back all the users that are in the moderation queue. -router.get('/users/pending', (req, res, next) => { +router.get('/users/flagged', (req, res, next) => { UsersService.moderationQueue() .then((users) => { return Promise.all([ diff --git a/test/routes/api/queue/index.js b/test/routes/api/queue/index.js index ab60a9f20..9f89a961e 100644 --- a/test/routes/api/queue/index.js +++ b/test/routes/api/queue/index.js @@ -110,7 +110,7 @@ describe('/api/v1/queue', () => { it('should return all pending users and actions', function(done){ chai.request(app) - .get('/api/v1/queue/users/pending') + .get('/api/v1/queue/users/flagged') .set(passport.inject({roles: ['ADMIN']})) .end(function(err, res){ expect(err).to.be.null;