1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 13:24:52 +00:00

Update draft page (#3036)

* draft-update

* test

* update draft reviewer api

* update draft page

* add file path
This commit is contained in:
Michael An
2019-03-04 22:47:40 +08:00
committed by Daniel Pan
parent 5d4bca7041
commit eee8589223
10 changed files with 727 additions and 109 deletions

View File

@@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Button } from 'reactstrap';
import { seafileAPI } from '../../utils/seafile-api';
import { reviewID, gettext, name } from '../../utils/constants';
import { gettext, name, draftRepoID, draftFilePath } from '../../utils/constants';
import { processor } from '../../utils/seafile-markdown2html';
import '../../css/review-comment-dialog.css';
@@ -13,6 +13,7 @@ const commentDialogPropTypes = {
quote: PropTypes.string,
newIndex: PropTypes.number,
oldIndex: PropTypes.number,
draftID: PropTypes.string,
};
class ReviewCommentDialog extends React.Component {
@@ -42,12 +43,12 @@ class ReviewCommentDialog extends React.Component {
oldIndex: this.props.oldIndex
};
let detailJSON = JSON.stringify(detail);
seafileAPI.addReviewComment(reviewID, comment, detailJSON).then((response) => {
seafileAPI.postComment(draftRepoID, draftFilePath, comment, detailJSON).then((response) => {
this.props.onCommentAdded();
});
}
else {
seafileAPI.addReviewComment(reviewID, comment).then((response) => {
seafileAPI.postComment(draftRepoID, draftFilePath, comment).then((response) => {
this.props.onCommentAdded();
});
}