Commit code with double quotes instead of single quotes
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
<div class="flex-wrap">
|
||||
<h3 class="title">{{ $t('new_environment') }}</h3>
|
||||
<h3 class="title">{{ $t("new_environment") }}</h3>
|
||||
<div>
|
||||
<button class="icon" @click="hideModal">
|
||||
<i class="material-icons">close</i>
|
||||
@@ -31,10 +31,10 @@
|
||||
<span></span>
|
||||
<span>
|
||||
<button class="icon" @click="hideModal">
|
||||
{{ $t('cancel') }}
|
||||
{{ $t("cancel") }}
|
||||
</button>
|
||||
<button class="icon primary" @click="addNewEnvironment">
|
||||
{{ $t('save') }}
|
||||
{{ $t("save") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -43,14 +43,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { fb } from '../../functions/fb'
|
||||
import { fb } from "../../functions/fb"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
show: Boolean,
|
||||
},
|
||||
components: {
|
||||
modal: () => import('../../components/modal'),
|
||||
modal: () => import("../../components/modal"),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
},
|
||||
addNewEnvironment() {
|
||||
if (!this.$data.name) {
|
||||
this.$toast.info(this.$t('invalid_environment_name'))
|
||||
this.$toast.info(this.$t("invalid_environment_name"))
|
||||
return
|
||||
}
|
||||
let newEnvironment = [
|
||||
@@ -76,16 +76,16 @@ export default {
|
||||
variables: [],
|
||||
},
|
||||
]
|
||||
this.$store.commit('postwoman/importAddEnvironments', {
|
||||
this.$store.commit("postwoman/importAddEnvironments", {
|
||||
environments: newEnvironment,
|
||||
confirmation: 'Environment added',
|
||||
confirmation: "Environment added",
|
||||
})
|
||||
this.$emit('hide-modal')
|
||||
this.$emit("hide-modal")
|
||||
this.syncEnvironments()
|
||||
},
|
||||
hideModal() {
|
||||
this.$data.name = undefined
|
||||
this.$emit('hide-modal')
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
<div class="flex-wrap">
|
||||
<h3 class="title">{{ $t('edit_environment') }}</h3>
|
||||
<h3 class="title">{{ $t("edit_environment") }}</h3>
|
||||
<div>
|
||||
<button class="icon" @click="hideModal">
|
||||
<i class="material-icons">close</i>
|
||||
@@ -28,7 +28,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
<div class="flex-wrap">
|
||||
<label for="variableList">{{ $t('env_variable_list') }}</label>
|
||||
<label for="variableList">{{ $t("env_variable_list") }}</label>
|
||||
<div>
|
||||
<button class="icon" @click="clearContent($event)" v-tooltip.bottom="$t('clear')">
|
||||
<i class="material-icons">clear_all</i>
|
||||
@@ -92,7 +92,7 @@
|
||||
<li>
|
||||
<button class="icon" @click="addEnvironmentVariable">
|
||||
<i class="material-icons">add</i>
|
||||
<span>{{ $t('add_new') }}</span>
|
||||
<span>{{ $t("add_new") }}</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -102,10 +102,10 @@
|
||||
<span></span>
|
||||
<span>
|
||||
<button class="icon" @click="hideModal">
|
||||
{{ $t('cancel') }}
|
||||
{{ $t("cancel") }}
|
||||
</button>
|
||||
<button class="icon primary" @click="saveEnvironment">
|
||||
{{ $t('save') }}
|
||||
{{ $t("save") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import textareaAutoHeight from '../../directives/textareaAutoHeight'
|
||||
import textareaAutoHeight from "../../directives/textareaAutoHeight"
|
||||
|
||||
export default {
|
||||
directives: {
|
||||
@@ -126,7 +126,7 @@ export default {
|
||||
editingEnvironmentIndex: Number,
|
||||
},
|
||||
components: {
|
||||
modal: () => import('../../components/modal'),
|
||||
modal: () => import("../../components/modal"),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
this.$props.editingEnvironment && this.$props.editingEnvironment.name
|
||||
? this.$props.editingEnvironment.name
|
||||
: undefined
|
||||
this.$store.commit('postwoman/setEditingEnvironment', this.$props.editingEnvironment)
|
||||
this.$store.commit("postwoman/setEditingEnvironment", this.$props.editingEnvironment)
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
@@ -148,21 +148,21 @@ export default {
|
||||
},
|
||||
variableString() {
|
||||
const result = this.editingEnvCopy.variables
|
||||
return result === '' ? '' : JSON.stringify(result)
|
||||
return result === "" ? "" : JSON.stringify(result)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearContent(e) {
|
||||
this.$store.commit('postwoman/removeVariables', [])
|
||||
this.$store.commit("postwoman/removeVariables", [])
|
||||
e.target.innerHTML = this.doneButton
|
||||
this.$toast.info(this.$t('cleared'), {
|
||||
icon: 'clear_all',
|
||||
this.$toast.info(this.$t("cleared"), {
|
||||
icon: "clear_all",
|
||||
})
|
||||
setTimeout(() => (e.target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
|
||||
},
|
||||
addEnvironmentVariable() {
|
||||
let value = { key: '', value: '' }
|
||||
this.$store.commit('postwoman/addVariable', value)
|
||||
let value = { key: "", value: "" }
|
||||
this.$store.commit("postwoman/addVariable", value)
|
||||
},
|
||||
removeEnvironmentVariable(index) {
|
||||
let variableIndex = index
|
||||
@@ -171,13 +171,13 @@ export default {
|
||||
(variable, index) => variableIndex !== index
|
||||
)
|
||||
|
||||
this.$store.commit('postwoman/removeVariable', newVariables)
|
||||
this.$toast.error(this.$t('deleted'), {
|
||||
icon: 'delete',
|
||||
this.$store.commit("postwoman/removeVariable", newVariables)
|
||||
this.$toast.error(this.$t("deleted"), {
|
||||
icon: "delete",
|
||||
action: {
|
||||
text: this.$t('undo'),
|
||||
text: this.$t("undo"),
|
||||
onClick: (e, toastObject) => {
|
||||
this.$store.commit('postwoman/removeVariable', oldVariables)
|
||||
this.$store.commit("postwoman/removeVariable", oldVariables)
|
||||
toastObject.remove()
|
||||
},
|
||||
},
|
||||
@@ -185,22 +185,22 @@ export default {
|
||||
},
|
||||
saveEnvironment() {
|
||||
if (!this.$data.name) {
|
||||
this.$toast.info(this.$t('invalid_environment_name'))
|
||||
this.$toast.info(this.$t("invalid_environment_name"))
|
||||
return
|
||||
}
|
||||
const environmentUpdated = {
|
||||
...this.editingEnvCopy,
|
||||
name: this.$data.name,
|
||||
}
|
||||
this.$store.commit('postwoman/saveEnvironment', {
|
||||
this.$store.commit("postwoman/saveEnvironment", {
|
||||
environment: environmentUpdated,
|
||||
environmentIndex: this.$props.editingEnvironmentIndex,
|
||||
})
|
||||
this.$emit('hide-modal')
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
hideModal() {
|
||||
this.$data.name = undefined
|
||||
this.$emit('hide-modal')
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
<div>
|
||||
<button class="icon" @click="$emit('edit-environment')" v-close-popover>
|
||||
<i class="material-icons">create</i>
|
||||
<span>{{ $t('edit') }}</span>
|
||||
<span>{{ $t("edit") }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="icon" @click="removeEnvironment" v-close-popover>
|
||||
<i class="material-icons">delete</i>
|
||||
<span>{{ $t('delete') }}</span>
|
||||
<span>{{ $t("delete") }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -49,8 +49,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
removeEnvironment() {
|
||||
if (!confirm('Are you sure you want to remove this environment?')) return
|
||||
this.$store.commit('postwoman/removeEnvironment', this.environmentIndex)
|
||||
if (!confirm("Are you sure you want to remove this environment?")) return
|
||||
this.$store.commit("postwoman/removeEnvironment", this.environmentIndex)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
>
|
||||
<button :disabled="!fb.currentUser" class="icon" @click="syncEnvironments">
|
||||
<i class="material-icons">folder_shared</i>
|
||||
<span>{{ $t('import_from_sync') }}</span>
|
||||
<span>{{ $t("import_from_sync") }}</span>
|
||||
</button>
|
||||
</span>
|
||||
<button
|
||||
@@ -28,7 +28,7 @@
|
||||
v-tooltip="$t('replace_current')"
|
||||
>
|
||||
<i class="material-icons">create_new_folder</i>
|
||||
<span>{{ $t('replace_json') }}</span>
|
||||
<span>{{ $t("replace_json") }}</span>
|
||||
<input
|
||||
type="file"
|
||||
@change="replaceWithJSON"
|
||||
@@ -43,7 +43,7 @@
|
||||
v-tooltip="$t('preserve_current')"
|
||||
>
|
||||
<i class="material-icons">folder_special</i>
|
||||
<span>{{ $t('import_json') }}</span>
|
||||
<span>{{ $t("import_json") }}</span>
|
||||
<input
|
||||
type="file"
|
||||
@change="importFromJSON"
|
||||
@@ -64,10 +64,10 @@
|
||||
<span></span>
|
||||
<span>
|
||||
<button class="icon" @click="hideModal">
|
||||
{{ $t('cancel') }}
|
||||
{{ $t("cancel") }}
|
||||
</button>
|
||||
<button class="icon primary" @click="exportJSON" v-tooltip="$t('download_file')">
|
||||
{{ $t('export') }}
|
||||
{{ $t("export") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
@@ -76,7 +76,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { fb } from '../../functions/fb'
|
||||
import { fb } from "../../functions/fb"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
show: Boolean,
|
||||
},
|
||||
components: {
|
||||
modal: () => import('../../components/modal'),
|
||||
modal: () => import("../../components/modal"),
|
||||
},
|
||||
computed: {
|
||||
environmentJson() {
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
hideModal() {
|
||||
this.$emit('hide-modal')
|
||||
this.$emit("hide-modal")
|
||||
},
|
||||
openDialogChooseFileToReplaceWith() {
|
||||
this.$refs.inputChooseFileToReplaceWith.click()
|
||||
@@ -110,7 +110,7 @@ export default {
|
||||
reader.onload = event => {
|
||||
let content = event.target.result
|
||||
let environments = JSON.parse(content)
|
||||
this.$store.commit('postwoman/replaceEnvironments', environments)
|
||||
this.$store.commit("postwoman/replaceEnvironments", environments)
|
||||
}
|
||||
reader.readAsText(this.$refs.inputChooseFileToReplaceWith.files[0])
|
||||
this.fileImported()
|
||||
@@ -120,8 +120,8 @@ export default {
|
||||
reader.onload = event => {
|
||||
let content = event.target.result
|
||||
let environments = JSON.parse(content)
|
||||
let confirmation = this.$t('file_imported')
|
||||
this.$store.commit('postwoman/importAddEnvironments', {
|
||||
let confirmation = this.$t("file_imported")
|
||||
this.$store.commit("postwoman/importAddEnvironments", {
|
||||
environments,
|
||||
confirmation,
|
||||
})
|
||||
@@ -130,29 +130,29 @@ export default {
|
||||
},
|
||||
exportJSON() {
|
||||
let text = this.environmentJson
|
||||
text = text.replace(/\n/g, '\r\n')
|
||||
text = text.replace(/\n/g, "\r\n")
|
||||
let blob = new Blob([text], {
|
||||
type: 'text/json',
|
||||
type: "text/json",
|
||||
})
|
||||
let anchor = document.createElement('a')
|
||||
anchor.download = 'postwoman-environment.json'
|
||||
let anchor = document.createElement("a")
|
||||
anchor.download = "postwoman-environment.json"
|
||||
anchor.href = window.URL.createObjectURL(blob)
|
||||
anchor.target = '_blank'
|
||||
anchor.style.display = 'none'
|
||||
anchor.target = "_blank"
|
||||
anchor.style.display = "none"
|
||||
document.body.appendChild(anchor)
|
||||
anchor.click()
|
||||
document.body.removeChild(anchor)
|
||||
this.$toast.success(this.$t('download_started'), {
|
||||
icon: 'done',
|
||||
this.$toast.success(this.$t("download_started"), {
|
||||
icon: "done",
|
||||
})
|
||||
},
|
||||
syncEnvironments() {
|
||||
this.$store.commit('postwoman/replaceEnvironments', fb.currentEnvironments)
|
||||
this.$store.commit("postwoman/replaceEnvironments", fb.currentEnvironments)
|
||||
this.fileImported()
|
||||
},
|
||||
fileImported() {
|
||||
this.$toast.info(this.$t('file_imported'), {
|
||||
icon: 'folder_shared',
|
||||
this.$toast.info(this.$t("file_imported"), {
|
||||
icon: "folder_shared",
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<div>
|
||||
<button class="icon" @click="displayModalAdd(true)">
|
||||
<i class="material-icons">add</i>
|
||||
<span>{{ $t('new') }}</span>
|
||||
<span>{{ $t("new") }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="icon" @click="displayModalImportExport(true)">
|
||||
{{ $t('import_export') }}
|
||||
{{ $t("import_export") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,8 +62,8 @@ ul {
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import environment from './environment'
|
||||
import { fb } from '../../functions/fb'
|
||||
import environment from "./environment"
|
||||
import { fb } from "../../functions/fb"
|
||||
|
||||
const updateOnLocalStorage = (propertyName, property) =>
|
||||
window.localStorage.setItem(propertyName, JSON.stringify(property))
|
||||
@@ -71,11 +71,11 @@ const updateOnLocalStorage = (propertyName, property) =>
|
||||
export default {
|
||||
components: {
|
||||
environment,
|
||||
'pw-section': () => import('../section'),
|
||||
addEnvironment: () => import('./addEnvironment'),
|
||||
editEnvironment: () => import('./editEnvironment'),
|
||||
importExportEnvironment: () => import('./importExportEnvironment'),
|
||||
VirtualList: () => import('vue-virtual-scroll-list'),
|
||||
"pw-section": () => import("../section"),
|
||||
addEnvironment: () => import("./addEnvironment"),
|
||||
editEnvironment: () => import("./editEnvironment"),
|
||||
importExportEnvironment: () => import("./importExportEnvironment"),
|
||||
VirtualList: () => import("vue-virtual-scroll-list"),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -93,12 +93,12 @@ export default {
|
||||
},
|
||||
async mounted() {
|
||||
this._keyListener = function(e) {
|
||||
if (e.key === 'Escape') {
|
||||
if (e.key === "Escape") {
|
||||
e.preventDefault()
|
||||
this.showModalImportExport = false
|
||||
}
|
||||
}
|
||||
document.addEventListener('keydown', this._keyListener.bind(this))
|
||||
document.addEventListener("keydown", this._keyListener.bind(this))
|
||||
},
|
||||
methods: {
|
||||
displayModalAdd(shouldDisplay) {
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.removeEventListener('keydown', this._keyListener)
|
||||
document.removeEventListener("keydown", this._keyListener)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user