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

Merge branch '7.0'

This commit is contained in:
shanshuirenjia
2020-04-10 18:22:52 +08:00
2 changed files with 27 additions and 18 deletions

View File

@@ -54,7 +54,7 @@ const propTypes = {
onShowDirentsDraggablePreview: PropTypes.func,
};
class DirentListItem extends React.Component {
class DirentListItem extends React.PureComponent {
constructor(props) {
super(props);

View File

@@ -86,6 +86,8 @@ class LibContentView extends React.Component {
window.onpopstate = this.onpopstate;
this.lastModifyTime = new Date();
this.isNeedUpdateHistoryState = true; // Load, refresh page, switch mode for the first time, no need to set historyState
this.currentMoveItemName = '';
this.currentMoveItemPath = '';
}
showDirentDetail = (direntDetailPanelTab) => {
@@ -594,6 +596,12 @@ class LibContentView extends React.Component {
if (data.successful) {
if (asyncOperationType === 'move') {
if (this.currentMoveItemName && this.currentMoveItemPath) {
if (this.state.currentMode === 'column') {
this.deleteTreeNode(this.currentMoveItemPath);
}
this.moveDirent(this.currentMoveItemName);
} else {
if (this.state.currentMode === 'column') {
let direntPaths = this.getSelectedDirentPaths();
this.deleteTreeNodes(direntPaths);
@@ -601,6 +609,7 @@ class LibContentView extends React.Component {
let direntNames = this.getSelectedDirentNames();
this.moveDirents(direntNames);
}
}
this.setState({isCopyMoveProgressDialogShow: false});
let message = gettext('Successfully moved files to another library.');
@@ -1037,10 +1046,10 @@ class LibContentView extends React.Component {
seafileAPI.moveDir(repoID, destRepo.repo_id, moveToDirentPath, nodeParentPath, dirName).then(res => {
if (repoID !== destRepo.repo_id) {
this.setState({
asyncCopyMoveTaskId: res.data.task_id,
}, () => {
this.getAsyncCopyMoveProgress();
this.setState({asyncCopyMoveTaskId: res.data.task_id}, () => {
this.currentMoveItemName = dirName;
this.currentMoveItemPath = direntPath;
this.getAsyncCopyMoveProgress(dirName, direntPath);
});
}
@@ -1099,7 +1108,8 @@ class LibContentView extends React.Component {
});
}
if (repoID === destRepo.repo_id && this.state.currentMode === 'column') {
if (repoID === destRepo.repo_id) {
if (this.state.currentMode === 'column') {
this.updateMoveCopyTreeNode(copyToDirentPath);
}
@@ -1107,7 +1117,6 @@ class LibContentView extends React.Component {
this.loadDirentList(this.state.path);
}
if (repoID === destRepo.repo_id) {
let message = gettext('Successfully copied %(name)s.');
message = message.replace('%(name)s', dirName);
toaster.success(message);