chore: use samrt-env for gql headers

This commit is contained in:
nivedin
2023-12-04 16:19:48 +05:30
committed by Andrew Bastin
parent fce68de282
commit 9bfe195253
2 changed files with 8 additions and 23 deletions

View File

@@ -137,8 +137,7 @@ import IconTrash2 from "~icons/lucide/trash-2"
import { PropType, computed, ref } from "vue" import { PropType, computed, ref } from "vue"
import { useI18n } from "@composables/i18n" import { useI18n } from "@composables/i18n"
import { useToast } from "@composables/toast" import { useToast } from "@composables/toast"
import { HoppGQLRequest, makeGQLRequest } from "@hoppscotch/data" import { HoppGQLRequest } from "@hoppscotch/data"
import { cloneDeep } from "lodash-es"
import { removeGraphqlRequest } from "~/newstore/collections" import { removeGraphqlRequest } from "~/newstore/collections"
import { useService } from "dioc/vue" import { useService } from "dioc/vue"
import { GQLTabService } from "~/services/tab/graphql" import { GQLTabService } from "~/services/tab/graphql"

View File

@@ -77,22 +77,11 @@
tabindex="-1" tabindex="-1"
/> />
</span> </span>
<HoppSmartAutoComplete <SmartEnvInput
v-model="header.key"
:placeholder="`${t('count.header', { count: index + 1 })}`" :placeholder="`${t('count.header', { count: index + 1 })}`"
:source="commonHeaders" :auto-complete-source="commonHeaders"
:spellcheck="false" @change="
:value="header.key"
autofocus
styles="
bg-transparent
flex
flex-1
py-1
px-4
truncate
"
class="!flex flex-1"
@input="
updateHeader(index, { updateHeader(index, {
id: header.id, id: header.id,
key: $event, key: $event,
@@ -101,17 +90,14 @@
}) })
" "
/> />
<input <SmartEnvInput
class="flex flex-1 bg-transparent px-4 py-2" v-model="header.value"
:placeholder="`${t('count.value', { count: index + 1 })}`" :placeholder="`${t('count.value', { count: index + 1 })}`"
:name="`value ${String(index)}`"
:value="header.value"
autofocus
@change=" @change="
updateHeader(index, { updateHeader(index, {
id: header.id, id: header.id,
key: header.key, key: header.key,
value: ($event!.target! as HTMLInputElement).value, value: $event,
active: header.active, active: header.active,
}) })
" "