From 71fcf9cd3f1c29cbcef3098c2d314ee83bcabd8a Mon Sep 17 00:00:00 2001 From: gaba Date: Fri, 10 Feb 2017 10:20:34 -0800 Subject: [PATCH] FE for the Staff Tag. Modifed typedfs graphql. --- client/coral-embed-stream/src/Comment.js | 3 ++- client/coral-plugin-tag-label/TagLabel.js | 7 ++++--- client/coral-plugin-tag-label/styles.css | 7 ++++--- graph/typeDefs.graphql | 10 ++++------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/client/coral-embed-stream/src/Comment.js b/client/coral-embed-stream/src/Comment.js index 257c076b1..12ee56d0c 100644 --- a/client/coral-embed-stream/src/Comment.js +++ b/client/coral-embed-stream/src/Comment.js @@ -21,6 +21,7 @@ import LikeButton from 'coral-plugin-likes/LikeButton'; import styles from './Comment.css'; const getAction = (type, comment) => comment.actions.filter((a) => a.type === type)[0]; +const isStaff = (tags) => !tags.every((t) => t.name !== 'STAFF') ; class Comment extends React.Component { @@ -101,7 +102,7 @@ class Comment extends React.Component {
- +
diff --git a/client/coral-plugin-tag-label/TagLabel.js b/client/coral-plugin-tag-label/TagLabel.js index dcfee8bf1..f9ad898ec 100644 --- a/client/coral-plugin-tag-label/TagLabel.js +++ b/client/coral-plugin-tag-label/TagLabel.js @@ -1,8 +1,9 @@ import React from 'react'; -const name = 'coral-plugin-tag-label'; -const TagLabel = () =>
- oh yeah +import styles from './styles.css'; + +const TagLabel = ({isStaff}) =>
+ {(isStaff) ? 'Staff' : ''}
; export default TagLabel; diff --git a/client/coral-plugin-tag-label/styles.css b/client/coral-plugin-tag-label/styles.css index eee8d7201..5408b43d4 100644 --- a/client/coral-plugin-tag-label/styles.css +++ b/client/coral-plugin-tag-label/styles.css @@ -1,5 +1,6 @@ -.tagLabel { - color: black; +.staff { + background-color: #4C1066; + color: white; display: inline-block; - margin: 10px 0; + margin: 10px 10px; } diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql index 07bc8ebdc..2ca815ad3 100644 --- a/graph/typeDefs.graphql +++ b/graph/typeDefs.graphql @@ -27,6 +27,9 @@ input CommentsQuery { # limit the number of results to be returned. limit: Int = 10 + # filter by a specific tag name. + tag: [String] + # skip results from the last created_at timestamp. cursor: Date @@ -65,7 +68,7 @@ type User { type Tag { # the actual tag for the comment. - name: COMMENT_TAG + name: String! # the user that assigned the tag. If NULL then the system automatically tagged it. assigned_by: String @@ -179,11 +182,6 @@ type Asset { created_at: Date } -enum COMMENT_TAG { - # For the comments submitted by staff members (ADMIN or MODERATOR users). - STAFF -} - enum COMMENT_STATUS { ACCEPTED REJECTED