Show all variables as undefined when no environment is selected
This commit is contained in:
parent
3a903f28ec
commit
80fe2a33f0
@ -723,19 +723,28 @@ class RequestTabWidget(Gtk.Box):
|
||||
|
||||
def _detect_undefined_variables(self):
|
||||
"""Detect undefined variables in the current request. Returns set of undefined variable names."""
|
||||
# Only detect if environment is selected
|
||||
env = self.get_selected_environment()
|
||||
if not env:
|
||||
return set()
|
||||
from .variable_substitution import VariableSubstitution
|
||||
|
||||
# Get current request from UI
|
||||
request = self.get_request()
|
||||
|
||||
# Use VariableSubstitution to detect undefined variables
|
||||
from .variable_substitution import VariableSubstitution
|
||||
_, undefined = VariableSubstitution.substitute_request(request, env)
|
||||
# Get selected environment
|
||||
env = self.get_selected_environment()
|
||||
|
||||
return undefined
|
||||
if not env:
|
||||
# No environment selected - ALL variables are undefined
|
||||
# Find all variables in the request
|
||||
all_vars = set()
|
||||
all_vars.update(VariableSubstitution.find_variables(request.url))
|
||||
all_vars.update(VariableSubstitution.find_variables(request.body))
|
||||
for key, value in request.headers.items():
|
||||
all_vars.update(VariableSubstitution.find_variables(key))
|
||||
all_vars.update(VariableSubstitution.find_variables(value))
|
||||
return all_vars
|
||||
else:
|
||||
# Environment selected - find which variables are undefined
|
||||
_, undefined = VariableSubstitution.substitute_request(request, env)
|
||||
return undefined
|
||||
|
||||
def _schedule_indicator_update(self):
|
||||
"""Schedule an indicator update with debouncing."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user