Lint + ES6
This commit is contained in:
@@ -126,7 +126,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
editingEnvironment: function (update) {
|
||||
editingEnvironment(update) {
|
||||
this.name =
|
||||
this.$props.editingEnvironment && this.$props.editingEnvironment.name
|
||||
? this.$props.editingEnvironment.name
|
||||
@@ -151,13 +151,13 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
clearContent(e) {
|
||||
clearContent({ target }) {
|
||||
this.$store.commit("postwoman/removeVariables", [])
|
||||
e.target.innerHTML = this.doneButton
|
||||
target.innerHTML = this.doneButton
|
||||
this.$toast.info(this.$t("cleared"), {
|
||||
icon: "clear_all",
|
||||
})
|
||||
setTimeout(() => (e.target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
|
||||
setTimeout(() => (target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
|
||||
},
|
||||
addEnvironmentVariable() {
|
||||
let value = { key: "", value: "" }
|
||||
|
||||
@@ -108,8 +108,8 @@ export default {
|
||||
},
|
||||
replaceWithJSON() {
|
||||
let reader = new FileReader()
|
||||
reader.onload = (event) => {
|
||||
let content = event.target.result
|
||||
reader.onload = ({ target }) => {
|
||||
let content = target.result
|
||||
let environments = JSON.parse(content)
|
||||
this.$store.commit("postwoman/replaceEnvironments", environments)
|
||||
}
|
||||
@@ -120,8 +120,8 @@ export default {
|
||||
},
|
||||
importFromJSON() {
|
||||
let reader = new FileReader()
|
||||
reader.onload = (event) => {
|
||||
let content = event.target.result
|
||||
reader.onload = ({ target }) => {
|
||||
let content = target.result
|
||||
let importFileObj = JSON.parse(content)
|
||||
if (
|
||||
importFileObj["_postman_variable_scope"] === "environment" ||
|
||||
@@ -143,11 +143,9 @@ export default {
|
||||
confirmation,
|
||||
})
|
||||
},
|
||||
importFromPostman(importFileObj) {
|
||||
let environment = { name: importFileObj.name, variables: [] }
|
||||
importFileObj.values.forEach((element) =>
|
||||
environment.variables.push({ key: element.key, value: element.value })
|
||||
)
|
||||
importFromPostman({ name, values }) {
|
||||
let environment = { name: name, variables: [] }
|
||||
values.forEach(({ key, value }) => environment.variables.push({ key: key, value: value }))
|
||||
let environments = [environment]
|
||||
this.importFromPostwoman(environments)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user