chore: add action for inscpector and tooltip env
This commit is contained in:
@@ -125,11 +125,16 @@ const cursorTooltipField = (aggregateEnvs: AggregateEnvironment[]) =>
|
||||
invokeActionType = "modals.my.environment.edit"
|
||||
}
|
||||
|
||||
invokeAction(invokeActionType, {
|
||||
envName: tooltipEnv?.sourceEnv !== "Global" ? envName : "Global",
|
||||
variableName: parsedEnvKey,
|
||||
isSecret: tooltipEnv?.secret,
|
||||
})
|
||||
if (tooltipEnv?.sourceEnv === "RequestVariable") {
|
||||
restTabs.currentActiveTab.value.document.optionTabPreference =
|
||||
"requestVariables"
|
||||
} else {
|
||||
invokeAction(invokeActionType, {
|
||||
envName: tooltipEnv?.sourceEnv !== "Global" ? envName : "Global",
|
||||
variableName: parsedEnvKey,
|
||||
isSecret: tooltipEnv?.secret,
|
||||
})
|
||||
}
|
||||
})
|
||||
editIcon.innerHTML = `<span class="inline-flex items-center justify-center my-1">${IconEdit}</span>`
|
||||
tooltip.appendChild(editIcon)
|
||||
|
||||
@@ -154,7 +154,18 @@ export class EnvironmentInspectorService extends Service implements Inspector {
|
||||
const formattedExEnv = exEnv.slice(2, -2)
|
||||
const currentSelectedEnvironment = getCurrentEnvironment()
|
||||
|
||||
this.aggregateEnvsWithSecrets.value.forEach((env) => {
|
||||
const currentTab = this.restTabs.currentActiveTab.value
|
||||
|
||||
const environmentVariables = [
|
||||
...currentTab.document.request.requestVariables.map((env) => ({
|
||||
...env,
|
||||
secret: false,
|
||||
sourceEnv: "RequestVariable",
|
||||
})),
|
||||
...this.aggregateEnvsWithSecrets.value,
|
||||
]
|
||||
|
||||
environmentVariables.forEach((env) => {
|
||||
const hasSecretEnv = this.secretEnvs.hasSecretValue(
|
||||
env.sourceEnv !== "Global"
|
||||
? currentSelectedEnvironment.id
|
||||
@@ -208,14 +219,19 @@ export class EnvironmentInspectorService extends Service implements Inspector {
|
||||
"inspections.environment.add_environment_value"
|
||||
),
|
||||
apply: () => {
|
||||
invokeAction(invokeActionType, {
|
||||
envName:
|
||||
env.sourceEnv !== "Global"
|
||||
? currentSelectedEnvironment.name
|
||||
: "Global",
|
||||
variableName: formattedExEnv,
|
||||
isSecret: env.secret,
|
||||
})
|
||||
if (env.sourceEnv === "RequestVariable") {
|
||||
currentTab.document.optionTabPreference =
|
||||
"requestVariables"
|
||||
} else {
|
||||
invokeAction(invokeActionType, {
|
||||
envName:
|
||||
env.sourceEnv !== "Global"
|
||||
? currentSelectedEnvironment.name
|
||||
: "Global",
|
||||
variableName: formattedExEnv,
|
||||
isSecret: env.secret,
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
severity: 2,
|
||||
|
||||
Reference in New Issue
Block a user