From cefe872bf00891f7e8011bcef290fe545097c3f9 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 1 Mar 2017 16:38:27 -0700 Subject: [PATCH 1/2] Fixed queries --- .../coral-framework/graphql/queries/myCommentHistory.graphql | 5 +++++ client/coral-plugin-history/Comment.js | 5 +++-- client/coral-plugin-history/CommentHistory.js | 5 ++--- client/coral-settings/components/NotLoggedIn.js | 4 ++-- client/coral-settings/containers/ProfileContainer.js | 2 +- webpack.config.js | 5 +++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/client/coral-framework/graphql/queries/myCommentHistory.graphql b/client/coral-framework/graphql/queries/myCommentHistory.graphql index 6a4309dac..0b37b192a 100644 --- a/client/coral-framework/graphql/queries/myCommentHistory.graphql +++ b/client/coral-framework/graphql/queries/myCommentHistory.graphql @@ -3,6 +3,11 @@ query myCommentHistory { comments { id body + asset { + id + title + url + } created_at } } diff --git a/client/coral-plugin-history/Comment.js b/client/coral-plugin-history/Comment.js index df61b9e7d..00dcc40c7 100644 --- a/client/coral-plugin-history/Comment.js +++ b/client/coral-plugin-history/Comment.js @@ -5,7 +5,7 @@ const Comment = props => { return (

- {props.asset.url} + {props.asset.title ? props.asset.title : props.asset.url}

{props.comment.body}

@@ -18,7 +18,8 @@ Comment.propTypes = { body: PropTypes.string }).isRequired, asset: PropTypes.shape({ - url: PropTypes.string + url: PropTypes.string, + title: PropTypes.string }).isRequired }; diff --git a/client/coral-plugin-history/CommentHistory.js b/client/coral-plugin-history/CommentHistory.js index 1940f2695..a53035fb3 100644 --- a/client/coral-plugin-history/CommentHistory.js +++ b/client/coral-plugin-history/CommentHistory.js @@ -11,7 +11,7 @@ const CommentHistory = props => { key={i} comment={comment} link={props.link} - asset={props.asset} />; + asset={comment.asset} />; })} @@ -19,8 +19,7 @@ const CommentHistory = props => { }; CommentHistory.propTypes = { - comments: PropTypes.array.isRequired, - asset: PropTypes.object.isRequired + comments: PropTypes.array.isRequired }; export default CommentHistory; diff --git a/client/coral-settings/components/NotLoggedIn.js b/client/coral-settings/components/NotLoggedIn.js index acd3ae7e6..c76553c50 100644 --- a/client/coral-settings/components/NotLoggedIn.js +++ b/client/coral-settings/components/NotLoggedIn.js @@ -5,9 +5,9 @@ import translations from '../translations'; import I18n from 'coral-framework/modules/i18n/i18n'; const lang = new I18n(translations); -export default ({showSignInDialog}) => ( +export default ({showSignInDialog, requireEmailConfirmation}) => (
- +
{ showSignInDialog(); diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js index 4a98ed8ff..9a8117e87 100644 --- a/client/coral-settings/containers/ProfileContainer.js +++ b/client/coral-settings/containers/ProfileContainer.js @@ -35,7 +35,7 @@ class ProfileContainer extends Component { const {me} = this.props.data; if (!loggedIn || !me) { - return ; + return ; } if (data.loading) { diff --git a/webpack.config.js b/webpack.config.js index cd00696d8..432bb6155 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,7 +17,7 @@ const buildEmbeds = [ ]; module.exports = { - devtool: 'cheap-source-map', + devtool: '#cheap-module-source-map', entry: Object.assign({}, { 'embed': [ 'babel-polyfill', @@ -58,7 +58,8 @@ module.exports = { exclude: /node_modules/, test: /\.js$/, query: { - cacheDirectory: true + cacheDirectory: true, + sourceMap: true } }, { From 57fc4b8a3fa0e2eba7a90bd63e2e5c3abc9f3f47 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 1 Mar 2017 16:40:47 -0700 Subject: [PATCH 2/2] Fixed test --- test/client/coral-plugin-history/CommentHistory.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/client/coral-plugin-history/CommentHistory.spec.js b/test/client/coral-plugin-history/CommentHistory.spec.js index 945bf45a3..671a50137 100644 --- a/test/client/coral-plugin-history/CommentHistory.spec.js +++ b/test/client/coral-plugin-history/CommentHistory.spec.js @@ -20,6 +20,10 @@ describe('coral-plugin-history/CommentHistory', () => { 'closedAt':null }; + comments.forEach((comment) => { + comment.asset = asset; + }); + beforeEach(() => { render = shallow({}}/>); });