fix: postman env variables are to be imported as secrets (#4474)
Co-authored-by: Shoban <mshobanr@ford.com> Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
@@ -36,6 +36,7 @@ import { TeamEnvironment } from "~/helpers/teams/TeamEnvironment"
|
||||
import { computed } from "vue"
|
||||
import { useReadonlyStream } from "~/composables/stream"
|
||||
import { initializeDownloadFile } from "~/helpers/import-export/export"
|
||||
import { transformEnvironmentVariables } from "~/helpers/import-export/export/environment"
|
||||
import { environmentsExporter } from "~/helpers/import-export/export/environments"
|
||||
import { gistExporter } from "~/helpers/import-export/export/gist"
|
||||
import { platform } from "~/platform"
|
||||
@@ -73,10 +74,12 @@ const isTeamEnvironment = computed(() => {
|
||||
|
||||
const environmentJson = computed(() => {
|
||||
if (isTeamEnvironment.value && props.teamEnvironments) {
|
||||
return props.teamEnvironments.map((x) => x.environment)
|
||||
return props.teamEnvironments.map(({ environment }) =>
|
||||
transformEnvironmentVariables(environment)
|
||||
)
|
||||
}
|
||||
|
||||
return myEnvironments.value
|
||||
return myEnvironments.value.map(transformEnvironmentVariables)
|
||||
})
|
||||
|
||||
const workspaceType = computed(() =>
|
||||
|
||||
@@ -352,12 +352,15 @@ watch(
|
||||
env: {
|
||||
key: e.key,
|
||||
value: e.secret
|
||||
? (secretEnvironmentService.getSecretEnvironmentVariable(
|
||||
? secretEnvironmentService.getSecretEnvironmentVariable(
|
||||
props.editingEnvironmentIndex === "Global"
|
||||
? "Global"
|
||||
: workingEnvID.value,
|
||||
index
|
||||
)?.value ?? "")
|
||||
)?.value ??
|
||||
// @ts-expect-error `value` field can exist for secret environment variables as inferred while importing
|
||||
e.value ??
|
||||
""
|
||||
: e.value,
|
||||
secret: e.secret,
|
||||
},
|
||||
|
||||
@@ -311,10 +311,13 @@ watch(
|
||||
env: {
|
||||
key: e.key,
|
||||
value: e.secret
|
||||
? (secretEnvironmentService.getSecretEnvironmentVariable(
|
||||
? secretEnvironmentService.getSecretEnvironmentVariable(
|
||||
editingID.value ?? "",
|
||||
index
|
||||
)?.value ?? "")
|
||||
)?.value ??
|
||||
// @ts-expect-error `value` field can exist for secret environment variables as inferred while importing
|
||||
e.value ??
|
||||
""
|
||||
: e.value,
|
||||
secret: e.secret,
|
||||
},
|
||||
@@ -352,10 +355,6 @@ const removeEnvironmentVariable = (id: number) => {
|
||||
const isLoading = ref(false)
|
||||
|
||||
const saveEnvironment = async () => {
|
||||
if (isLoading.value) {
|
||||
return
|
||||
}
|
||||
|
||||
isLoading.value = true
|
||||
|
||||
if (!editingName.value) {
|
||||
|
||||
Reference in New Issue
Block a user