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:
@@ -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>
|
||||
|
Reference in New Issue
Block a user