Merge branch 'master' into fix-config

This commit is contained in:
Wyatt Johnson
2017-09-15 15:56:46 -06:00
committed by GitHub
18 changed files with 348 additions and 127 deletions
+2 -4
View File
@@ -4,10 +4,8 @@ export const viewUserDetail = (userId) => ({type: actions.VIEW_USER_DETAIL, user
export const hideUserDetail = () => ({type: actions.HIDE_USER_DETAIL});
export const changeUserDetailStatuses = (tab) => {
let statuses;
if (tab === 'all') {
statuses = ['NONE', 'ACCEPTED', 'REJECTED', 'PREMOD'];
} else if (tab === 'rejected') {
let statuses = [];
if (tab === 'rejected') {
statuses = ['REJECTED'];
}
return {type: actions.CHANGE_USER_DETAIL_STATUSES, tab, statuses};
@@ -3,7 +3,7 @@ import * as actions from '../constants/userDetail';
const initialState = {
userId: null,
activeTab: 'all',
statuses: ['NONE', 'ACCEPTED', 'REJECTED', 'PREMOD'],
statuses: [],
selectedCommentIds: [],
};
@@ -13,7 +13,7 @@ export default {
},
reported: {
action_type: 'FLAG',
statuses: ['NONE', 'PREMOD'],
statuses: ['NONE', 'PREMOD', 'SYSTEM_WITHHELD'],
icon: 'flag',
name: t('modqueue.reported'),
},
@@ -51,7 +51,7 @@ class StreamContainer extends React.Component {
return prev;
}
if (['PREMOD', 'REJECTED'].includes(commentEdited.status)) {
if (['PREMOD', 'REJECTED', 'SYSTEM_WITHHELD'].includes(commentEdited.status)) {
return removeCommentFromEmbedQuery(prev, commentEdited.id);
}
},
+10 -2
View File
@@ -77,6 +77,14 @@ export default {
title
url
}
actions {
__typename
id
... on FlagAction {
reason
message
}
}
tags {
tag {
name
@@ -166,7 +174,7 @@ export default {
},
updateQueries: {
CoralEmbedStream_Embed: (prev, {mutationResult: {data: {createComment: {comment}}}}) => {
if (prev.asset.settings.moderation === 'PRE' || comment.status === 'PREMOD' || comment.status === 'REJECTED') {
if (prev.asset.settings.moderation === 'PRE' || comment.status === 'PREMOD' || comment.status === 'REJECTED' || comment.status === 'SYSTEM_WITHHELD') {
return prev;
}
return insertCommentIntoEmbedQuery(prev, comment);
@@ -185,7 +193,7 @@ export default {
EditComment: () => ({
updateQueries: {
CoralEmbedStream_Embed: (prev, {mutationResult: {data: {editComment: {comment}}}}) => {
if (!['PREMOD', 'REJECTED'].includes(comment.status)) {
if (!['PREMOD', 'REJECTED', 'SYSTEM_WITHHELD'].includes(comment.status)) {
return null;
}
return removeCommentFromEmbedQuery(prev, comment.id);
+4 -4
View File
@@ -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') {
} 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();