From c33e7fddf07a22a9b43a76642901607dd7218f86 Mon Sep 17 00:00:00 2001 From: jouliet <137276534+jouliet@users.noreply.github.com> Date: Mon, 26 Jun 2023 15:54:16 +0200 Subject: [PATCH] 99 dragndroppubliclink (#112) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛Removed noisy notification with shared link * 🐛upload zone size (#99) --- .../app/views/client/body/drive/browser.tsx | 23 ++++++++++++++++++- .../app/views/client/body/drive/shared.tsx | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tdrive/frontend/src/app/views/client/body/drive/browser.tsx b/tdrive/frontend/src/app/views/client/body/drive/browser.tsx index b24b9db6..54255bb9 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/browser.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/browser.tsx @@ -101,6 +101,8 @@ export default memo( [_setParentId], ); + + //In case we are kicked out of the current folder, we need to reset the parent id useEffect(() => { if (!loading && !path?.length && !inPublicSharing && !sharedWithMe) setParentId('root'); @@ -134,6 +136,22 @@ export default memo( const onBuildContextMenu = useOnBuildContextMenu(children, initialParentId); const { viewId } = useRouteState(); + const handleDragOver = (event: { preventDefault: () => void; }) => { + event.preventDefault(); + } + const handleDrop = async (event: {dataTransfer: any; preventDefault: () => void;}) => { + event.preventDefault(); + const dataTransfer = event.dataTransfer; + if (dataTransfer) { + const tree = await getFilesTree(dataTransfer); + setCreationModalState({ parent_id: '', open: false }); + uploadTree(tree, { + companyId, + parentId, + }); + } + } + const buildFileTypeContextMenu = useOnBuildFileTypeContextMenu(); const buildPeopleContextMen = useOnBuildPeopleContextMenu(); const buildDateContextMenu = useOnBuildDateContextMenu(); @@ -151,7 +169,7 @@ export default memo( diff --git a/tdrive/frontend/src/app/views/client/body/drive/shared.tsx b/tdrive/frontend/src/app/views/client/body/drive/shared.tsx index e03fbeca..cbf5fcad 100755 --- a/tdrive/frontend/src/app/views/client/body/drive/shared.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/shared.tsx @@ -79,7 +79,7 @@ export default () => { -
+