Browse Source

able to reply from each comments

shinoka7 6 years ago
parent
commit
227f16454d

+ 3 - 1
src/client/js/components/PageComment/CommentEditor.jsx

@@ -106,7 +106,7 @@ class CommentEditor extends React.Component {
     this.props.commentContainer.postComment(
       this.state.comment,
       this.state.isMarkdown,
-      null, // TODO set replyTo
+      this.props.replyTo, // TODO set replyTo
       this.state.isSlackEnabled,
       this.state.slackChannels,
     )
@@ -343,12 +343,14 @@ CommentEditor.propTypes = {
   commentContainer: PropTypes.instanceOf(CommentContainer).isRequired,
   editorOptions: PropTypes.object,
   slackChannels: PropTypes.string,
+  replyTo: PropTypes.string,
 };
 CommentEditorWrapper.propTypes = {
   crowi: PropTypes.object.isRequired,
   crowiOriginRenderer: PropTypes.object.isRequired,
   editorOptions: PropTypes.object,
   slackChannels: PropTypes.string,
+  replyTo: PropTypes.string,
 };
 
 export default CommentEditorWrapper;

+ 7 - 1
src/client/js/components/PageComment/CommentEditorLazyRenderer.jsx

@@ -43,7 +43,13 @@ export default class CommentEditorLazyRenderer extends React.Component {
           )
         }
         { this.state.isEditorShown
-          && <CommentEditor {...this.props}></CommentEditor>
+          && (
+          <CommentEditor
+            {...this.props}
+            replyTo={undefined}
+          >
+          </CommentEditor>
+)
         }
       </React.Fragment>
     );

+ 2 - 0
src/client/js/components/PageComments.jsx

@@ -141,6 +141,8 @@ class PageComments extends React.Component {
               crowi={this.props.crowi}
               crowiOriginRenderer={this.props.crowiOriginRenderer}
               editorOptions={this.props.editorOptions}
+              slackChannels={this.props.slackChannels}
+              replyTo={commentId}
             />
           )}
         </div>