1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +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

@@ -57,6 +57,21 @@ class RepoListViewPanel extends React.Component {
// todo;
});
}
onItemRename = (repo, newName) => {
let group = this.props.group;
seafileAPI.renameGroupOwnedLibrary(group.id, 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
});
}
render() {
let group = this.props.group;
@@ -76,6 +91,7 @@ class RepoListViewPanel extends React.Component {
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
onItemDetails={this.props.onItemDetails}
onItemRename={this.onItemRename}
/>
}
</div>