-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
refactor: combine add and edit environment modals #2131
Conversation
👷 Deploy request for hoppscotch pending review. 🔨 Explore the source changes: abf5524 |
fd76bd0
to
9b2a873
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is now an issue with saving an environment
Steps to reproduce
- Create an environment and add some variables.
- Save the environment
- Now click on the newly created environment to edit it.
- Observe that the environment variables not appearing.
@AndrewBastin I am really out of it these days, huh |
9b2a873
to
c72e956
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor correction and then one missed implementation.
Steps to reproduce:
- Disable any active environment selection (set to no environment)
- Create a REST Request, add a pre-request script with the given content
pw.env.set("x", "y");
- Execute the request.
The execution will lead to the assignment of the variable to environment, but since none is selected, there should be an alert in the "Test Results" tab asking what to do with it. If we selected, Create Environment there, it opens up the Edit Environment Modal but without proper configuration (It shows "Edit" instead of "New", it doesn't populate the environment configuration that will be added etc.)
85fa072
to
5e84655
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be cool if on clicking "Create New Envrionment" from Test Result Alert, it fills up the environment variables the Test Results have found out onto the modal.
One thing I find inconsistent is the
|
@kyteinsky Yup, that is an interesting observation. @liyasthomas, did you miss the code to make sure changes to the global only not trigger that alert box ? |
I guess this is the expected behavior. If you don't select any environment, we'll prompt you to add the new variable to either "Global" or "Create new environment". |
@liyasthomas ahh gotcha. that situation is handled, I thought @kyteinsky was talking (I misread) about Global updations (which we do ignore, I verified just now). @kyteinsky, if you change the key, that is considered a new key. Global variables are kinda transparent and affects all the requests, in order to prevent the user absolutely not knowing about it, unlike an environment variable being set, all ways of creating Global Variables are intentionally explicit (requiring user's consent). Selecting no environment doesn't mean Global is the executing environment, it doesn't have the same behaviors as a regular environment. There is always an affinity to the executing environment for making changes. So the behavior you brought up is intentional |
Oh okay. It just seemed a bit queer to me that this happened. If that is the expected behaviour, then there's no issue. Although, imo replacing |
Ahh, |
I see. Now everything seems to come together. The way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💯
@liyasthomas a final check pass ?
abf5524
to
7600fb7
Compare
Description
Combines add and edit modals for ease of use.
@liyasthomas @AndrewBastin
Please check if the PR does what it needs to.