1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +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'}>
<div className="notice-item">
<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>
</div>
<p className="time">{moment(noticeItem.time).fromNow()}</p>

View File

@@ -7,7 +7,7 @@ export const MENU_HIDE = 'REACT_CONTEXTMENU_HIDE';
export function dispatchGlobalEvent(eventName, opts, target = window) {
// Compatibale with IE
// Compatibale with IE
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
let event;

View File

@@ -1,4 +1,4 @@
import React, { Fragment } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { Modal, ModalHeader, ModalBody, ModalFooter, Alert } from 'reactstrap';
import { gettext, repoPasswordMinLength } from '../../utils/constants';
@@ -79,30 +79,30 @@ class ChangeRepoPasswordDialog extends React.Component {
submitBtnDisabled: true
});
seafileAPI.changeEncryptedRepoPassword(this.props.repoID, oldPassword, newPassword)
.then(() => {
this.props.toggleDialog();
toaster.success(gettext('Successfully changed library password.'));
}).catch((error) => {
let errorMsg = '';
if (error.response) {
if (error.response.data) {
.then(() => {
this.props.toggleDialog();
toaster.success(gettext('Successfully changed library password.'));
}).catch((error) => {
let errorMsg = '';
if (error.response) {
if (error.response.data) {
errorMsg = error.response.data.error_msg;
} else {
} else {
errorMsg = gettext('Error');
}
} else {
}
} else {
errorMsg = gettext('Please check the network.');
}
this.setState({
errorMsg: errorMsg,
submitBtnDisabled: false
});
});
}
this.setState({
errorMsg: errorMsg,
submitBtnDisabled: false
});
});
}
render() {
const { repoID, repoName, toggleDialog } = this.props;
const { repoName, toggleDialog } = this.props;
return (
<Modal isOpen={true} centered={true} style={{height: 'auto'}}>
@@ -121,7 +121,7 @@ class ChangeRepoPasswordDialog extends React.Component {
</form>
</ModalBody>
<ModalFooter>
<button className="btn btn-primary" disabled={this.state.submitBtnDisabled} onClick={this.formSubmit}>{gettext('Submit')}</button>
<button className="btn btn-primary" disabled={this.state.submitBtnDisabled} onClick={this.formSubmit}>{gettext('Submit')}</button>
</ModalFooter>
</Modal>
);

View File

@@ -162,7 +162,7 @@ class RepoListItem extends React.Component {
<span className="icon far fa-folder tree-node-icon"></span>
</i>
</div>
</div>
</div>
{this.state.isShowChildren && (
<TreeListView
repo={this.props.repo}

View File

@@ -90,19 +90,19 @@ class TreeViewItem extends React.Component {
<div className="file-chooser-item">
<div className={`${node.path === '/'? 'hide': ''}`}>
<div className={`${(isCurrentRepo && isCurrentPath) ? 'item-active' : ''} item-info`} onClick={this.onItemClick}>
<div className="item-text">
<span className="name user-select-none ellipsis">{node.object && node.object.name}</span>
<div className="item-text">
<span className="name user-select-none ellipsis">{node.object && node.object.name}</span>
</div>
<div className="item-left-icon">
{
node.object.type !== 'file' &&
<span className={`icon item-toggle fa ${node.isExpanded ? 'fa-caret-down' : 'fa-caret-right'}`} onClick={this.onToggleClick}></span>
}
<i className="tree-node-icon">
<span className={`icon far ${node.object.type === 'dir' ? 'fa-folder' : 'fa-file'}`}></span>
</i>
</div>
</div>
<div className="item-left-icon">
{
node.object.type !== 'file' &&
<span className={`icon item-toggle fa ${node.isExpanded ? 'fa-caret-down' : 'fa-caret-right'}`} onClick={this.onToggleClick}></span>
}
<i className="tree-node-icon">
<span className={`icon far ${node.object.type === 'dir' ? 'fa-folder' : 'fa-file'}`}></span>
</i>
</div>
</div>
</div>
{node.isExpanded && this.renderChildren()}
</div>

View File

@@ -224,7 +224,7 @@ class MainSideNav extends React.Component {
</Link>
</li>
{canInvitePeople &&
<li className="nav-item">
<li className="nav-item">
<Link className={`nav-link ellipsis ${this.getActiveClass('invitations')}`} to={siteRoot + 'invitations/'} title={gettext('Invite People')} onClick={() => this.tabItemClick('invitations')}>
<span className="sf2-icon-invite" aria-hidden="true"></span>
<span className="nav-text">{gettext('Invite People')}</span>

View File

@@ -235,7 +235,7 @@ class WikiMarkdownViewer extends React.Component {
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%
let contentClassName = `${this.props.repoID ? contentClass + ' w-100' : contentClass}`
let contentClassName = `${this.props.repoID ? contentClass + ' w-100' : contentClass}`;
return (
<div ref={this.markdownContainer} className="wiki-page-container" onScroll={this.onScrollHandler.bind(this)}>
<div className={contentClassName}>