mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-24 05:05:39 +00:00
Feature: Add collapse full collection feature (#4492)
* Add collapse collection feature --------- Co-authored-by: Anoop M D <anoop@usebruno.com>
This commit is contained in:
committed by
GitHub
parent
191a997b05
commit
41e0615f77
@@ -6,7 +6,7 @@ import filter from 'lodash/filter';
|
||||
import { useDrop, useDrag } from 'react-dnd';
|
||||
import { IconChevronRight, IconDots, IconLoader2 } from '@tabler/icons';
|
||||
import Dropdown from 'components/Dropdown';
|
||||
import { toggleCollection } from 'providers/ReduxStore/slices/collections';
|
||||
import { toggleCollection, collapseFullCollection } from 'providers/ReduxStore/slices/collections';
|
||||
import { mountCollection, moveCollectionAndPersist, handleCollectionItemDrop } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { hideHomePage } from 'providers/ReduxStore/slices/app';
|
||||
@@ -132,6 +132,10 @@ const Collection = ({ collection, searchText }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleCollapseFullCollection = () => {
|
||||
dispatch(collapseFullCollection({ collectionUid: collection.uid }));
|
||||
};
|
||||
|
||||
const viewCollectionSettings = () => {
|
||||
dispatch(
|
||||
addTab({
|
||||
@@ -311,6 +315,15 @@ const Collection = ({ collection, searchText }) => {
|
||||
>
|
||||
Share
|
||||
</div>
|
||||
<div
|
||||
className="dropdown-item"
|
||||
onClick={(_e) => {
|
||||
menuDropdownTippyRef.current.hide();
|
||||
handleCollapseFullCollection();
|
||||
}}
|
||||
>
|
||||
Collapse
|
||||
</div>
|
||||
<div
|
||||
className="dropdown-item"
|
||||
onClick={(_e) => {
|
||||
|
||||
@@ -96,6 +96,13 @@ export const collectionsSlice = createSlice({
|
||||
state.collections.push(collection);
|
||||
}
|
||||
},
|
||||
collapseFullCollection: (state, action) => {
|
||||
const { collectionUid } = action.payload;
|
||||
const collection = findCollectionByUid(state.collections, collectionUid);
|
||||
if (collection) {
|
||||
collapseAllItemsInCollection(collection);
|
||||
}
|
||||
},
|
||||
updateCollectionMountStatus: (state, action) => {
|
||||
const collection = findCollectionByUid(state.collections, action.payload.collectionUid);
|
||||
if (collection) {
|
||||
@@ -2748,6 +2755,7 @@ export const {
|
||||
saveRequest,
|
||||
deleteRequestDraft,
|
||||
newEphemeralHttpRequest,
|
||||
collapseFullCollection,
|
||||
toggleCollection,
|
||||
toggleCollectionItem,
|
||||
requestUrlChanged,
|
||||
|
||||
Reference in New Issue
Block a user