No request found in this folder.
- ) : (
-
-
- Run
- ({runLength} requests)
-
-
This will only run the requests in this folder.
-
- Recursive Run
- ({recursiveRunLength} requests)
-
-
This will run all the requests in this folder and all its subfolders.
- {isFolderLoading ?
Requests in this folder are still loading.
: null}
- {isCollectionRunInProgress ?
A Collection Run is already in progress.
: null}
+
+
+ Run
+ ({totalRequestItemsCountForFolderRun} requests)
+
+
This will only run the requests in this folder.
+
+ Recursive Run
+ ({totalRequestItemsCountForRecursiveFolderRun} requests)
+
+
This will run all the requests in this folder and all its subfolders.
+ {isFolderLoading ?
Requests in this folder are still loading.
: null}
+ {isCollectionRunInProgress ?
A Collection Run is already in progress.
: null}
- {/* Tags for the collection run */}
-
+ {/* Tags for the collection run */}
+
-
-
-
-
- {
- isCollectionRunInProgress ?
+
+
+
+
+ {
+ isCollectionRunInProgress ?
+
+
+
+ :
+ <>
-
- :
- <>
-
- onSubmit(true)}>
- Recursive Run
-
-
-
- onSubmit(false)}>
- Run
-
-
- >
- }
-
+
+ onSubmit(false)}>
+ Run
+
+
+ >
+ }
- )}
+
);
diff --git a/packages/bruno-app/src/components/TagList/index.js b/packages/bruno-app/src/components/TagList/index.js
index 3e13637f3..e683a0a41 100644
--- a/packages/bruno-app/src/components/TagList/index.js
+++ b/packages/bruno-app/src/components/TagList/index.js
@@ -41,7 +41,7 @@ const TagList = ({ tagsHintList = [], handleAddTag, tags, handleRemoveTag, onSav
{
if (!str || !str.length || !isString(str)) {
@@ -1125,3 +1126,31 @@ export const getUniqueTagsFromItems = (items = []) => {
getTags(items);
return Array.from(allTags).sort();
};
+
+
+export const getRequestItemsForCollectionRun = ({ recursive, items = [], tags }) => {
+ let requestItems = [];
+
+ if (recursive) {
+ requestItems = flattenItems(items);
+ } else {
+ each(items, (item) => {
+ if (item.request) {
+ requestItems.push(item);
+ }
+ });
+ }
+
+ const requestTypes = ['http-request', 'graphql-request'];
+ requestItems = requestItems.filter(request => requestTypes.includes(request.type));
+
+ if (tags && tags.include && tags.exclude) {
+ const includeTags = tags.include ? tags.include : [];
+ const excludeTags = tags.exclude ? tags.exclude : [];
+ requestItems = requestItems.filter(({ tags = [] }) => {
+ return isRequestTagsIncluded(tags, includeTags, excludeTags);
+ });
+ }
+
+ return requestItems;
+};
\ No newline at end of file