Including author name when comments are first posted.

This commit is contained in:
David Jay
2016-11-18 23:15:41 -05:00
parent 29bf5b9990
commit a4a8b97873
6 changed files with 12 additions and 9 deletions
@@ -115,7 +115,7 @@ class CommentStream extends Component {
const comment = this.props.items.comments[commentId];
return <div className="comment" key={commentId}>
<hr aria-hidden={true}/>
<AuthorName author={users[comment.user_id]}/>
<AuthorName author={users[comment.author_id]}/>
<PubDate created_at={comment.created_at}/>
<Content body={comment.body}/>
<div className="commentActionsLeft">
@@ -162,7 +162,7 @@ class CommentStream extends Component {
let reply = this.props.items.comments[replyId];
return <div className="reply" key={replyId}>
<hr aria-hidden={true}/>
<AuthorName author={users[comment.user_id]}/>
<AuthorName author={users[comment.author_id]}/>
<PubDate created_at={reply.created_at}/>
<Content body={reply.body}/>
<div className="replyActionsLeft">
+5 -2
View File
@@ -3,6 +3,7 @@ import translations from './../translations';
const lang = new I18n(translations);
import * as actions from '../constants/auth';
import {base, handleResp, getInit} from '../helpers/response';
import {addItem} from './items'
// Dialog Actions
export const showSignInDialog = () => ({type: actions.SHOW_SIGNIN_DIALOG});
@@ -29,6 +30,7 @@ export const fetchSignIn = (formData) => dispatch => {
.then(({user}) => {
dispatch(hideSignInDialog());
dispatch(signInSuccess(user));
dispatch(addItem(user, 'users'));
})
.catch(() => dispatch(signInFailure(lang.t('error.emailPasswordError'))));
};
@@ -54,8 +56,10 @@ export const facebookCallback = (err, data) => dispatch => {
return;
}
try {
dispatch(signInFacebookSuccess(JSON.parse(data)));
const user = JSON.parse(data);
dispatch(signInFacebookSuccess(user));
dispatch(hideSignInDialog());
dispatch(addItem(user, 'users'));
} catch (err) {
dispatch(signInFacebookFailure(err));
return;
@@ -113,4 +117,3 @@ export const logout = () => dispatch => {
export const validForm = () => ({type: actions.VALID_FORM});
export const invalidForm = error => ({type: actions.INVALID_FORM, error});
+1 -1
View File
@@ -26,7 +26,7 @@ class CommentBox extends Component {
let comment = {
body: this.state.body,
asset_id: id,
user_id: author.id
author_id: author.id
};
let related;
let parent_type;
+2 -2
View File
@@ -106,7 +106,7 @@ input.error{
.userBox a {
color: #2c69b6;
cursor: pointer;
margin: 0 5px;
margin: 0px;
}
.attention {
@@ -128,4 +128,4 @@ input.error{
.action {
margin-top: 15px;
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ router.get('/', (req, res, next) => {
return Promise.all([
[asset],
comments,
User.findPublicByIdArray(comments.map((comment) => comment.user_id)),
User.findPublicByIdArray(comments.map((comment) => comment.author_id)),
Action.getActionSummaries(comments.map((comment) => comment.id))
]);
})
+1 -1
View File
@@ -243,7 +243,7 @@ definitions:
type: string
format: date-time
description: Display name of comment
user_id:
author_id:
type: string
description: User who posted the comment
parent_id: