diff --git a/packages/bruno-app/src/components/Dropdown/StyledWrapper.js b/packages/bruno-app/src/components/Dropdown/StyledWrapper.js index cb97c16ae..65a52fbaf 100644 --- a/packages/bruno-app/src/components/Dropdown/StyledWrapper.js +++ b/packages/bruno-app/src/components/Dropdown/StyledWrapper.js @@ -8,44 +8,66 @@ const Wrapper = styled.div` } .tippy-box { - min-width: 135px; + min-width: 160px; font-size: ${(props) => props.theme.font.size.base}; color: ${(props) => props.theme.dropdown.color}; background-color: ${(props) => props.theme.dropdown.bg}; - box-shadow: ${(props) => props.theme.dropdown.shadow}; - border-radius: 3px; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05); + border-radius: 10px; max-height: 90vh; overflow-y: auto; max-width: unset !important; + padding: 0.25rem; .tippy-content { padding-left: 0; padding-right: 0; - padding-top: 0.25rem; - padding-bottom: 0.25rem; + padding-top: 0; + padding-bottom: 0; .label-item { display: flex; align-items: center; - padding: 0.35rem 0.6rem; - background-color: ${(props) => props.theme.dropdown.labelBg}; + padding: 0.375rem 0.625rem 0.25rem 0.625rem; + font-size: 0.6875rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.025em; + color: ${(props) => props.theme.dropdown.color}; + opacity: 0.6; + margin-top: 0.25rem; + + &:first-child { + margin-top: 0; + } } .dropdown-item { display: flex; align-items: center; - padding: 0.35rem 0.6rem; + gap: 0.5rem; + padding: 0.275rem 0.625rem; cursor: pointer; + border-radius: 6px; + margin: 0.0625rem 0; + font-size: 0.8125rem; &.active { color: ${(props) => props.theme.colors.text.yellow} !important; - .icon { + .dropdown-icon { color: ${(props) => props.theme.colors.text.yellow} !important; } } - .icon { + .dropdown-icon { + flex-shrink: 0; + width: 16px; + height: 16px; + display: flex; + align-items: center; + justify-content: center; color: ${(props) => props.theme.dropdown.iconColor}; + opacity: 0.8; } &:hover:not(:disabled) { @@ -54,13 +76,39 @@ const Wrapper = styled.div` &:disabled { cursor: not-allowed; - color: gray; + opacity: 0.5; + } + + &.delete-item { + color: ${(props) => props.theme.colors.text.danger}; + .dropdown-icon { + color: ${(props) => props.theme.colors.text.danger}; + } + &:hover { + background-color: ${({ theme }) => { + const hex = theme.colors.text.danger.replace('#', ''); + const r = parseInt(hex.substring(0, 2), 16); + const g = parseInt(hex.substring(2, 4), 16); + const b = parseInt(hex.substring(4, 6), 16); + return `rgba(${r}, ${g}, ${b}, 0.04)`; // 4% opacity + }} !important; + + color: ${(props) => props.theme.colors.text.danger} !important; + } } &.border-top { border-top: solid 1px ${(props) => props.theme.dropdown.separator}; + margin-top: 0.25rem; + padding-top: 0.375rem; } } + + .dropdown-separator { + height: 1px; + background-color: ${(props) => props.theme.dropdown.separator}; + margin: 0.25rem 0; + } } } `; diff --git a/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/index.js b/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/index.js index e8240efc8..48cdaa04c 100644 --- a/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/index.js +++ b/packages/bruno-app/src/components/RequestPane/RequestBody/RequestBodyMode/index.js @@ -1,6 +1,15 @@ import React, { useRef, forwardRef } from 'react'; import get from 'lodash/get'; -import { IconCaretDown } from '@tabler/icons'; +import { + IconCaretDown, + IconForms, + IconBraces, + IconCode, + IconFileText, + IconDatabase, + IconFile, + IconX +} from '@tabler/icons'; import Dropdown from 'components/Dropdown'; import { useDispatch } from 'react-redux'; import { updateRequestBodyMode } from 'providers/ReduxStore/slices/collections'; @@ -70,7 +79,7 @@ const RequestBodyMode = ({ item, collection }) => {
} placement="bottom-end"> -
Form
+
Form
{ @@ -78,6 +87,9 @@ const RequestBodyMode = ({ item, collection }) => { onModeChange('multipartForm'); }} > + + + Multipart Form
{ onModeChange('formUrlEncoded'); }} > + + + Form URL Encoded
-
Raw
+
Raw
{ @@ -97,6 +112,9 @@ const RequestBodyMode = ({ item, collection }) => { onModeChange('json'); }} > + + + JSON
{ onModeChange('xml'); }} > + + + XML
{ onModeChange('text'); }} > + + + TEXT
{ onModeChange('sparql'); }} > + + + SPARQL
-
Other
+
Other
{ @@ -134,6 +161,9 @@ const RequestBodyMode = ({ item, collection }) => { onModeChange('file'); }} > + + + File / Binary
{ onModeChange('none'); }} > + + + No Body
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 5d5075e23..24ca66e9f 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 @@ -4,7 +4,22 @@ import range from 'lodash/range'; import filter from 'lodash/filter'; import classnames from 'classnames'; import { useDrag, useDrop } from 'react-dnd'; -import { IconChevronRight, IconDots } from '@tabler/icons'; +import { + IconChevronRight, + IconDots, + IconFilePlus, + IconFolderPlus, + IconPlayerPlay, + IconEdit, + IconCopy, + IconClipboard, + IconCode, + IconPhoto, + IconFolder, + IconTrash, + IconSettings, + IconInfoCircle +} from '@tabler/icons'; import { useSelector, useDispatch } from 'react-redux'; import { addTab, focusTab, makeTabPermanent } from 'providers/ReduxStore/slices/tabs'; import { handleCollectionItemDrop, sendRequest, showInFolder, pasteItem, saveRequest } from 'providers/ReduxStore/slices/collections/actions'; @@ -489,6 +504,18 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText })
} placement="bottom-start"> +
{ + dropdownTippyRef.current.hide(); + setItemInfoModalOpen(true); + }} + > + + + + Info +
{isFolder && ( <>
+ + + New Request
+ + + New Folder
+ + + Run
)} -
{ - dropdownTippyRef.current.hide(); - setRenameItemModalOpen(true); - }} - > - Rename -
{ @@ -536,6 +563,9 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText }) setCloneItemModalOpen(true); }} > + + + Clone
{!isFolder && ( @@ -543,6 +573,9 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText }) className="dropdown-item" onClick={handleCopyRequest} > + + + Copy
)} @@ -551,21 +584,36 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText }) className="dropdown-item" onClick={handlePasteRequest} > + + + Paste )} - {!isFolder && ( -
{ - dropdownTippyRef.current.hide(); - handleClick(null); - handleRun(); - }} - > - Run -
- )} +
{ + dropdownTippyRef.current.hide(); + setRenameItemModalOpen(true); + }} + > + + + + Rename +
+
{ + dropdownTippyRef.current.hide(); + handleShowInFolder(); + }} + > + + + + Show in Folder +
{!isFolder && (item.type === 'http-request' || item.type === 'graphql-request') && (
+ + + Generate Code
)} @@ -584,27 +635,13 @@ const CollectionItem = ({ item, collectionUid, collectionPathname, searchText }) setCreateExampleModalOpen(true); }} > + + + Create Example )} -
{ - dropdownTippyRef.current.hide(); - handleShowInFolder(); - }} - > - Show in Folder -
-
{ - dropdownTippyRef.current.hide(); - setDeleteItemModalOpen(true); - }} - > - Delete -
+
{isFolder && (
+ + + Settings
)}
{ dropdownTippyRef.current.hide(); - setItemInfoModalOpen(true); + setDeleteItemModalOpen(true); }} > - Info + + + + Delete
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 bdd3025c2..7c7a26f58 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js @@ -4,7 +4,21 @@ import classnames from 'classnames'; import { uuid } from 'utils/common'; import filter from 'lodash/filter'; import { useDrop, useDrag } from 'react-dnd'; -import { IconChevronRight, IconDots, IconLoader2 } from '@tabler/icons'; +import { + IconChevronRight, + IconDots, + IconLoader2, + IconFilePlus, + IconFolderPlus, + IconCopy, + IconClipboard, + IconPlayerPlay, + IconEdit, + IconShare, + IconFoldDown, + IconX, + IconSettings +} from '@tabler/icons'; import Dropdown from 'components/Dropdown'; import { toggleCollection, collapseFullCollection } from 'providers/ReduxStore/slices/collections'; import { mountCollection, moveCollectionAndPersist, handleCollectionItemDrop, pasteItem } from 'providers/ReduxStore/slices/collections/actions'; @@ -277,6 +291,9 @@ const Collection = ({ collection, searchText }) => { setShowNewRequestModal(true); }} > + + + New Request
{ setShowNewFolderModal(true); }} > + + + New Folder
+
{ + menuDropdownTippyRef.current.hide(); + ensureCollectionIsMounted(); + handleRun(); + }} + > + + + + Run +
{ setShowCloneCollectionModalOpen(true); }} > + + + Clone
{hasCopiedItems && ( @@ -303,19 +339,12 @@ const Collection = ({ collection, searchText }) => { className="dropdown-item" onClick={handlePasteRequest} > + + + Paste )} -
{ - menuDropdownTippyRef.current.hide(); - ensureCollectionIsMounted(); - handleRun(); - }} - > - Run -
{ @@ -323,6 +352,9 @@ const Collection = ({ collection, searchText }) => { setShowRenameCollectionModal(true); }} > + + + Rename
{ setShowShareCollectionModal(true); }} > + + + Share
{ handleCollapseFullCollection(); }} > + + + Collapse
+
+
{ + menuDropdownTippyRef.current.hide(); + viewCollectionSettings(); + }} + > + + + + Settings +
{ @@ -351,17 +402,11 @@ const Collection = ({ collection, searchText }) => { setShowRemoveCollectionModal(true); }} > + + + Close
-
{ - menuDropdownTippyRef.current.hide(); - viewCollectionSettings(); - }} - > - Settings -
diff --git a/packages/bruno-app/src/components/Sidebar/TitleBar/index.js b/packages/bruno-app/src/components/Sidebar/TitleBar/index.js index 96806e664..3cf3a5a3f 100644 --- a/packages/bruno-app/src/components/Sidebar/TitleBar/index.js +++ b/packages/bruno-app/src/components/Sidebar/TitleBar/index.js @@ -5,7 +5,7 @@ import CreateCollection from '../CreateCollection'; import ImportCollection from 'components/Sidebar/ImportCollection'; import ImportCollectionLocation from 'components/Sidebar/ImportCollectionLocation'; -import { IconDots } from '@tabler/icons'; +import { IconDots, IconPlus, IconFolder, IconDownload, IconDeviceDesktop } from '@tabler/icons'; import { useState, forwardRef, useRef } from 'react'; import { useDispatch } from 'react-redux'; import { showHomePage } from 'providers/ReduxStore/slices/app'; @@ -90,6 +90,7 @@ const TitleBar = () => {
} placement="bottom-start"> +
Collections
{ @@ -97,6 +98,9 @@ const TitleBar = () => { menuDropdownTippyRef.current.hide(); }} > + + + Create Collection
{ menuDropdownTippyRef.current.hide(); }} > - Open Collection + + + + Open
{ setImportCollectionModalOpen(true); }} > - Import Collection + + + + Import
+
API Specs
+
{ + setCreateCollectionModalOpen(true); + menuDropdownTippyRef.current.hide(); + }} + > + + + + Create Collection +
+
{ + handleOpenCollection(); + menuDropdownTippyRef.current.hide(); + }} + > + + + + Open +
+
{ @@ -124,6 +160,9 @@ const TitleBar = () => { openDevTools(); }} > + + + Devtools