From 793f63495915e47bc0678f6feda738d21ac41ef2 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 17 May 2017 09:01:41 -0300 Subject: [PATCH] Working tags --- client/coral-embed-stream/src/components/Comment.js | 2 +- client/coral-embed-stream/src/containers/Comment.js | 4 ---- client/coral-framework/graphql/fragments/commentView.graphql | 4 +++- .../coral-framework/graphql/mutations/addCommentTag.graphql | 4 +++- .../graphql/mutations/removeCommentTag.graphql | 4 +++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 9d7cb436d..dabac433c 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -25,7 +25,7 @@ import {getActionSummary, iPerformedThisAction} from 'coral-framework/utils'; import {getEditableUntilDate} from './util'; import styles from './Comment.css'; -const isStaff = tags => !tags.every(t => t.id !== 'STAFF'); +const isStaff = tags => !!tags.filter(i => i.tag.name === 'STAFF').length; // hold actions links (e.g. Reply) along the comment footer const ActionButton = ({children}) => { diff --git a/client/coral-embed-stream/src/containers/Comment.js b/client/coral-embed-stream/src/containers/Comment.js index 7b5159cc1..7ae96e177 100644 --- a/client/coral-embed-stream/src/containers/Comment.js +++ b/client/coral-embed-stream/src/containers/Comment.js @@ -30,10 +30,6 @@ export default withFragments({ tags { tag { name - created_at - } - assigned_by { - id } } user { diff --git a/client/coral-framework/graphql/fragments/commentView.graphql b/client/coral-framework/graphql/fragments/commentView.graphql index 1832cc77d..0aa80c9cf 100644 --- a/client/coral-framework/graphql/fragments/commentView.graphql +++ b/client/coral-framework/graphql/fragments/commentView.graphql @@ -6,7 +6,9 @@ fragment commentView on Comment { created_at status tags { - id + tag { + name + } } user { id diff --git a/client/coral-framework/graphql/mutations/addCommentTag.graphql b/client/coral-framework/graphql/mutations/addCommentTag.graphql index a4ff36da4..aa4ce7f5b 100644 --- a/client/coral-framework/graphql/mutations/addCommentTag.graphql +++ b/client/coral-framework/graphql/mutations/addCommentTag.graphql @@ -3,7 +3,9 @@ mutation AddCommentTag ($id: ID!, $tag: String!) { comment { id tags { - id + tag { + name + } } } errors { diff --git a/client/coral-framework/graphql/mutations/removeCommentTag.graphql b/client/coral-framework/graphql/mutations/removeCommentTag.graphql index 642466f00..c89fc24f9 100644 --- a/client/coral-framework/graphql/mutations/removeCommentTag.graphql +++ b/client/coral-framework/graphql/mutations/removeCommentTag.graphql @@ -3,7 +3,9 @@ mutation RemoveCommentTag ($id: ID!, $tag: String!) { comment { id tags { - id + tag { + name + } } } errors {