mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 19:01:42 +00:00
Fix transfer group or repo bug (#6934)
* 01 fix transfer repo to other user * 02 fix transfer group to other users * 03 group no repo style
This commit is contained in:
@@ -49,8 +49,11 @@ class TransferDialog extends React.Component {
|
||||
};
|
||||
|
||||
submit = () => {
|
||||
let user = this.state.selectedOption;
|
||||
let selectedOption = this.state.selectedOption;
|
||||
if (selectedOption && selectedOption[0]) {
|
||||
let user = selectedOption[0];
|
||||
this.props.submit(user);
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
@@ -5,6 +5,7 @@ import { gettext } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import UserSelect from '../user-select';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import toaster from '../toast';
|
||||
|
||||
import '../../css/transfer-group-dialog.css';
|
||||
|
||||
@@ -34,10 +35,15 @@ class TransferGroupDialog extends React.Component {
|
||||
};
|
||||
|
||||
transferGroup = () => {
|
||||
const email = this.state.selectedOption && this.state.selectedOption.email;
|
||||
let selectedOption = this.state.selectedOption;
|
||||
let email;
|
||||
if (selectedOption && selectedOption[0]) {
|
||||
email = selectedOption[0].email;
|
||||
}
|
||||
if (email) {
|
||||
seafileAPI.transferGroup(this.props.groupID, email).then((res) => {
|
||||
this.props.toggleTransferGroupDialog();
|
||||
toaster.success(gettext('Group has been transfered'));
|
||||
}).catch((error) => {
|
||||
let errMessage = Utils.getErrorMsg(error);
|
||||
this.setState({ errMessage: errMessage });
|
||||
|
@@ -133,13 +133,12 @@ class GroupView extends React.Component {
|
||||
<EmptyTip
|
||||
title={gettext('No libraries shared with this group')}
|
||||
text={gettext('No libraries have been shared with this group yet. A library shared with a group can be accessed by all group members. You can share a library with a group in "My Libraries". You can also create a new library to be shared with this group by clicking the "New Library" button in the menu bar.')}
|
||||
className="m-0 pt-0 pb-8"
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
if (currentGroup.admins.indexOf(username) == -1) { // is a member of this group
|
||||
return (
|
||||
<EmptyTip title={gettext('No libraries')} className="m-0 pt-0 pb-8" />
|
||||
<EmptyTip title={gettext('No libraries')} />
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
|
Reference in New Issue
Block a user