Merge pull request #2198 from paulkaplan/fix-comment-msg

Comment minor fixes
This commit is contained in:
Paul Kaplan 2018-10-17 14:09:53 -04:00 committed by GitHub
commit 505dda09ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 7 deletions

View file

@ -238,6 +238,7 @@
"comments.status.delbyclass": "Deleted by class", "comments.status.delbyclass": "Deleted by class",
"comments.status.hiddenduetourl": "Hidden due to URL", "comments.status.hiddenduetourl": "Hidden due to URL",
"comments.status.markedbyfilter": "Marked by filter", "comments.status.markedbyfilter": "Marked by filter",
"comments.status.censbyunconstructive": "Censored unconstructive",
"comments.status.suspended": "Suspended", "comments.status.suspended": "Suspended",
"comments.status.acctdel": "Account deleted", "comments.status.acctdel": "Account deleted",
"comments.status.deleted": "Deleted", "comments.status.deleted": "Deleted",

View file

@ -87,6 +87,7 @@ class Comment extends React.Component {
author, author,
canDelete, canDelete,
canReply, canReply,
canReport,
canRestore, canRestore,
content, content,
datetimeCreated, datetimeCreated,
@ -122,12 +123,14 @@ class Comment extends React.Component {
<FormattedMessage id="comments.delete" /> <FormattedMessage id="comments.delete" />
</span> </span>
)} )}
<span {canReport && (
className="comment-report" <span
onClick={this.handleReport} className="comment-report"
> onClick={this.handleReport}
<FormattedMessage id="comments.report" /> >
</span> <FormattedMessage id="comments.report" />
</span>
)}
</React.Fragment> </React.Fragment>
) : ( ) : (
<React.Fragment> <React.Fragment>
@ -215,6 +218,7 @@ Comment.propTypes = {
}), }),
canDelete: PropTypes.bool, canDelete: PropTypes.bool,
canReply: PropTypes.bool, canReply: PropTypes.bool,
canReport: PropTypes.bool,
canRestore: PropTypes.bool, canRestore: PropTypes.bool,
content: PropTypes.string, content: PropTypes.string,
datetimeCreated: PropTypes.string, datetimeCreated: PropTypes.string,

View file

@ -55,6 +55,7 @@ class TopLevelComment extends React.Component {
author, author,
canDelete, canDelete,
canReply, canReply,
canReport,
canRestore, canRestore,
content, content,
datetimeCreated, datetimeCreated,
@ -80,6 +81,7 @@ class TopLevelComment extends React.Component {
datetimeCreated, datetimeCreated,
canDelete, canDelete,
canReply, canReply,
canReport,
canRestore, canRestore,
id, id,
onDelete, onDelete,
@ -102,6 +104,7 @@ class TopLevelComment extends React.Component {
author={reply.author} author={reply.author}
canDelete={canDelete} canDelete={canDelete}
canReply={canReply} canReply={canReply}
canReport={canReport}
canRestore={canRestore && parentVisible} canRestore={canRestore && parentVisible}
content={reply.content} content={reply.content}
datetimeCreated={reply.datetime_created} datetimeCreated={reply.datetime_created}
@ -143,6 +146,7 @@ TopLevelComment.propTypes = {
}), }),
canDelete: PropTypes.bool, canDelete: PropTypes.bool,
canReply: PropTypes.bool, canReply: PropTypes.bool,
canReport: PropTypes.bool,
canRestore: PropTypes.bool, canRestore: PropTypes.bool,
content: PropTypes.string, content: PropTypes.string,
datetimeCreated: PropTypes.string, datetimeCreated: PropTypes.string,

View file

@ -45,6 +45,7 @@ const PreviewPresentation = ({
assetHost, assetHost,
backpackOptions, backpackOptions,
canAddToStudio, canAddToStudio,
canDeleteComments,
canReport, canReport,
canRestoreComments, canRestoreComments,
comments, comments,
@ -364,8 +365,9 @@ const PreviewPresentation = ({
{comments.map(comment => ( {comments.map(comment => (
<TopLevelComment <TopLevelComment
author={comment.author} author={comment.author}
canDelete={userOwnsProject} canDelete={canDeleteComments}
canReply={isLoggedIn && projectInfo.comments_allowed} canReply={isLoggedIn && projectInfo.comments_allowed}
canReport={isLoggedIn}
canRestore={canRestoreComments} canRestore={canRestoreComments}
content={comment.content} content={comment.content}
datetimeCreated={comment.datetime_created} datetimeCreated={comment.datetime_created}
@ -412,6 +414,7 @@ PreviewPresentation.propTypes = {
visible: PropTypes.bool visible: PropTypes.bool
}), }),
canAddToStudio: PropTypes.bool, canAddToStudio: PropTypes.bool,
canDeleteComments: PropTypes.bool,
canReport: PropTypes.bool, canReport: PropTypes.bool,
canRestoreComments: PropTypes.bool, canRestoreComments: PropTypes.bool,
comments: PropTypes.arrayOf(PropTypes.object), comments: PropTypes.arrayOf(PropTypes.object),

View file

@ -350,6 +350,7 @@ class Preview extends React.Component {
assetHost={this.props.assetHost} assetHost={this.props.assetHost}
backpackOptions={this.props.backpackOptions} backpackOptions={this.props.backpackOptions}
canAddToStudio={this.props.canAddToStudio} canAddToStudio={this.props.canAddToStudio}
canDeleteComments={this.props.isAdmin || this.props.userOwnsProject}
canReport={this.props.canReport} canReport={this.props.canReport}
canRestoreComments={this.props.isAdmin} canRestoreComments={this.props.isAdmin}
comments={this.props.comments} comments={this.props.comments}