Skip to content
Snippets Groups Projects
Commit e384ede7 authored by vkovtun's avatar vkovtun
Browse files

SSDM-13579: Added loading dialog for copying, moving and renaming.

parent fcba91e6
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -36,6 +36,7 @@ import Popover from '@material-ui/core/Popover' ...@@ -36,6 +36,7 @@ import Popover from '@material-ui/core/Popover'
import InputDialog from '@src/js/components/common/dialog/InputDialog.jsx' import InputDialog from '@src/js/components/common/dialog/InputDialog.jsx'
import ConfirmationDialog from '@src/js/components/common/dialog/ConfirmationDialog.jsx' import ConfirmationDialog from '@src/js/components/common/dialog/ConfirmationDialog.jsx'
import LocationDialog from '@src/js/components/database/data-browser/LocationDialog.jsx' import LocationDialog from '@src/js/components/database/data-browser/LocationDialog.jsx'
import LoadingDialog from "@src/js/components/common/loading/LoadingDialog.jsx";
const color = 'default' const color = 'default'
const iconButtonSize = 'medium' const iconButtonSize = 'medium'
...@@ -81,7 +82,8 @@ class LeftToolbar extends React.Component { ...@@ -81,7 +82,8 @@ class LeftToolbar extends React.Component {
newFolderDialogOpen: false, newFolderDialogOpen: false,
deleteDialogOpen: false, deleteDialogOpen: false,
renameDialogOpen: false, renameDialogOpen: false,
locationDialogMode: null locationDialogMode: null,
loading: false
} }
this.controller = this.props.controller this.controller = this.props.controller
...@@ -125,7 +127,13 @@ class LeftToolbar extends React.Component { ...@@ -125,7 +127,13 @@ class LeftToolbar extends React.Component {
const { multiselectedFiles } = this.props const { multiselectedFiles } = this.props
const oldName = multiselectedFiles.values().next().value.name const oldName = multiselectedFiles.values().next().value.name
this.closeRenameDialog() this.closeRenameDialog()
await this.controller.rename(oldName, newName)
try {
this.setState({ loading: true })
await this.controller.rename(oldName, newName)
} finally {
this.setState({ loading: false })
}
} }
handleRenameCancel() { handleRenameCancel() {
...@@ -149,10 +157,15 @@ class LeftToolbar extends React.Component { ...@@ -149,10 +157,15 @@ class LeftToolbar extends React.Component {
const { locationDialogMode} = this.state const { locationDialogMode} = this.state
this.closeLocationDialog() this.closeLocationDialog()
if (locationDialogMode === moveLocationMode) { try {
await this.controller.move(multiselectedFiles, newPath) this.setState({ loading: true })
} else { if (locationDialogMode === moveLocationMode) {
await this.controller.copy(multiselectedFiles, newPath) await this.controller.move(multiselectedFiles, newPath)
} else {
await this.controller.copy(multiselectedFiles, newPath)
}
} finally {
this.setState({ loading: false })
} }
} }
...@@ -379,15 +392,18 @@ class LeftToolbar extends React.Component { ...@@ -379,15 +392,18 @@ class LeftToolbar extends React.Component {
logger.log(logger.DEBUG, 'LeftToolbar.render') logger.log(logger.DEBUG, 'LeftToolbar.render')
const { multiselectedFiles, classes } = this.props const { multiselectedFiles, classes } = this.props
return ( const { loading } = this.state
<ResizeObserver onResize={this.onResize}>
return ([
<ResizeObserver key='resize-observer' onResize={this.onResize}>
<div className={classes.buttons}> <div className={classes.buttons}>
{multiselectedFiles && multiselectedFiles.size > 0 {multiselectedFiles && multiselectedFiles.size > 0
? this.renderSelectionContextToolbar() ? this.renderSelectionContextToolbar()
: this.renderNoSelectionContextToolbar()} : this.renderNoSelectionContextToolbar()}
</div> </div>
</ResizeObserver> </ResizeObserver>,
) <LoadingDialog key='loaging-dialog' loading={loading} />
])
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment