1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

Fix eslint warnings (#5635)

* 01 fix eslint warnings

* fix code warnings

* fix code warnings

* fix code warnings

* fix code warnings

* fix code warnings
This commit is contained in:
Michael An
2023-09-13 08:40:50 +08:00
committed by GitHub
parent d829ba5b23
commit 14ce391007
520 changed files with 4774 additions and 3438 deletions

View File

@@ -32,7 +32,7 @@ class Account extends Component {
getContainer = () => {
return ReactDOM.findDOMNode(this);
}
};
handleProps = () => {
if (this.state.showInfo) {
@@ -40,19 +40,19 @@ class Account extends Component {
} else {
this.removeEvents();
}
}
};
addEvents = () => {
['click', 'touchstart', 'keyup'].forEach(event =>
document.addEventListener(event, this.handleDocumentClick, true)
);
}
};
removeEvents = () => {
['click', 'touchstart', 'keyup'].forEach(event =>
document.removeEventListener(event, this.handleDocumentClick, true)
);
}
};
handleDocumentClick = (e) => {
if (e && (e.which === 3 || (e.type === 'keyup' && e.which !== Utils.keyCodes.tab))) return;
@@ -65,7 +65,7 @@ class Account extends Component {
this.setState({
showInfo: !this.state.showInfo,
});
}
};
onClickAccount = (e) => {
e.preventDefault();
@@ -90,7 +90,7 @@ class Account extends Component {
} else {
this.setState({showInfo: !this.state.showInfo});
}
}
};
renderMenu = () => {
let data;
@@ -134,20 +134,20 @@ class Account extends Component {
}
return data && <a href={data.url} title={data.text} className="item">{data.text}</a>;
}
};
renderAvatar = () => {
return (<img src={appAvatarURL} width="36" height="36" className="avatar" alt={gettext('Avatar')} />);
}
};
render() {
return (
<div id="account">
<a id="my-info" href="#" onClick={this.onClickAccount} className="account-toggle no-deco d-none d-md-block" aria-label={gettext("View profile and more")}>
<a id="my-info" href="#" onClick={this.onClickAccount} className="account-toggle no-deco d-none d-md-block" aria-label={gettext('View profile and more')}>
{this.renderAvatar()}
<span className="fas fa-caret-down vam"></span>
</a>
<span className="account-toggle sf2-icon-more mobile-icon d-md-none" aria-label={gettext("View profile and more")} onClick={this.onClickAccount}></span>
<span className="account-toggle sf2-icon-more mobile-icon d-md-none" aria-label={gettext('View profile and more')} onClick={this.onClickAccount}></span>
<div id="user-info-popup" className={`account-popup sf-popover ${this.state.showInfo? '':'hide'}`}>
<div className="outer-caret up-outer-caret">
<div className="inner-caret"></div>

View File

@@ -7,7 +7,7 @@ class GoBack extends Component {
onBackClick = (event) => {
event.preventDefault();
window.history.back();
}
};
render() {
return (

View File

@@ -7,4 +7,4 @@ export default function Logout() {
<i className="sf3-font sf3-font-logout" style={{fontSize: '24px'}}></i>
</a>
);
}
}

View File

@@ -6,6 +6,7 @@ import { Utils } from '../../utils/utils';
const propTypes = {
noticeItem: PropTypes.object.isRequired,
tr: PropTypes.any,
onNoticeItemClick: PropTypes.func
};
@@ -17,7 +18,7 @@ const MSG_TYPE_FILE_UPLOADED = 'file_uploaded';
const MSG_TYPE_FILE_COMMENT = 'file_comment';
const MSG_TYPE_DRAFT_COMMENT = 'draft_comment';
const MSG_TYPE_DRAFT_REVIEWER = 'draft_reviewer';
const MSG_TYPE_GUEST_INVITATION_ACCEPTED = 'guest_invitation_accepted';
// const MSG_TYPE_GUEST_INVITATION_ACCEPTED = 'guest_invitation_accepted';
const MSG_TYPE_REPO_MONITOR = 'repo_monitor';
const MSG_TYPE_DELETED_FILES = 'deleted_files';
@@ -335,7 +336,7 @@ class NoticeItem extends React.Component {
return;
}
this.props.onNoticeItemClick(item);
}
};
render() {
let noticeItem = this.props.noticeItem;

View File

@@ -38,18 +38,18 @@ export default class NotificationPopover extends React.Component {
}
this.props.onNotificationListToggle();
}
}
};
onNotificationDialogToggle = () => {
this.props.onNotificationDialogToggle();
this.props.onNotificationListToggle();
}
};
onHandleScroll = () => {
if (this.notificationListRef.offsetHeight + this.notificationListRef.scrollTop + 1 >= this.notificationsWrapperRef.offsetHeight) {
this.props.listNotifications && this.props.listNotifications();
}
}
};
render() {
const { headerText, bodyText, footerText } = this.props;

View File

@@ -36,7 +36,7 @@ class Notification extends React.Component {
this.loadNotices();
this.setState({showNotice: true});
}
}
};
loadNotices = () => {
let page = 1;
@@ -45,7 +45,7 @@ class Notification extends React.Component {
let noticeList = res.data.notification_list;
this.setState({noticeList: noticeList});
});
}
};
onNoticeItemClick = (noticeItem) => {
let noticeList = this.state.noticeList.map(item => {
@@ -61,22 +61,22 @@ class Notification extends React.Component {
unseenCount: unseenCount,
});
}
};
getInitDialogState = () => {
const searchParams = Utils.getUrlSearches();
return searchParams.notifications === 'all';
}
};
onNotificationDialogToggle = () => {
let newSearch = this.state.isShowNotificationDialog ? null : 'all';
Utils.updateSearchParameter('notifications', newSearch);
this.setState({isShowNotificationDialog: !this.state.isShowNotificationDialog});
}
};
onNotificationListToggle = () => {
this.setState({showNotice: false});
}
};
onMarkAllNotifications = () => {
seafileAPI.updateNotifications().then(() => {
@@ -88,7 +88,7 @@ class Notification extends React.Component {
errorMsg: Utils.getErrorMsg(error, true)
});
});
}
};
render() {
const { unseenCount } = this.state;
@@ -98,7 +98,7 @@ class Notification extends React.Component {
<span className="sf2-icon-bell" id="notification-popover"></span>
<span className={`num ${unseenCount ? '' : 'hide'}`}>{unseenCount}</span>
</a>
{this.state.showNotice &&
{this.state.showNotice &&
<NotificationPopover
headerText={gettext('Notification')}
bodyText={gettext('Mark all as read')}