mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 14:49:09 +00:00
[eslint] updated eslintrc and improved the code (#4702)
This commit is contained in:
@@ -71,7 +71,7 @@ class CommentPanel extends React.Component {
|
||||
toaster.danger(Utils.getErrorMsg(err));
|
||||
});
|
||||
this.setState({ comment: '' });
|
||||
}
|
||||
}
|
||||
|
||||
onSubmit = () => {
|
||||
this.addParticipant(username);
|
||||
|
@@ -4,7 +4,7 @@ import moment from 'moment';
|
||||
import { isPro, gettext, mediaUrl, siteRoot } from '../../utils/constants';
|
||||
import InternalLinkDialog from '../dialog/internal-link-dialog';
|
||||
|
||||
const propTypes = {
|
||||
const propTypes = {
|
||||
toggleStar: PropTypes.func.isRequired,
|
||||
isLocked: PropTypes.bool.isRequired,
|
||||
isStarred: PropTypes.bool.isRequired
|
||||
|
@@ -7,7 +7,7 @@ import { Utils } from '../../utils/utils';
|
||||
import ModalPortal from '../modal-portal';
|
||||
import ShareDialog from '../dialog/share-dialog';
|
||||
|
||||
const propTypes = {
|
||||
const propTypes = {
|
||||
isLocked: PropTypes.bool.isRequired,
|
||||
lockedByMe: PropTypes.bool.isRequired,
|
||||
onSave: PropTypes.func,
|
||||
@@ -17,7 +17,7 @@ const propTypes = {
|
||||
toggleCommentPanel: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
const {
|
||||
const {
|
||||
canLockUnlockFile, canGenerateShareLink,
|
||||
repoID, repoName, repoEncrypted, parentDir, filePerm, filePath,
|
||||
fileName,
|
||||
@@ -47,7 +47,7 @@ class FileToolbar extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { isLocked, lockedByMe } = this.props;
|
||||
const { isLocked, lockedByMe } = this.props;
|
||||
let showLockUnlockBtn = false;
|
||||
let lockUnlockText, lockUnlockIcon;
|
||||
if (canLockUnlockFile) {
|
||||
@@ -59,8 +59,8 @@ class FileToolbar extends React.Component {
|
||||
showLockUnlockBtn = true;
|
||||
lockUnlockText = gettext('Unlock');
|
||||
lockUnlockIcon = 'fa fa-unlock';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let showShareBtn = false;
|
||||
if (repoEncrypted) {
|
||||
@@ -104,8 +104,8 @@ class FileToolbar extends React.Component {
|
||||
href={`${siteRoot}repo/file_revisions/${repoID}/?p=${encodeURIComponent(filePath)}`}
|
||||
/>
|
||||
)}
|
||||
{(canEditFile && !err) &&
|
||||
( this.props.isSaving ?
|
||||
{(canEditFile && !err) &&
|
||||
( this.props.isSaving ?
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button> :
|
||||
(
|
||||
|
@@ -25,7 +25,7 @@ class FileViewTip extends React.Component {
|
||||
<a href="?dl=1" className="btn btn-secondary">{gettext('Download')}</a>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
FileViewTip.propTypes = propTypes;
|
||||
|
@@ -69,8 +69,8 @@ class FileView extends React.Component {
|
||||
if (this.state.isLocked) {
|
||||
seafileAPI.unlockfile(repoID, filePath).then((res) => {
|
||||
this.setState({
|
||||
isLocked: false,
|
||||
lockedByMe: false
|
||||
isLocked: false,
|
||||
lockedByMe: false
|
||||
});
|
||||
}).catch((error) => {
|
||||
const errorMsg = Utils.getErrorMsg(error);
|
||||
@@ -86,7 +86,7 @@ class FileView extends React.Component {
|
||||
const errorMsg = Utils.getErrorMsg(error);
|
||||
toaster.danger(errorMsg);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -98,7 +98,7 @@ class FileView extends React.Component {
|
||||
isLocked={this.state.isLocked}
|
||||
toggleStar={this.toggleStar}
|
||||
/>
|
||||
<FileToolbar
|
||||
<FileToolbar
|
||||
isLocked={this.state.isLocked}
|
||||
lockedByMe={this.state.lockedByMe}
|
||||
onSave={this.props.onSave}
|
||||
|
Reference in New Issue
Block a user