@@ -14,11 +27,11 @@ class IgnoredCommentTombstone extends React.Component {
padding: '1em',
color: '#3E4F71',
}}>
- {t('framework.comment_is_ignored')}
+ {this.getCopy()}
);
}
}
-export default IgnoredCommentTombstone;
+export default CommentTombstone;
diff --git a/client/coral-framework/graphql/mutations.js b/client/coral-framework/graphql/mutations.js
index c09ce8751..fb004956b 100644
--- a/client/coral-framework/graphql/mutations.js
+++ b/client/coral-framework/graphql/mutations.js
@@ -127,6 +127,27 @@ export const withSetCommentStatus = withMutation(
commentId,
status,
},
+ optimisticResponse: {
+ setCommentStatus: {
+ __typename: 'SetCommentStatusResponse',
+ errors: null,
+ }
+ },
+ update: (proxy) => {
+
+ const fragment = gql`
+ fragment Talk_SetCommentStatus on Comment {
+ status
+ }`;
+
+ const fragmentId = `Comment_${commentId}`;
+
+ const data = proxy.readFragment({fragment, id: fragmentId});
+
+ data.status = status;
+
+ proxy.writeFragment({fragment, id: fragmentId, data});
+ }
});
}
})
diff --git a/docs/index.md b/docs/index.md
index 35cb5a158..2c106394d 100755
--- a/docs/index.md
+++ b/docs/index.md
@@ -10,7 +10,7 @@ sidebar:
nav: "docs"
---
-Online comments are broken. Mozilla's open-source, plugin-based tool Talk rethinks how moderation, comment display, and conversation function online, creating the opportunity for better, smarter discussions designed to fit your needs. [Read more about Talk here.](https://coralproject.net/products/talk)
+Online comments are broken. Mozilla's open-source, plugin-based tool Talk rethinks how moderation, comment display, and conversation function online, creating the opportunity for better, smarter discussions designed to fit your needs. [Read more about Talk here.](https://coralproject.net/products/talk.html)
Third party licenses are available via the `/client/3rdpartylicenses.txt`
endpoint when the server is running with built assets.
@@ -32,11 +32,7 @@ See our [Contribution Guide]({{ "/docs/development/contributing" | absolute_url
- iPad
- iPad Pro
-- iPhone 7 Plus
-- iPhone 7
-- iPhone 6 Plus
-- iPhone 6
-- iPhone 5
+- iPhone 5 and later
### iOS Browsers
@@ -46,9 +42,8 @@ See our [Contribution Guide]({{ "/docs/development/contributing" | absolute_url
### Android Devices
-- Galaxy S5
-- Nexus 5X
-- Nexus 6P
+- Galaxy S5 and later
+- Nexus 5X and later
### Android Browsers
diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js
index 9142687f6..c6e335018 100644
--- a/graph/mutators/comment.js
+++ b/graph/mutators/comment.js
@@ -194,16 +194,32 @@ const createComment = async (context, {tags = [], body, asset_id, parent_id = nu
* @param {String} [asset_id] id of asset comment is posted on
* @return {Object} resolves to the wordlist results
*/
-const filterNewComment = (context, {body, asset_id}) => {
+const filterNewComment = async (context, {body, asset_id}) => {
+
+ // Load the settings.
+ const [
+ settings,
+ asset,
+ ] = await Promise.all([
+ context.loaders.Settings.load(),
+ context.loaders.Assets.getByID.load(asset_id),
+ ]);
// Create a new instance of the Wordlist.
const wl = new Wordlist();
+ // Load the wordlist.
+ wl.upsert(settings.wordlist);
+
// Load the wordlist and filter the comment content.
- return Promise.all([
- wl.load().then(() => wl.scan('body', body)),
- asset_id && AssetsService.rectifySettings(AssetsService.findById(asset_id))
- ]);
+ return [
+
+ // Scan the word.
+ wl.scan('body', body),
+
+ // Return the asset's settings.
+ await AssetsService.rectifySettings(asset, settings)
+ ];
};
/**
@@ -247,7 +263,7 @@ const resolveNewCommentStatus = async (context, {asset_id, body, status}, wordli
// Return `premod` if pre-moderation is enabled and an empty "new" status
// in the event that it is not in pre-moderation mode.
- let {moderation, charCountEnable, charCount} = await AssetsService.rectifySettings(asset);
+ let {moderation, charCountEnable, charCount} = await AssetsService.rectifySettings(asset, settings);
// Reject if the comment is too long
if (charCountEnable && body.length > charCount) {
@@ -365,7 +381,7 @@ const edit = async (context, {id, asset_id, edit: {body}}) => {
const status = await resolveNewCommentStatus(context, {asset_id, body}, wordlist, settings);
// Execute the edit.
- const comment = await CommentsService.edit(id, context.user.id, {body, status});
+ const comment = await CommentsService.edit({id, author_id: context.user.id, body, status});
// Publish the edited comment via the subscription.
context.pubsub.publish('commentEdited', comment);
diff --git a/locales/en.yml b/locales/en.yml
index 4d215fd06..703de4b28 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -221,6 +221,8 @@ en:
banned_account_body: "This means that you cannot Like, Report, or write comments."
comment: comment
comment_is_ignored: "This comment is hidden because you ignored this user."
+ comment_is_rejected: "You have rejected this comment."
+ comment_is_hidden: "This comment is not available."
comments: comments
configure_stream: "Configure"
content_not_available: "This content is not available"
diff --git a/locales/es.yml b/locales/es.yml
index f9b675a10..db25ab527 100644
--- a/locales/es.yml
+++ b/locales/es.yml
@@ -219,6 +219,8 @@ es:
banned_account_body: "Esto significa que no puedes gustar, marcar o escribir comentarios."
comment: "comentario"
comment_is_ignored: "Este comentario está escondido porque has ignorado al usuario."
+ comment_is_rejected: "Has rechazado este comentario."
+ comment_is_hidden: "Este comentario no está disponible."
comments: "comentarios"
configure_stream: "Configurar Hilo de Comentarios"
content_not_available: "Este contenido no se encuentra disponible"
diff --git a/plugin-api/beta/client/hocs/index.js b/plugin-api/beta/client/hocs/index.js
index 15c8b3544..d6d5a67a0 100644
--- a/plugin-api/beta/client/hocs/index.js
+++ b/plugin-api/beta/client/hocs/index.js
@@ -8,4 +8,5 @@ export {default as withEmit} from 'coral-framework/hocs/withEmit';
export {
withIgnoreUser,
withStopIgnoringUser,
+ withSetCommentStatus,
} from 'coral-framework/graphql/mutations';
diff --git a/plugins/talk-plugin-featured-comments/client/components/Button.css b/plugins/talk-plugin-featured-comments/client/components/Button.css
index daaa329c9..09432af70 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Button.css
+++ b/plugins/talk-plugin-featured-comments/client/components/Button.css
@@ -14,4 +14,4 @@
.icon {
font-size: 18px;
vertical-align: top;
-}
+}
\ No newline at end of file
diff --git a/plugins/talk-plugin-featured-comments/client/components/Button.js b/plugins/talk-plugin-featured-comments/client/components/Button.js
index b9d0cc95f..c581ce027 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Button.js
+++ b/plugins/talk-plugin-featured-comments/client/components/Button.js
@@ -24,4 +24,3 @@ const Button = (props) => {
};
export default withTags('featured')(Button);
-
diff --git a/plugins/talk-plugin-featured-comments/client/components/Comment.js b/plugins/talk-plugin-featured-comments/client/components/Comment.js
index ada7ae7b6..1c2045110 100644
--- a/plugins/talk-plugin-featured-comments/client/components/Comment.js
+++ b/plugins/talk-plugin-featured-comments/client/components/Comment.js
@@ -5,6 +5,7 @@ import {t, timeago} from 'plugin-api/beta/client/services';
import {Slot, CommentAuthorName} from 'plugin-api/beta/client/components';
import {Icon} from 'plugin-api/beta/client/components/ui';
import {pluginName} from '../../package.json';
+import Button from './Button';
class Comment extends React.Component {
@@ -48,6 +49,13 @@ class Comment extends React.Component {
asset={asset}
inline
/>
+
+