Adding author id to posted comments.

This commit is contained in:
David Jay
2016-11-18 13:10:59 -05:00
parent d9f1c05216
commit a0db48ea22
3 changed files with 8 additions and 7 deletions
@@ -105,7 +105,7 @@ class CommentStream extends Component {
id={rootItemId}
premod={this.props.config.moderation}
reply={false}
canPost={loggedIn}
authorId={user.id}
/>
{!loggedIn && <SignInContainer />}
</div>
+6 -5
View File
@@ -12,7 +12,8 @@ class CommentBox extends Component {
id: PropTypes.string,
comments: PropTypes.array,
reply: PropTypes.bool,
canPost: PropTypes.bool
canPost: PropTypes.bool,
currentUser: PropTypes.object
}
state = {
@@ -21,11 +22,11 @@ class CommentBox extends Component {
}
postComment = () => {
const {postItem, updateItem, id, parent_id, addNotification, appendItemArray, premod} = this.props;
const {postItem, updateItem, id, parent_id, addNotification, appendItemArray, premod, authorId} = this.props;
let comment = {
body: this.state.body,
asset_id: id,
username: this.state.username
user_id: authorId.id
};
let related;
let parent_type;
@@ -52,7 +53,7 @@ class CommentBox extends Component {
}
render () {
const {styles, reply, canPost} = this.props;
const {styles, reply, authorId} = this.props;
// How to handle language in plugins? Should we have a dependency on our central translation file?
return <div>
<div
@@ -73,7 +74,7 @@ class CommentBox extends Component {
rows={3}/>
</div>
<div className={`${name}-button-container`}>
{ canPost && (
{ authorId && (
<button
className={`${name}-button`}
style={styles && styles.button}
+1 -1
View File
@@ -245,7 +245,7 @@ definitions:
description: Display name of comment
user_id:
type: string
description: Display name of comment
description: User who posted the comment
parent_id:
type: string
description: Display name of comment