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.hiddenduetourl": "Hidden due to URL",
"comments.status.markedbyfilter": "Marked by filter",
"comments.status.censbyunconstructive": "Censored unconstructive",
"comments.status.suspended": "Suspended",
"comments.status.acctdel": "Account deleted",
"comments.status.deleted": "Deleted",

View file

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

View file

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

View file

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

View file

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