From f04e2505ec77dda0409d132b762b65f225335188 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 7 Nov 2016 13:25:45 -0500 Subject: [PATCH 01/12] Adding title to iframe for screen readers. --- client/coral-embed-stream/public/samplearticle.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-embed-stream/public/samplearticle.html b/client/coral-embed-stream/public/samplearticle.html index 493fc29fa..e973ee9be 100644 --- a/client/coral-embed-stream/public/samplearticle.html +++ b/client/coral-embed-stream/public/samplearticle.html @@ -9,7 +9,7 @@
From cb682981715f131f9d08604ad30578b683cc74b4 Mon Sep 17 00:00:00 2001 From: David Jay Date: Mon, 7 Nov 2016 13:39:33 -0500 Subject: [PATCH 02/12] Adding temporary user name field to commentbox. --- client/coral-embed-stream/style/default.css | 8 +++- client/coral-plugin-commentbox/CommentBox.js | 45 +++++++++++++------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 219a7aef5..4421bfaed 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -56,7 +56,7 @@ hr { .coral-plugin-commentbox-textarea { flex: 1; - padding: 10px; + padding: 5px; } .coral-plugin-commentbox-button-container { @@ -75,6 +75,12 @@ hr { border-radius: 2px; } +.coral-plugin-commentbox-username { + width: 50%; + padding-left: 5px; + margin-bottom: 5px; +} + /* Comment styles */ .comment { margin-bottom: 10px; diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index c893be075..1bd138af9 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -8,32 +8,34 @@ class CommentBox extends Component { static propTypes = { postItem: PropTypes.func, updateItem: PropTypes.func, - item_id: PropTypes.string, + id: PropTypes.string, comments: PropTypes.array, reply: PropTypes.bool } state = { - content: '' + body: '', + username: '' } postComment = () => { - const {postItem, updateItem, item_id, reply, addNotification, appendItemArray} = this.props + const {postItem, updateItem, id, reply, addNotification, appendItemArray} = this.props let comment = { - content: this.state.content + body: this.state.body, + asset_id: id, + username: this.state.username } let related if (reply) { - comment.parent_id = item_id + comment.parent_id = id related = 'children' } else { - comment.asset_id = item_id related = 'comments' } - updateItem(item_id, 'showReply', false) + updateItem(id, 'showReply', false) postItem(comment, 'comments') - .then((id) => { - appendItemArray(item_id, related, id) + .then((comment_id) => { + appendItemArray(id, related, comment_id) addNotification('success', 'Your comment has been posted.') }).catch((err) => console.error(err)) this.setState({content: ''}) @@ -43,21 +45,30 @@ class CommentBox extends Component { const {styles, reply} = this.props // How to handle language in plugins? Should we have a dependency on our central translation file? return
+
+ this.setState({username: e.target.value})}/> +
+ className={name + '-container'}>