-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Added the ignore for the collection nested folders #8725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ac0a71d
Added the ignore for the collection nested folders
ravindra-bruno 04839cf
Removed the unignored functionality for Collection folder for now
ravindra-bruno 4227c26
require path boundary in folder ignore matching to prevent prefix and…
ravindra-bruno 76f235b
fix(collection): deep-cloned bruno config before transform so ignore/…
ravindra-bruno d78f6da
Merge branch 'main' into feat/bru-3462
ravindra-bruno 0357da6
resolved the coderebbit review comments
ravindra-bruno 8322331
Merge branch 'main' into feat/bru-3462
ravindra-bruno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...rc/components/Sidebar/Collections/Collection/CollectionItem/IgnoreCollectionItem/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| import React from 'react'; | ||
| import Modal from 'components/Modal'; | ||
| import { useSelector, useDispatch } from 'react-redux'; | ||
| import { ignoreFolder, closeTabs } from 'providers/ReduxStore/slices/collections/actions'; | ||
| import { recursivelyGetAllItemUids } from 'utils/collections'; | ||
| import toast from 'react-hot-toast'; | ||
|
|
||
| const IgnoreCollectionItem = ({ onClose, item, collectionUid }) => { | ||
| const dispatch = useDispatch(); | ||
| const collection = useSelector((state) => state.collections.collections?.find((c) => c.uid === collectionUid)); | ||
| const isYamlCollection = collection?.format === 'yml' || Boolean(collection?.brunoConfig?.opencollection); | ||
| const configFileName = isYamlCollection ? 'opencollection.yml' : 'bruno.json'; | ||
|
|
||
| const onConfirm = () => { | ||
| dispatch(ignoreFolder(item.uid, collectionUid)) | ||
| .then(() => { | ||
| const tabUids = [...recursivelyGetAllItemUids(item.items), item.uid]; | ||
| dispatch(closeTabs({ tabUids })); | ||
| toast.success('Folder ignored'); | ||
| }) | ||
| .catch((error) => { | ||
| console.error('Error ignoring folder', error); | ||
| toast.error(error?.message || 'Error ignoring folder'); | ||
| }); | ||
| onClose(); | ||
| }; | ||
|
|
||
| return ( | ||
| <Modal | ||
| size="md" | ||
| title="Ignore Folder" | ||
| confirmText="Ignore" | ||
| handleConfirm={onConfirm} | ||
| handleCancel={onClose} | ||
| > | ||
| Ignoring <span className="font-medium">{item.name}</span> will hide it from this | ||
| {' '} | ||
| {isYamlCollection ? 'opencollection (YAML)' : 'Bruno (JSON)'} | ||
| {' '} | ||
| collection by adding it to the | ||
| {' '} | ||
| <span className="font-medium">ignore</span> | ||
| {' '} | ||
| list in | ||
| {' '} | ||
| <span className="font-medium">{configFileName}</span> | ||
| . The folder and its files are not deleted. To restore it later, remove the entry from the | ||
| {' '} | ||
| <span className="font-medium">ignore</span> | ||
| {' '} | ||
| list in | ||
| {' '} | ||
| <span className="font-medium">{configFileName}</span> | ||
| . | ||
| </Modal> | ||
| ); | ||
| }; | ||
|
|
||
| export default IgnoreCollectionItem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.