mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 05:39:59 +00:00
[eslint] updated eslintrc and improved the code (#4702)
This commit is contained in:
@@ -18,10 +18,10 @@ class CommonToolbar extends React.Component {
|
||||
return (
|
||||
<div className="common-toolbar">
|
||||
{isPro && (
|
||||
<Search
|
||||
<Search
|
||||
repoID={this.props.repoID}
|
||||
placeholder={searchPlaceholder}
|
||||
onSearchedClick={this.props.onSearchedClick}
|
||||
onSearchedClick={this.props.onSearchedClick}
|
||||
/>
|
||||
)}
|
||||
<Notification />
|
||||
|
@@ -83,7 +83,7 @@ class DirOperationToolbar extends React.Component {
|
||||
this.setState({isUploadMenuShow: false});
|
||||
this.props.onUploadFile(e);
|
||||
}
|
||||
|
||||
|
||||
onUploadFolder = (e) => {
|
||||
this.setState({isUploadMenuShow: false});
|
||||
this.props.onUploadFolder(e);
|
||||
@@ -241,7 +241,7 @@ class DirOperationToolbar extends React.Component {
|
||||
)}
|
||||
{this.state.isShareDialogShow &&
|
||||
<ModalPortal>
|
||||
<ShareDialog
|
||||
<ShareDialog
|
||||
itemType={itemType}
|
||||
itemName={itemName}
|
||||
itemPath={this.props.path}
|
||||
|
@@ -16,15 +16,15 @@ class GeneralToolbar extends React.Component {
|
||||
return (
|
||||
<div className="main-panel-north">
|
||||
<div className="cur-view-toolbar">
|
||||
<span
|
||||
className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none"
|
||||
title="Side Nav Menu"
|
||||
<span
|
||||
className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none"
|
||||
title="Side Nav Menu"
|
||||
onClick={onShowSidePanel}>
|
||||
</span>
|
||||
</div>
|
||||
<CommonToolbar
|
||||
<CommonToolbar
|
||||
searchPlaceholder={this.props.searchPlaceholder}
|
||||
onSearchedClick={onSearchedClick}
|
||||
onSearchedClick={onSearchedClick}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
@@ -156,7 +156,7 @@ class MarkdownViewerToolbar extends React.Component {
|
||||
{(canLockUnlockFile && lockedByMe) &&
|
||||
<IconButton id="lock-unlock-file" icon='fa fa-unlock' text={gettext('Unlock')} onMouseDown={this.props.toggleLockFile}/>
|
||||
}
|
||||
{canGenerateShareLink &&
|
||||
{canGenerateShareLink &&
|
||||
<IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'}
|
||||
onMouseDown={this.props.toggleShareLinkDialog}/>
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class MarkdownViewerToolbar extends React.Component {
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button>
|
||||
:
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
onMouseDown={window.seafileEditor && window.seafileEditor.onRichEditorSave} isActive={contentChanged}/>
|
||||
}
|
||||
</ButtonGroup>
|
||||
@@ -194,7 +194,7 @@ class MarkdownViewerToolbar extends React.Component {
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button>
|
||||
:
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
onMouseDown={window.seafileEditor && window.seafileEditor.onRichEditorSave} isActive={contentChanged}/>
|
||||
}
|
||||
</ButtonGroup>
|
||||
|
@@ -56,7 +56,7 @@ class MultipleDirOperationToolbar extends React.Component {
|
||||
fileTagList: [],
|
||||
multiFileTagList: [],
|
||||
showRelatedFileDialog: false,
|
||||
viewMode: 'list_related_file',
|
||||
viewMode: 'list_related_file',
|
||||
isRenameDialogOpen: false,
|
||||
isPermissionDialogOpen: false
|
||||
};
|
||||
@@ -170,7 +170,7 @@ class MultipleDirOperationToolbar extends React.Component {
|
||||
case 'History':
|
||||
this.onHistory(dirent);
|
||||
break;
|
||||
case 'Access Log':
|
||||
case 'Access Log':
|
||||
this.onAccessLog(dirent);
|
||||
break;
|
||||
case 'Open via Client':
|
||||
@@ -327,7 +327,7 @@ class MultipleDirOperationToolbar extends React.Component {
|
||||
const dirent = this.props.selectedDirentList[0];
|
||||
|
||||
let direntPath = this.getDirentPath(dirent);
|
||||
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="dir-operation">
|
||||
@@ -356,8 +356,8 @@ class MultipleDirOperationToolbar extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
{Utils.isDesktop() && <ViewModeToolbar currentMode={this.props.currentMode} switchViewMode={this.props.switchViewMode} />}
|
||||
{this.state.isMoveDialogShow &&
|
||||
<MoveDirentDialog
|
||||
{this.state.isMoveDialogShow &&
|
||||
<MoveDirentDialog
|
||||
path={this.props.path}
|
||||
repoID={this.props.repoID}
|
||||
repoEncrypted={this.props.repoEncrypted}
|
||||
|
@@ -14,7 +14,7 @@ const propTypes = {
|
||||
};
|
||||
|
||||
class RepoViewToolbar extends React.Component {
|
||||
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -63,7 +63,7 @@ class RepoViewToolbar extends React.Component {
|
||||
</div>
|
||||
{this.state.isCreateRepoDialogShow && (
|
||||
<ModalPortal>
|
||||
<CreateRepoDialog
|
||||
<CreateRepoDialog
|
||||
libraryType={this.props.libraryType}
|
||||
onCreateRepo={this.onCreateRepo}
|
||||
onCreateToggle={this.onCreateToggle}
|
||||
|
@@ -118,7 +118,7 @@ class ViewFileToolbar extends React.Component {
|
||||
{gettext('More')}
|
||||
</DropdownToggle>
|
||||
<DropdownMenu>
|
||||
{this.props.showShareBtn &&
|
||||
{this.props.showShareBtn &&
|
||||
<DropdownItem onClick={this.onShareToggle}>{gettext('Share')}</DropdownItem>
|
||||
}
|
||||
<DropdownItem onClick={this.onEditFileTagToggle}>{gettext('Tags')}</DropdownItem>
|
||||
@@ -130,7 +130,7 @@ class ViewFileToolbar extends React.Component {
|
||||
</div>
|
||||
{this.state.isShareDialogShow && (
|
||||
<ModalPotal>
|
||||
<ShareDialog
|
||||
<ShareDialog
|
||||
itemType={'file'}
|
||||
itemName={Utils.getFileName(this.props.path)}
|
||||
itemPath={this.props.path}
|
||||
|
Reference in New Issue
Block a user