diff --git a/products/ASC.Files/Client/src/components/Badges.js b/products/ASC.Files/Client/src/components/Badges.js index adeca7cc98b..f568bc00b48 100644 --- a/products/ASC.Files/Client/src/components/Badges.js +++ b/products/ASC.Files/Client/src/components/Badges.js @@ -33,10 +33,10 @@ const Badges = ({ versionGroup, title, fileExst, + isEditing, } = item; const isFavorite = fileStatus === 32; - const isEditing = fileStatus === 1; const isNewWithFav = fileStatus === 34; const isEditingWithFav = fileStatus === 33; const showEditBadge = !locked || item.access === 0; diff --git a/products/ASC.Files/Client/src/components/dialogs/DeleteDialog/index.js b/products/ASC.Files/Client/src/components/dialogs/DeleteDialog/index.js index 66c63dc0fa9..061f568f6f7 100644 --- a/products/ASC.Files/Client/src/components/dialogs/DeleteDialog/index.js +++ b/products/ASC.Files/Client/src/components/dialogs/DeleteDialog/index.js @@ -20,7 +20,12 @@ class DeleteDialogComponent extends React.Component { let i = 0; while (props.selection.length !== i) { - if (!(props.isRootFolder && props.selection[i].providerKey)) { + if ( + !( + (props.isRootFolder && props.selection[i].providerKey) || + props.selection[i].isEditing + ) + ) { if ( props.selection[i].access === 0 || props.selection[i].access === 1 || diff --git a/products/ASC.Files/Client/src/components/panels/OperationsPanel/index.js b/products/ASC.Files/Client/src/components/panels/OperationsPanel/index.js index 6fa619142a7..5f64582b5f0 100644 --- a/products/ASC.Files/Client/src/components/panels/OperationsPanel/index.js +++ b/products/ASC.Files/Client/src/components/panels/OperationsPanel/index.js @@ -159,6 +159,7 @@ export default inject( } = dialogsStore; const selections = selection.length ? selection : [bufferSelection]; + const selectionsWithoutEditing = selections.filter((f) => !f.isEditing); const provider = selections.find((x) => x.providerKey); @@ -172,7 +173,7 @@ export default inject( operationsFolders, visible: copyPanelVisible || moveToPanelVisible, provider, - selection: selections, + selection: selectionsWithoutEditing, setCopyPanelVisible, setMoveToPanelVisible, diff --git a/products/ASC.Files/Client/src/store/FilesActionsStore.js b/products/ASC.Files/Client/src/store/FilesActionsStore.js index ae63a514b6e..a86e0f61f26 100644 --- a/products/ASC.Files/Client/src/store/FilesActionsStore.js +++ b/products/ASC.Files/Client/src/store/FilesActionsStore.js @@ -681,6 +681,7 @@ class FilesActionStore { canConvertSelected, isThirdPartyRootSelection, hasSelection, + allFilesIsEditing, } = this.filesStore; const { personal } = this.authStore.settingsStore; const { userAccess } = this.filesStore; @@ -699,12 +700,16 @@ class FilesActionStore { hasSelection && isAccessedSelected && !isRecentFolder && - !isFavoritesFolder + !isFavoritesFolder && + !allFilesIsEditing ); case "delete": const deleteCondition = - !isThirdPartyRootSelection && hasSelection && isAccessedSelected; + !isThirdPartyRootSelection && + hasSelection && + isAccessedSelected && + !allFilesIsEditing; return isCommonFolder ? userAccess && deleteCondition : deleteCondition; } diff --git a/products/ASC.Files/Client/src/store/FilesStore.js b/products/ASC.Files/Client/src/store/FilesStore.js index 5904003142f..98ad66082f5 100644 --- a/products/ASC.Files/Client/src/store/FilesStore.js +++ b/products/ASC.Files/Client/src/store/FilesStore.js @@ -519,7 +519,7 @@ class FilesStore { const canConvert = false; //TODO: fix of added convert check; const isEncrypted = item.encrypted; const isDocuSign = false; //TODO: need this prop; - const isEditing = false; //TODO: need this prop; + const isEditing = item.fileStatus === 1; const isFileOwner = item.createdBy.id === this.userStore.user.id; const { @@ -618,6 +618,7 @@ class FilesStore { fileOptions = this.removeOptions(fileOptions, [ "finalize-version", "move-to", + "separator2", "delete", ]); if (isThirdPartyFolder) { @@ -1269,6 +1270,7 @@ class FilesStore { : null; const needConvert = canConvert(fileExst); + const isEditing = item.fileStatus === 1; const docUrl = combineUrl( AppServerConfig.proxyURL, @@ -1328,6 +1330,7 @@ class FilesStore { folderUrl, href, isThirdPartyFolder, + isEditing, }; }); @@ -1535,6 +1538,16 @@ class FilesStore { return filesList.length <= 0; } + get allFilesIsEditing() { + const hasFolders = this.selection.find( + (x) => !x.fileExst || !x.contentLength + ); + if (!hasFolders) { + return this.selection.every((x) => x.isEditing); + } + return false; + } + getOptions = (selection, externalAccess = false) => { const { canWebEdit,