diff --git a/client/coral-admin/src/components/CommentType.css b/client/coral-admin/src/components/CommentType.css index e4851275e..969d9511d 100644 --- a/client/coral-admin/src/components/CommentType.css +++ b/client/coral-admin/src/components/CommentType.css @@ -3,12 +3,11 @@ color: white; background: grey; box-sizing: border-box; - padding: 0px 5px; - border-radius: 2px; + padding: 2px 5px; font-size: 12px; height: 24px; letter-spacing: 0.4px; - margin-bottom: 1px; + line-height: 22px; > i { font-size: 14px; diff --git a/client/coral-admin/src/components/ReplyBadge.js b/client/coral-admin/src/components/ReplyBadge.js new file mode 100644 index 000000000..5c8bb88ba --- /dev/null +++ b/client/coral-admin/src/components/ReplyBadge.js @@ -0,0 +1,11 @@ +import React from 'react'; +import {Badge} from 'coral-ui'; +import t from 'coral-framework/services/i18n'; + +const ReplyBadge = () => ( + + {t('modqueue.reply')} + +); + +export default ReplyBadge; diff --git a/client/coral-admin/src/components/UserDetailComment.css b/client/coral-admin/src/components/UserDetailComment.css index b042aea39..2dfd61cf3 100644 --- a/client/coral-admin/src/components/UserDetailComment.css +++ b/client/coral-admin/src/components/UserDetailComment.css @@ -55,7 +55,7 @@ position: relative; } -.commentType { +.badgeBar { position: absolute; right: 0px; } diff --git a/client/coral-admin/src/components/UserDetailComment.js b/client/coral-admin/src/components/UserDetailComment.js index 9b4936847..dc809b9c7 100644 --- a/client/coral-admin/src/components/UserDetailComment.js +++ b/client/coral-admin/src/components/UserDetailComment.js @@ -3,6 +3,7 @@ import {Link} from 'react-router'; import {Icon} from 'coral-ui'; import FlagBox from './FlagBox'; +import ReplyBadge from './ReplyBadge'; import styles from './UserDetailComment.css'; import CommentType from './CommentType'; import {getActionSummary} from 'coral-framework/utils'; @@ -56,7 +57,11 @@ class UserDetailComment extends React.Component { ?  ({t('comment.edited')}) : null } - + +
+ {comment.hasParent && } + +
Story: {comment.asset.title} diff --git a/client/coral-admin/src/containers/UserDetailComment.js b/client/coral-admin/src/containers/UserDetailComment.js index a70a9394d..9f0e3a793 100644 --- a/client/coral-admin/src/containers/UserDetailComment.js +++ b/client/coral-admin/src/containers/UserDetailComment.js @@ -9,6 +9,7 @@ export default withFragments({ body created_at status + hasParent asset { id title diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.js b/client/coral-admin/src/routes/Moderation/components/Comment.js index 1335a8c52..c73d15eaa 100644 --- a/client/coral-admin/src/routes/Moderation/components/Comment.js +++ b/client/coral-admin/src/routes/Moderation/components/Comment.js @@ -2,6 +2,7 @@ import React, {PropTypes} from 'react'; import {Link} from 'react-router'; import {Icon} from 'coral-ui'; +import ReplyBadge from 'coral-admin/src/components/ReplyBadge'; import FlagBox from 'coral-admin/src/components/FlagBox'; import styles from './styles.css'; import CommentType from 'coral-admin/src/components/CommentType'; @@ -107,6 +108,7 @@ class Comment extends React.Component { }
+ {comment.hasParent && } ( + + {icon && } + {children} + +); + +export default Badge; diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js index 8a538d120..8f261bcca 100644 --- a/client/coral-ui/index.js +++ b/client/coral-ui/index.js @@ -26,3 +26,4 @@ export {default as Option} from './components/Option'; export {default as SnackBar} from './components/SnackBar'; export {default as TextArea} from './components/TextArea'; export {default as Drawer} from './components/Drawer'; +export {default as Badge} from './components/Badge'; diff --git a/graph/resolvers/comment.js b/graph/resolvers/comment.js index 0fd3a730c..57ebc4d56 100644 --- a/graph/resolvers/comment.js +++ b/graph/resolvers/comment.js @@ -1,6 +1,9 @@ const {decorateWithTags} = require('./util'); const Comment = { + hasParent({parent_id}) { + return !!parent_id; + }, parent({parent_id}, _, {loaders: {Comments}}) { if (parent_id == null) { return null; diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql index d2c1ffe1f..d83d9f75f 100644 --- a/graph/typeDefs.graphql +++ b/graph/typeDefs.graphql @@ -339,6 +339,9 @@ type Comment { # describes how the comment can be edited editing: EditInfo + + # Indicates if it has a parent + hasParent: Boolean } # CommentConnection represents a paginable subset of a comment list. diff --git a/locales/en.yml b/locales/en.yml index 54d5315d5..2ec0c816c 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -281,6 +281,7 @@ en: prev_comment: "Go to the previous comment" reject: "Reject" rejected: "Rejected" + reply: "Reply" select_stream: "Select Stream" shift_key: "⇧" shortcuts: "Shortcuts" diff --git a/locales/es.yml b/locales/es.yml index 8c3e7927b..877a42841 100644 --- a/locales/es.yml +++ b/locales/es.yml @@ -272,6 +272,7 @@ es: prev_comment: "Ir al comentario anterior" reject: "Rechazar" rejected: "rechazado" + reply: "Respuesta" select_stream: "Seleccionar hilo de comentarios" shift_key: ⇧ shortcuts: Atajos