mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-20 19:58:10 +02:00
chore: disable dragndrop temporarily due to electron issues
This commit is contained in:
parent
7f2e19250f
commit
ae7e3a722c
@ -35,28 +35,28 @@ const CollectionItem = ({ item, collection, searchText }) => {
|
|||||||
const [newFolderModalOpen, setNewFolderModalOpen] = useState(false);
|
const [newFolderModalOpen, setNewFolderModalOpen] = useState(false);
|
||||||
const [itemIsCollapsed, setItemisCollapsed] = useState(item.collapsed);
|
const [itemIsCollapsed, setItemisCollapsed] = useState(item.collapsed);
|
||||||
|
|
||||||
const [{ isDragging }, drag] = useDrag({
|
// const [{ isDragging }, drag] = useDrag({
|
||||||
type: 'COLLECTION_ITEM',
|
// type: 'COLLECTION_ITEM',
|
||||||
item: item,
|
// item: item,
|
||||||
collect: (monitor) => ({
|
// collect: (monitor) => ({
|
||||||
isDragging: monitor.isDragging()
|
// isDragging: monitor.isDragging()
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
|
|
||||||
const [{ isOver }, drop] = useDrop({
|
// const [{ isOver }, drop] = useDrop({
|
||||||
accept: 'COLLECTION_ITEM',
|
// accept: 'COLLECTION_ITEM',
|
||||||
drop: (draggedItem) => {
|
// drop: (draggedItem) => {
|
||||||
if (draggedItem.uid !== item.uid) {
|
// if (draggedItem.uid !== item.uid) {
|
||||||
dispatch(moveItem(collection.uid, draggedItem.uid, item.uid));
|
// dispatch(moveItem(collection.uid, draggedItem.uid, item.uid));
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
canDrop: (draggedItem) => {
|
// canDrop: (draggedItem) => {
|
||||||
return draggedItem.uid !== item.uid;
|
// return draggedItem.uid !== item.uid;
|
||||||
},
|
// },
|
||||||
collect: (monitor) => ({
|
// collect: (monitor) => ({
|
||||||
isOver: monitor.isOver()
|
// isOver: monitor.isOver()
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (searchText && searchText.length) {
|
if (searchText && searchText.length) {
|
||||||
@ -141,7 +141,7 @@ const CollectionItem = ({ item, collection, searchText }) => {
|
|||||||
{deleteItemModalOpen && <DeleteCollectionItem item={item} collection={collection} onClose={() => setDeleteItemModalOpen(false)} />}
|
{deleteItemModalOpen && <DeleteCollectionItem item={item} collection={collection} onClose={() => setDeleteItemModalOpen(false)} />}
|
||||||
{newRequestModalOpen && <NewRequest item={item} collection={collection} onClose={() => setNewRequestModalOpen(false)} />}
|
{newRequestModalOpen && <NewRequest item={item} collection={collection} onClose={() => setNewRequestModalOpen(false)} />}
|
||||||
{newFolderModalOpen && <NewFolder item={item} collection={collection} onClose={() => setNewFolderModalOpen(false)} />}
|
{newFolderModalOpen && <NewFolder item={item} collection={collection} onClose={() => setNewFolderModalOpen(false)} />}
|
||||||
<div className={itemRowClassName} ref={(node) => drag(drop(node))}>
|
<div className={itemRowClassName}>
|
||||||
<div className="flex items-center h-full w-full">
|
<div className="flex items-center h-full w-full">
|
||||||
{indents && indents.length
|
{indents && indents.length
|
||||||
? indents.map((i) => {
|
? indents.map((i) => {
|
||||||
|
@ -73,20 +73,20 @@ const Collection = ({ collection, searchText }) => {
|
|||||||
|
|
||||||
const isLocal = isLocalCollection(collection);
|
const isLocal = isLocalCollection(collection);
|
||||||
|
|
||||||
const [{ isOver }, drop] = useDrop({
|
// const [{ isOver }, drop] = useDrop({
|
||||||
accept: 'COLLECTION_ITEM',
|
// accept: 'COLLECTION_ITEM',
|
||||||
drop: (draggedItem) => {
|
// drop: (draggedItem) => {
|
||||||
console.log('drop', draggedItem);
|
// console.log('drop', draggedItem);
|
||||||
dispatch(moveItemToRootOfCollection(collection.uid, draggedItem.uid));
|
// dispatch(moveItemToRootOfCollection(collection.uid, draggedItem.uid));
|
||||||
},
|
// },
|
||||||
canDrop: (draggedItem) => {
|
// canDrop: (draggedItem) => {
|
||||||
// todo need to make sure that draggedItem belongs to the collection
|
// // todo need to make sure that draggedItem belongs to the collection
|
||||||
return true;
|
// return true;
|
||||||
},
|
// },
|
||||||
collect: (monitor) => ({
|
// collect: (monitor) => ({
|
||||||
isOver: monitor.isOver()
|
// isOver: monitor.isOver()
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledWrapper className="flex flex-col">
|
<StyledWrapper className="flex flex-col">
|
||||||
@ -96,7 +96,7 @@ const Collection = ({ collection, searchText }) => {
|
|||||||
{showRemoveCollectionFromWSModal && <RemoveCollectionFromWorkspace collection={collection} onClose={() => setShowRemoveCollectionFromWSModal(false)} />}
|
{showRemoveCollectionFromWSModal && <RemoveCollectionFromWorkspace collection={collection} onClose={() => setShowRemoveCollectionFromWSModal(false)} />}
|
||||||
{showDeleteCollectionModal && <DeleteCollection collection={collection} onClose={() => setShowDeleteCollectionModal(false)} />}
|
{showDeleteCollectionModal && <DeleteCollection collection={collection} onClose={() => setShowDeleteCollectionModal(false)} />}
|
||||||
{showRemoveLocalCollectionModal && <RemoveLocalCollection collection={collection} onClose={() => setShowRemoveLocalCollectionModal(false)} />}
|
{showRemoveLocalCollectionModal && <RemoveLocalCollection collection={collection} onClose={() => setShowRemoveLocalCollectionModal(false)} />}
|
||||||
<div className="flex py-1 collection-name items-center" ref={(node) => drop(node)}>
|
<div className="flex py-1 collection-name items-center">
|
||||||
<div className="flex flex-grow items-center" onClick={handleClick}>
|
<div className="flex flex-grow items-center" onClick={handleClick}>
|
||||||
<IconChevronRight size={16} strokeWidth={2} className={iconClassName} style={{ width: 16, color: 'rgb(160 160 160)' }} />
|
<IconChevronRight size={16} strokeWidth={2} className={iconClassName} style={{ width: 16, color: 'rgb(160 160 160)' }} />
|
||||||
<div className="ml-1" id="sidebar-collection-name">{collection.name}</div>
|
<div className="ml-1" id="sidebar-collection-name">{collection.name}</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user