diff --git a/frontend/src/components/dialog/add-reviewer-dialog.js b/frontend/src/components/dialog/add-reviewer-dialog.js index e2a1359f4d..d61a6fdbad 100644 --- a/frontend/src/components/dialog/add-reviewer-dialog.js +++ b/frontend/src/components/dialog/add-reviewer-dialog.js @@ -43,8 +43,6 @@ class AddReviewerDialog extends React.Component { loadOptions = (value, callback) => { if (value.trim().length > 0) { - this.Options = []; - let that = this; seafileAPI.searchUsers(value.trim()).then((res) => { for (let i = 0 ; i < res.data.users.length; i++) { let obj = {}; @@ -55,7 +53,8 @@ class AddReviewerDialog extends React.Component { {res.data.users[i].name} ; - that.Options.push(obj); + this.Options.splice(0, this.Options.length); + this.Options.push(obj); } callback(this.Options); }); @@ -131,7 +130,7 @@ class AddReviewerDialog extends React.Component { } + {gettext('Close')} ); diff --git a/frontend/src/components/review-list-view/review-comments.js b/frontend/src/components/review-list-view/review-comments.js index dab0e537fc..4fa16b4548 100644 --- a/frontend/src/components/review-list-view/review-comments.js +++ b/frontend/src/components/review-list-view/review-comments.js @@ -31,12 +31,15 @@ class ReviewComments extends React.Component { this.accountInfo = {}; } - listComments = () => { + listComments = (scroll) => { seafileAPI.listReviewComments(reviewID).then((response) => { response.data.comments.reverse(); this.setState({ commentsList: response.data.comments }); + if (scroll) { + this.refs.commentsList.scrollTo(0, 10000); + } }); } @@ -59,7 +62,7 @@ class ReviewComments extends React.Component { let comment = this.refs.commentTextarea.value; if (comment.trim().length > 0) { seafileAPI.addReviewComment(reviewID, comment.trim()).then((res) => { - this.listComments(); + this.listComments(true); this.props.getCommentsNumber(); }); this.refs.commentTextarea.value = ''; @@ -108,6 +111,16 @@ class ReviewComments extends React.Component { onResizeMouseMove = (event) => { let rate = 100 - (event.nativeEvent.clientY - 50 ) / this.refs.comment.clientHeight * 100; if (rate < 20 || rate > 70) { + if (rate < 20) { + this.setState({ + commentFooterHeight: 25 + }); + } + if (rate > 70) { + this.setState({ + commentFooterHeight: 65 + }); + } this.setState({ inResizing: false }); @@ -150,28 +163,30 @@ class ReviewComments extends React.Component {
{gettext('No comment yet.')}
} - { (this.state.commentsList.length == 0 && this.props.commentsNumber > 0) && -
+ { (this.state.commentsList.length === 0 && this.props.commentsNumber > 0) && +
+ } + { this.state.commentsList.length > 0 && + } -
diff --git a/frontend/src/css/draft-review.css b/frontend/src/css/draft-review.css index cc7b53921b..ec9ff06fce 100644 --- a/frontend/src/css/draft-review.css +++ b/frontend/src/css/draft-review.css @@ -88,6 +88,9 @@ border-bottom: 1px solid #e6e6dd; padding: 1em 0; } +.reviewer-info { + margin-bottom: 0.8125rem; +} .reviewers-header, .author-header { display: flex; justify-content: space-between; diff --git a/frontend/src/css/review-comments.css b/frontend/src/css/review-comments.css index d683159d12..6e56ca4638 100644 --- a/frontend/src/css/review-comments.css +++ b/frontend/src/css/review-comments.css @@ -76,7 +76,10 @@ background-color: #fff; height: 100%; } -.seafile-comment-item .seafile-comment-info.seafile-comment-dropdown .seafile-comment-dropdown-btn { +.seafile-comment-dropdown button:hover i { + color: #555; +} +.seafile-comment-item .seafile-comment-info .seafile-comment-dropdown .seafile-comment-dropdown-btn { color: #999; } .seafile-comment-item .seafile-comment-info .seafile-comment-dropdown:hover .seafile-comment-dropdown-btn { @@ -136,6 +139,7 @@ height: calc(100% - 38px); min-height: 90px; width: 100%; + resize: none; } .seafile-comment-footer .seafile-add-comment .submit-comment { height: 28px; diff --git a/frontend/src/draft-review.js b/frontend/src/draft-review.js index 108e362940..b8866bc5e8 100644 --- a/frontend/src/draft-review.js +++ b/frontend/src/draft-review.js @@ -157,6 +157,9 @@ class DraftReview extends React.Component { } toggleAddReviewerDialog = () => { + if (this.state.showReviewerDialog) { + this.listReviewers(); + } this.setState({ showReviewerDialog: !this.state.showReviewerDialog });