mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 18:03:48 +00:00
Copyitems into the current directory
This commit is contained in:
@@ -67,12 +67,6 @@ class CopyDirent extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy dirents to current path
|
|
||||||
if (selectedPath && selectedPath === this.props.path && repo.repo_id === repoID) {
|
|
||||||
this.setState({errMessage: message});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy dirents to one of their child. eg: A/B, A/D -> A/B/C
|
// copy dirents to one of their child. eg: A/B, A/D -> A/B/C
|
||||||
let copyDirentPath = '';
|
let copyDirentPath = '';
|
||||||
let isChildPath = direntPaths.some(direntPath => {
|
let isChildPath = direntPaths.some(direntPath => {
|
||||||
@@ -110,6 +104,9 @@ class CopyDirent extends React.Component {
|
|||||||
this.setState({errMessage: message});
|
this.setState({errMessage: message});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(repo.repo_id);
|
||||||
|
console.log(repoID)
|
||||||
|
|
||||||
// copy the dirent to current path
|
// copy the dirent to current path
|
||||||
if (selectedPath && this.props.path === selectedPath && repo.repo_id === repoID) {
|
if (selectedPath && this.props.path === selectedPath && repo.repo_id === repoID) {
|
||||||
|
@@ -576,6 +576,9 @@ class LibContentView extends React.Component {
|
|||||||
this.copyTreeNode(direntPath, destDirentPath, destRepo, names[index]);
|
this.copyTreeNode(direntPath, destDirentPath, destRepo, names[index]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (destDirentPath === this.state.path) {
|
||||||
|
this.loadDirentList(this.state.path);
|
||||||
|
}
|
||||||
let message = Utils.getCopySuccessfulMessage(dirNames);
|
let message = Utils.getCopySuccessfulMessage(dirNames);
|
||||||
toaster.success(message);
|
toaster.success(message);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -872,6 +875,9 @@ class LibContentView extends React.Component {
|
|||||||
if (this.state.currentMode === 'column') {
|
if (this.state.currentMode === 'column') {
|
||||||
this.copyTreeNode(direntPath, copyToDirentPath, destRepo, nodeName);
|
this.copyTreeNode(direntPath, copyToDirentPath, destRepo, nodeName);
|
||||||
}
|
}
|
||||||
|
if (copyToDirentPath === nodeParentPath) {
|
||||||
|
this.loadDirentList(this.state.path);
|
||||||
|
}
|
||||||
let message = gettext('Successfully copied %(name)s.');
|
let message = gettext('Successfully copied %(name)s.');
|
||||||
message = message.replace('%(name)s', dirName);
|
message = message.replace('%(name)s', dirName);
|
||||||
toaster.success(message);
|
toaster.success(message);
|
||||||
|
Reference in New Issue
Block a user