1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +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

@@ -19,21 +19,21 @@ class UserItem extends React.Component {
onMouseEnter = () => {
this.setState({isOperationShow: true});
}
};
onMouseLeave = () => {
this.setState({isOperationShow: false});
}
};
deleteUserFolderPermission = () => {
let item = this.props.item;
this.props.deleteUserFolderPermission(item);
}
};
onChangeUserFolderPerm = (permission) => {
let item = this.props.item;
this.props.onChangeUserFolderPerm(item.repo_id, permission, item.folder_path, item.user_email);
}
};
render() {
let item = this.props.item;
@@ -41,7 +41,7 @@ class UserItem extends React.Component {
return (
<tr onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} onFocus={this.onMouseEnter}>
<td>
<a href={`${siteRoot}profile/${encodeURIComponent(item.user_email)}/`} target="_blank">{item.user_name}</a>
<a href={`${siteRoot}profile/${encodeURIComponent(item.user_email)}/`} target="_blank" rel="noreferrer">{item.user_name}</a>
</td>
{this.props.showPath &&
<td>
@@ -75,10 +75,22 @@ class UserItem extends React.Component {
}
}
UserItem.propTypes = {
item: PropTypes.object.isRequired,
permissions: PropTypes.array.isRequired,
deleteUserFolderPermission: PropTypes.func.isRequired,
onChangeUserFolderPerm: PropTypes.func.isRequired,
showPath: PropTypes.bool.isRequired,
repoName: PropTypes.string.isRequired,
handleChange: PropTypes.func.isRequired,
};
const propTypes = {
repoID: PropTypes.string.isRequired,
isDepartmentRepo: PropTypes.bool
isDepartmentRepo: PropTypes.bool,
folderPath: PropTypes.string.isRequired,
repoName: PropTypes.string.isRequired,
};
@@ -103,7 +115,7 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
handleUserSelectChange = (option) => {
this.setState({selectedUsers: option});
}
};
componentDidMount() {
const {repoID, folderPath, isDepartmentRepo} = this.props;
@@ -119,7 +131,7 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
setPermission = (permission) => {
this.setState({permission: permission});
}
};
addUserFolderPerm = () => {
const { selectedUsers } = this.state;
@@ -163,7 +175,7 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
errorMsg: [errorMsg]
});
});
}
};
deleteUserFolderPermItem = (item) => {
const request = this.props.isDepartmentRepo ?
@@ -176,7 +188,7 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
})
});
});
}
};
onChangeUserFolderPerm = (repoID, permission, folderPath, userEmail) => {
const request = this.props.isDepartmentRepo ?
@@ -191,38 +203,38 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
});
this.setState({userFolderPermItems: userFolderPermItems});
});
}
};
onSetSubFolder = (e) => {
this.setState({
folderPath: e.target.value
});
}
};
toggleFileChooser = () => {
this.setState({
showFileChooser: !this.state.showFileChooser,
folderPath: ''
});
}
};
toggleSubFolder = (repo, path, item) => {
this.setState({
folderPath: path,
});
}
};
handleFileChooserSubmit = () => {
this.setState({
showFileChooser: !this.state.showFileChooser
});
}
};
onRepoItemClick = () => {
this.setState({
folderPath: '/'
});
}
};
render() {
let showPath = this.props.folderPath ? false : true;