Merge pull request #921 from ONLYOFFICE/bugfix/shared-drag-n-drop

Web:Client:Home: disable drag
This commit is contained in:
Nikita Gopienko 2022-10-18 18:51:46 +03:00 committed by GitHub
commit d30f95576b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

View File

@ -57,8 +57,11 @@ export default function withFileActions(WrappedFileItem) {
};
onDrop = (items) => {
const { isTrashFolder, dragging, setDragging } = this.props;
const { fileExst, id } = this.props.item;
if (isTrashFolder) return dragging && setDragging(false);
if (!fileExst) {
this.onDropZoneUpload(items, id);
} else {

View File

@ -255,8 +255,12 @@ class PureHome extends React.Component {
setDragging,
dragging,
uploadEmptyFolders,
disableDrag,
} = this.props;
dragging && setDragging(false);
if (disableDrag) return;
const emptyFolders = files.filter((f) => f.isEmptyDirectory);
if (emptyFolders.length > 0) {
@ -609,6 +613,8 @@ export default inject(
refreshFiles,
setViewAs,
isEmptyPage,
disableDrag,
} = filesStore;
const { gallerySelected } = oformsStore;
@ -616,6 +622,7 @@ export default inject(
const {
isRecycleBinFolder,
isPrivacyFolder,
expandedKeys,
setExpandedKeys,
isRoomsFolder,
@ -714,6 +721,8 @@ export default inject(
isRoomsFolder,
isArchiveFolder,
disableDrag,
setExpandedKeys,
setFirstLoad,
setDragging,

View File

@ -2683,6 +2683,24 @@ class FilesStore {
setRoomSecurity = async (id, data) => {
return await api.rooms.setRoomSecurity(id, data);
};
get disableDrag() {
const {
isRecycleBinFolder,
isRoomsFolder,
isArchiveFolder,
isFavoritesFolder,
isRecentFolder,
} = this.treeFoldersStore;
return (
isRecycleBinFolder ||
isRoomsFolder ||
isArchiveFolder ||
isFavoritesFolder ||
isRecentFolder
);
}
}
export default FilesStore;