diff --git a/packages/bruno-app/src/components/CollectionSettings/Info/StyledWrapper.js b/packages/bruno-app/src/components/CollectionSettings/Info/StyledWrapper.js new file mode 100644 index 000000000..7fd98347c --- /dev/null +++ b/packages/bruno-app/src/components/CollectionSettings/Info/StyledWrapper.js @@ -0,0 +1,13 @@ +import styled from 'styled-components'; + +const StyledWrapper = styled.div` + table { + td { + &:first-child { + width: 120px; + } + } + } +`; + +export default StyledWrapper; diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionProperties/index.js b/packages/bruno-app/src/components/CollectionSettings/Info/index.js similarity index 83% rename from packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionProperties/index.js rename to packages/bruno-app/src/components/CollectionSettings/Info/index.js index 376a88db4..15ebc80d7 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionProperties/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/Info/index.js @@ -1,5 +1,5 @@ import React from 'react'; -import Modal from 'components/Modal'; +import StyledWrapper from './StyledWrapper'; function countRequests(items) { let count = 0; @@ -20,9 +20,9 @@ function countRequests(items) { return count; } -const CollectionProperties = ({ collection, onClose }) => { +const Info = ({ collection }) => { return ( - + @@ -43,8 +43,8 @@ const CollectionProperties = ({ collection, onClose }) => {
-
+ ); }; -export default CollectionProperties; +export default Info; diff --git a/packages/bruno-app/src/components/CollectionSettings/index.js b/packages/bruno-app/src/components/CollectionSettings/index.js index f55f312a3..dbdd8d40d 100644 --- a/packages/bruno-app/src/components/CollectionSettings/index.js +++ b/packages/bruno-app/src/components/CollectionSettings/index.js @@ -14,6 +14,7 @@ import Script from './Script'; import Test from './Tests'; import Docs from './Docs'; import Presets from './Presets'; +import Info from './Info'; import StyledWrapper from './StyledWrapper'; const CollectionSettings = ({ collection }) => { @@ -103,6 +104,9 @@ const CollectionSettings = ({ collection }) => { case 'docs': { return ; } + case 'info': { + return ; + } } }; @@ -139,6 +143,9 @@ const CollectionSettings = ({ collection }) => {
setTab('docs')}> Docs
+
setTab('info')}> + Info +
{getTabPanel(tab)} diff --git a/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js b/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js index c0818c97e..ba77d47c9 100644 --- a/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js +++ b/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js @@ -42,7 +42,7 @@ const CollectionToolBar = ({ collection }) => { return (
-
+
{collection.name}
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 bf7d41d6d..dade095ed 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js @@ -2,7 +2,6 @@ import React, { useState, forwardRef, useRef, useEffect } from 'react'; import classnames from 'classnames'; import { uuid } from 'utils/common'; import filter from 'lodash/filter'; -import cloneDeep from 'lodash/cloneDeep'; import { useDrop } from 'react-dnd'; import { IconChevronRight, IconDots } from '@tabler/icons'; import Dropdown from 'components/Dropdown'; @@ -15,7 +14,6 @@ import NewFolder from 'components/Sidebar/NewFolder'; import CollectionItem from './CollectionItem'; import RemoveCollection from './RemoveCollection'; import ExportCollection from './ExportCollection'; -import CollectionProperties from './CollectionProperties'; import { doesCollectionHaveItemsMatchingSearchText } from 'utils/collections/search'; import { isItemAFolder, isItemARequest, transformCollectionToSaveToExportAsFile } from 'utils/collections'; import exportCollection from 'utils/collections/export'; @@ -29,7 +27,6 @@ const Collection = ({ collection, searchText }) => { const [showRenameCollectionModal, setShowRenameCollectionModal] = useState(false); const [showExportCollectionModal, setShowExportCollectionModal] = useState(false); const [showRemoveCollectionModal, setShowRemoveCollectionModal] = useState(false); - const [collectionPropertiesModal, setCollectionPropertiesModal] = useState(false); const [collectionIsCollapsed, setCollectionIsCollapsed] = useState(collection.collapsed); const dispatch = useDispatch(); @@ -80,9 +77,14 @@ const Collection = ({ collection, searchText }) => { } }; - const handleExportClick = () => { - const collectionCopy = cloneDeep(collection); - exportCollection(transformCollectionToSaveToExportAsFile(collectionCopy)); + const viewCollectionSettings = () => { + dispatch( + addTab({ + uid: uuid(), + collectionUid: collection.uid, + type: 'collection-settings' + }) + ); }; const [{ isOver }, drop] = useDrop({ @@ -131,9 +133,6 @@ const Collection = ({ collection, searchText }) => { {showExportCollectionModal && ( setShowExportCollectionModal(false)} /> )} - {collectionPropertiesModal && ( - setCollectionPropertiesModal(false)} /> - )}
{ className="dropdown-item" onClick={(e) => { menuDropdownTippyRef.current.hide(); - setCollectionPropertiesModal(true); + setShowRemoveCollectionModal(true); }} > - Properties + Remove
{ menuDropdownTippyRef.current.hide(); - setShowRemoveCollectionModal(true); + viewCollectionSettings(); }} > - Remove + Settings