1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-27 23:56:18 +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

@@ -1,6 +1,7 @@
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { seafileAPI } from '../../../utils/seafile-api';
import { gettext, siteRoot } from '../../../utils/constants';
import { gettext } from '../../../utils/constants';
import { Utils } from '../../../utils/utils';
import EmptyTip from '../../../components/empty-tip';
import moment from 'moment';
@@ -16,17 +17,13 @@ import LogsExportExcelDialog from '../../../components/dialog/sysadmin-dialog/sy
class Content extends Component {
constructor(props) {
super(props);
}
getPreviousPage = () => {
this.props.getLogsByPage(this.props.currentPage - 1);
}
};
getNextPage = () => {
this.props.getLogsByPage(this.props.currentPage + 1);
}
};
render() {
const { loading, errorMsg, items, perPage, currentPage, hasNextPage } = this.props;
@@ -77,6 +74,19 @@ class Content extends Component {
}
}
Content.propTypes = {
loading: PropTypes.bool.isRequired,
errorMsg: PropTypes.string.isRequired,
items: PropTypes.array.isRequired,
getLogsByPage: PropTypes.func,
resetPerPage: PropTypes.func,
currentPage: PropTypes.number,
perPage: PropTypes.number,
pageInfo: PropTypes.object,
hasNextPage: PropTypes.bool,
};
class Item extends Component {
constructor(props) {
@@ -91,27 +101,27 @@ class Item extends Component {
this.setState({
isOpIconShown: true
});
}
};
handleMouseOut = () => {
this.setState({
isOpIconShown: false
});
}
};
toggleCommitDetailsDialog = () => {
this.setState({
isCommitDetailsDialogOpen: !this.state.isCommitDetailsDialogOpen
});
}
};
showCommitDetails = (e) => {
e.preventDefault();
this.setState({
isCommitDetailsDialogOpen: !this.state.isCommitDetailsDialogOpen
});
}
};
render() {
let { item } = this.props;
@@ -143,6 +153,12 @@ class Item extends Component {
}
}
Item.propTypes = {
item: PropTypes.object.isRequired,
};
class FileUpdateLogs extends Component {
constructor(props) {
@@ -161,7 +177,7 @@ class FileUpdateLogs extends Component {
toggleExportExcelDialog = () => {
this.setState({isExportExcelDialogOpen: !this.state.isExportExcelDialogOpen});
}
};
componentDidMount () {
let urlParams = (new URL(window.location)).searchParams;
@@ -189,13 +205,13 @@ class FileUpdateLogs extends Component {
errorMsg: Utils.getErrorMsg(error, true) // true: show login tip if 403
});
});
}
};
resetPerPage = (newPerPage) => {
this.setState({
perPage: newPerPage,
}, () => this.getLogsByPage(this.initPage));
}
};
render() {
let { logList, currentPage, perPage, hasNextPage, isExportExcelDialogOpen } = this.state;