1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

Merge pull request #3633 from haiwen/fix-warnings

fix recent warnings
This commit is contained in:
Daniel Pan
2019-06-11 10:08:47 +08:00
committed by GitHub
16 changed files with 53 additions and 53 deletions

View File

@@ -210,7 +210,7 @@ class NoticeItem extends React.Component {
<li onClick={this.onNoticeItemClick} className={noticeItem.seen ? 'read' : 'unread'}> <li onClick={this.onNoticeItemClick} className={noticeItem.seen ? 'read' : 'unread'}>
<div className="notice-item"> <div className="notice-item">
<div className="main-info"> <div className="main-info">
<img src={avatar_url} width="32" height="32" className="avatar" /> <img src={avatar_url} width="32" height="32" className="avatar" alt=""/>
<p className="brief" dangerouslySetInnerHTML={{__html: notice}}></p> <p className="brief" dangerouslySetInnerHTML={{__html: notice}}></p>
</div> </div>
<p className="time">{moment(noticeItem.time).fromNow()}</p> <p className="time">{moment(noticeItem.time).fromNow()}</p>

View File

@@ -1,4 +1,4 @@
import React, { Fragment } from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Modal, ModalHeader, ModalBody, ModalFooter, Alert } from 'reactstrap'; import { Modal, ModalHeader, ModalBody, ModalFooter, Alert } from 'reactstrap';
import { gettext, repoPasswordMinLength } from '../../utils/constants'; import { gettext, repoPasswordMinLength } from '../../utils/constants';
@@ -102,7 +102,7 @@ class ChangeRepoPasswordDialog extends React.Component {
render() { render() {
const { repoID, repoName, toggleDialog } = this.props; const { repoName, toggleDialog } = this.props;
return ( return (
<Modal isOpen={true} centered={true} style={{height: 'auto'}}> <Modal isOpen={true} centered={true} style={{height: 'auto'}}>

View File

@@ -235,7 +235,7 @@ class WikiMarkdownViewer extends React.Component {
return <Loading />; return <Loading />;
} }
// In dir-column-file repoID is one of props, width is 100%; In wiki-viewer repoID is not props, width isn't 100% // In dir-column-file repoID is one of props, width is 100%; In wiki-viewer repoID is not props, width isn't 100%
let contentClassName = `${this.props.repoID ? contentClass + ' w-100' : contentClass}` let contentClassName = `${this.props.repoID ? contentClass + ' w-100' : contentClass}`;
return ( return (
<div ref={this.markdownContainer} className="wiki-page-container" onScroll={this.onScrollHandler.bind(this)}> <div ref={this.markdownContainer} className="wiki-page-container" onScroll={this.onScrollHandler.bind(this)}>
<div className={contentClassName}> <div className={contentClassName}>

View File

@@ -23,7 +23,7 @@ const DEFAULT_DATA = {
} }
], ],
rows: [{name: 'name_' + 0}] rows: [{name: 'name_' + 0}]
} };
class AppMain extends React.Component { class AppMain extends React.Component {

View File

@@ -222,11 +222,11 @@ class GroupView extends React.Component {
}); });
this.setState({repoList: repoList}); this.setState({repoList: repoList});
let name = repo.repo_name; let name = repo.repo_name;
var msg = gettext("Successfully deleted {name}.").replace('{name}', name); var msg = gettext('Successfully deleted {name}.').replace('{name}', name);
toaster.success(msg); toaster.success(msg);
}).catch(() => { }).catch(() => {
let name = repo.repo_name; let name = repo.repo_name;
var msg = gettext("Failed to delete {name}.").replace('{name}', name); var msg = gettext('Failed to delete {name}.').replace('{name}', name);
toaster.danger(msg); toaster.danger(msg);
}); });
} }

View File

@@ -196,11 +196,11 @@ class MylibRepoListItem extends React.Component {
seafileAPI.deleteRepo(repo.repo_id).then((res) => { seafileAPI.deleteRepo(repo.repo_id).then((res) => {
this.props.onDeleteRepo(repo); this.props.onDeleteRepo(repo);
let name = repo.repo_name; let name = repo.repo_name;
var msg = gettext("Successfully deleted {name}.").replace('{name}', name); var msg = gettext('Successfully deleted {name}.').replace('{name}', name);
toaster.success(msg); toaster.success(msg);
}).catch(() => { }).catch(() => {
let name = repo.repo_name; let name = repo.repo_name;
var msg = gettext("Failed to delete {name}.").replace('{name}', name); var msg = gettext('Failed to delete {name}.').replace('{name}', name);
toaster.danger(msg); toaster.danger(msg);
}); });
} }

View File

@@ -121,7 +121,7 @@ class Item extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
let item = this.props.item let item = this.props.item;
this.state = { this.state = {
currentPermission: item.permissions.can_download ? 'Preview and download' : 'Preview only', currentPermission: item.permissions.can_download ? 'Preview and download' : 'Preview only',
showOpIcon: false, showOpIcon: false,
@@ -210,7 +210,7 @@ class Item extends Component {
let deleteIconClassName = 'sf2-icon-delete action-icon' + iconVisibility; let deleteIconClassName = 'sf2-icon-delete action-icon' + iconVisibility;
return ( return (
<tr onMouseEnter={this.handleMouseOver} onMouseLeave={this.handleMouseOut}> <tr onMouseEnter={this.handleMouseOver} onMouseLeave={this.handleMouseOut}>
<td><img src={iconUrl} width="24" /></td> <td><img src={iconUrl} width="24" alt=""/></td>
<td> <td>
{item.is_dir ? {item.is_dir ?
<Link to={linkUrl}>{item.obj_name}</Link> : <Link to={linkUrl}>{item.obj_name}</Link> :

View File

@@ -196,7 +196,7 @@ class Item extends Component {
} else { } else {
seafileAPI.starItem(this.props.data.repo_id, '/').then(() => { seafileAPI.starItem(this.props.data.repo_id, '/').then(() => {
this.setState({isStarred: !this.state.isStarred}); this.setState({isStarred: !this.state.isStarred});
}) });
} }
} }
@@ -266,7 +266,7 @@ class Item extends Component {
{(isPro && data.is_admin) && {(isPro && data.is_admin) &&
<a href="#" className={shareIconClassName} title={gettext('Share')} onClick={this.share}></a> <a href="#" className={shareIconClassName} title={gettext('Share')} onClick={this.share}></a>
} }
<a href="#" className={leaveShareIconClassName} title={gettext("Leave Share")} onClick={this.leaveShare}></a> <a href="#" className={leaveShareIconClassName} title={gettext('Leave Share')} onClick={this.leaveShare}></a>
</td> </td>
</tr> </tr>
{this.state.isShowSharedDialog && ( {this.state.isShowSharedDialog && (

View File

@@ -1,11 +1,11 @@
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Router } from '@reach/router'; import { Router } from '@reach/router';
import { siteRoot, gettext } from '../../utils/constants'; import { siteRoot } from '../../utils/constants';
import SidePanel from './side-panel'; import SidePanel from './side-panel';
import MainPanel from './main-panel'; import MainPanel from './main-panel';
import FileScanRecords from './file-scan-records'; import FileScanRecords from './file-scan-records';
import WorkWeixinDepartments from './work-weixin-departments' import WorkWeixinDepartments from './work-weixin-departments';
import '../../assets/css/fa-solid.css'; import '../../assets/css/fa-solid.css';
import '../../assets/css/fa-regular.css'; import '../../assets/css/fa-regular.css';

View File

@@ -231,8 +231,8 @@ class WorkWeixinDepartments extends Component {
<div className="main-panel-north border-left-show"> <div className="main-panel-north border-left-show">
<div className="cur-view-toolbar"> <div className="cur-view-toolbar">
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu"></span> <span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu"></span>
<Button className={btnClass + "my-1 d-md-none"} onClick={this.onSubmit}>{'导入用户'}</Button> <Button className={btnClass + 'my-1 d-md-none'} onClick={this.onSubmit}>{'导入用户'}</Button>
<Button className={btnClass + "hidden-md-up"} onClick={this.onSubmit}>{'导入用户'}</Button> <Button className={btnClass + 'hidden-md-up'} onClick={this.onSubmit}>{'导入用户'}</Button>
</div> </div>
<div className="common-toolbar"> <div className="common-toolbar">
<Account isAdminPanel={true}/> <Account isAdminPanel={true}/>

View File

@@ -70,7 +70,7 @@ class WorkWeixinDepartmentMembersList extends Component {
} }
{!isMembersListLoading && this.props.membersList.length === 0 && {!isMembersListLoading && this.props.membersList.length === 0 &&
<div className="message empty-tip text-center"> <div className="message empty-tip text-center">
<img src={`${siteRoot}media/img/member-list-empty-2x.png`}/> <img src={`${siteRoot}media/img/member-list-empty-2x.png`} alt=""/>
<h4>{'成员列表为空'}</h4> <h4>{'成员列表为空'}</h4>
</div> </div>
} }

View File

@@ -55,7 +55,7 @@ class WorkWeixinDepartmentsTreeNode extends Component {
let toggleClass = classNames({ let toggleClass = classNames({
'folder-toggle-icon fa fa-caret-down': department.children && this.state.isChildrenShow, 'folder-toggle-icon fa fa-caret-down': department.children && this.state.isChildrenShow,
'folder-toggle-icon fa fa-caret-right': department.children && !this.state.isChildrenShow, 'folder-toggle-icon fa fa-caret-right': department.children && !this.state.isChildrenShow,
}) });
let nodeInnerClass = classNames({ let nodeInnerClass = classNames({
'tree-node-inner': true, 'tree-node-inner': true,
'tree-node-hight-light': checkedDepartmentId === department.id 'tree-node-hight-light': checkedDepartmentId === department.id