1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

remove comment to Seafile editor (#3287)

* remove toolbar comment btn

* remove comment panel in markdown-editor
This commit is contained in:
Michael An
2019-04-17 08:51:05 +08:00
committed by Daniel Pan
parent 7124d373c0
commit 7e23be8ea7
2 changed files with 0 additions and 38 deletions

View File

@@ -20,8 +20,6 @@ const propTypes = {
openDialogs: PropTypes.func.isRequired,
showFileHistory: PropTypes.bool.isRequired,
toggleHistory: PropTypes.func.isRequired,
// commentsNumber: PropTypes.number.isRequired,
// toggleCommentList: PropTypes.func.isRequired,
editorMode: PropTypes.string.isRequired,
readOnly: PropTypes.bool.isRequired,
contentChanged: PropTypes.bool.isRequired,
@@ -115,15 +113,6 @@ class MarkdownViewerToolbar extends React.Component {
<ButtonGroup>
<IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'}
onMouseDown={this.props.toggleShareLinkDialog}/>
{/*
this.props.commentsNumber > 0 ?
<button className="btn btn-icon btn-secondary btn-active" id="commentsNumber" type="button"
data-active="false" onMouseDown={this.props.toggleCommentList}>
<i className="fa fa-comments"></i>{' '}<span>{this.props.commentsNumber}</span>
</button>
:
<IconButton id={'commentsNumber'} text={gettext('Comments')} icon={'fa fa-comments'} onMouseDown={this.props.toggleCommentList}/>
*/}
<IconButton text={gettext('Back to parent directory')} id={'parentDirectory'}
icon={'fa fa-folder-open'} onMouseDown={this.props.backToParentDirectory}/>
{

View File

@@ -12,7 +12,6 @@ import InsertFileDialog from './components/dialog/insert-file-dialog';
import { serialize, deserialize } from '@seafile/seafile-editor/dist/utils/slate2markdown';
import LocalDraftDialog from './components/dialog/local-draft-dialog';
import MarkdownViewerToolbar from './components/toolbar/markdown-viewer-toolbar';
import CommentPanel from './components/file-view/comment-panel';
import './css/markdown-viewer/markdown-editor.css';
@@ -286,9 +285,7 @@ class MarkdownEditor extends React.Component {
showDraftSaved: false,
collabUsers: userInfo ?
[{user: userInfo, is_editing: false}] : [],
commentsNumber: null,
value: null,
isShowComments: false,
isShowHistory: false,
readOnly: true,
contentChanged: false,
@@ -451,7 +448,6 @@ class MarkdownEditor extends React.Component {
{
case 'help':
window.richMarkdownEditor.showHelpDialog();
this.setState({ isShowComments: false });
break;
case 'share_link':
this.setState({
@@ -542,7 +538,6 @@ class MarkdownEditor extends React.Component {
});
}
this.checkDraft();
this.getCommentsNumber();
setTimeout(() => {
let url = new URL(window.location.href);
@@ -621,17 +616,7 @@ class MarkdownEditor extends React.Component {
this.openDialogs('share_link');
}
getCommentsNumber = () => {
editorUtilities.getCommentsNumber().then((res) => {
let commentsNumber = res.data[Object.getOwnPropertyNames(res.data)[0]];
this.setState({
commentsNumber: commentsNumber
});
});
}
onCommentAdded = () => {
this.getCommentsNumber();
this.toggleCancel();
}
@@ -650,11 +635,6 @@ class MarkdownEditor extends React.Component {
window.location.href = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(filePath);
}
toggleCommentList = () => {
this.setState({ isShowComments: !this.state.isShowComments });
window.richMarkdownEditor.handleCommentOpen();
}
getInsertLink = (repoID, filePath) => {
seafileAPI.getShareLink(repoID, filePath).then((res) => {
if (res.data.length !== 0) {
@@ -704,8 +684,6 @@ class MarkdownEditor extends React.Component {
toggleShareLinkDialog={this.toggleShareLinkDialog}
onEdit={this.onEdit}
toggleNewDraft={editorUtilities.createDraftFile}
commentsNumber={this.state.commentsNumber}
toggleCommentList={this.toggleCommentList}
showFileHistory={this.state.isShowHistory ? false : true }
toggleHistory={this.toggleHistory}
readOnly={this.state.readOnly}
@@ -743,11 +721,6 @@ class MarkdownEditor extends React.Component {
contentChanged={this.state.contentChanged}
saving={this.state.saving}
/>
{this.state.isShowComments &&
<div className="seafile-md-comment">
<CommentPanel toggleCommentPanel={this.toggleCommentList} commentsNumber={this.state.commentsNumber}/>
</div>
}
</Fragment>
);