mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-10 03:11:07 +00:00
[eslint] updated eslintrc and improved the code (#4702)
This commit is contained in:
@@ -15,7 +15,7 @@ import ReviewComments from './components/review-list-view/review-comments';
|
||||
import ReviewCommentDialog from './components/review-list-view/review-comment-dialog.js';
|
||||
import { Tooltip } from 'reactstrap';
|
||||
import AddReviewerDialog from './components/dialog/add-reviewer-dialog.js';
|
||||
import { ReactEditor } from '@seafile/slate-react';
|
||||
import { ReactEditor } from '@seafile/slate-react';
|
||||
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
|
||||
import classnames from 'classnames';
|
||||
import HistoryList from './pages/review/history-list';
|
||||
@@ -80,7 +80,7 @@ class Draft extends React.Component {
|
||||
|
||||
if (!originFileExists) {
|
||||
seafileAPI.getFileDownloadLink(draftRepoID, draftFilePath)
|
||||
.then(res => {
|
||||
.then(res => {
|
||||
seafileAPI.getFileContent(res.data)
|
||||
.then(res => {
|
||||
this.setState({
|
||||
@@ -88,7 +88,7 @@ class Draft extends React.Component {
|
||||
draftOriginContent: res.data,
|
||||
isLoading: false,
|
||||
isShowDiff: false
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ class Draft extends React.Component {
|
||||
activeTab: 'history',
|
||||
});
|
||||
seafileAPI.listFileHistoryRecords(draftRepoID, draftFilePath, 1, 25).then((res) => {
|
||||
const historyList = res.data.data;
|
||||
const historyList = res.data.data;
|
||||
this.setState({
|
||||
historyList: historyList,
|
||||
totalReversionCount: res.data.total_count
|
||||
@@ -162,8 +162,8 @@ class Draft extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
let dl0 = siteRoot + 'repo/' + draftRepoID + '/' + draftPublishVersion + '/download?' + 'p=' + draftOriginFilePath;
|
||||
let dl = siteRoot + 'repo/' + draftRepoID + '/' + originFileVersion + '/download?' + 'p=' + draftOriginFilePath;
|
||||
let dl0 = siteRoot + 'repo/' + draftRepoID + '/' + draftPublishVersion + '/download?' + 'p=' + draftOriginFilePath;
|
||||
let dl = siteRoot + 'repo/' + draftRepoID + '/' + originFileVersion + '/download?' + 'p=' + draftOriginFilePath;
|
||||
axios.all([
|
||||
seafileAPI.getFileContent(dl0),
|
||||
seafileAPI.getFileContent(dl)
|
||||
@@ -172,7 +172,7 @@ class Draft extends React.Component {
|
||||
draftContent: draftContent.data,
|
||||
draftOriginContent: draftOriginContent.data,
|
||||
isLoading: false,
|
||||
});
|
||||
});
|
||||
}));
|
||||
break;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ class Draft extends React.Component {
|
||||
const nodes = this.refs.diffViewer.value;
|
||||
let commentNode = nodes.find((node) => {
|
||||
if (node.data['old_index'] == oldIndex && node.data['new_index'] == newIndex) {
|
||||
return node
|
||||
return node;
|
||||
}
|
||||
});
|
||||
if (commentNode) {
|
||||
@@ -459,7 +459,7 @@ class Draft extends React.Component {
|
||||
if (tab !== 'history' && window.location.hash) {
|
||||
this.setURL('#');
|
||||
}
|
||||
if (tab == 'reviewInfo') {
|
||||
if (tab == 'reviewInfo') {
|
||||
this.initialContent();
|
||||
} else if (tab == 'history') {
|
||||
this.initialDiffViewerContent();
|
||||
@@ -508,7 +508,7 @@ class Draft extends React.Component {
|
||||
</NavItem>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getDomNodeByPath = (path) => {
|
||||
let node, parent = document.querySelector('.viewer-component');
|
||||
@@ -660,7 +660,7 @@ class Draft extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { draftInfo, reviewers, originRepoName, draftStatus } = this.state;
|
||||
const { draftInfo, reviewers, originRepoName, draftStatus } = this.state;
|
||||
const onResizeMove = this.state.inResizing ? this.onResizeMouseMove : null;
|
||||
const draftLink = siteRoot + 'lib/' + draftRepoID + '/file' + draftFilePath + '?mode=edit';
|
||||
const showPublishedButton = this.state.draftStatus == 'published';
|
||||
@@ -711,8 +711,8 @@ class Draft extends React.Component {
|
||||
<div className='cur-view-content' ref="viewContent" style={{width:(100 - this.state.rightPartWidth) + '%'}}>
|
||||
{this.state.isLoading ?
|
||||
<div className="markdown-viewer-render-content article">
|
||||
<Loading />
|
||||
</div>
|
||||
<Loading />
|
||||
</div>
|
||||
:
|
||||
<div className="markdown-viewer-render-content article">
|
||||
{this.renderContent()}
|
||||
|
Reference in New Issue
Block a user