@@ -106,8 +106,8 @@ export class CommentForm extends React.Component {
rows={3}/>
- {
- this.props.charCountEnable &&
+ {
+ this.props.charCountEnable &&
maxCharCount ? `${name}-char-max` : ''}`}>
{maxCharCount && `${maxCharCount - length} ${lang.t('characters-remaining')}`}
diff --git a/client/coral-plugin-replies/ReplyBox.js b/client/coral-plugin-replies/ReplyBox.js
index d6e2b5631..97667f932 100644
--- a/client/coral-plugin-replies/ReplyBox.js
+++ b/client/coral-plugin-replies/ReplyBox.js
@@ -12,7 +12,7 @@ class ReplyBox extends Component {
render() {
const {
styles,
- postItem,
+ postComment,
assetId,
authorId,
addNotification,
@@ -32,7 +32,7 @@ class ReplyBox extends Component {
addNotification={addNotification}
authorId={authorId}
assetId={assetId}
- postItem={postItem}
+ postComment={postComment}
isReply={true} />
;
}
@@ -46,7 +46,7 @@ ReplyBox.propTypes = {
parentId: PropTypes.string,
addNotification: PropTypes.func.isRequired,
authorId: PropTypes.string.isRequired,
- postItem: PropTypes.func.isRequired,
+ postComment: PropTypes.func.isRequired,
assetId: PropTypes.string.isRequired
};
diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js
index 47ad5f4f2..b0b258f92 100644
--- a/client/coral-settings/containers/ProfileContainer.js
+++ b/client/coral-settings/containers/ProfileContainer.js
@@ -1,11 +1,10 @@
import {connect} from 'react-redux';
-import {compose} from 'react-apollo';
+import {compose, graphql, gql} from 'react-apollo';
import React, {Component} from 'react';
import I18n from 'coral-framework/modules/i18n/i18n';
import {bindActionCreators} from 'redux';
-import {myCommentHistory, myIgnoredUsers} from 'coral-framework/graphql/queries';
-import {stopIgnoringUser} from 'coral-framework/graphql/mutations';
+import {withStopIgnoringUser} from 'coral-framework/graphql/mutations';
import {link} from 'coral-framework/services/PymConnection';
import NotLoggedIn from '../components/NotLoggedIn';
@@ -88,6 +87,36 @@ class ProfileContainer extends Component {
}
}
+const withMyIgnoredUsersQuery = graphql(gql`
+ query myIgnoredUsers {
+ myIgnoredUsers {
+ id,
+ username,
+ }
+ }`, {
+ props: ({data}) => {
+ return ({
+ myIgnoredUsersData: data
+ });
+ }
+ });
+
+const withMyCommentHistoryQuery = graphql(gql`
+ query myCommentHistory {
+ me {
+ comments {
+ id
+ body
+ asset {
+ id
+ title
+ url
+ }
+ created_at
+ }
+ }
+ }`);
+
const mapStateToProps = (state) => ({
user: state.user.toJS(),
asset: state.asset.toJS(),
@@ -99,7 +128,7 @@ const mapDispatchToProps = (dispatch) =>
export default compose(
connect(mapStateToProps, mapDispatchToProps),
- myCommentHistory,
- myIgnoredUsers,
- stopIgnoringUser,
+ withMyCommentHistoryQuery,
+ withMyIgnoredUsersQuery,
+ withStopIgnoringUser,
)(ProfileContainer);
diff --git a/plugins/coral-plugin-respect/client/containers/RespectButton.js b/plugins/coral-plugin-respect/client/containers/RespectButton.js
index fba54c195..296ca9a1f 100644
--- a/plugins/coral-plugin-respect/client/containers/RespectButton.js
+++ b/plugins/coral-plugin-respect/client/containers/RespectButton.js
@@ -1,15 +1,15 @@
-import {compose, gql, graphql} from 'react-apollo';
+import {compose, gql} from 'react-apollo';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import get from 'lodash/get';
-import withFragments from 'coral-framework/hocs/withFragments';
+import {withFragments, withMutation} from 'coral-framework/hocs';
import {showSignInDialog} from 'coral-framework/actions/auth';
import RespectButton from '../components/RespectButton';
const isRespectAction = (a) => a.__typename === 'RespectActionSummary';
const COMMENT_FRAGMENT = gql`
- fragment RespectButton_updateFragment on Comment {
+ fragment CoralRespect_UpdateFragment on Comment {
action_summaries {
... on RespectActionSummary {
count
@@ -21,8 +21,8 @@ const COMMENT_FRAGMENT = gql`
}
`;
-const withDeleteAction = graphql(gql`
- mutation deleteAction($id: ID!) {
+const withDeleteAction = withMutation(gql`
+ mutation CoralRespect_DeleteAction($id: ID!) {
deleteAction(id:$id) {
errors {
translation_key
@@ -66,8 +66,8 @@ const withDeleteAction = graphql(gql`
}),
});
-const withPostRespect = graphql(gql`
- mutation createRespect($respect: CreateRespectInput!) {
+const withPostRespect = withMutation(gql`
+ mutation CoralRespect_CreateRespect($respect: CreateRespectInput!) {
createRespect(respect: $respect) {
respect {
id
@@ -137,14 +137,14 @@ const mapDispatchToProps = (dispatch) =>
const enhance = compose(
withFragments({
root: gql`
- fragment RespectButton_root on RootQuery {
+ fragment CoralRespect_RespectButton_root on RootQuery {
me {
status
}
}
`,
comment: gql`
- fragment RespectButton_comment on Comment {
+ fragment CoralRespect_RespectButton_comment on Comment {
action_summaries {
... on RespectActionSummary {
count