mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 01:44:13 +00:00
Merge branch '7.0'
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
@@ -307,7 +307,7 @@ class GenerateShareLink extends React.Component {
|
||||
}
|
||||
</dd>
|
||||
</FormGroup>
|
||||
{!sharedLinkInfo.is_dir && ( //just for file
|
||||
{!sharedLinkInfo.is_dir && sharedLinkInfo.permissions.can_download &&( //just for file
|
||||
<FormGroup className="mb-0">
|
||||
<dt className="text-secondary font-weight-normal">{gettext('Direct Download Link:')}</dt>
|
||||
<dd className="d-flex">
|
||||
|
Reference in New Issue
Block a user