1
0
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:
Michael An
2024-10-23 07:43:02 +08:00
committed by GitHub
parent eb64781c68
commit bbeb36af8a
3 changed files with 13 additions and 5 deletions

View File

@@ -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() {

View File

@@ -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 });

View File

@@ -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 (