1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 17:02:47 +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, openDialogs: PropTypes.func.isRequired,
showFileHistory: PropTypes.bool.isRequired, showFileHistory: PropTypes.bool.isRequired,
toggleHistory: PropTypes.func.isRequired, toggleHistory: PropTypes.func.isRequired,
// commentsNumber: PropTypes.number.isRequired,
// toggleCommentList: PropTypes.func.isRequired,
editorMode: PropTypes.string.isRequired, editorMode: PropTypes.string.isRequired,
readOnly: PropTypes.bool.isRequired, readOnly: PropTypes.bool.isRequired,
contentChanged: PropTypes.bool.isRequired, contentChanged: PropTypes.bool.isRequired,
@@ -115,15 +113,6 @@ class MarkdownViewerToolbar extends React.Component {
<ButtonGroup> <ButtonGroup>
<IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'} <IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'}
onMouseDown={this.props.toggleShareLinkDialog}/> 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'} <IconButton text={gettext('Back to parent directory')} id={'parentDirectory'}
icon={'fa fa-folder-open'} onMouseDown={this.props.backToParentDirectory}/> 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 { serialize, deserialize } from '@seafile/seafile-editor/dist/utils/slate2markdown';
import LocalDraftDialog from './components/dialog/local-draft-dialog'; import LocalDraftDialog from './components/dialog/local-draft-dialog';
import MarkdownViewerToolbar from './components/toolbar/markdown-viewer-toolbar'; import MarkdownViewerToolbar from './components/toolbar/markdown-viewer-toolbar';
import CommentPanel from './components/file-view/comment-panel';
import './css/markdown-viewer/markdown-editor.css'; import './css/markdown-viewer/markdown-editor.css';
@@ -286,9 +285,7 @@ class MarkdownEditor extends React.Component {
showDraftSaved: false, showDraftSaved: false,
collabUsers: userInfo ? collabUsers: userInfo ?
[{user: userInfo, is_editing: false}] : [], [{user: userInfo, is_editing: false}] : [],
commentsNumber: null,
value: null, value: null,
isShowComments: false,
isShowHistory: false, isShowHistory: false,
readOnly: true, readOnly: true,
contentChanged: false, contentChanged: false,
@@ -451,7 +448,6 @@ class MarkdownEditor extends React.Component {
{ {
case 'help': case 'help':
window.richMarkdownEditor.showHelpDialog(); window.richMarkdownEditor.showHelpDialog();
this.setState({ isShowComments: false });
break; break;
case 'share_link': case 'share_link':
this.setState({ this.setState({
@@ -542,7 +538,6 @@ class MarkdownEditor extends React.Component {
}); });
} }
this.checkDraft(); this.checkDraft();
this.getCommentsNumber();
setTimeout(() => { setTimeout(() => {
let url = new URL(window.location.href); let url = new URL(window.location.href);
@@ -621,17 +616,7 @@ class MarkdownEditor extends React.Component {
this.openDialogs('share_link'); this.openDialogs('share_link');
} }
getCommentsNumber = () => {
editorUtilities.getCommentsNumber().then((res) => {
let commentsNumber = res.data[Object.getOwnPropertyNames(res.data)[0]];
this.setState({
commentsNumber: commentsNumber
});
});
}
onCommentAdded = () => { onCommentAdded = () => {
this.getCommentsNumber();
this.toggleCancel(); this.toggleCancel();
} }
@@ -650,11 +635,6 @@ class MarkdownEditor extends React.Component {
window.location.href = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(filePath); 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) => { getInsertLink = (repoID, filePath) => {
seafileAPI.getShareLink(repoID, filePath).then((res) => { seafileAPI.getShareLink(repoID, filePath).then((res) => {
if (res.data.length !== 0) { if (res.data.length !== 0) {
@@ -704,8 +684,6 @@ class MarkdownEditor extends React.Component {
toggleShareLinkDialog={this.toggleShareLinkDialog} toggleShareLinkDialog={this.toggleShareLinkDialog}
onEdit={this.onEdit} onEdit={this.onEdit}
toggleNewDraft={editorUtilities.createDraftFile} toggleNewDraft={editorUtilities.createDraftFile}
commentsNumber={this.state.commentsNumber}
toggleCommentList={this.toggleCommentList}
showFileHistory={this.state.isShowHistory ? false : true } showFileHistory={this.state.isShowHistory ? false : true }
toggleHistory={this.toggleHistory} toggleHistory={this.toggleHistory}
readOnly={this.state.readOnly} readOnly={this.state.readOnly}
@@ -743,11 +721,6 @@ class MarkdownEditor extends React.Component {
contentChanged={this.state.contentChanged} contentChanged={this.state.contentChanged}
saving={this.state.saving} saving={this.state.saving}
/> />
{this.state.isShowComments &&
<div className="seafile-md-comment">
<CommentPanel toggleCommentPanel={this.toggleCommentList} commentsNumber={this.state.commentsNumber}/>
</div>
}
</Fragment> </Fragment>
); );