1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-11 11:51:27 +00:00

Add department transfer function to the administrator interface (#6014)

* Add the function of transferring departments in the administrator interface

* fix admin get all departments

* update

* Update departments.py

* update

* update

* add department repo transfer

* Update groups.py

* update

---------

Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
Co-authored-by: r350178982 <32759763+r350178982@users.noreply.github.com>
This commit is contained in:
awu0403
2024-04-25 12:08:13 +08:00
committed by GitHub
parent 7a04bfa928
commit db6cee68e9
11 changed files with 362 additions and 51 deletions

View File

@@ -280,6 +280,12 @@ class Item extends Component {
getOperations = () => {
const { repo } = this.props;
let operations = ['Delete', 'Transfer'];
const index = repo.owner_email.indexOf('@seafile_group');
let isGroupOwnedRepo = index != -1;
if (isGroupOwnedRepo) {
operations = ['Transfer'];
return operations;
}
if (!repo.encrypted) {
operations.push('Share');
}
@@ -319,7 +325,7 @@ class Item extends Component {
}
</td>
<td>
{(!isGroupOwnedRepo && isOpIconShown) &&
{(isOpIconShown) &&
<OpMenu
operations={this.getOperations()}
translateOperations={this.translateOperations}
@@ -359,8 +365,8 @@ class Item extends Component {
<TransferDialog
itemName={repo.name}
submit={this.onTransferRepo}
canTransferToDept={false}
toggleDialog={this.toggleTransferDialog}
isSysAdmin={true}
/>
</ModalPortal>
}