1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +00:00

Org libraries (#3110)

* org admin libraris

* update front page

* update code style

* refactor code

* update api name
This commit is contained in:
陈钦亮
2019-03-15 16:30:20 +08:00
committed by Daniel Pan
parent 39703d58c9
commit 7dfb1cfe75
12 changed files with 365 additions and 78 deletions

View File

@@ -1,14 +1,11 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import toaster from '../toast';
import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api.js';
import UserSelect from '../user-select';
const propTypes = {
itemName: PropTypes.string.isRequired,
repoID: PropTypes.string.isRequired,
toggleDialog: PropTypes.func.isRequired,
submit: PropTypes.func.isRequired,
};
@@ -30,17 +27,8 @@ class TransferDialog extends React.Component {
}
submit = () => {
let repoID = this.props.repoID;
let user = this.state.selectedOption.email;
seafileAPI.transferRepo(repoID, user).then(res => {
let message = gettext('Successfully transferred the library.');
toaster.success(message);
this.props.submit(repoID);
}).catch(res => {
let message = gettext('Failed. Please check the network.');
this.props.toggleDialog();
toaster.danger(message);
});
let user = this.state.selectedOption;
this.props.submit(user);
}
render() {