mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
feat: add hideApiSpecPage dispatch to Collection and CollectionItem components (#6344)
This commit is contained in:
@@ -39,7 +39,7 @@ import GenerateCodeItem from './GenerateCodeItem';
|
||||
import { isItemARequest, isItemAFolder } from 'utils/tabs';
|
||||
import { doesRequestMatchSearchText, doesFolderHaveItemsMatchSearchText } from 'utils/collections/search';
|
||||
import { getDefaultRequestPaneTab } from 'utils/collections';
|
||||
import { hideHomePage } from 'providers/ReduxStore/slices/app';
|
||||
import { hideHomePage, hideApiSpecPage } from 'providers/ReduxStore/slices/app';
|
||||
import toast from 'react-hot-toast';
|
||||
import StyledWrapper from './StyledWrapper';
|
||||
import NetworkError from 'components/ResponsePane/NetworkError/index';
|
||||
@@ -222,6 +222,7 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
|
||||
const isRequest = isItemARequest(item);
|
||||
if (isRequest) {
|
||||
dispatch(hideHomePage());
|
||||
dispatch(hideApiSpecPage());
|
||||
if (isTabForItemPresent) {
|
||||
dispatch(
|
||||
focusTab({
|
||||
@@ -239,6 +240,8 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
|
||||
})
|
||||
);
|
||||
} else {
|
||||
dispatch(hideHomePage());
|
||||
dispatch(hideApiSpecPage());
|
||||
dispatch(
|
||||
addTab({
|
||||
uid: item.uid,
|
||||
|
||||
@@ -24,7 +24,7 @@ import Dropdown from 'components/Dropdown';
|
||||
import { toggleCollection, collapseFullCollection } from 'providers/ReduxStore/slices/collections';
|
||||
import { mountCollection, moveCollectionAndPersist, handleCollectionItemDrop, pasteItem } from 'providers/ReduxStore/slices/collections/actions';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { hideHomePage } from 'providers/ReduxStore/slices/app';
|
||||
import { hideApiSpecPage, hideHomePage } from 'providers/ReduxStore/slices/app';
|
||||
import { addTab, makeTabPermanent } from 'providers/ReduxStore/slices/tabs';
|
||||
import toast from 'react-hot-toast';
|
||||
import NewRequest from 'components/Sidebar/NewRequest';
|
||||
@@ -112,6 +112,7 @@ const Collection = ({ collection, searchText }) => {
|
||||
|
||||
if (!isChevronClick) {
|
||||
dispatch(hideHomePage()); // @TODO Playwright tests are often stuck on home page, rather than collection settings tab. Revisit for a proper fix.
|
||||
dispatch(hideApiSpecPage());
|
||||
dispatch(
|
||||
addTab({
|
||||
uid: collection.uid,
|
||||
|
||||
Reference in New Issue
Block a user