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.
Add environment to the presets tab which will set the default environment on opening a collection. Show default environment inside of environment selector. Also add cli support for default environments.
Description
This is to fix #303 by adding the property called
environment
inside ofCollection > Presets
. The collection descriptor file,bruno.json
will now have the preset structure of:The preset environment will only change the environment under these conditions:
No Environment
(if its something else then it won't set the environment)In the future we can rely on something like
lastEnvironment
to override the preset environment if people set it in their preferences.Default_Environment.mp4
The environment selector now has a helpful indicator showing what the preset environment is by the yellow
(Default)
value at the end of it. Any old collections that don't have a preset environment or the environment can't be found in the current list of environments will default toNo Environment
insuring that nothing breaks.Some behavior that I need some guidance on @helloanoop, would be the formatting of
(Default)
indicator and whether to have it display next toNo Environment
if an environment preset is defined but not found. Currently I am setting it toNo Environment
in the environment selector and showing an error message on collection open when environment can't be found.Now Bruno cli will try to look for the new
![Default_Environment_cli](https://private-user-images.githubusercontent.com/115114979/285100573-d6cef6a7-2a7a-47b4-8a37-5a52d404a2dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0NjAzMDksIm5iZiI6MTcyMTQ2MDAwOSwicGF0aCI6Ii8xMTUxMTQ5NzkvMjg1MTAwNTczLWQ2Y2VmNmE3LTJhN2EtNDdiNC04YTM3LTVhNTJkNDA0YTJkYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyMFQwNzIwMDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iZGY1MmMwN2RhMzlmNTA3Nzk5ZGU4NTAwNjA1YTI4OGMzZDMwOTkwZjJjYzg1MDlkZDNhM2NjYjMwZmQyNDc5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7Othqauekl9U_HoSGkEn8rGxwXx8t-BFMwrP4u1m0vc)
environment
preset value and set it as the environment if none is given.I think this is a very helpful QOL change that will make opening and testing APIs a quick and easy process.
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.