Skip to content

Commit

Permalink
comments_async: fix some issues with child comments
Browse files Browse the repository at this point in the history
- fix child comments not being editable by creator
- hide comment form headline when editing
  • Loading branch information
goapunk authored and hom3mad3 committed Jun 20, 2024
1 parent 9a0b147 commit 811c326
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions adhocracy4/comments_async/static/comments_async/comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default class Comment extends React.Component {
comment = (
// Edit comment form
<CommentForm
editing
subjectType={this.props.content_type}
subjectId={this.props.object_pk}
comment={this.props.children}
Expand Down Expand Up @@ -421,6 +422,8 @@ export default class Comment extends React.Component {
comments={this.props.child_comments}
anchoredCommentId={this.props.anchoredCommentId}
anchoredCommentParentId={this.props.anchoredCommentParentId}
hasCommentingPermission={this.props.hasCommentingPermission}
wouldHaveCommentingPermission={this.props.wouldHaveCommentingPermission}
parentIndex={this.props.index}
onRenderFinished={this.props.onRenderFinished}
onCommentDelete={this.props.onCommentDelete}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export default class CommentForm extends React.Component {
if (this.props.hasCommentingPermission) {
return (
<>
<h3 className="a4-comments__comment-form__heading-comments-allowed">{translated.formHeadingCommentsAllowed}</h3>
{!this.props.editing &&
<h3 className="a4-comments__comment-form__heading-comments-allowed">{translated.formHeadingCommentsAllowed}</h3>}
<form id={'id-comment-form' + this.props.commentId} className="a4-comments__comment-form__form" onSubmit={this.handleSubmit.bind(this)}>
{this.props.error &&
<Alert type="danger" message={this.props.errorMessage} onClick={this.props.handleErrorClick} />}
Expand Down
5 changes: 5 additions & 0 deletions changelog/_1113.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Fixed

- comments_async: fix child comments not being editable by creator
- comments_async: hide "Join the discussion" headline when editing
a comment

0 comments on commit 811c326

Please sign in to comment.