mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
Tree structure deletion reminder (#4359)
This commit is contained in:
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|||||||
import TreeView from '../../components/tree-view/tree-view';
|
import TreeView from '../../components/tree-view/tree-view';
|
||||||
import Loading from '../../components/loading';
|
import Loading from '../../components/loading';
|
||||||
import ModalPortal from '../../components/modal-portal';
|
import ModalPortal from '../../components/modal-portal';
|
||||||
import Delete from '../../components/dialog/delete-dialog';
|
|
||||||
import Rename from '../../components/dialog/rename-dialog';
|
import Rename from '../../components/dialog/rename-dialog';
|
||||||
import Copy from '../../components/dialog/copy-dirent-dialog';
|
import Copy from '../../components/dialog/copy-dirent-dialog';
|
||||||
import Move from '../../components/dialog/move-dirent-dialog';
|
import Move from '../../components/dialog/move-dirent-dialog';
|
||||||
@@ -42,7 +41,6 @@ class DirColumnNav extends React.Component {
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
opNode: null,
|
opNode: null,
|
||||||
isDeleteDialogShow: false,
|
|
||||||
isAddFileDialogShow: false,
|
isAddFileDialogShow: false,
|
||||||
isAddFolderDialogShow: false,
|
isAddFolderDialogShow: false,
|
||||||
isRenameDialogShow: false,
|
isRenameDialogShow: false,
|
||||||
@@ -90,7 +88,7 @@ class DirColumnNav extends React.Component {
|
|||||||
this.onRenameToggle();
|
this.onRenameToggle();
|
||||||
break;
|
break;
|
||||||
case 'Delete':
|
case 'Delete':
|
||||||
this.onDeleteToggle();
|
this.onDeleteNode(node);
|
||||||
break;
|
break;
|
||||||
case 'Copy':
|
case 'Copy':
|
||||||
this.onCopyToggle();
|
this.onCopyToggle();
|
||||||
@@ -132,10 +130,6 @@ class DirColumnNav extends React.Component {
|
|||||||
this.setState({isRenameDialogShow: !this.state.isRenameDialogShow});
|
this.setState({isRenameDialogShow: !this.state.isRenameDialogShow});
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeleteToggle = () => {
|
|
||||||
this.setState({isDeleteDialogShow: !this.state.isDeleteDialogShow});
|
|
||||||
}
|
|
||||||
|
|
||||||
onCopyToggle = () => {
|
onCopyToggle = () => {
|
||||||
this.setState({isCopyDialogShow: !this.state.isCopyDialogShow});
|
this.setState({isCopyDialogShow: !this.state.isCopyDialogShow});
|
||||||
}
|
}
|
||||||
@@ -160,9 +154,7 @@ class DirColumnNav extends React.Component {
|
|||||||
this.props.onRenameNode(node, newName);
|
this.props.onRenameNode(node, newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeleteNode = () => {
|
onDeleteNode = (node) => {
|
||||||
this.setState({isDeleteDialogShow: !this.state.isDeleteDialogShow});
|
|
||||||
let node = this.state.opNode;
|
|
||||||
this.props.onDeleteNode(node);
|
this.props.onDeleteNode(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,15 +303,6 @@ class DirColumnNav extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</ModalPortal>
|
</ModalPortal>
|
||||||
)}
|
)}
|
||||||
{this.state.isDeleteDialogShow && (
|
|
||||||
<ModalPortal>
|
|
||||||
<Delete
|
|
||||||
currentNode={this.state.opNode}
|
|
||||||
handleSubmit={this.onDeleteNode}
|
|
||||||
toggleCancel={this.onDeleteToggle}
|
|
||||||
/>
|
|
||||||
</ModalPortal>
|
|
||||||
)}
|
|
||||||
{this.state.isCopyDialogShow && (
|
{this.state.isCopyDialogShow && (
|
||||||
<ModalPortal>
|
<ModalPortal>
|
||||||
<Copy
|
<Copy
|
||||||
|
Reference in New Issue
Block a user