mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 13:50:07 +00:00
[eslint] updated eslintrc and improved the code (#4702)
This commit is contained in:
@@ -62,7 +62,7 @@ class DirColumnFile extends React.Component {
|
||||
e.preventDefault();
|
||||
this.props.goDraftPage();
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
if (this.props.isFileLoadedErr) {
|
||||
return (
|
||||
|
@@ -113,7 +113,7 @@ class DirColumnNav extends React.Component {
|
||||
this.setState({isAddFileDialogShow: !this.state.isAddFileDialogShow});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onAddFolderToggle = (type) => {
|
||||
if (type === 'root') {
|
||||
let root = this.props.treeData.root;
|
||||
@@ -165,7 +165,7 @@ class DirColumnNav extends React.Component {
|
||||
|
||||
checkDuplicatedName = (newName) => {
|
||||
let node = this.state.opNode;
|
||||
// root node to new node conditions: parentNode is null,
|
||||
// root node to new node conditions: parentNode is null,
|
||||
let parentNode = node.parentNode ? node.parentNode : node;
|
||||
let childrenObject = parentNode.children.map(item => {
|
||||
return item.object;
|
||||
@@ -253,7 +253,7 @@ class DirColumnNav extends React.Component {
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="dir-content-nav" role="navigation" style={{flex: (flex), userSelect: select}} onScroll={this.stopTreeScrollPropagation}>
|
||||
{this.props.isTreeDataLoading ?
|
||||
{this.props.isTreeDataLoading ?
|
||||
(<Loading/>) :
|
||||
(<TreeView
|
||||
repoPermission={this.props.repoPermission}
|
||||
|
@@ -70,7 +70,7 @@ const propTypes = {
|
||||
};
|
||||
|
||||
class DirColumnView extends React.Component {
|
||||
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -150,7 +150,7 @@ class DirColumnView extends React.Component {
|
||||
const mainFlex = '1 0 ' + (1 - this.state.navRate - 0.05) * 100 + '%';
|
||||
return (
|
||||
<div className="dir-colunm-view" onMouseMove={onResizeMove} onMouseUp={this.onResizeMouseUp} ref="viewModeContainer">
|
||||
<DirColumnNav
|
||||
<DirColumnNav
|
||||
currentPath={this.props.path}
|
||||
repoPermission={this.props.repoPermission}
|
||||
isTreeDataLoading={this.props.isTreeDataLoading}
|
||||
@@ -175,7 +175,7 @@ class DirColumnView extends React.Component {
|
||||
<div className="dir-content-resize" onMouseDown={this.onResizeMouseDown}></div>
|
||||
<div className="dir-content-main" style={{userSelect: select, flex: mainFlex}}>
|
||||
{this.props.isViewFile ? (
|
||||
<DirColumnFile
|
||||
<DirColumnFile
|
||||
path={this.props.path}
|
||||
repoID={this.props.repoID}
|
||||
hash={this.props.hash}
|
||||
@@ -191,7 +191,7 @@ class DirColumnView extends React.Component {
|
||||
onLinkClick={this.props.onLinkClick}
|
||||
/>
|
||||
) : (
|
||||
<DirListView
|
||||
<DirListView
|
||||
path={this.props.path}
|
||||
repoID={this.props.repoID}
|
||||
currentRepoInfo={this.props.currentRepoInfo}
|
||||
|
@@ -38,7 +38,7 @@ class DirGridView extends React.Component {
|
||||
render() {
|
||||
if (this.props.path === '/' && this.props.direntList.length === 0) {
|
||||
return (
|
||||
<DirentNoneView
|
||||
<DirentNoneView
|
||||
path={this.props.path}
|
||||
isDirentListLoading={this.props.isDirentListLoading}
|
||||
onAddFile={this.props.onAddFile}
|
||||
@@ -48,7 +48,7 @@ class DirGridView extends React.Component {
|
||||
return (
|
||||
<Fragment>
|
||||
{this.props.isRepoInfoBarShow && (
|
||||
<RepoInfoBar
|
||||
<RepoInfoBar
|
||||
repoID={this.props.repoID}
|
||||
currentPath={this.props.path}
|
||||
readmeMarkdown={this.props.readmeMarkdown}
|
||||
|
@@ -42,12 +42,12 @@ const propTypes = {
|
||||
};
|
||||
|
||||
class DirListView extends React.Component {
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
if (this.props.path === '/' && this.props.direntList.length === 0) {
|
||||
return (
|
||||
<DirentNoneView
|
||||
<DirentNoneView
|
||||
path={this.props.path}
|
||||
isDirentListLoading={this.props.isDirentListLoading}
|
||||
onAddFile={this.props.onAddFile}
|
||||
@@ -58,7 +58,7 @@ class DirListView extends React.Component {
|
||||
return (
|
||||
<Fragment>
|
||||
{this.props.isRepoInfoBarShow && (
|
||||
<RepoInfoBar
|
||||
<RepoInfoBar
|
||||
repoID={this.props.repoID}
|
||||
currentPath={this.props.path}
|
||||
readmeMarkdown={this.props.readmeMarkdown}
|
||||
|
Reference in New Issue
Block a user