-
setTab('general')}>
-
- General
-
-
setTab('themes')}>
-
- Themes
-
-
setTab('display')}>
-
- Display
-
-
setTab('proxy')}>
-
- Proxy
-
-
setTab('keybindings')}>
-
- Keybindings
-
-
setTab('support')}>
-
- Support
-
-
setTab('beta')}>
-
- Beta
-
+
+
+
+
setTab('general')}>
+
+ General
+
+
setTab('themes')}>
+
+ Themes
+
+
setTab('display')}>
+
+ Display
+
+
setTab('proxy')}>
+
+ Proxy
+
+
setTab('keybindings')}>
+
+ Keybindings
+
+
setTab('support')}>
+
+ Support
+
+
setTab('beta')}>
+
+ Beta
-
-
+
+
);
};
diff --git a/packages/bruno-app/src/components/RequestTabPanel/index.js b/packages/bruno-app/src/components/RequestTabPanel/index.js
index 88aca8b20..ad53e7af2 100644
--- a/packages/bruno-app/src/components/RequestTabPanel/index.js
+++ b/packages/bruno-app/src/components/RequestTabPanel/index.js
@@ -33,6 +33,7 @@ import WSResponsePane from 'components/ResponsePane/WsResponsePane';
import { useTabPaneBoundaries } from 'hooks/useTabPaneBoundaries/index';
import ResponseExample from 'components/ResponseExample';
import WorkspaceHome from 'components/WorkspaceHome';
+import Preferences from 'components/Preferences';
import EnvironmentSettings from 'components/Environments/EnvironmentSettings';
import GlobalEnvironmentSettings from 'components/Environments/GlobalEnvironmentSettings';
@@ -171,13 +172,17 @@ const RequestTabPanel = () => {
}, [isConsoleOpen, isVerticalLayout]);
if (!activeTabUid || !focusedTab) {
- return
;
+ return
An error occurred!
;
}
if (focusedTab.type === 'global-environment-settings') {
return
;
}
+ if (focusedTab.type === 'preferences') {
+ return
;
+ }
+
if (!focusedTab.uid || !focusedTab.collectionUid) {
return
An error occurred!
;
}
diff --git a/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js b/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js
index d2afd5275..3c53cdbef 100644
--- a/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js
+++ b/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js
@@ -12,6 +12,10 @@ import ActionIcon from 'ui/ActionIcon';
const CollectionToolBar = ({ collection }) => {
const dispatch = useDispatch();
+ if (!collection) {
+ return null;
+ }
+
const handleRun = () => {
dispatch(
addTab({
diff --git a/packages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.js b/packages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.js
index 89cc5949a..dad87bf1b 100644
--- a/packages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.js
+++ b/packages/bruno-app/src/components/RequestTabs/RequestTab/SpecialTab.js
@@ -61,6 +61,14 @@ const SpecialTab = ({ handleCloseClick, type, tabName, handleDoubleClick, hasDra
>
);
}
+ case 'preferences': {
+ return (
+ <>
+
+
Preferences
+ >
+ );
+ }
}
};
diff --git a/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js b/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js
index 0714af2db..f001484e3 100644
--- a/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js
+++ b/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js
@@ -172,7 +172,7 @@ const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUi
setShowConfirmGlobalEnvironmentClose(true);
};
- if (['collection-settings', 'collection-overview', 'folder-settings', 'variables', 'collection-runner', 'environment-settings', 'global-environment-settings'].includes(tab.type)) {
+ if (['collection-settings', 'collection-overview', 'folder-settings', 'variables', 'collection-runner', 'environment-settings', 'global-environment-settings', 'preferences'].includes(tab.type)) {
return (
{
}, []);
const activeTab = find(tabs, (t) => t.uid === activeTabUid);
- const activeCollection = find(collections, (c) => c.uid === activeTab?.collectionUid);
+ const activeCollection = find(collections, (c) => c?.uid === activeTab?.collectionUid);
const collectionRequestTabs = filter(tabs, (t) => t.collectionUid === activeTab?.collectionUid);
useEffect(() => {
@@ -52,7 +52,7 @@ const RequestTabs = () => {
const checkOverflow = () => {
if (tabsRef.current && scrollContainerRef.current) {
- const hasOverflow = tabsRef.current.scrollWidth > scrollContainerRef.current.clientWidth;
+ const hasOverflow = tabsRef.current.scrollWidth > scrollContainerRef.current.clientWidth + 1;
setShowChevrons(hasOverflow);
}
};
@@ -111,7 +111,7 @@ const RequestTabs = () => {
)}
{collectionRequestTabs && collectionRequestTabs.length ? (
<>
-
+ {activeCollection && }
diff --git a/packages/bruno-app/src/components/StatusBar/index.js b/packages/bruno-app/src/components/StatusBar/index.js
index 87f1657b9..636c71ffc 100644
--- a/packages/bruno-app/src/components/StatusBar/index.js
+++ b/packages/bruno-app/src/components/StatusBar/index.js
@@ -1,22 +1,29 @@
import React, { useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
+import find from 'lodash/find';
import { IconSettings, IconCookie, IconTool, IconSearch, IconPalette, IconBrandGithub } from '@tabler/icons';
import Mousetrap from 'mousetrap';
import { getKeyBindingsForActionAllOS } from 'providers/Hotkeys/keyMappings';
import ToolHint from 'components/ToolHint';
-import Preferences from 'components/Preferences';
import Cookies from 'components/Cookies';
import Notifications from 'components/Notifications';
import Portal from 'components/Portal';
import ThemeDropdown from './ThemeDropdown';
-import { showPreferences } from 'providers/ReduxStore/slices/app';
import { openConsole } from 'providers/ReduxStore/slices/logs';
+import { setActiveWorkspaceTab } from 'providers/ReduxStore/slices/workspaceTabs';
+import { addTab } from 'providers/ReduxStore/slices/tabs';
import { useApp } from 'providers/App';
import StyledWrapper from './StyledWrapper';
const StatusBar = () => {
const dispatch = useDispatch();
- const preferencesOpen = useSelector((state) => state.app.showPreferences);
+ const activeWorkspaceUid = useSelector((state) => state.workspaces.activeWorkspaceUid);
+ const showHomePage = useSelector((state) => state.app.showHomePage);
+ const showManageWorkspacePage = useSelector((state) => state.app.showManageWorkspacePage);
+ const showApiSpecPage = useSelector((state) => state.app.showApiSpecPage);
+ const tabs = useSelector((state) => state.tabs.tabs);
+ const activeTabUid = useSelector((state) => state.tabs.activeTabUid);
+ const activeTab = find(tabs, (t) => t.uid === activeTabUid);
const logs = useSelector((state) => state.logs.logs);
const [cookiesOpen, setCookiesOpen] = useState(false);
const { version } = useApp();
@@ -27,6 +34,22 @@ const StatusBar = () => {
dispatch(openConsole());
};
+ const handlePreferencesClick = () => {
+ if (showHomePage || showManageWorkspacePage || showApiSpecPage || !activeTabUid) {
+ if (activeWorkspaceUid) {
+ dispatch(setActiveWorkspaceTab({ workspaceUid: activeWorkspaceUid, type: 'preferences' }));
+ }
+ } else {
+ dispatch(
+ addTab({
+ type: 'preferences',
+ uid: activeTab?.collectionUid ? `${activeTab.collectionUid}-preferences` : 'preferences',
+ collectionUid: activeTab?.collectionUid
+ })
+ );
+ }
+ };
+
const openGlobalSearch = () => {
const bindings = getKeyBindingsForActionAllOS('globalSearch') || [];
bindings.forEach((binding) => {
@@ -36,21 +59,6 @@ const StatusBar = () => {
return (
- {preferencesOpen && (
-
- {
- dispatch(showPreferences(false));
- document.querySelector('[data-trigger="preferences"]').focus();
- }}
- aria-modal="true"
- role="dialog"
- aria-labelledby="preferences-title"
- aria-describedby="preferences-description"
- />
-
- )}
-
{cookiesOpen && (
{