mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-22 11:57:34 +00:00
fix warning (#2687)
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() {
|
||||
|
Reference in New Issue
Block a user