From e31cdebc12dec1664c71b3c2d3fc7b0d3c808b9f Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 15 Sep 2017 22:52:19 +0700 Subject: [PATCH] Make it appear in reported queue --- client/coral-admin/src/routes/Moderation/queueConfig.js | 2 +- client/coral-embed-stream/src/graphql/index.js | 8 ++++++++ client/talk-plugin-commentbox/CommentBox.js | 8 ++++---- graph/mutators/comment.js | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/client/coral-admin/src/routes/Moderation/queueConfig.js b/client/coral-admin/src/routes/Moderation/queueConfig.js index 86a622177..b90979efe 100644 --- a/client/coral-admin/src/routes/Moderation/queueConfig.js +++ b/client/coral-admin/src/routes/Moderation/queueConfig.js @@ -13,7 +13,7 @@ export default { }, reported: { action_type: 'FLAG', - statuses: ['NONE', 'PREMOD'], + statuses: ['NONE', 'PREMOD', 'SYSTEM_WITHHELD'], icon: 'flag', name: t('modqueue.reported'), }, diff --git a/client/coral-embed-stream/src/graphql/index.js b/client/coral-embed-stream/src/graphql/index.js index 884a9c86a..dc81b56a4 100644 --- a/client/coral-embed-stream/src/graphql/index.js +++ b/client/coral-embed-stream/src/graphql/index.js @@ -77,6 +77,14 @@ export default { title url } + actions { + __typename + id + ... on FlagAction { + reason + message + } + } tags { tag { name diff --git a/client/talk-plugin-commentbox/CommentBox.js b/client/talk-plugin-commentbox/CommentBox.js index 33b46e245..c85dfb306 100644 --- a/client/talk-plugin-commentbox/CommentBox.js +++ b/client/talk-plugin-commentbox/CommentBox.js @@ -13,10 +13,10 @@ export const name = 'talk-plugin-commentbox'; // Given a newly posted comment's status, show a notification to the user // if needed -export const notifyForNewCommentStatus = (notify, status) => { - if (status === 'REJECTED') { +export const notifyForNewCommentStatus = (notify, comment) => { + if (comment.status === 'REJECTED') { notify('error', t('comment_box.comment_post_banned_word')); - } else if (status === 'PREMOD' || status === 'SYSTEM_WITHHELD') { + } else if (comment.status === 'PREMOD' || comment.status === 'SYSTEM_WITHHELD') { notify('success', t('comment_box.comment_post_notif_premod')); } }; @@ -74,7 +74,7 @@ class CommentBox extends React.Component { // Execute postSubmit Hooks this.state.hooks.postSubmit.forEach((hook) => hook(data)); - notifyForNewCommentStatus(notify, postedComment.status); + notifyForNewCommentStatus(notify, postedComment); if (commentPostedHandler) { commentPostedHandler(); diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index c79634c99..2aa6f3128 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -282,8 +282,8 @@ const resolveNewCommentStatus = async (context, {asset_id, body, status}, wordli // If the user is not a reliable commenter (passed the unreliability // threshold by having too many rejected comments) then we can change the - // status of the comment to `PREMOD`, therefore pushing the user's comments - // away from the public eye until a moderator can manage them. This of + // status of the comment to `SYSTEM_WITHHELD`, therefore pushing the user's + // comments away from the public eye until a moderator can manage them. This of // course can only be applied if the comment's current status is `NONE`, // we don't want to interfere if the comment was rejected. if (KarmaService.isReliable('comment', user.metadata.trust) === false) {