mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 02:42:47 +00:00
fix warning
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link } from '@reach/router';
|
||||
import { Button, Modal, Input, ModalBody, Form, FormGroup, Label } from 'reactstrap';
|
||||
import { Button, Modal, Input, ModalBody, Form, FormGroup } from 'reactstrap';
|
||||
import { gettext, siteRoot } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
|
||||
const propTypes = {
|
||||
repoID: PropTypes.string.isRequired,
|
||||
onLibDecryptDialog: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
|
||||
class LibDecryptDialog extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -24,7 +28,8 @@ class LibDecryptDialog extends React.Component {
|
||||
this.setState({
|
||||
showError: true
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
@@ -49,25 +54,27 @@ class LibDecryptDialog extends React.Component {
|
||||
return (
|
||||
<Modal isOpen={true} centered={true}>
|
||||
<ModalBody>
|
||||
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
|
||||
<Form className="lib-decrypt-form text-center">
|
||||
<img src={siteRoot + 'media/img/lock.png'} alt=""/>
|
||||
<p>{gettext('This library is password protected')}</p>
|
||||
{this.state.showError &&
|
||||
<p className="error">{gettext('Wrong password')}</p>
|
||||
}
|
||||
<FormGroup>
|
||||
<Input type="password" name="password" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange}/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Button type="submit" value="Submit" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
||||
</FormGroup>
|
||||
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
|
||||
</Form>
|
||||
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
|
||||
<Form className="lib-decrypt-form text-center">
|
||||
<img src={siteRoot + 'media/img/lock.png'} alt=""/>
|
||||
<p>{gettext('This library is password protected')}</p>
|
||||
{this.state.showError &&
|
||||
<p className="error">{gettext('Wrong password')}</p>
|
||||
}
|
||||
<FormGroup>
|
||||
<Input type="password" name="password" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange}/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Button type="submit" value="Submit" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
||||
</FormGroup>
|
||||
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
|
||||
</Form>
|
||||
</ModalBody>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
LibDecryptDialog.propTypes = propTypes;
|
||||
|
||||
export default LibDecryptDialog;
|
||||
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import AsyncSelect from 'react-select/lib/Async';
|
||||
import toaster from '../toast';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
||||
import { Button, Modal, ModalHeader, ModalBody } from 'reactstrap';
|
||||
import { seafileAPI } from '../../utils/seafile-api.js';
|
||||
|
||||
const propTypes = {
|
||||
@@ -58,10 +58,10 @@ class TransferDialog extends React.Component {
|
||||
this.props.submit(repoID);
|
||||
this.props.toggleDialog();
|
||||
}).catch(res => {
|
||||
let message = gettext('Failed. Please check the network.')
|
||||
this.props.toggleDialog();
|
||||
toaster.danger(message);
|
||||
})
|
||||
let message = gettext('Failed. Please check the network.');
|
||||
this.props.toggleDialog();
|
||||
toaster.danger(message);
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@@ -67,8 +67,8 @@ class DraftListItem extends React.Component {
|
||||
</td>
|
||||
<td className="review">
|
||||
{(draft.review_id && draft.review_status === 'open') ?
|
||||
<a href={reviewUrl} target="_blank">#{draft.review_id}</a> :
|
||||
<span>--</span>
|
||||
<a href={reviewUrl} target="_blank">#{draft.review_id}</a> :
|
||||
<span>--</span>
|
||||
}
|
||||
</td>
|
||||
<td className="update">{localTime}</td>
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import MarkdownViewer from '@seafile/seafile-editor/dist/viewer/markdown-viewer';
|
||||
import { Tooltip } from 'reactstrap';
|
||||
|
||||
const gettext = window.gettext;
|
||||
|
||||
@@ -11,7 +10,13 @@ const viewerPropTypes = {
|
||||
latestContributor: PropTypes.string,
|
||||
markdownContent: PropTypes.string,
|
||||
onContentRendered: PropTypes.func.isRequired,
|
||||
activeTitleIndex: PropTypes.number
|
||||
activeTitleIndex: PropTypes.number,
|
||||
onLinkClick: PropTypes.func,
|
||||
reviewStatus: PropTypes.string,
|
||||
goReviewPage: PropTypes.func,
|
||||
isDraft: PropTypes.bool,
|
||||
hasDraft: PropTypes.bool,
|
||||
goDraftPage: PropTypes.func,
|
||||
};
|
||||
|
||||
const contentClass = 'markdown-content';
|
||||
@@ -43,31 +48,31 @@ class MarkdownContentViewer extends React.Component {
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="markdown-content">
|
||||
{this.props.reviewStatus === 'open' &&
|
||||
<div className='seafile-btn-view-review text-center'>
|
||||
<div className='tag tag-green'>
|
||||
{gettext('This file is in review stage')}
|
||||
<a className="ml-2" onMouseDown={this.props.goReviewPage}>{gettext('View Review')}</a>
|
||||
</div>
|
||||
<div className="markdown-content">
|
||||
{this.props.reviewStatus === 'open' &&
|
||||
<div className='seafile-btn-view-review text-center'>
|
||||
<div className='tag tag-green'>
|
||||
{gettext('This file is in review stage')}
|
||||
<a className="ml-2" onMouseDown={this.props.goReviewPage}>{gettext('View Review')}</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
{(!this.props.isDraft && this.props.hasDraft && this.props.reviewStatus !== 'open') &&
|
||||
<div className='seafile-btn-view-review text-center'>
|
||||
<div className='tag tag-green'>
|
||||
{gettext('This file is in draft stage.')}
|
||||
<a className="ml-2" onMouseDown={this.props.goDraftPage}>{gettext('Edit Draft')}</a>
|
||||
</div>
|
||||
{(!this.props.isDraft && this.props.hasDraft && this.props.reviewStatus !== 'open') &&
|
||||
<div className='seafile-btn-view-review text-center'>
|
||||
<div className='tag tag-green'>
|
||||
{gettext('This file is in draft stage.')}
|
||||
<a className="ml-2" onMouseDown={this.props.goDraftPage}>{gettext('Edit Draft')}</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
<MarkdownViewer markdownContent={this.props.markdownContent} showTOC={true}
|
||||
activeTitleIndex={this.props.activeTitleIndex}
|
||||
onContentRendered={this.props.onContentRendered}
|
||||
/>
|
||||
<p id="wiki-page-last-modified">{gettext('Last modified by')} {this.props.latestContributor}, <span>{this.props.lastModified}</span></p>
|
||||
</div>
|
||||
<MarkdownViewer markdownContent={this.props.markdownContent} showTOC={true}
|
||||
activeTitleIndex={this.props.activeTitleIndex}
|
||||
onContentRendered={this.props.onContentRendered}
|
||||
/>
|
||||
<p id="wiki-page-last-modified">{gettext('Last modified by')} {this.props.latestContributor}, <span>{this.props.lastModified}</span></p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user