+
{
const comment = await Comment.setStatus({id, status});
if (status === 'ACCEPTED') {
-
- // Publish the comment status change via the subscription.
pubsub.publish('commentAccepted', comment);
} else if (status === 'REJECTED') {
-
- // Publish the comment status change via the subscription.
pubsub.publish('commentRejected', comment);
+ } else if (status === 'NONE') {
+ pubsub.publish('commentReset', comment);
}
},
addTag: async (_, {tag}, {mutators: {Tag}}) => {
diff --git a/graph/resolvers/subscription.js b/graph/resolvers/subscription.js
index f6da9fb54..8be3236c1 100644
--- a/graph/resolvers/subscription.js
+++ b/graph/resolvers/subscription.js
@@ -11,6 +11,9 @@ const Subscription = {
commentRejected(comment) {
return comment;
},
+ commentReset(comment) {
+ return comment;
+ },
commentFlagged(comment) {
return comment;
},
diff --git a/graph/setupFunctions.js b/graph/setupFunctions.js
index 86ae106b9..512452e64 100644
--- a/graph/setupFunctions.js
+++ b/graph/setupFunctions.js
@@ -2,6 +2,7 @@ const {
SUBSCRIBE_COMMENT_ACCEPTED,
SUBSCRIBE_COMMENT_REJECTED,
SUBSCRIBE_COMMENT_FLAGGED,
+ SUBSCRIBE_COMMENT_RESET,
SUBSCRIBE_ALL_COMMENT_EDITED,
SUBSCRIBE_ALL_COMMENT_ADDED,
SUBSCRIBE_ALL_USER_SUSPENDED,
@@ -59,12 +60,18 @@ const setupFunctions = {
}
return !args.asset_id || comment.asset_id === args.asset_id;
},
- commentRejected: (options, args) => (comment, context) => {
+ commentRejected: (options, args, comment, context) => {
if (!context.user || !context.user.can(SUBSCRIBE_COMMENT_REJECTED)) {
return false;
}
return !args.asset_id || comment.asset_id === args.asset_id;
},
+ commentReset: (options, args, comment, context) => {
+ if (!context.user || !context.user.can(SUBSCRIBE_COMMENT_RESET)) {
+ return false;
+ }
+ return !args.asset_id || comment.asset_id === args.asset_id;
+ },
userSuspended: (options, args, user, context) => {
if (
!context.user
diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql
index 165c31fda..38d67053d 100644
--- a/graph/typeDefs.graphql
+++ b/graph/typeDefs.graphql
@@ -1499,6 +1499,10 @@ type Subscription {
# Requires the `ADMIN` or `MODERATOR` role.
commentRejected(asset_id: ID): Comment
+ # Get an update whenever the status of a comment has been reset.
+ # Requires the `ADMIN` or `MODERATOR` role.
+ commentReset(asset_id: ID): Comment
+
# Get an update whenever a user has been suspended.
# `user_id` must match id of current user except for
# users with the `ADMIN` or `MODERATOR` role.
diff --git a/locales/en.yml b/locales/en.yml
index 83d7f266f..ffe106480 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -17,6 +17,7 @@ en:
characters_remaining: "characters remaining"
comment:
anon: "Anonymous"
+ undo_reject: "Undo"
ban_user: "Ban User"
comment: "Post a comment"
edited: Edited
@@ -281,6 +282,7 @@ en:
notify_accepted: '{0} accepted comment "{1}"'
notify_rejected: '{0} rejected comment "{1}"'
notify_flagged: '{0} flagged comment "{1}"'
+ notify_reset: '{0} reset status of comment "{1}"'
approve: "Approve"
approved: "Approved"
ban_user: "Ban"
diff --git a/package.json b/package.json
index 8dc9ac46b..e2cc43a17 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "talk",
- "version": "3.7.1",
+ "version": "3.8.0",
"description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net",
"main": "app.js",
"private": true,
diff --git a/perms/constants/subscription.js b/perms/constants/subscription.js
index 6c56529ea..94b417e3a 100644
--- a/perms/constants/subscription.js
+++ b/perms/constants/subscription.js
@@ -2,6 +2,7 @@ module.exports = {
SUBSCRIBE_COMMENT_ACCEPTED: 'SUBSCRIBE_COMMENT_ACCEPTED',
SUBSCRIBE_COMMENT_REJECTED: 'SUBSCRIBE_COMMENT_REJECTED',
SUBSCRIBE_COMMENT_FLAGGED: 'SUBSCRIBE_COMMENT_FLAGGED',
+ SUBSCRIBE_COMMENT_RESET: 'SUBSCRIBE_COMMENT_RESET',
SUBSCRIBE_ALL_COMMENT_ADDED: 'SUBSCRIBE_ALL_COMMENT_ADDED',
SUBSCRIBE_ALL_COMMENT_EDITED: 'SUBSCRIBE_ALL_COMMENT_EDITED',
SUBSCRIBE_ALL_USER_SUSPENDED: 'SUBSCRIBE_ALL_USER_SUSPENDED',
diff --git a/perms/reducers/subscription.js b/perms/reducers/subscription.js
index 3a6268553..799b3e4c4 100644
--- a/perms/reducers/subscription.js
+++ b/perms/reducers/subscription.js
@@ -6,6 +6,8 @@ module.exports = (user, perm) => {
case types.SUBSCRIBE_COMMENT_FLAGGED:
case types.SUBSCRIBE_COMMENT_ACCEPTED:
case types.SUBSCRIBE_COMMENT_REJECTED:
+ case types.SUBSCRIBE_COMMENT_RESET:
+ return check(user, ['ADMIN', 'MODERATOR']);
case types.SUBSCRIBE_ALL_COMMENT_EDITED:
case types.SUBSCRIBE_ALL_COMMENT_ADDED:
case types.SUBSCRIBE_ALL_USER_SUSPENDED:
diff --git a/plugins/talk-plugin-featured-comments/client/components/Comment.css b/plugins/talk-plugin-featured-comments/client/components/Comment.css
index 9481b4396..bd4428091 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Comment.css
+++ b/plugins/talk-plugin-featured-comments/client/components/Comment.css
@@ -44,6 +44,7 @@
margin: 0;
quotes: '\201c' '\201d';
margin-bottom: 10px;
+ word-wrap: break-word;
}
.quote:before {
diff --git a/plugins/talk-plugin-moderation-actions/client/components/BanUserDialog.js b/plugins/talk-plugin-moderation-actions/client/components/BanUserDialog.js
index c98e3e7c2..9db509869 100644
--- a/plugins/talk-plugin-moderation-actions/client/components/BanUserDialog.js
+++ b/plugins/talk-plugin-moderation-actions/client/components/BanUserDialog.js
@@ -33,9 +33,9 @@ const BanUserDialog = ({showBanDialog, closeBanDialog, banUser}) => (
);
BanUserDialog.propTypes = {
- showBanDialog: PropTypes.func.isRequired,
+ showBanDialog: PropTypes.bool.isRequired,
closeBanDialog: PropTypes.func.isRequired,
banUser: PropTypes.func.isRequired,
};
-export default BanUserDialog;
\ No newline at end of file
+export default BanUserDialog;
diff --git a/services/passport.js b/services/passport.js
index 0920c1c39..1d5d0ddcf 100644
--- a/services/passport.js
+++ b/services/passport.js
@@ -515,5 +515,6 @@ module.exports = {
HandleAuthPopupCallback,
HandleGenerateCredentials,
HandleLogout,
- CheckBlacklisted
+ CheckBlacklisted,
+ CheckRecaptcha,
};