From 322434f751135eded1cb54d0b68989c7ac81273e Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Mon, 1 May 2017 11:13:35 -0300 Subject: [PATCH] Removing LIKE from talk --- .../src/services/fragmentMatcher.js | 4 --- .../src/components/Comment.js | 26 +------------------ .../src/components/Stream.js | 3 --- .../src/containers/Stream.js | 4 +-- .../graphql/mutations/index.js | 12 --------- .../graphql/mutations/postLike.graphql | 10 ------- 6 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 client/coral-framework/graphql/mutations/postLike.graphql diff --git a/client/coral-admin/src/services/fragmentMatcher.js b/client/coral-admin/src/services/fragmentMatcher.js index afb87d445..bf167cd1e 100644 --- a/client/coral-admin/src/services/fragmentMatcher.js +++ b/client/coral-admin/src/services/fragmentMatcher.js @@ -20,7 +20,6 @@ const fm = new IntrospectionFragmentMatcher({ name: 'Response', possibleTypes: [ {name: 'CreateCommentResponse'}, - {name: 'CreateLikeResponse'}, {name: 'CreateFlagResponse'}, {name: 'CreateDontAgreeResponse'}, {name: 'DeleteActionResponse'}, @@ -38,7 +37,6 @@ const fm = new IntrospectionFragmentMatcher({ name: 'Action', possibleTypes: [ {name: 'FlagAction'}, - {name: 'LikeAction'}, {name: 'DontAgreeAction'} ], }, @@ -47,7 +45,6 @@ const fm = new IntrospectionFragmentMatcher({ name: 'ActionSummary', possibleTypes: [ {name: 'FlagActionSummary'}, - {name: 'LikeActionSummary'}, {name: 'DontAgreeActionSummary'} ], }, @@ -57,7 +54,6 @@ const fm = new IntrospectionFragmentMatcher({ possibleTypes: [ {name: 'DefaultAssetActionSummary'}, {name: 'FlagAssetActionSummary'}, - {name: 'LikeAssetActionSummary'} ] } ], diff --git a/client/coral-embed-stream/src/components/Comment.js b/client/coral-embed-stream/src/components/Comment.js index 4f8426159..320a6b95f 100644 --- a/client/coral-embed-stream/src/components/Comment.js +++ b/client/coral-embed-stream/src/components/Comment.js @@ -1,11 +1,3 @@ -// this component will -// render its children -// render a like button -// render a permalink button -// render a reply button -// render a flag button -// translate things? - import React, {PropTypes} from 'react'; import PermalinkButton from 'coral-plugin-permalinks/PermalinkButton'; @@ -16,7 +8,6 @@ import Content from 'coral-plugin-commentcontent/CommentContent'; import PubDate from 'coral-plugin-pubdate/PubDate'; import {ReplyBox, ReplyButton} from 'coral-plugin-replies'; import FlagComment from 'coral-plugin-flags/FlagComment'; -import LikeButton from 'coral-plugin-likes/LikeButton'; import {BestButton, IfUserCanModifyBest, BEST_TAG, commentIsBest, BestIndicator} from 'coral-plugin-best/BestButton'; import Slot from 'coral-framework/components/Slot'; import LoadMore from './LoadMore'; @@ -28,7 +19,7 @@ import styles from './Comment.css'; const isStaff = (tags) => !tags.every((t) => t.name !== 'STAFF') ; -// hold actions links (e.g. Like, Reply) along the comment footer +// hold actions links (e.g. Reply) along the comment footer const ActionButton = ({children}) => { return { children }; }; @@ -49,7 +40,6 @@ class Comment extends React.Component { setActiveReplyBox: PropTypes.func.isRequired, showSignInDialog: PropTypes.func.isRequired, postFlag: PropTypes.func.isRequired, - postLike: PropTypes.func.isRequired, deleteAction: PropTypes.func.isRequired, parentId: PropTypes.string, highlighted: PropTypes.string, @@ -110,7 +100,6 @@ class Comment extends React.Component { postItem, addNotification, showSignInDialog, - postLike, highlighted, postFlag, postDontAgree, @@ -127,7 +116,6 @@ class Comment extends React.Component { charCountEnable, } = this.props; - const likeSummary = getActionSummary('LikeActionSummary', comment); const flagSummary = getActionSummary('FlagActionSummary', comment); const dontAgreeSummary = getActionSummary('DontAgreeActionSummary', comment); let myFlag = null; @@ -198,17 +186,6 @@ class Comment extends React.Component {
- - {/* TODO implmement iPerformedThisAction for the like */} - - { !disableReply && @@ -288,7 +265,6 @@ class Comment extends React.Component { asset={asset} highlighted={highlighted} currentUser={currentUser} - postLike={postLike} postFlag={postFlag} deleteAction={deleteAction} addCommentTag={addCommentTag} diff --git a/client/coral-embed-stream/src/components/Stream.js b/client/coral-embed-stream/src/components/Stream.js index 2875d0397..bed0a5470 100644 --- a/client/coral-embed-stream/src/components/Stream.js +++ b/client/coral-embed-stream/src/components/Stream.js @@ -28,7 +28,6 @@ class Stream extends React.Component { postItem, addNotification, postFlag, - postLike, postDontAgree, loadMore, deleteAction, @@ -117,7 +116,6 @@ class Stream extends React.Component { asset={asset} currentUser={user} highlighted={comment.id} - postLike={this.props.postLike} postFlag={this.props.postFlag} postDontAgree={this.props.postDontAgree} loadMore={this.props.loadMore} @@ -157,7 +155,6 @@ class Stream extends React.Component { postItem={postItem} asset={asset} currentUser={user} - postLike={postLike} postFlag={postFlag} postDontAgree={postDontAgree} addCommentTag={addCommentTag} diff --git a/client/coral-embed-stream/src/containers/Stream.js b/client/coral-embed-stream/src/containers/Stream.js index 49f234dab..16714df06 100644 --- a/client/coral-embed-stream/src/containers/Stream.js +++ b/client/coral-embed-stream/src/containers/Stream.js @@ -6,7 +6,7 @@ import uniqBy from 'lodash/uniqBy'; import sortBy from 'lodash/sortBy'; import isNil from 'lodash/isNil'; import {NEW_COMMENT_COUNT_POLL_INTERVAL} from '../constants/stream'; -import {postComment, postFlag, postLike, postDontAgree, deleteAction, addCommentTag, removeCommentTag, ignoreUser} from 'coral-framework/graphql/mutations'; +import {postComment, postFlag, postDontAgree, deleteAction, addCommentTag, removeCommentTag, ignoreUser} from 'coral-framework/graphql/mutations'; import {notificationActions, authActions} from 'coral-framework'; import {editName} from 'coral-framework/actions/user'; import {setCommentCountCache, setActiveReplyBox} from '../actions/stream'; @@ -217,7 +217,6 @@ const mapStateToProps = state => ({ auth: state.auth.toJS(), commentCountCache: state.stream.commentCountCache, activeReplyBox: state.stream.activeReplyBox, - commentId: state.stream.commentId, assetId: state.stream.assetId, assetUrl: state.stream.assetUrl, @@ -239,7 +238,6 @@ export default compose( connect(mapStateToProps, mapDispatchToProps), postComment, postFlag, - postLike, postDontAgree, addCommentTag, removeCommentTag, diff --git a/client/coral-framework/graphql/mutations/index.js b/client/coral-framework/graphql/mutations/index.js index b1ea57ae1..bdd7fd1a1 100644 --- a/client/coral-framework/graphql/mutations/index.js +++ b/client/coral-framework/graphql/mutations/index.js @@ -1,7 +1,6 @@ import {graphql} from 'react-apollo'; import POST_COMMENT from './postComment.graphql'; import POST_FLAG from './postFlag.graphql'; -import POST_LIKE from './postLike.graphql'; import POST_DONT_AGREE from './postDontAgree.graphql'; import DELETE_ACTION from './deleteAction.graphql'; import ADD_COMMENT_TAG from './addCommentTag.graphql'; @@ -83,17 +82,6 @@ export const postComment = graphql(POST_COMMENT, { }), }); -export const postLike = graphql(POST_LIKE, { - props: ({mutate}) => ({ - postLike: (like) => { - return mutate({ - variables: { - like - } - }); - }}), -}); - export const postFlag = graphql(POST_FLAG, { props: ({mutate}) => ({ postFlag: (flag) => { diff --git a/client/coral-framework/graphql/mutations/postLike.graphql b/client/coral-framework/graphql/mutations/postLike.graphql deleted file mode 100644 index 350904352..000000000 --- a/client/coral-framework/graphql/mutations/postLike.graphql +++ /dev/null @@ -1,10 +0,0 @@ -mutation CreateLike ($like: CreateLikeInput!) { - createLike(like:$like) { - like { - id - } - errors { - translation_key - } - } -}