chore: lint
This commit is contained in:
@@ -22,7 +22,18 @@
|
||||
href="https://appwrite.io/?utm_source=hoppscotch&utm_medium=banner&utm_campaign=hello"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="inline-flex items-center px-4 py-2 mx-4 font-mono text-sm rounded-md bg-bgDarkColor hide-on-small-screen"
|
||||
class="
|
||||
inline-flex
|
||||
items-center
|
||||
px-4
|
||||
py-2
|
||||
mx-4
|
||||
font-mono
|
||||
text-sm
|
||||
rounded-md
|
||||
bg-bgDarkColor
|
||||
hide-on-small-screen
|
||||
"
|
||||
>
|
||||
Appwrite - Open-Source Backend as a Service
|
||||
<img class="w-8 ml-2" src="~assets/images/appwrite-icon.svg" alt="Appwrite" />
|
||||
@@ -301,8 +312,7 @@ export default {
|
||||
navigator
|
||||
.share({
|
||||
title: "Hoppscotch",
|
||||
text:
|
||||
"Hoppscotch • Open source API development ecosystem - Helps you create requests faster, saving precious time on development.",
|
||||
text: "Hoppscotch • Open source API development ecosystem - Helps you create requests faster, saving precious time on development.",
|
||||
url: "https://hoppscotch.io",
|
||||
})
|
||||
.then(() => {})
|
||||
|
||||
@@ -162,7 +162,13 @@ export default {
|
||||
this._keyListener = function (e) {
|
||||
if (e.key === "Escape") {
|
||||
e.preventDefault()
|
||||
this.showModalAdd = this.showModalEdit = this.showModalImportExport = this.showModalAddFolder = this.showModalEditFolder = this.showModalEditRequest = false
|
||||
this.showModalAdd =
|
||||
this.showModalEdit =
|
||||
this.showModalImportExport =
|
||||
this.showModalAddFolder =
|
||||
this.showModalEditFolder =
|
||||
this.showModalEditRequest =
|
||||
false
|
||||
}
|
||||
}
|
||||
document.addEventListener("keydown", this._keyListener.bind(this))
|
||||
|
||||
@@ -275,7 +275,13 @@ export default {
|
||||
this._keyListener = function (e) {
|
||||
if (e.key === "Escape") {
|
||||
e.preventDefault()
|
||||
this.showModalAdd = this.showModalEdit = this.showModalImportExport = this.showModalAddFolder = this.showModalEditFolder = this.showModalEditRequest = false
|
||||
this.showModalAdd =
|
||||
this.showModalEdit =
|
||||
this.showModalImportExport =
|
||||
this.showModalAddFolder =
|
||||
this.showModalEditFolder =
|
||||
this.showModalEditRequest =
|
||||
false
|
||||
}
|
||||
}
|
||||
document.addEventListener("keydown", this._keyListener.bind(this))
|
||||
@@ -579,7 +585,7 @@ export default {
|
||||
.mutate({
|
||||
// Query
|
||||
mutation: gql`
|
||||
mutation($collectionID: String!) {
|
||||
mutation ($collectionID: String!) {
|
||||
deleteCollection(collectionID: $collectionID)
|
||||
}
|
||||
`,
|
||||
|
||||
@@ -194,7 +194,6 @@ export default {
|
||||
this.$emit("select", {
|
||||
picked: {
|
||||
pickedType: "my-collection",
|
||||
|
||||
collectionIndex: this.collectionIndex,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -176,7 +176,6 @@ export default {
|
||||
this.$emit("select", {
|
||||
picked: {
|
||||
pickedType: "my-folder",
|
||||
|
||||
collectionIndex: this.collectionIndex,
|
||||
folderName: this.folder.name,
|
||||
folderPath: this.folderPath,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@click="!doc ? selectRequest() : {}"
|
||||
v-tooltip="!doc ? $t('use_request') : ''"
|
||||
>
|
||||
<i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
|
||||
<i v-if="isSelected" class="mx-3 text-green-400 material-icons">check_circle</i>
|
||||
|
||||
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
||||
<span>{{ request.name }}</span>
|
||||
@@ -104,7 +104,6 @@ export default {
|
||||
this.$emit("select", {
|
||||
picked: {
|
||||
pickedType: "my-request",
|
||||
|
||||
collectionIndex: this.collectionIndex,
|
||||
folderPath: this.folderPath,
|
||||
folderName: this.folderName,
|
||||
|
||||
@@ -183,7 +183,6 @@ export default {
|
||||
this.$emit("select", {
|
||||
picked: {
|
||||
pickedType: "teams-collection",
|
||||
|
||||
collectionID: this.collection.id,
|
||||
},
|
||||
})
|
||||
@@ -193,7 +192,6 @@ export default {
|
||||
this.$emit("select", {
|
||||
picked: {
|
||||
pickedType: "teams-collection",
|
||||
|
||||
collectionID: this.collection.id,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -164,7 +164,6 @@ export default {
|
||||
this.$emit("select", {
|
||||
picked: {
|
||||
pickedType: "teams-folder",
|
||||
|
||||
folderID: this.folder.id,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
@click="!doc ? selectRequest() : {}"
|
||||
v-tooltip="!doc ? $t('use_request') : ''"
|
||||
>
|
||||
<i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
|
||||
<i v-if="isSelected" class="mx-3 text-green-400 material-icons">check_circle</i>
|
||||
|
||||
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
||||
<span>{{ request.name }}</span>
|
||||
@@ -102,6 +102,7 @@ export default {
|
||||
requestID: this.requestIndex,
|
||||
},
|
||||
})
|
||||
else this.$store.commit("postwoman/selectRequest", { request: this.request })
|
||||
},
|
||||
removeRequest() {
|
||||
this.$emit("remove-request", {
|
||||
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
},
|
||||
subscriptions() {
|
||||
return {
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -30,7 +30,14 @@
|
||||
<ul
|
||||
v-for="(variable, index) in this.editingEnvCopy.variables"
|
||||
:key="index"
|
||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
||||
class="
|
||||
border-b border-dashed
|
||||
divide-y
|
||||
md:divide-x
|
||||
border-brdColor
|
||||
divide-dashed divide-brdColor
|
||||
md:divide-y-0
|
||||
"
|
||||
:class="{ 'border-t': index == 0 }"
|
||||
>
|
||||
<li>
|
||||
@@ -118,7 +125,7 @@ export default {
|
||||
},
|
||||
subscriptions() {
|
||||
return {
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -52,7 +52,7 @@ export default {
|
||||
},
|
||||
subscriptions() {
|
||||
return {
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
},
|
||||
subscriptions() {
|
||||
return {
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
||||
@@ -17,7 +17,18 @@
|
||||
{{ gqlField.description }}
|
||||
</div>
|
||||
<div
|
||||
class="inline-block px-4 py-2 my-2 text-sm font-bold text-black bg-yellow-200 rounded-lg field-deprecated"
|
||||
class="
|
||||
inline-block
|
||||
px-4
|
||||
py-2
|
||||
my-2
|
||||
text-sm
|
||||
font-bold
|
||||
text-black
|
||||
bg-yellow-200
|
||||
rounded-lg
|
||||
field-deprecated
|
||||
"
|
||||
v-if="gqlField.isDeprecated"
|
||||
>
|
||||
{{ $t("deprecated") }}
|
||||
|
||||
@@ -19,7 +19,14 @@
|
||||
<ul
|
||||
v-for="(param, index) in bodyParams"
|
||||
:key="index"
|
||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
||||
class="
|
||||
border-b border-dashed
|
||||
divide-y
|
||||
md:divide-x
|
||||
border-brdColor
|
||||
divide-dashed divide-brdColor
|
||||
md:divide-y-0
|
||||
"
|
||||
:class="{ 'border-t': index == 0 }"
|
||||
>
|
||||
<li>
|
||||
@@ -60,7 +67,7 @@
|
||||
<li>
|
||||
<button
|
||||
class="icon"
|
||||
@click="toggleActive(index,param)"
|
||||
@click="toggleActive(index, param)"
|
||||
v-tooltip.bottom="{
|
||||
content: param.hasOwnProperty('active')
|
||||
? param.active
|
||||
@@ -148,8 +155,10 @@ export default {
|
||||
this.$emit("set-route-query-state")
|
||||
},
|
||||
removeRequestBodyParam(index) {
|
||||
const paramArr = this.$store.state.request.bodyParams
|
||||
.filter((item, itemIndex) => itemIndex !== index && (item.hasOwnProperty("active") ? item.active == true : true))
|
||||
const paramArr = this.$store.state.request.bodyParams.filter(
|
||||
(item, itemIndex) =>
|
||||
itemIndex !== index && (item.hasOwnProperty("active") ? item.active == true : true)
|
||||
)
|
||||
this.setRawParams(paramArr)
|
||||
this.$emit("remove-request-body-param", index)
|
||||
},
|
||||
@@ -174,44 +183,44 @@ export default {
|
||||
fileIndex,
|
||||
})
|
||||
},
|
||||
updateBodyParams(event, index, type){
|
||||
updateBodyParams(event, index, type) {
|
||||
this.$store.commit(type, {
|
||||
index,
|
||||
value: event.target.value,
|
||||
})
|
||||
let paramArr = this.$store.state.request.bodyParams
|
||||
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
||||
|
||||
this.setRawParams(paramArr)
|
||||
},
|
||||
toggleActive(index, param){
|
||||
let paramArr = this.$store.state.request.bodyParams
|
||||
.filter((item, itemIndex) => {
|
||||
if(index === itemIndex){
|
||||
return !param.active
|
||||
} else {
|
||||
return item.hasOwnProperty("active") ? item.active == true : true
|
||||
}
|
||||
})
|
||||
|
||||
this.setRawParams(paramArr)
|
||||
let paramArr = this.$store.state.request.bodyParams.filter((item) =>
|
||||
item.hasOwnProperty("active") ? item.active == true : true
|
||||
)
|
||||
|
||||
this.$store.commit('setActiveBodyParams', {
|
||||
index,
|
||||
value: param.hasOwnProperty('active') ? !param.active : false,
|
||||
})
|
||||
this.setRawParams(paramArr)
|
||||
},
|
||||
setRawParams(filteredParamArr){
|
||||
let rawParams = {}
|
||||
filteredParamArr.forEach(_param=>{
|
||||
rawParams={
|
||||
...rawParams,
|
||||
[_param.key]:_param.value
|
||||
toggleActive(index, param) {
|
||||
let paramArr = this.$store.state.request.bodyParams.filter((item, itemIndex) => {
|
||||
if (index === itemIndex) {
|
||||
return !param.active
|
||||
} else {
|
||||
return item.hasOwnProperty("active") ? item.active == true : true
|
||||
}
|
||||
})
|
||||
const rawParamsStr = JSON.stringify(rawParams,null,2)
|
||||
|
||||
this.setRawParams(paramArr)
|
||||
|
||||
this.$store.commit("setActiveBodyParams", {
|
||||
index,
|
||||
value: param.hasOwnProperty("active") ? !param.active : false,
|
||||
})
|
||||
},
|
||||
setRawParams(filteredParamArr) {
|
||||
let rawParams = {}
|
||||
filteredParamArr.forEach((_param) => {
|
||||
rawParams = {
|
||||
...rawParams,
|
||||
[_param.key]: _param.value,
|
||||
}
|
||||
})
|
||||
const rawParamsStr = JSON.stringify(rawParams, null, 2)
|
||||
this.$store.commit("setState", { value: rawParamsStr, attribute: "rawParams" })
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
contentType() {
|
||||
|
||||
@@ -19,7 +19,14 @@
|
||||
<ul
|
||||
v-for="(header, index) in headers"
|
||||
:key="`${header.value}_${index}`"
|
||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
||||
class="
|
||||
border-b border-dashed
|
||||
divide-y
|
||||
md:divide-x
|
||||
border-brdColor
|
||||
divide-dashed divide-brdColor
|
||||
md:divide-y-0
|
||||
"
|
||||
:class="{ 'border-t': index == 0 }"
|
||||
>
|
||||
<li>
|
||||
|
||||
@@ -19,7 +19,14 @@
|
||||
<ul
|
||||
v-for="(param, index) in params"
|
||||
:key="index"
|
||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
||||
class="
|
||||
border-b border-dashed
|
||||
divide-y
|
||||
md:divide-x
|
||||
border-brdColor
|
||||
divide-dashed divide-brdColor
|
||||
md:divide-y-0
|
||||
"
|
||||
:class="{ 'border-t': index == 0 }"
|
||||
>
|
||||
<li>
|
||||
|
||||
@@ -71,7 +71,14 @@
|
||||
<ul
|
||||
v-for="(input, index) of communication.inputs"
|
||||
:key="`input-${index}`"
|
||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
||||
class="
|
||||
border-b border-dashed
|
||||
divide-y
|
||||
md:divide-x
|
||||
border-brdColor
|
||||
divide-dashed divide-brdColor
|
||||
md:divide-y-0
|
||||
"
|
||||
:class="{ 'border-t': index == 0 }"
|
||||
>
|
||||
<li>
|
||||
|
||||
@@ -15,7 +15,20 @@
|
||||
v-for="(color, index) of accentColors"
|
||||
:key="`color-${index}`"
|
||||
v-tooltip="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
|
||||
class="inline-flex items-center justify-center p-3 m-2 transition duration-150 ease-in-out bg-transparent rounded-full cursor-pointer hover:shadow-none"
|
||||
class="
|
||||
inline-flex
|
||||
items-center
|
||||
justify-center
|
||||
p-3
|
||||
m-2
|
||||
transition
|
||||
duration-150
|
||||
ease-in-out
|
||||
bg-transparent
|
||||
rounded-full
|
||||
cursor-pointer
|
||||
hover:shadow-none
|
||||
"
|
||||
:class="[`text-${color}-400`, { 'bg-actColor': color === active }]"
|
||||
@click="setActiveColor(color)"
|
||||
>
|
||||
|
||||
@@ -176,9 +176,8 @@ export default {
|
||||
break
|
||||
|
||||
case "Tab":
|
||||
let activeSuggestion = this.suggestions[
|
||||
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
||||
]
|
||||
let activeSuggestion =
|
||||
this.suggestions[this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0]
|
||||
|
||||
if (!activeSuggestion) {
|
||||
return
|
||||
|
||||
@@ -14,7 +14,23 @@
|
||||
v-for="(color, index) of colors"
|
||||
:key="`color-${index}`"
|
||||
v-tooltip="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
|
||||
class="inline-flex items-center justify-center p-3 m-2 transition duration-150 ease-in-out bg-transparent rounded-full cursor-pointer border-collapseer-2 text-fgLightColor hover:text-fgColor hover:shadow-none"
|
||||
class="
|
||||
inline-flex
|
||||
items-center
|
||||
justify-center
|
||||
p-3
|
||||
m-2
|
||||
transition
|
||||
duration-150
|
||||
ease-in-out
|
||||
bg-transparent
|
||||
rounded-full
|
||||
cursor-pointer
|
||||
border-collapseer-2
|
||||
text-fgLightColor
|
||||
hover:text-fgColor
|
||||
hover:shadow-none
|
||||
"
|
||||
:class="[
|
||||
{ 'bg-actColor': color === $colorMode.preference },
|
||||
{ 'text-acColor hover:text-acColor': color === $colorMode.value },
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
/*
|
||||
/*
|
||||
Implements a wrapper listening to viewport intersections via
|
||||
IntesectionObserver API
|
||||
|
||||
|
||||
Reference in New Issue
Block a user