mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 02:10:24 +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 = () => {
|
submit = () => {
|
||||||
let user = this.state.selectedOption;
|
let selectedOption = this.state.selectedOption;
|
||||||
this.props.submit(user);
|
if (selectedOption && selectedOption[0]) {
|
||||||
|
let user = selectedOption[0];
|
||||||
|
this.props.submit(user);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@@ -5,6 +5,7 @@ import { gettext } from '../../utils/constants';
|
|||||||
import { seafileAPI } from '../../utils/seafile-api';
|
import { seafileAPI } from '../../utils/seafile-api';
|
||||||
import UserSelect from '../user-select';
|
import UserSelect from '../user-select';
|
||||||
import { Utils } from '../../utils/utils';
|
import { Utils } from '../../utils/utils';
|
||||||
|
import toaster from '../toast';
|
||||||
|
|
||||||
import '../../css/transfer-group-dialog.css';
|
import '../../css/transfer-group-dialog.css';
|
||||||
|
|
||||||
@@ -34,10 +35,15 @@ class TransferGroupDialog extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
transferGroup = () => {
|
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) {
|
if (email) {
|
||||||
seafileAPI.transferGroup(this.props.groupID, email).then((res) => {
|
seafileAPI.transferGroup(this.props.groupID, email).then((res) => {
|
||||||
this.props.toggleTransferGroupDialog();
|
this.props.toggleTransferGroupDialog();
|
||||||
|
toaster.success(gettext('Group has been transfered'));
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
this.setState({ errMessage: errMessage });
|
this.setState({ errMessage: errMessage });
|
||||||
|
@@ -133,13 +133,12 @@ class GroupView extends React.Component {
|
|||||||
<EmptyTip
|
<EmptyTip
|
||||||
title={gettext('No libraries shared with this group')}
|
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.')}
|
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 {
|
} else {
|
||||||
if (currentGroup.admins.indexOf(username) == -1) { // is a member of this group
|
if (currentGroup.admins.indexOf(username) == -1) { // is a member of this group
|
||||||
return (
|
return (
|
||||||
<EmptyTip title={gettext('No libraries')} className="m-0 pt-0 pb-8" />
|
<EmptyTip title={gettext('No libraries')} />
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user