Initial environment state system refactor
This commit is contained in:
@@ -541,7 +541,7 @@
|
||||
</SmartTab>
|
||||
|
||||
<SmartTab :id="'env'" :label="$t('environments')">
|
||||
<Environments @use-environment="useSelectedEnvironment($event)" />
|
||||
<Environments />
|
||||
</SmartTab>
|
||||
|
||||
<SmartTab :id="'notes'" :label="$t('notes')">
|
||||
@@ -1191,29 +1191,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
useSelectedEnvironment(args) {
|
||||
let environment = args.environment
|
||||
let environments = args.environments
|
||||
let preRequestScriptString = ""
|
||||
for (let variable of environment.variables) {
|
||||
preRequestScriptString += `pw.env.set('${variable.key}', '${variable.value}');\n`
|
||||
}
|
||||
for (let env of environments) {
|
||||
if (env.name === environment.name) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (env.name === "Globals" || env.name === "globals") {
|
||||
preRequestScriptString += this.useSelectedEnvironment({
|
||||
environment: env,
|
||||
environments,
|
||||
})
|
||||
}
|
||||
}
|
||||
this.preRequestScript = preRequestScriptString
|
||||
this.showPreRequestScript = true
|
||||
return preRequestScriptString
|
||||
},
|
||||
checkCollections() {
|
||||
const checkCollectionAvailability =
|
||||
this.$store.state.postwoman.collections &&
|
||||
|
||||
Reference in New Issue
Block a user