1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 08:53:14 +00:00

Group repo rename (#2926)

* add rename for group repo

* freezed item when renaming

* add mobile rename handler
This commit is contained in:
杨顺强
2019-02-11 15:22:42 +08:00
committed by Daniel Pan
parent 1a78c81309
commit 4288db826e
5 changed files with 112 additions and 27 deletions

View File

@@ -239,6 +239,20 @@ class GroupView extends React.Component {
});
}
onItemRename = (repo, newName) => {
seafileAPI.renameGroupOwnedLibrary(this.props.groupID, repo.repo_id, newName).then(res => {
let repoList = this.state.repoList.map(item => {
if (item.repo_id === repo.repo_id) {
item.repo_name = newName;
}
return item;
});
this.setState({repoList: repoList});
}).catch(() => {
// todo
});
}
onTabNavClick = (tabName) => {
this.props.onTabNavClick(tabName);
}
@@ -436,6 +450,7 @@ class GroupView extends React.Component {
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
onItemDetails={this.onItemDetails}
onItemRename={this.onItemRename}
/>
}
</div>