From 524a59aed47d8a38c8b1b6b2459eb88e9a9dc449 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Wed, 1 Feb 2023 10:05:09 +0530 Subject: [PATCH] chore: hardened dnd boundary --- .../Sidebar/Collections/Collection/CollectionItem/index.js | 4 ++-- .../src/components/Sidebar/Collections/Collection/index.js | 2 +- packages/bruno-app/src/components/Welcome/index.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js index 4c3b43c65..30830d5fb 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js @@ -36,7 +36,7 @@ const CollectionItem = ({ item, collection, searchText }) => { const [itemIsCollapsed, setItemisCollapsed] = useState(item.collapsed); const [{ isDragging }, drag] = useDrag({ - type: 'COLLECTION_ITEM', + type: `COLLECTION_ITEM_${collection.uid}`, item: item, collect: (monitor) => ({ isDragging: monitor.isDragging() @@ -44,7 +44,7 @@ const CollectionItem = ({ item, collection, searchText }) => { }); const [{ isOver }, drop] = useDrop({ - accept: 'COLLECTION_ITEM', + accept: `COLLECTION_ITEM_${collection.uid}`, drop: (draggedItem) => { if (draggedItem.uid !== item.uid) { dispatch(moveItem(collection.uid, draggedItem.uid, item.uid)); diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js index 7c6b8c08d..713f02c97 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js @@ -65,7 +65,7 @@ const Collection = ({ collection, searchText }) => { }; const [{ isOver }, drop] = useDrop({ - accept: 'COLLECTION_ITEM', + accept: `COLLECTION_ITEM_${collection.uid}`, drop: (draggedItem) => { dispatch(moveItemToRootOfCollection(collection.uid, draggedItem.uid)); }, diff --git a/packages/bruno-app/src/components/Welcome/index.js b/packages/bruno-app/src/components/Welcome/index.js index 3e7d104b0..54754854d 100644 --- a/packages/bruno-app/src/components/Welcome/index.js +++ b/packages/bruno-app/src/components/Welcome/index.js @@ -60,9 +60,9 @@ const Welcome = () => { Create Collection -
+
- + Open Collection