perf: template literals

This commit is contained in:
liyasthomas
2021-09-18 16:09:58 +05:30
parent 4236d1179c
commit e1e763575d
64 changed files with 425 additions and 333 deletions

View File

@@ -137,12 +137,12 @@ export default defineComponent({
const cookiesAllowed = getLocalConfig("cookiesAllowed") === "yes" const cookiesAllowed = getLocalConfig("cookiesAllowed") === "yes"
if (!cookiesAllowed) { if (!cookiesAllowed) {
this.$toast.show(this.$t("app.we_use_cookies").toString(), { this.$toast.show(this.$t("app.we_use_cookies"), {
icon: "cookie", icon: "cookie",
duration: 0, duration: 0,
action: [ action: [
{ {
text: this.$t("action.learn_more").toString(), text: this.$t("action.learn_more"),
onClick: (_, toastObject) => { onClick: (_, toastObject) => {
setLocalConfig("cookiesAllowed", "yes") setLocalConfig("cookiesAllowed", "yes")
toastObject.goAway(0) toastObject.goAway(0)
@@ -152,7 +152,7 @@ export default defineComponent({
}, },
}, },
{ {
text: this.$t("action.dismiss").toString(), text: this.$t("action.dismiss"),
onClick: (_, toastObject) => { onClick: (_, toastObject) => {
setLocalConfig("cookiesAllowed", "yes") setLocalConfig("cookiesAllowed", "yes")
toastObject.goAway(0) toastObject.goAway(0)

View File

@@ -8,7 +8,7 @@
type="text" type="text"
autocomplete="off" autocomplete="off"
name="command" name="command"
:placeholder="$t('app.type_a_command_search').toString()" :placeholder="`${$t('app.type_a_command_search')}`"
class=" class="
bg-transparent bg-transparent
border-b border-dividerLight border-b border-dividerLight

View File

@@ -40,7 +40,7 @@
</span> </span>
<span <span
v-for="(key, keyIndex) in shortcut.keys" v-for="(key, keyIndex) in shortcut.keys"
:key="`key-${keyIndex}`" :key="`key-${String(keyIndex)}`"
class="shortcut-key" class="shortcut-key"
> >
{{ key }} {{ key }}

View File

@@ -88,7 +88,7 @@ export default defineComponent({
copyAppLink() { copyAppLink() {
copyToClipboard(this.url) copyToClipboard(this.url)
this.copyIcon = "check" this.copyIcon = "check"
this.$toast.success(this.$t("state.copied_to_clipboard").toString(), { this.$toast.success(this.$t("state.copied_to_clipboard"), {
icon: "content_paste", icon: "content_paste",
}) })
setTimeout(() => (this.copyIcon = "copy"), 1000) setTimeout(() => (this.copyIcon = "copy"), 1000)

View File

@@ -36,7 +36,7 @@
px-4 px-4
focus-visible:border-divider focus-visible:border-divider
" "
:placeholder="$t('action.search')" :placeholder="`${$t('action.search')}`"
/> />
</div> </div>
</div> </div>

View File

@@ -5,7 +5,7 @@
</span> </span>
<span <span
v-for="(key, index) in shortcut.keys" v-for="(key, index) in shortcut.keys"
:key="`key-${index}`" :key="`key-${String(index)}`"
class="shortcut-key" class="shortcut-key"
> >
{{ key }} {{ key }}

View File

@@ -3,13 +3,13 @@
<SmartTabs :id="'collections_tab'" @tab-changed="updateCollectionsType"> <SmartTabs :id="'collections_tab'" @tab-changed="updateCollectionsType">
<SmartTab <SmartTab
:id="'my-collections'" :id="'my-collections'"
:label="$t('collection.my_collections')" :label="`${$t('collection.my_collections')}`"
:selected="true" :selected="true"
/> />
<SmartTab <SmartTab
v-if="currentUser && currentUser.eaInvited && !doc" v-if="currentUser && currentUser.eaInvited && !doc"
:id="'team-collections'" :id="'team-collections'"
:label="$t('collection.team_collections')" :label="`${$t('collection.team_collections')}`"
> >
<SmartIntersection @intersecting="onTeamSelectIntersect"> <SmartIntersection @intersecting="onTeamSelectIntersect">
<div class="select-wrapper"> <div class="select-wrapper">
@@ -43,8 +43,8 @@
</option> </option>
<option <option
v-for="(team, index) in myTeams" v-for="(team, index) in myTeams"
:key="`team-${index}`" :key="`team-${String(index)}`"
:value="index" :value="String(index)"
> >
{{ team.name }} {{ team.name }}
</option> </option>

View File

@@ -12,8 +12,10 @@
class="rounded" class="rounded"
svg="arrow-left" svg="arrow-left"
@click.native=" @click.native="
mode = 'import_export' () => {
mySelectedCollectionID = undefined mode = 'import_export'
mySelectedCollectionID = undefined
}
" "
/> />
<span> <span>
@@ -39,8 +41,10 @@
icon="assignment_returned" icon="assignment_returned"
:label="$t('import.from_gist')" :label="$t('import.from_gist')"
@click.native=" @click.native="
readCollectionGist () => {
$refs.options.tippy().hide() readCollectionGist
$refs.options.tippy().hide()
}
" "
/> />
<span <span
@@ -64,8 +68,10 @@
icon="assignment_turned_in" icon="assignment_turned_in"
:label="$t('export.create_secret_gist')" :label="$t('export.create_secret_gist')"
@click.native=" @click.native="
createCollectionGist() () => {
$refs.options.tippy().hide() createCollectionGist()
$refs.options.tippy().hide()
}
" "
/> />
</span> </span>

View File

@@ -1,7 +1,7 @@
<template> <template>
<SmartModal <SmartModal
v-if="show" v-if="show"
:title="$t('collection.save_as').toString()" :title="`${$t('collection.save_as')}`"
@close="hideModal" @close="hideModal"
> >
<template #body> <template #body>
@@ -45,11 +45,11 @@
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary <ButtonPrimary
:label="$t('action.save').toString()" :label="`${$t('action.save')}`"
@click.native="saveRequestAs" @click.native="saveRequestAs"
/> />
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel').toString()" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -194,13 +194,13 @@ const hideModal = () => {
const saveRequestAs = async () => { const saveRequestAs = async () => {
if (!requestName.value) { if (!requestName.value) {
$toast.error(t("error.empty_req_name").toString(), { $toast.error(`${t("error.empty_req_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return
} }
if (picked.value === null) { if (picked.value === null) {
$toast.error(t("collection.select").toString(), { $toast.error(`${t("collection.select")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return
@@ -342,7 +342,7 @@ const saveRequestAs = async () => {
requestUpdated as HoppGQLRequest requestUpdated as HoppGQLRequest
) )
} }
$toast.success(t("request.added").toString(), { $toast.success(`${t("request.added")}`, {
icon: "post_add", icon: "post_add",
}) })
hideModal() hideModal()

View File

@@ -1,5 +1,5 @@
<template> <template>
<SmartModal v-if="show" :title="$t('collection.new')" @close="hideModal"> <SmartModal v-if="show" :title="`${$t('collection.new')}`" @close="hideModal">
<template #body> <template #body>
<div class="flex flex-col px-2"> <div class="flex flex-col px-2">
<input <input
@@ -20,11 +20,11 @@
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary <ButtonPrimary
:label="$t('action.save')" :label="`${$t('action.save')}`"
@click.native="addNewCollection" @click.native="addNewCollection"
/> />
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel')" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -49,7 +49,7 @@ export default defineComponent({
methods: { methods: {
addNewCollection() { addNewCollection() {
if (!this.name) { if (!this.name) {
this.$toast.error(this.$t("collection.invalid_name").toString(), { this.$toast.error(`${this.$t("collection.invalid_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return

View File

@@ -62,29 +62,35 @@
</template> </template>
<SmartItem <SmartItem
svg="folder-plus" svg="folder-plus"
:label="$t('folder.new')" :label="`${$t('folder.new')}`"
@click.native=" @click.native="
$emit('add-folder', { () => {
path: `${collectionIndex}`, $emit('add-folder', {
}) path: `${collectionIndex}`,
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="edit" svg="edit"
:label="$t('action.edit')" :label="`${$t('action.edit')}`"
@click.native=" @click.native="
$emit('edit-collection') () => {
$refs.options.tippy().hide() $emit('edit-collection')
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="trash-2" svg="trash-2"
color="red" color="red"
:label="$t('action.delete')" :label="`${$t('action.delete')}`"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
@@ -94,13 +100,13 @@
<div v-if="showChildren || isFiltered"> <div v-if="showChildren || isFiltered">
<CollectionsGraphqlFolder <CollectionsGraphqlFolder
v-for="(folder, index) in collection.folders" v-for="(folder, index) in collection.folders"
:key="`folder-${index}`" :key="`folder-${String(index)}`"
class="border-l border-dividerLight ml-6" class="border-l border-dividerLight ml-6"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
:folder="folder" :folder="folder"
:folder-index="index" :folder-index="index"
:folder-path="`${collectionIndex}/${index}`" :folder-path="`${collectionIndex}/${String(index)}`"
:collection-index="collectionIndex" :collection-index="collectionIndex"
:doc="doc" :doc="doc"
:is-filtered="isFiltered" :is-filtered="isFiltered"
@@ -111,7 +117,7 @@
/> />
<CollectionsGraphqlRequest <CollectionsGraphqlRequest
v-for="(request, index) in collection.requests" v-for="(request, index) in collection.requests"
:key="`request-${index}`" :key="`request-${String(index)}`"
class="border-l border-dividerLight ml-6" class="border-l border-dividerLight ml-6"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
@@ -147,7 +153,7 @@
</div> </div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_collection')" :title="`${$t('confirm.remove_collection')}`"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="removeCollection" @resolve="removeCollection"
/> />
@@ -220,7 +226,7 @@ export default defineComponent({
this.$emit("select", { picked: null }) this.$emit("select", { picked: null })
} }
removeGraphqlCollection(this.collectionIndex) removeGraphqlCollection(this.collectionIndex)
this.$toast.success(this.$t("state.deleted").toString(), { this.$toast.success(`${this.$t("state.deleted")}`, {
icon: "delete", icon: "delete",
}) })
}, },

View File

@@ -1,5 +1,9 @@
<template> <template>
<SmartModal v-if="show" :title="$t('collection.edit')" @close="hideModal"> <SmartModal
v-if="show"
:title="`${$t('collection.edit')}`"
@close="hideModal"
>
<template #body> <template #body>
<div class="flex flex-col px-2"> <div class="flex flex-col px-2">
<input <input
@@ -20,11 +24,11 @@
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary <ButtonPrimary
:label="$t('action.save')" :label="`${$t('action.save')}`"
@click.native="saveCollection" @click.native="saveCollection"
/> />
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel')" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -50,7 +54,7 @@ export default defineComponent({
methods: { methods: {
saveCollection() { saveCollection() {
if (!this.name) { if (!this.name) {
this.$toast.error(this.$t("collection.invalid_name").toString(), { this.$toast.error(`${this.$t("collection.invalid_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return

View File

@@ -1,7 +1,7 @@
<template> <template>
<SmartModal <SmartModal
v-if="show" v-if="show"
:title="$t('folder.edit')" :title="`${$t('folder.edit')}`"
@close="$emit('hide-modal')" @close="$emit('hide-modal')"
> >
<template #body> <template #body>
@@ -23,9 +23,12 @@
</template> </template>
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary :label="$t('action.save')" @click.native="editFolder" /> <ButtonPrimary
:label="`${$t('action.save')}`"
@click.native="editFolder"
/>
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel')" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -51,7 +54,7 @@ export default defineComponent({
methods: { methods: {
editFolder() { editFolder() {
if (!this.name) { if (!this.name) {
this.$toast.error(this.$t("collection.invalid_name").toString(), { this.$toast.error(`${this.$t("collection.invalid_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return

View File

@@ -1,5 +1,9 @@
<template> <template>
<SmartModal v-if="show" :title="$t('modal.edit_request')" @close="hideModal"> <SmartModal
v-if="show"
:title="`${$t('modal.edit_request')}`"
@close="hideModal"
>
<template #body> <template #body>
<div class="flex flex-col px-2"> <div class="flex flex-col px-2">
<input <input
@@ -19,9 +23,12 @@
</template> </template>
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary :label="$t('action.save')" @click.native="saveRequest" /> <ButtonPrimary
:label="`${$t('action.save')}`"
@click.native="saveRequest"
/>
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel')" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -51,7 +58,7 @@ export default defineComponent({
methods: { methods: {
saveRequest() { saveRequest() {
if (!this.requestUpdateData.name) { if (!this.requestUpdateData.name) {
this.$toast.error(this.$t("collection.invalid_name").toString(), { this.$toast.error(`${this.$t("collection.invalid_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return

View File

@@ -60,27 +60,33 @@
</template> </template>
<SmartItem <SmartItem
svg="folder-plus" svg="folder-plus"
:label="$t('folder.new')" :label="`${$t('folder.new')}`"
@click.native=" @click.native="
$emit('add-folder', { folder, path: folderPath }) () => {
$refs.options.tippy().hide() $emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="edit" svg="edit"
:label="$t('action.edit')" :label="`${$t('action.edit')}`"
@click.native=" @click.native="
$emit('edit-folder', { folder, folderPath }) () => {
$refs.options.tippy().hide() $emit('edit-folder', { folder, folderPath })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="trash-2" svg="trash-2"
color="red" color="red"
:label="$t('action.delete')" :label="`${$t('action.delete')}`"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
@@ -90,13 +96,13 @@
<div v-if="showChildren || isFiltered"> <div v-if="showChildren || isFiltered">
<CollectionsGraphqlFolder <CollectionsGraphqlFolder
v-for="(subFolder, subFolderIndex) in folder.folders" v-for="(subFolder, subFolderIndex) in folder.folders"
:key="`subFolder-${subFolderIndex}`" :key="`subFolder-${String(subFolderIndex)}`"
class="border-l border-dividerLight ml-6" class="border-l border-dividerLight ml-6"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
:folder="subFolder" :folder="subFolder"
:folder-index="subFolderIndex" :folder-index="subFolderIndex"
:folder-path="`${folderPath}/${subFolderIndex}`" :folder-path="`${folderPath}/${String(subFolderIndex)}`"
:collection-index="collectionIndex" :collection-index="collectionIndex"
:doc="doc" :doc="doc"
:is-filtered="isFiltered" :is-filtered="isFiltered"
@@ -107,7 +113,7 @@
/> />
<CollectionsGraphqlRequest <CollectionsGraphqlRequest
v-for="(request, index) in folder.requests" v-for="(request, index) in folder.requests"
:key="`request-${index}`" :key="`request-${String(index)}`"
class="border-l border-dividerLight ml-6" class="border-l border-dividerLight ml-6"
:picked="picked" :picked="picked"
:saving-mode="savingMode" :saving-mode="savingMode"
@@ -146,7 +152,7 @@
</div> </div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_folder')" :title="`${$t('confirm.remove_folder')}`"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="removeFolder" @resolve="removeFolder"
/> />
@@ -219,7 +225,7 @@ export default defineComponent({
} }
removeGraphqlFolder(this.folderPath) removeGraphqlFolder(this.folderPath)
this.$toast.success(this.$t("state.deleted").toString(), { this.$toast.success(`${this.$t("state.deleted")}`, {
icon: "delete", icon: "delete",
}) })
}, },

View File

@@ -66,23 +66,27 @@
</template> </template>
<SmartItem <SmartItem
svg="edit" svg="edit"
:label="$t('action.edit')" :label="`${$t('action.edit')}`"
@click.native=" @click.native="
$emit('edit-request', { () => {
request, $emit('edit-request', {
requestIndex, request,
folderPath, requestIndex,
}) folderPath,
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="trash-2" svg="trash-2"
color="red" color="red"
:label="$t('action.delete')" :label="`${$t('action.delete')}`"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
@@ -91,7 +95,7 @@
</div> </div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_request')" :title="`${$t('confirm.remove_request')}`"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="removeRequest" @resolve="removeRequest"
/> />
@@ -176,7 +180,7 @@ export default defineComponent({
} }
removeGraphqlRequest(this.folderPath, this.requestIndex) removeGraphqlRequest(this.folderPath, this.requestIndex)
this.$toast.success(this.$t("state.deleted").toString(), { this.$toast.success(`${this.$t("state.deleted")}`, {
icon: "delete", icon: "delete",
}) })
}, },

View File

@@ -82,19 +82,23 @@
svg="folder-plus" svg="folder-plus"
:label="$t('folder.new')" :label="$t('folder.new')"
@click.native=" @click.native="
$emit('add-folder', { () => {
folder: collection, $emit('add-folder', {
path: `${collectionIndex}`, folder: collection,
}) path: `${collectionIndex}`,
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="edit" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-collection') () => {
$refs.options.tippy().hide() $emit('edit-collection')
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -102,8 +106,10 @@
color="red" color="red"
:label="$t('action.delete')" :label="$t('action.delete')"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
@@ -138,7 +144,7 @@
:collection-index="collectionIndex" :collection-index="collectionIndex"
:folder-index="-1" :folder-index="-1"
:folder-name="collection.name" :folder-name="collection.name"
:folder-path="collectionIndex.toString()" :folder-path="`${collectionIndex}`"
:request-index="index" :request-index="index"
:doc="doc" :doc="doc"
:save-request="saveRequest" :save-request="saveRequest"
@@ -247,7 +253,7 @@ export default defineComponent({
this.dragging = !this.dragging this.dragging = !this.dragging
const folderPath = dataTransfer.getData("folderPath") const folderPath = dataTransfer.getData("folderPath")
const requestIndex = dataTransfer.getData("requestIndex") const requestIndex = dataTransfer.getData("requestIndex")
moveRESTRequest(folderPath, requestIndex, this.collectionIndex.toString()) moveRESTRequest(folderPath, requestIndex, `${this.collectionIndex}`)
}, },
}, },
}) })

View File

@@ -62,21 +62,25 @@
svg="folder-plus" svg="folder-plus"
:label="$t('folder.new')" :label="$t('folder.new')"
@click.native=" @click.native="
$emit('add-folder', { folder, path: folderPath }) () => {
$refs.options.tippy().hide() $emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
svg="edit" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-folder', { () => {
folder, $emit('edit-folder', {
folderIndex, folder,
collectionIndex, folderIndex,
folderPath, collectionIndex,
}) folderPath,
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -84,8 +88,10 @@
color="red" color="red"
:label="$t('action.delete')" :label="$t('action.delete')"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>

View File

@@ -76,11 +76,13 @@
svg="folder-plus" svg="folder-plus"
:label="$t('folder.new')" :label="$t('folder.new')"
@click.native=" @click.native="
$emit('add-folder', { () => {
folder: collection, $emit('add-folder', {
path: `${collectionIndex}`, folder: collection,
}) path: `${collectionIndex}`,
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -88,8 +90,10 @@
svg="edit" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-collection') () => {
$refs.options.tippy().hide() $emit('edit-collection')
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -98,8 +102,10 @@
color="red" color="red"
:label="$t('action.delete')" :label="$t('action.delete')"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>

View File

@@ -57,8 +57,10 @@
svg="folder-plus" svg="folder-plus"
:label="$t('folder.new')" :label="$t('folder.new')"
@click.native=" @click.native="
$emit('add-folder', { folder, path: folderPath }) () => {
$refs.options.tippy().hide() $emit('add-folder', { folder, path: folderPath })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -66,13 +68,15 @@
svg="edit" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-folder', { () => {
folder, $emit('edit-folder', {
folderIndex, folder,
collectionIndex, folderIndex,
folderPath: '', collectionIndex,
}) folderPath: '',
$refs.options.tippy().hide() })
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -81,8 +85,10 @@
color="red" color="red"
:label="$t('action.delete')" :label="$t('action.delete')"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>

View File

@@ -1,5 +1,9 @@
<template> <template>
<SmartModal v-if="show" :title="$t('environment.new')" @close="hideModal"> <SmartModal
v-if="show"
:title="`${$t('environment.new')}`"
@close="hideModal"
>
<template #body> <template #body>
<div class="flex flex-col px-2"> <div class="flex flex-col px-2">
<input <input
@@ -20,11 +24,11 @@
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary <ButtonPrimary
:label="$t('action.save')" :label="`${$t('action.save')}`"
@click.native="addNewEnvironment" @click.native="addNewEnvironment"
/> />
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel')" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -48,7 +52,7 @@ export default defineComponent({
methods: { methods: {
addNewEnvironment() { addNewEnvironment() {
if (!this.name) { if (!this.name) {
this.$toast.error(this.$t("environment.invalid_name").toString(), { this.$toast.error(`${this.$t("environment.invalid_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return

View File

@@ -1,5 +1,9 @@
<template> <template>
<SmartModal v-if="show" :title="$t('environment.edit')" @close="hideModal"> <SmartModal
v-if="show"
:title="`${$t('environment.edit')}`"
@close="hideModal"
>
<template #body> <template #body>
<div class="flex flex-col px-2"> <div class="flex flex-col px-2">
<div class="flex relative"> <div class="flex relative">
@@ -48,13 +52,13 @@
<input <input
v-model="variable.key" v-model="variable.key"
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.variable', { count: index + 1 })" :placeholder="`${$t('count.variable', { count: index + 1 })}`"
:name="'param' + index" :name="'param' + index"
/> />
<input <input
v-model="variable.value" v-model="variable.value"
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="`${$t('count.value', { count: index + 1 })}`"
:name="'value' + index" :name="'value' + index"
/> />
<div class="flex"> <div class="flex">
@@ -83,7 +87,7 @@
{{ $t("empty.environments") }} {{ $t("empty.environments") }}
</span> </span>
<ButtonSecondary <ButtonSecondary
:label="$t('add.new')" :label="`${$t('add.new')}`"
filled filled
@click.native="addEnvironmentVariable" @click.native="addEnvironmentVariable"
/> />
@@ -94,11 +98,11 @@
<template #footer> <template #footer>
<span> <span>
<ButtonPrimary <ButtonPrimary
:label="$t('action.save')" :label="`${$t('action.save')}`"
@click.native="saveEnvironment" @click.native="saveEnvironment"
/> />
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel')" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -160,7 +164,7 @@ export default defineComponent({
clearContent() { clearContent() {
this.vars = [] this.vars = []
this.clearIcon = "check" this.clearIcon = "check"
this.$toast.success(this.$t("state.cleared").toString(), { this.$toast.success(`${this.$t("state.cleared")}`, {
icon: "clear_all", icon: "clear_all",
}) })
setTimeout(() => (this.clearIcon = "trash-2"), 1000) setTimeout(() => (this.clearIcon = "trash-2"), 1000)
@@ -176,7 +180,7 @@ export default defineComponent({
}, },
saveEnvironment() { saveEnvironment() {
if (!this.name) { if (!this.name) {
this.$toast.error(this.$t("environment.invalid_name").toString(), { this.$toast.error(`${this.$t("environment.invalid_name")}`, {
icon: "error_outline", icon: "error_outline",
}) })
return return

View File

@@ -33,27 +33,31 @@
</template> </template>
<SmartItem <SmartItem
svg="edit" svg="edit"
:label="$t('action.edit')" :label="`${$t('action.edit')}`"
@click.native=" @click.native="
$emit('edit-environment') () => {
$refs.options.tippy().hide() $emit('edit-environment')
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
v-if="!(environmentIndex === 'Global')" v-if="!(environmentIndex === 'Global')"
svg="trash-2" svg="trash-2"
color="red" color="red"
:label="$t('action.delete')" :label="`${$t('action.delete')}`"
@click.native=" @click.native="
confirmRemove = true () => {
$refs.options.tippy().hide() confirmRemove = true
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
</span> </span>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_environment')" :title="`${$t('confirm.remove_environment')}`"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="removeEnvironment" @resolve="removeEnvironment"
/> />
@@ -81,7 +85,7 @@ export default defineComponent({
removeEnvironment() { removeEnvironment() {
if (this.environmentIndex !== "Global") if (this.environmentIndex !== "Global")
deleteEnvironment(this.environmentIndex) deleteEnvironment(this.environmentIndex)
this.$toast.success(this.$t("state.deleted").toString(), { this.$toast.success(`${this.$t("state.deleted")}`, {
icon: "delete", icon: "delete",
}) })
}, },

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppSection :label="$t('environment.title')"> <AppSection :label="`${$t('environment.title')}`">
<div <div
class=" class="
bg-primary bg-primary
@@ -14,7 +14,7 @@
<template #trigger> <template #trigger>
<span <span
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('environment.select')" :title="`${$t('environment.select')}`"
class=" class="
bg-transparent bg-transparent
border-b border-dividerLight border-b border-dividerLight
@@ -29,18 +29,20 @@
/> />
<ButtonSecondary <ButtonSecondary
v-else v-else
:label="$t('environment.no_environment')" :label="`${$t('environment.no_environment')}`"
class="rounded-none flex-1 pr-8" class="rounded-none flex-1 pr-8"
/> />
</span> </span>
</template> </template>
<SmartItem <SmartItem
:label="$t('environment.no_environment')" :label="`${$t('environment.no_environment')}`"
:info-icon="selectedEnvironmentIndex === -1 ? 'done' : ''" :info-icon="selectedEnvironmentIndex === -1 ? 'done' : ''"
:active-info-icon="selectedEnvironmentIndex === -1" :active-info-icon="selectedEnvironmentIndex === -1"
@click.native=" @click.native="
selectedEnvironmentIndex = -1 () => {
$refs.options.tippy().hide() selectedEnvironmentIndex = -1
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -50,15 +52,17 @@
:info-icon="index === selectedEnvironmentIndex ? 'done' : ''" :info-icon="index === selectedEnvironmentIndex ? 'done' : ''"
:active-info-icon="index === selectedEnvironmentIndex" :active-info-icon="index === selectedEnvironmentIndex"
@click.native=" @click.native="
selectedEnvironmentIndex = index () => {
$refs.options.tippy().hide() selectedEnvironmentIndex = index
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>
<div class="border-b border-dividerLight flex flex-1 justify-between"> <div class="border-b border-dividerLight flex flex-1 justify-between">
<ButtonSecondary <ButtonSecondary
svg="plus" svg="plus"
:label="$t('action.new')" :label="`${$t('action.new')}`"
class="!rounded-none" class="!rounded-none"
@click.native="displayModalAdd(true)" @click.native="displayModalAdd(true)"
/> />
@@ -115,7 +119,7 @@
{{ $t("empty.environments") }} {{ $t("empty.environments") }}
</span> </span>
<ButtonSecondary <ButtonSecondary
:label="$t('add.new')" :label="`${$t('add.new')}`"
filled filled
@click.native="displayModalAdd(true)" @click.native="displayModalAdd(true)"
/> />

View File

@@ -1,7 +1,7 @@
<template> <template>
<SmartModal <SmartModal
v-if="show" v-if="show"
:title="$t('auth.login_to_hoppscotch')" :title="`${$t('auth.login_to_hoppscotch')}`"
dialog dialog
@close="hideModal" @close="hideModal"
> >
@@ -10,18 +10,18 @@
<SmartItem <SmartItem
:loading="signingInWithGitHub" :loading="signingInWithGitHub"
svg="auth/github" svg="auth/github"
:label="$t('auth.continue_with_github')" :label="`${$t('auth.continue_with_github')}`"
@click.native="signInWithGithub" @click.native="signInWithGithub"
/> />
<SmartItem <SmartItem
:loading="signingInWithGoogle" :loading="signingInWithGoogle"
svg="auth/google" svg="auth/google"
:label="$t('auth.continue_with_google')" :label="`${$t('auth.continue_with_google')}`"
@click.native="signInWithGoogle" @click.native="signInWithGoogle"
/> />
<SmartItem <SmartItem
icon="mail" icon="mail"
:label="$t('auth.continue_with_email')" :label="`${$t('auth.continue_with_email')}`"
@click.native="mode = 'email'" @click.native="mode = 'email'"
/> />
</div> </div>
@@ -55,7 +55,7 @@
: true : true
" "
type="button" type="button"
:label="$t('auth.send_magic_link')" :label="`${$t('auth.send_magic_link')}`"
@click.native="signInWithEmail" @click.native="signInWithEmail"
/> />
</div> </div>
@@ -108,7 +108,7 @@
/> />
<SmartAnchor <SmartAnchor
class="link" class="link"
:label="$t('action.dismiss')" :label="`${$t('action.dismiss')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</p> </p>
@@ -161,7 +161,7 @@ export default defineComponent({
}, },
methods: { methods: {
showLoginSuccess() { showLoginSuccess() {
this.$toast.success(this.$t("auth.login_success").toString(), { this.$toast.success(`${this.$t("auth.login_success")}`, {
icon: "vpn_key", icon: "vpn_key",
}) })
}, },
@@ -184,7 +184,7 @@ export default defineComponent({
duration: 0, duration: 0,
closeOnSwipe: false, closeOnSwipe: false,
action: { action: {
text: this.$t("action.yes").toString(), text: `${this.$t("action.yes")}`,
onClick: async (_, toastObject) => { onClick: async (_, toastObject) => {
const { user } = await signInUserWithGithub() const { user } = await signInUserWithGithub()
await linkWithFBCredential(user, pendingCred) await linkWithFBCredential(user, pendingCred)
@@ -196,7 +196,7 @@ export default defineComponent({
}, },
}) })
} else { } else {
this.$toast.error(this.$t("error.something_went_wrong").toString(), { this.$toast.error(`${this.$t("error.something_went_wrong")}`, {
icon: "error_outline", icon: "error_outline",
}) })
} }
@@ -228,7 +228,7 @@ export default defineComponent({
duration: 0, duration: 0,
closeOnSwipe: false, closeOnSwipe: false,
action: { action: {
text: this.$t("action.yes").toString(), text: `${this.$t("action.yes")}`,
onClick: async (_, toastObject) => { onClick: async (_, toastObject) => {
const { user } = await signInUserWithGoogle() const { user } = await signInUserWithGoogle()
await linkWithFBCredential(user, pendingCred) await linkWithFBCredential(user, pendingCred)
@@ -240,7 +240,7 @@ export default defineComponent({
}, },
}) })
} else { } else {
this.$toast.error(this.$t("error.something_went_wrong").toString(), { this.$toast.error(`${this.$t("error.something_went_wrong")}`, {
icon: "error_outline", icon: "error_outline",
}) })
} }

View File

@@ -2,15 +2,17 @@
<div class="flex"> <div class="flex">
<SmartItem <SmartItem
svg="log-out" svg="log-out"
:label="$t('auth.logout')" :label="`${$t('auth.logout')}`"
@click.native=" @click.native="
$emit('confirm-logout') () => {
confirmLogout = true $emit('confirm-logout')
confirmLogout = true
}
" "
/> />
<SmartConfirmModal <SmartConfirmModal
:show="confirmLogout" :show="confirmLogout"
:title="$t('confirm.logout')" :title="`${$t('confirm.logout')}`"
@hide-modal="confirmLogout = false" @hide-modal="confirmLogout = false"
@resolve="logout" @resolve="logout"
/> />
@@ -31,12 +33,12 @@ export default defineComponent({
async logout() { async logout() {
try { try {
await signOutUser() await signOutUser()
this.$toast.success(this.$t("auth.logged_out").toString(), { this.$toast.success(`${this.$t("auth.logged_out")}`, {
icon: "vpn_key", icon: "vpn_key",
}) })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
this.$toast.error(this.$t("error.something_went_wrong").toString(), { this.$toast.error(`${this.$t("error.something_went_wrong")}`, {
icon: "error_outline", icon: "error_outline",
}) })
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
<SmartTab :id="'query'" :label="$t('tab.query')" :selected="true"> <SmartTab :id="'query'" :label="`${$t('tab.query')}`" :selected="true">
<AppSection label="query"> <AppSection label="query">
<div <div
class=" class="
@@ -22,7 +22,7 @@
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary
:label="$t('request.run')" :label="`${$t('request.run')}`"
svg="play" svg="play"
class="rounded-none !text-accent" class="rounded-none !text-accent"
@click.native="runQuery()" @click.native="runQuery()"
@@ -59,7 +59,7 @@
</AppSection> </AppSection>
</SmartTab> </SmartTab>
<SmartTab :id="'variables'" :label="$t('tab.variables')"> <SmartTab :id="'variables'" :label="`${$t('tab.variables')}`">
<AppSection label="variables"> <AppSection label="variables">
<div <div
class=" class="
@@ -97,7 +97,7 @@
</AppSection> </AppSection>
</SmartTab> </SmartTab>
<SmartTab :id="'headers'" :label="$t('tab.headers')"> <SmartTab :id="'headers'" :label="`${$t('tab.headers')}`">
<AppSection label="headers"> <AppSection label="headers">
<div <div
class=" class="
@@ -158,7 +158,7 @@
" "
> >
<SmartAutoComplete <SmartAutoComplete
:placeholder="$t('count.header', { count: index + 1 })" :placeholder="`${$t('count.header', { count: index + 1 })}`"
:source="commonHeaders" :source="commonHeaders"
:spellcheck="false" :spellcheck="false"
:value="header.key" :value="header.key"
@@ -182,9 +182,7 @@
/> />
<input <input
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder=" :placeholder="`${$t('count.value', { count: index + 1 })}`"
$t('count.value', { count: index + 1 }).toString()
"
:name="`value ${index}`" :name="`value ${index}`"
:value="header.value" :value="header.value"
autofocus autofocus
@@ -247,7 +245,7 @@
{{ $t("empty.headers") }} {{ $t("empty.headers") }}
</span> </span>
<ButtonSecondary <ButtonSecondary
:label="$t('add.new')" :label="`${$t('add.new')}`"
filled filled
svg="plus" svg="plus"
@click.native="addRequestHeader" @click.native="addRequestHeader"
@@ -326,7 +324,7 @@ watch(bulkHeaders, () => {
})) }))
setGQLHeaders(transformation) setGQLHeaders(transformation)
} catch (e) { } catch (e) {
$toast.error(t("error.something_went_wrong").toString(), { $toast.error(`${t("error.something_went_wrong")}`, {
icon: "error_outline", icon: "error_outline",
}) })
console.error(e) console.error(e)
@@ -343,7 +341,7 @@ const bulkEditor = ref<any | null>(null)
useCodemirror(bulkEditor, bulkHeaders, { useCodemirror(bulkEditor, bulkHeaders, {
extendedEditorConfig: { extendedEditorConfig: {
mode: "text/x-yaml", mode: "text/x-yaml",
placeholder: t("state.bulk_mode_placeholder").toString(), placeholder: `${t("state.bulk_mode_placeholder")}`,
}, },
linter: null, linter: null,
completer: null, completer: null,
@@ -354,7 +352,7 @@ const variableEditor = ref<any | null>(null)
useCodemirror(variableEditor, variableString, { useCodemirror(variableEditor, variableString, {
extendedEditorConfig: { extendedEditorConfig: {
mode: "application/ld+json", mode: "application/ld+json",
placeholder: t("request.variables").toString(), placeholder: `${t("request.variables")}`,
}, },
linter: jsonLinter, linter: jsonLinter,
completer: null, completer: null,
@@ -366,7 +364,7 @@ const schemaString = useReadonlyStream(props.conn.schema$, null)
useCodemirror(queryEditor, gqlQueryString, { useCodemirror(queryEditor, gqlQueryString, {
extendedEditorConfig: { extendedEditorConfig: {
mode: "graphql", mode: "graphql",
placeholder: t("request.query").toString(), placeholder: `${t("request.query")}`,
}, },
linter: createGQLQueryLinter(schemaString), linter: createGQLQueryLinter(schemaString),
completer: queryCompleter(schemaString), completer: queryCompleter(schemaString),
@@ -409,7 +407,7 @@ const runQuery = async () => {
const startTime = Date.now() const startTime = Date.now()
nuxt.value.$loading.start() nuxt.value.$loading.start()
response.value = t("state.loading").toString() response.value = `${t("state.loading")}`
try { try {
const runURL = clone(url.value) const runURL = clone(url.value)
@@ -443,14 +441,14 @@ const runQuery = async () => {
}) })
) )
$toast.success(t("state.finished_in", { duration }).toString(), { $toast.success(`${t("state.finished_in", { duration })}`, {
icon: "done", icon: "done",
}) })
} catch (e: any) { } catch (e: any) {
response.value = `${e}. ${t("error.check_console_details")}` response.value = `${e}. ${t("error.check_console_details")}`
nuxt.value.$loading.finish() nuxt.value.$loading.finish()
$toast.error(`${e} ${t("error.f12_details").toString()}`, { $toast.error(`${e} ${t("error.f12_details")}`, {
icon: "error_outline", icon: "error_outline",
}) })
console.error(e) console.error(e)
@@ -470,7 +468,7 @@ const prettifyQuery = () => {
try { try {
gqlQueryString.value = gql.print(gql.parse(gqlQueryString.value)) gqlQueryString.value = gql.print(gql.parse(gqlQueryString.value))
} catch (e) { } catch (e) {
$toast.error(t("error.gql_prettify_invalid_query").toString(), { $toast.error(`${t("error.gql_prettify_invalid_query")}`, {
icon: "error_outline", icon: "error_outline",
}) })
} }

View File

@@ -71,7 +71,7 @@
</div> </div>
</div> </div>
<ButtonSecondary <ButtonSecondary
:label="$t('app.documentation')" :label="`${$t('app.documentation')}`"
to="https://docs.hoppscotch.io" to="https://docs.hoppscotch.io"
svg="external-link" svg="external-link"
blank blank
@@ -133,7 +133,7 @@ const downloadResponse = () => {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
downloadResponseIcon.value = "check" downloadResponseIcon.value = "check"
$toast.success(t("state.download_started").toString(), { $toast.success(`${t("state.download_started")}`, {
icon: "downloading", icon: "downloading",
}) })
setTimeout(() => { setTimeout(() => {

View File

@@ -8,7 +8,7 @@
v-model="graphqlFieldsFilterText" v-model="graphqlFieldsFilterText"
type="search" type="search"
autocomplete="off" autocomplete="off"
:placeholder="$t('action.search')" :placeholder="`${$t('action.search')}`"
class="bg-transparent flex w-full p-4 py-2" class="bg-transparent flex w-full p-4 py-2"
/> />
<div class="flex"> <div class="flex">
@@ -29,7 +29,7 @@
<SmartTab <SmartTab
v-if="queryFields.length > 0" v-if="queryFields.length > 0"
:id="'queries'" :id="'queries'"
:label="$t('tab.queries')" :label="`${$t('tab.queries')}`"
:selected="true" :selected="true"
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
@@ -44,7 +44,7 @@
<SmartTab <SmartTab
v-if="mutationFields.length > 0" v-if="mutationFields.length > 0"
:id="'mutations'" :id="'mutations'"
:label="$t('graphql.mutations')" :label="`${$t('graphql.mutations')}`"
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlField <GraphqlField
@@ -58,7 +58,7 @@
<SmartTab <SmartTab
v-if="subscriptionFields.length > 0" v-if="subscriptionFields.length > 0"
:id="'subscriptions'" :id="'subscriptions'"
:label="$t('graphql.subscriptions')" :label="`${$t('graphql.subscriptions')}`"
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlField <GraphqlField
@@ -73,7 +73,7 @@
v-if="graphqlTypes.length > 0" v-if="graphqlTypes.length > 0"
:id="'types'" :id="'types'"
ref="typesTab" ref="typesTab"
:label="$t('tab.types')" :label="`${$t('tab.types')}`"
class="divide-y divide-dividerLight" class="divide-y divide-dividerLight"
> >
<GraphqlType <GraphqlType
@@ -111,7 +111,7 @@
</AppSection> </AppSection>
</SmartTab> </SmartTab>
<SmartTab :id="'history'" :label="$t('tab.history')"> <SmartTab :id="'history'" :label="`${$t('tab.history')}`">
<History <History
ref="graphqlHistoryComponent" ref="graphqlHistoryComponent"
:page="'graphql'" :page="'graphql'"
@@ -119,7 +119,7 @@
/> />
</SmartTab> </SmartTab>
<SmartTab :id="'collections'" :label="$t('tab.collections')"> <SmartTab :id="'collections'" :label="`${$t('tab.collections')}`">
<CollectionsGraphql /> <CollectionsGraphql />
</SmartTab> </SmartTab>
@@ -412,7 +412,7 @@ const downloadSchema = () => {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
downloadSchemaIcon.value = "check" downloadSchemaIcon.value = "check"
$toast.success(t("state.download_started").toString(), { $toast.success(`${t("state.download_started")}`, {
icon: "downloading", icon: "downloading",
}) })
setTimeout(() => { setTimeout(() => {

View File

@@ -22,7 +22,7 @@ export default defineComponent({
computed: { computed: {
typeString() { typeString() {
return this.gqlType.toString() return `${this.gqlType}`
}, },
isScalar() { isScalar() {
return this.resolveRootType(this.gqlType) instanceof GraphQLScalarType return this.resolveRootType(this.gqlType) instanceof GraphQLScalarType

View File

@@ -15,7 +15,7 @@
type="search" type="search"
autocomplete="off" autocomplete="off"
class="bg-transparent flex w-full p-4 py-2" class="bg-transparent flex w-full p-4 py-2"
:placeholder="$t('action.search')" :placeholder="`${$t('action.search')}`"
/> />
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary
@@ -76,7 +76,7 @@
</div> </div>
<SmartConfirmModal <SmartConfirmModal
:show="confirmRemove" :show="confirmRemove"
:title="$t('confirm.remove_history')" :title="`${$t('confirm.remove_history')}`"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve="clearHistory" @resolve="clearHistory"
/> />
@@ -131,7 +131,7 @@ export default defineComponent({
return Object.keys(entry).some((key) => { return Object.keys(entry).some((key) => {
let value = entry[key as keyof typeof entry] let value = entry[key as keyof typeof entry]
if (value) { if (value) {
value = typeof value !== "string" ? value.toString() : value value = `${value}`
return value.toLowerCase().includes(filterText) return value.toLowerCase().includes(filterText)
} }
return false return false
@@ -144,7 +144,7 @@ export default defineComponent({
clearHistory() { clearHistory() {
if (this.page === "rest") clearRESTHistory() if (this.page === "rest") clearRESTHistory()
else clearGraphqlHistory() else clearGraphqlHistory()
this.$toast.success(this.$t("state.history_deleted").toString(), { this.$toast.success(`${this.$t("state.history_deleted")}`, {
icon: "delete", icon: "delete",
}) })
}, },
@@ -154,7 +154,7 @@ export default defineComponent({
deleteHistory(entry: any) { deleteHistory(entry: any) {
if (this.page === "rest") deleteRESTHistoryEntry(entry) if (this.page === "rest") deleteRESTHistoryEntry(entry)
else deleteGraphqlHistoryEntry(entry) else deleteGraphqlHistoryEntry(entry)
this.$toast.success(this.$t("state.deleted").toString(), { this.$toast.success(`${this.$t("state.deleted")}`, {
icon: "delete", icon: "delete",
}) })
}, },

View File

@@ -4,7 +4,7 @@
class="cursor-pointer flex px-2 w-16 justify-center items-center truncate" class="cursor-pointer flex px-2 w-16 justify-center items-center truncate"
:class="entryStatus.className" :class="entryStatus.className"
data-testid="restore_history_entry" data-testid="restore_history_entry"
:title="duration" :title="`${duration}`"
@click="$emit('use-entry')" @click="$emit('use-entry')"
> >
{{ entry.request.method }} {{ entry.request.method }}
@@ -20,7 +20,7 @@
group-hover:text-secondaryDark group-hover:text-secondaryDark
" "
data-testid="restore_history_entry" data-testid="restore_history_entry"
:title="duration" :title="`${duration}`"
@click="$emit('use-entry')" @click="$emit('use-entry')"
> >
<span class="truncate"> <span class="truncate">
@@ -75,9 +75,9 @@ export default defineComponent({
if (!responseDuration) return "" if (!responseDuration) return ""
return responseDuration > 0 return responseDuration > 0
? `${$t("request.duration").toString()}: ${responseDuration}ms` ? `${$t("request.duration")}: ${responseDuration}ms`
: $t("error.no_duration").toString() : $t("error.no_duration")
} else return $t("error.no_duration").toString() } else return $t("error.no_duration")
}) })
const entryStatus = computed(() => { const entryStatus = computed(() => {

View File

@@ -37,8 +37,10 @@
:info-icon="contentType === null ? 'done' : ''" :info-icon="contentType === null ? 'done' : ''"
:active-info-icon="contentType === null" :active-info-icon="contentType === null"
@click.native=" @click.native="
contentType = null () => {
$refs.contentTypeOptions.tippy().hide() contentType = null
$refs.contentTypeOptions.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -48,8 +50,10 @@
:info-icon="contentTypeItem === contentType ? 'done' : ''" :info-icon="contentTypeItem === contentType ? 'done' : ''"
:active-info-icon="contentTypeItem === contentType" :active-info-icon="contentTypeItem === contentType"
@click.native=" @click.native="
contentType = contentTypeItem () => {
$refs.contentTypeOptions.tippy().hide() contentType = contentTypeItem
$refs.contentTypeOptions.tippy().hide()
}
" "
/> />
</tippy> </tippy>
@@ -66,7 +70,7 @@
</span> </span>
<ButtonSecondary <ButtonSecondary
outline outline
:label="$t('app.documentation')" :label="`${$t('app.documentation')}`"
to="https://docs.hoppscotch.io" to="https://docs.hoppscotch.io"
blank blank
svg="external-link" svg="external-link"

View File

@@ -46,7 +46,7 @@
<SmartEnvInput <SmartEnvInput
v-if="EXPERIMENTAL_URL_BAR_ENABLED" v-if="EXPERIMENTAL_URL_BAR_ENABLED"
v-model="param.key" v-model="param.key"
:placeholder="$t('count.parameter', { count: index + 1 })" :placeholder="`${$t('count.parameter', { count: index + 1 })}`"
styles=" styles="
bg-transparent bg-transparent
flex flex
@@ -66,7 +66,7 @@
<input <input
v-else v-else
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.parameter', { count: index + 1 })" :placeholder="`${$t('count.parameter', { count: index + 1 })}`"
:name="'param' + index" :name="'param' + index"
:value="param.key" :value="param.key"
autofocus autofocus
@@ -94,7 +94,7 @@
<SmartEnvInput <SmartEnvInput
v-if="EXPERIMENTAL_URL_BAR_ENABLED" v-if="EXPERIMENTAL_URL_BAR_ENABLED"
v-model="param.value" v-model="param.value"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="`${$t('count.value', { count: index + 1 })}`"
styles=" styles="
bg-transparent bg-transparent
flex flex
@@ -114,7 +114,7 @@
<input <input
v-else v-else
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="`${$t('count.value', { count: index + 1 })}`"
:name="'value' + index" :name="'value' + index"
:value="param.value" :value="param.value"
@change=" @change="
@@ -190,7 +190,7 @@
{{ $t("empty.body") }} {{ $t("empty.body") }}
</span> </span>
<ButtonSecondary <ButtonSecondary
:label="$t('add.new')" :label="`${$t('add.new')}`"
filled filled
svg="plus" svg="plus"
@click.native="addBodyParam" @click.native="addBodyParam"

View File

@@ -1,7 +1,7 @@
<template> <template>
<SmartModal <SmartModal
v-if="show" v-if="show"
:title="t('request.generate_code')" :title="`${t('request.generate_code')}`"
@close="hideModal" @close="hideModal"
> >
<template #body> <template #body>
@@ -48,12 +48,12 @@
<template #footer> <template #footer>
<span class="flex"> <span class="flex">
<ButtonPrimary <ButtonPrimary
:label="t('action.copy').toString()" :label="`${t('action.copy')}`"
:svg="copyIcon" :svg="copyIcon"
@click.native="copyRequestCode" @click.native="copyRequestCode"
/> />
<ButtonSecondary <ButtonSecondary
:label="t('action.dismiss').toString()" :label="`${t('action.dismiss')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -126,7 +126,7 @@ const hideModal = () => emit("hide-modal")
const copyRequestCode = () => { const copyRequestCode = () => {
copyToClipboard(requestCode.value) copyToClipboard(requestCode.value)
copyIcon.value = "check" copyIcon.value = "check"
$toast.success(t("state.copied_to_clipboard").toString(), { $toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste", icon: "content_paste",
}) })
setTimeout(() => (copyIcon.value = "copy"), 1000) setTimeout(() => (copyIcon.value = "copy"), 1000)

View File

@@ -55,7 +55,7 @@
class="divide-x divide-dividerLight border-b border-dividerLight flex" class="divide-x divide-dividerLight border-b border-dividerLight flex"
> >
<SmartAutoComplete <SmartAutoComplete
:placeholder="$t('count.header', { count: index + 1 })" :placeholder="`${$t('count.header', { count: index + 1 })}`"
:source="commonHeaders" :source="commonHeaders"
:spellcheck="false" :spellcheck="false"
:value="header.key" :value="header.key"
@@ -80,7 +80,7 @@
<SmartEnvInput <SmartEnvInput
v-if="EXPERIMENTAL_URL_BAR_ENABLED" v-if="EXPERIMENTAL_URL_BAR_ENABLED"
v-model="header.value" v-model="header.value"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="`${$t('count.value', { count: index + 1 })}`"
styles=" styles="
bg-transparent bg-transparent
flex flex
@@ -99,7 +99,7 @@
<input <input
v-else v-else
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="`${$t('count.value', { count: index + 1 })}`"
:name="'value' + index" :name="'value' + index"
:value="header.value" :value="header.value"
@change=" @change="
@@ -164,7 +164,7 @@
</span> </span>
<ButtonSecondary <ButtonSecondary
filled filled
:label="$t('add.new')" :label="`${$t('add.new')}`"
svg="plus" svg="plus"
@click.native="addHeader" @click.native="addHeader"
/> />
@@ -202,7 +202,7 @@ const bulkEditor = ref<any | null>(null)
useCodemirror(bulkEditor, bulkHeaders, { useCodemirror(bulkEditor, bulkHeaders, {
extendedEditorConfig: { extendedEditorConfig: {
mode: "text/x-yaml", mode: "text/x-yaml",
placeholder: t("state.bulk_mode_placeholder").toString(), placeholder: `${t("state.bulk_mode_placeholder")}`,
}, },
linter: null, linter: null,
completer: null, completer: null,
@@ -217,7 +217,7 @@ watch(bulkHeaders, () => {
})) }))
setRESTHeaders(transformation) setRESTHeaders(transformation)
} catch (e) { } catch (e) {
$toast.error(t("error.something_went_wrong").toString(), { $toast.error(`${t("error.something_went_wrong")}`, {
icon: "error_outline", icon: "error_outline",
}) })
console.error(e) console.error(e)

View File

@@ -1,9 +1,5 @@
<template> <template>
<SmartModal <SmartModal v-if="show" :title="`${$t('import.curl')}`" @close="hideModal">
v-if="show"
:title="$t('import.curl').toString()"
@close="hideModal"
>
<template #body> <template #body>
<div class="flex flex-col px-2"> <div class="flex flex-col px-2">
<div ref="curlEditor" class="border border-dividerLight rounded"></div> <div ref="curlEditor" class="border border-dividerLight rounded"></div>
@@ -12,11 +8,11 @@
<template #footer> <template #footer>
<span class="flex"> <span class="flex">
<ButtonPrimary <ButtonPrimary
:label="$t('import.title').toString()" :label="`${$t('import.title')}`"
@click.native="handleImport" @click.native="handleImport"
/> />
<ButtonSecondary <ButtonSecondary
:label="$t('action.cancel').toString()" :label="`${$t('action.cancel')}`"
@click.native="hideModal" @click.native="hideModal"
/> />
</span> </span>
@@ -49,7 +45,7 @@ const curlEditor = ref<any | null>(null)
useCodemirror(curlEditor, curl, { useCodemirror(curlEditor, curl, {
extendedEditorConfig: { extendedEditorConfig: {
mode: "application/x-sh", mode: "application/x-sh",
placeholder: t("request.enter_curl").toString(), placeholder: `${t("request.enter_curl")}`,
}, },
linter: null, linter: null,
completer: null, completer: null,
@@ -128,7 +124,7 @@ const handleImport = () => {
) )
} catch (e) { } catch (e) {
console.error(e) console.error(e)
$toast.error(t("error.curl_invalid_format").toString(), { $toast.error(`${t("error.curl_invalid_format")}`, {
icon: "error_outline", icon: "error_outline",
}) })
} }

View File

@@ -48,7 +48,7 @@
<div class="p-2"> <div class="p-2">
<ButtonSecondary <ButtonSecondary
filled filled
:label="$t('authorization.generate_token')" :label="`${$t('authorization.generate_token')}`"
@click.native="handleAccessTokenRequest()" @click.native="handleAccessTokenRequest()"
/> />
</div> </div>
@@ -97,7 +97,7 @@ export default {
oidcDiscoveryURL.value === "" && oidcDiscoveryURL.value === "" &&
(authURL.value === "" || accessTokenURL.value === "") (authURL.value === "" || accessTokenURL.value === "")
) { ) {
$toast.error($t("complete_config_urls").toString(), { $toast.error(`${$t("complete_config_urls")}`, {
icon: "error", icon: "error",
}) })
return return
@@ -113,7 +113,7 @@ export default {
} }
await tokenRequest(tokenReqParams) await tokenRequest(tokenReqParams)
} catch (e) { } catch (e) {
$toast.error(e, { $toast.error(`${e}`, {
icon: "code", icon: "code",
}) })
} }

View File

@@ -57,7 +57,7 @@
<SmartEnvInput <SmartEnvInput
v-if="EXPERIMENTAL_URL_BAR_ENABLED" v-if="EXPERIMENTAL_URL_BAR_ENABLED"
v-model="param.key" v-model="param.key"
:placeholder="$t('count.parameter', { count: index + 1 })" :placeholder="`${$t('count.parameter', { count: index + 1 })}`"
styles=" styles="
bg-transparent bg-transparent
flex flex
@@ -76,7 +76,9 @@
<input <input
v-else v-else
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.parameter', { count: index + 1 }).toString()" :placeholder="`${$t('count.parameter', {
count: index + 1,
})}`"
:name="'param' + index" :name="'param' + index"
:value="param.key" :value="param.key"
autofocus autofocus
@@ -91,7 +93,7 @@
<SmartEnvInput <SmartEnvInput
v-if="EXPERIMENTAL_URL_BAR_ENABLED" v-if="EXPERIMENTAL_URL_BAR_ENABLED"
v-model="param.value" v-model="param.value"
:placeholder="$t('count.value', { count: index + 1 })" :placeholder="`${$t('count.value', { count: index + 1 })}`"
styles=" styles="
bg-transparent bg-transparent
flex flex
@@ -110,7 +112,7 @@
<input <input
v-else v-else
class="bg-transparent flex flex-1 py-2 px-4" class="bg-transparent flex flex-1 py-2 px-4"
:placeholder="$t('count.value', { count: index + 1 }).toString()" :placeholder="`${$t('count.value', { count: index + 1 })}`"
:name="'value' + index" :name="'value' + index"
:value="param.value" :value="param.value"
@change=" @change="
@@ -172,7 +174,7 @@
{{ $t("empty.parameters") }} {{ $t("empty.parameters") }}
</span> </span>
<ButtonSecondary <ButtonSecondary
:label="$t('add.new')" :label="`${$t('add.new')}`"
svg="plus" svg="plus"
filled filled
@click.native="addParam" @click.native="addParam"
@@ -216,7 +218,7 @@ watch(bulkParams, () => {
})) }))
setRESTParams(transformation) setRESTParams(transformation)
} catch (e) { } catch (e) {
$toast.error(t("error.something_went_wrong").toString(), { $toast.error(`${t("error.something_went_wrong")}`, {
icon: "error_outline", icon: "error_outline",
}) })
console.error(e) console.error(e)
@@ -228,7 +230,7 @@ const bulkEditor = ref<any | null>(null)
useCodemirror(bulkEditor, bulkParams, { useCodemirror(bulkEditor, bulkParams, {
extendedEditorConfig: { extendedEditorConfig: {
mode: "text/x-yaml", mode: "text/x-yaml",
placeholder: t("state.bulk_mode_placeholder").toString(), placeholder: `${t("state.bulk_mode_placeholder")}`,
}, },
linter: null, linter: null,
completer: null, completer: null,

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppSection id="script" :label="$t('preRequest.script')"> <AppSection id="script" :label="`${$t('preRequest.script')}`">
<div <div
class=" class="
bg-primary bg-primary
@@ -60,7 +60,7 @@
{{ $t("helpers.pre_request_script") }} {{ $t("helpers.pre_request_script") }}
</div> </div>
<SmartAnchor <SmartAnchor
:label="$t('preRequest.learn')" :label="`${$t('preRequest.learn')}`"
to="https://docs.hoppscotch.io/features/pre-request-script" to="https://docs.hoppscotch.io/features/pre-request-script"
blank blank
/> />
@@ -107,7 +107,7 @@ useCodemirror(
extendedEditorConfig: { extendedEditorConfig: {
mode: "application/javascript", mode: "application/javascript",
lineWrapping: linewrapEnabled, lineWrapping: linewrapEnabled,
placeholder: t("preRequest.javascript_code").toString(), placeholder: `${t("preRequest.javascript_code")}`,
}, },
linter, linter,
completer, completer,

View File

@@ -35,7 +35,7 @@
v-tippy="{ theme: 'tooltip' }" v-tippy="{ theme: 'tooltip' }"
:title="$t('action.clear')" :title="$t('action.clear')"
svg="trash-2" svg="trash-2"
@click.native="clearContent('rawParams', $event)" @click.native="clearContent"
/> />
<ButtonSecondary <ButtonSecondary
v-if="contentType && contentType.endsWith('json')" v-if="contentType && contentType.endsWith('json')"
@@ -104,7 +104,7 @@ useCodemirror(
extendedEditorConfig: { extendedEditorConfig: {
lineWrapping: linewrapEnabled, lineWrapping: linewrapEnabled,
mode: rawInputEditorLang, mode: rawInputEditorLang,
placeholder: t("request.raw_body").toString(), placeholder: t("request.raw_body"),
}, },
linter: null, linter: null,
completer: null, completer: null,
@@ -123,11 +123,11 @@ const uploadPayload = (e: InputEvent) => {
rawParamsBody.value = target?.result rawParamsBody.value = target?.result
} }
reader.readAsText(file) reader.readAsText(file)
$toast.success(t("state.file_imported").toString(), { $toast.success(`${t("state.file_imported")}`, {
icon: "attach_file", icon: "attach_file",
}) })
} else { } else {
$toast.error(t("action.choose_file").toString(), { $toast.error(`${t("action.choose_file")}`, {
icon: "attach_file", icon: "attach_file",
}) })
} }

View File

@@ -43,7 +43,7 @@
" "
:value="newMethod" :value="newMethod"
:readonly="!isCustomMethod" :readonly="!isCustomMethod"
:placeholder="$t('request.method')" :placeholder="`${$t('request.method')}`"
@input="onSelectMethod($event.target.value)" @input="onSelectMethod($event.target.value)"
/> />
</span> </span>
@@ -61,7 +61,7 @@
<SmartEnvInput <SmartEnvInput
v-if="EXPERIMENTAL_URL_BAR_ENABLED" v-if="EXPERIMENTAL_URL_BAR_ENABLED"
v-model="newEndpoint" v-model="newEndpoint"
:placeholder="$t('request.url')" :placeholder="`${$t('request.url')}`"
styles=" styles="
bg-primaryLight bg-primaryLight
border border-divider border border-divider
@@ -100,7 +100,7 @@
type="text" type="text"
autocomplete="off" autocomplete="off"
spellcheck="false" spellcheck="false"
:placeholder="$t('request.url')" :placeholder="`${$t('request.url')}`"
autofocus autofocus
@keyup.enter="newSendRequest()" @keyup.enter="newSendRequest()"
/> />
@@ -110,7 +110,7 @@
<ButtonPrimary <ButtonPrimary
id="send" id="send"
class="rounded-r-none flex-1 min-w-22" class="rounded-r-none flex-1 min-w-22"
:label="!loading ? $t('action.send') : $t('action.cancel')" :label="`${!loading ? $t('action.send') : $t('action.cancel')}`"
@click.native="!loading ? newSendRequest() : cancelRequest()" @click.native="!loading ? newSendRequest() : cancelRequest()"
/> />
<span class="flex"> <span class="flex">
@@ -125,7 +125,7 @@
<ButtonPrimary class="rounded-l-none" filled svg="chevron-down" /> <ButtonPrimary class="rounded-l-none" filled svg="chevron-down" />
</template> </template>
<SmartItem <SmartItem
:label="$t('import.curl')" :label="`${$t('import.curl')}`"
svg="terminal" svg="terminal"
@click.native=" @click.native="
() => { () => {
@@ -135,7 +135,7 @@
" "
/> />
<SmartItem <SmartItem
:label="$t('show.code')" :label="`${$t('show.code')}`"
svg="code" svg="code"
@click.native=" @click.native="
() => { () => {
@@ -146,7 +146,7 @@
/> />
<SmartItem <SmartItem
ref="clearAll" ref="clearAll"
:label="$t('action.clear_all')" :label="`${$t('action.clear_all')}`"
svg="rotate-ccw" svg="rotate-ccw"
@click.native=" @click.native="
() => { () => {
@@ -159,7 +159,7 @@
</span> </span>
<ButtonSecondary <ButtonSecondary
class="rounded-r-none ml-2" class="rounded-r-none ml-2"
:label="$t('request.save')" :label="`${$t('request.save')}`"
filled filled
svg="save" svg="save"
@click.native="saveRequest()" @click.native="saveRequest()"
@@ -178,7 +178,7 @@
<input <input
id="request-name" id="request-name"
v-model="requestName" v-model="requestName"
:placeholder="$t('request.name')" :placeholder="`${$t('request.name')}`"
name="request-name" name="request-name"
type="text" type="text"
autocomplete="off" autocomplete="off"
@@ -187,7 +187,7 @@
/> />
<SmartItem <SmartItem
ref="copyRequest" ref="copyRequest"
:label="$t('request.copy_link')" :label="`${$t('request.copy_link')}`"
:svg="hasNavigatorShare ? 'share-2' : 'copy'" :svg="hasNavigatorShare ? 'share-2' : 'copy'"
@click.native=" @click.native="
() => { () => {
@@ -198,7 +198,7 @@
/> />
<SmartItem <SmartItem
ref="saveRequest" ref="saveRequest"
:label="$t('request.save_as')" :label="`${$t('request.save_as')}`"
svg="folder-plus" svg="folder-plus"
@click.native=" @click.native="
() => { () => {
@@ -352,7 +352,7 @@ const copyRequest = () => {
.catch(() => {}) .catch(() => {})
} else { } else {
copyToClipboard(window.location.href) copyToClipboard(window.location.href)
$toast.success(t("state.copied_to_clipboard").toString(), { $toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste", icon: "content_paste",
}) })
} }
@@ -409,7 +409,7 @@ const saveRequest = () => {
return return
} }
} }
$toast.success(t("request.saved").toString(), { $toast.success(`${t("request.saved")}`, {
icon: "playlist_add_check", icon: "playlist_add_check",
}) })
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppSection :label="$t('test.results')"> <AppSection :label="`${$t('test.results')}`">
<div <div
v-if=" v-if="
testResults && testResults &&
@@ -64,7 +64,9 @@
<span class="text-secondaryLight"> <span class="text-secondaryLight">
{{ {{
` \xA0 — \xA0test ${ ` \xA0 — \xA0test ${
result.status === "pass" ? $t("passed") : $t("failed") result.status === "pass"
? $t("test.passed")
: $t("test.failed")
}` }`
}} }}
</span> </span>
@@ -84,7 +86,7 @@
</span> </span>
<ButtonSecondary <ButtonSecondary
outline outline
:label="$t('action.learn_more')" :label="`${$t('action.learn_more')}`"
to="https://docs.hoppscotch.io" to="https://docs.hoppscotch.io"
blank blank
svg="external-link" svg="external-link"

View File

@@ -27,8 +27,8 @@
</span> </span>
<span class="text-secondaryLight"> <span class="text-secondaryLight">
{{ {{
` \xA0 — \xA0test ${ ` \xA0 — \xA0 ${
result.status === "pass" ? $t("passed") : $t("failed") result.status === "pass" ? $t("test.passed") : $t("test.failed")
}` }`
}} }}
</span> </span>

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppSection id="script" :label="$t('test.script')"> <AppSection id="script" :label="`${$t('test.script')}`">
<div <div
class=" class="
bg-primary bg-primary
@@ -60,7 +60,7 @@
{{ $t("helpers.post_request_tests") }} {{ $t("helpers.post_request_tests") }}
</div> </div>
<SmartAnchor <SmartAnchor
:label="$t('test.learn')" :label="`${$t('test.learn')}`"
to="https://docs.hoppscotch.io/features/tests" to="https://docs.hoppscotch.io/features/tests"
blank blank
/> />
@@ -107,7 +107,7 @@ useCodemirror(
extendedEditorConfig: { extendedEditorConfig: {
mode: "application/javascript", mode: "application/javascript",
lineWrapping: linewrapEnabled, lineWrapping: linewrapEnabled,
placeholder: t("test.javascript_code").toString(), placeholder: `${t("test.javascript_code")}`,
}, },
linter, linter,
completer, completer,

View File

@@ -13,7 +13,7 @@
v-if="headerLength" v-if="headerLength"
id="headers" id="headers"
:label="$t('response.headers')" :label="$t('response.headers')"
:info="headerLength.toString()" :info="`${headerLength}`"
> >
<LensesHeadersRenderer :headers="response.headers" /> <LensesHeadersRenderer :headers="response.headers" />
</SmartTab> </SmartTab>

View File

@@ -130,7 +130,7 @@ const downloadResponse = () => {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
downloadIcon.value = "check" downloadIcon.value = "check"
$toast.success(t("state.download_started").toString(), { $toast.success(`${t("state.download_started")}`, {
icon: "downloading", icon: "downloading",
}) })
setTimeout(() => { setTimeout(() => {
@@ -143,7 +143,7 @@ const downloadResponse = () => {
const copyResponse = () => { const copyResponse = () => {
copyToClipboard(responseBodyText.value) copyToClipboard(responseBodyText.value)
copyIcon.value = "check" copyIcon.value = "check"
$toast.success(t("state.copied_to_clipboard").toString(), { $toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste", icon: "content_paste",
}) })
setTimeout(() => (copyIcon.value = "copy"), 1000) setTimeout(() => (copyIcon.value = "copy"), 1000)

View File

@@ -74,7 +74,7 @@
<div v-if="item.kind === 'RootObject'" class="outline">{}</div> <div v-if="item.kind === 'RootObject'" class="outline">{}</div>
<div v-if="item.kind === 'RootArray'" class="outline">[]</div> <div v-if="item.kind === 'RootArray'" class="outline">[]</div>
<div v-if="item.kind === 'ArrayMember'" class="outline"> <div v-if="item.kind === 'ArrayMember'" class="outline">
{{ item.index.toString() }} {{ item.index }}
</div> </div>
<div v-if="item.kind === 'ObjectMember'" class="outline"> <div v-if="item.kind === 'ObjectMember'" class="outline">
{{ item.name }} {{ item.name }}
@@ -87,7 +87,7 @@
<SmartItem <SmartItem
v-for="(arrayMember, astIndex) in item.astParent.values" v-for="(arrayMember, astIndex) in item.astParent.values"
:key="`ast-${astIndex}`" :key="`ast-${astIndex}`"
:label="astIndex.toString()" :label="`${astIndex}`"
@click.native=" @click.native="
() => { () => {
jumpCursor(arrayMember) jumpCursor(arrayMember)
@@ -235,7 +235,7 @@ const downloadResponse = () => {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
downloadIcon.value = "check" downloadIcon.value = "check"
$toast.success(t("state.download_started").toString(), { $toast.success(`${t("state.download_started")}`, {
icon: "downloading", icon: "downloading",
}) })
setTimeout(() => { setTimeout(() => {
@@ -257,7 +257,7 @@ const outlinePath = computed(() => {
const copyResponse = () => { const copyResponse = () => {
copyToClipboard(responseBodyText.value) copyToClipboard(responseBodyText.value)
copyIcon.value = "check" copyIcon.value = "check"
$toast.success(t("state.copied_to_clipboard").toString(), { $toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste", icon: "content_paste",
}) })
setTimeout(() => (copyIcon.value = "copy"), 1000) setTimeout(() => (copyIcon.value = "copy"), 1000)

View File

@@ -117,7 +117,7 @@ const downloadResponse = () => {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
downloadIcon.value = "check" downloadIcon.value = "check"
$toast.success(t("state.download_started").toString(), { $toast.success(`${t("state.download_started")}`, {
icon: "downloading", icon: "downloading",
}) })
setTimeout(() => { setTimeout(() => {
@@ -130,7 +130,7 @@ const downloadResponse = () => {
const copyResponse = () => { const copyResponse = () => {
copyToClipboard(responseBodyText.value) copyToClipboard(responseBodyText.value)
copyIcon.value = "check" copyIcon.value = "check"
$toast.success(t("state.copied_to_clipboard").toString(), { $toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste", icon: "content_paste",
}) })
setTimeout(() => (copyIcon.value = "copy"), 1000) setTimeout(() => (copyIcon.value = "copy"), 1000)

View File

@@ -118,7 +118,7 @@ const downloadResponse = () => {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
downloadIcon.value = "check" downloadIcon.value = "check"
$toast.success(t("state.download_started").toString(), { $toast.success(`${t("state.download_started")}`, {
icon: "downloading", icon: "downloading",
}) })
setTimeout(() => { setTimeout(() => {
@@ -131,7 +131,7 @@ const downloadResponse = () => {
const copyResponse = () => { const copyResponse = () => {
copyToClipboard(responseBodyText.value) copyToClipboard(responseBodyText.value)
copyIcon.value = "check" copyIcon.value = "check"
$toast.success(t("state.copied_to_clipboard").toString(), { $toast.success(`${t("state.copied_to_clipboard")}`, {
icon: "content_paste", icon: "content_paste",
}) })
setTimeout(() => (copyIcon.value = "copy"), 1000) setTimeout(() => (copyIcon.value = "copy"), 1000)

View File

@@ -19,7 +19,7 @@
v-for="(locale, index) in $i18n.locales.filter( v-for="(locale, index) in $i18n.locales.filter(
({ code }) => code !== $i18n.locale ({ code }) => code !== $i18n.locale
)" )"
:key="`locale-${index}`" :key="`locale-${String(index)}`"
:to="switchLocalePath(locale.code)" :to="switchLocalePath(locale.code)"
@click="$refs.language.tippy().hide()" @click="$refs.language.tippy().hide()"
> >

View File

@@ -384,10 +384,10 @@ export default defineComponent({
const preSelectionRange = range.cloneRange() const preSelectionRange = range.cloneRange()
preSelectionRange.selectNodeContents(containerEl) preSelectionRange.selectNodeContents(containerEl)
preSelectionRange.setEnd(range.startContainer, range.startOffset) preSelectionRange.setEnd(range.startContainer, range.startOffset)
start = preSelectionRange.toString().length start = `${preSelectionRange}`.length
return { return {
start, start,
end: start + range.toString().length, end: start + `${range}`.length,
} }
} else if (document.selection) { } else if (document.selection) {
const selectedTextRange = document.selection.createRange() const selectedTextRange = document.selection.createRange()

View File

@@ -9,19 +9,23 @@
class="pr-8" class="pr-8"
svg="type" svg="type"
outline outline
:label="getFontSizeName(fontSizes.find((size) => size == active))" :label="`${getFontSizeName(
fontSizes.find((size) => size == active)
)}`"
/> />
</span> </span>
</template> </template>
<SmartItem <SmartItem
v-for="(size, index) in fontSizes" v-for="(size, index) in fontSizes"
:key="`size-${index}`" :key="`size-${index}`"
:label="getFontSizeName(size)" :label="`${getFontSizeName(size)}`"
:info-icon="size === active ? 'done' : ''" :info-icon="size === active ? 'done' : ''"
:active-info-icon="size === active" :active-info-icon="size === active"
@click.native=" @click.native="
setActiveFont(size) () => {
$refs.fontSize.tippy().hide() setActiveFont(size)
$refs.fontSize.tippy().hide()
}
" "
/> />
</tippy> </tippy>

View File

@@ -17,7 +17,7 @@
{{ tab.icon }} {{ tab.icon }}
</i> </i>
<span v-if="tab.label">{{ tab.label }}</span> <span v-if="tab.label">{{ tab.label }}</span>
<span v-if="tab.info" class="tab-info"> <span v-if="tab.info && tab.info !== 'null'" class="tab-info">
{{ tab.info }} {{ tab.info }}
</span> </span>
</button> </button>

View File

@@ -35,8 +35,10 @@
svg="edit" svg="edit"
:label="$t('action.edit')" :label="$t('action.edit')"
@click.native=" @click.native="
$emit('edit-team') () => {
$refs.options.tippy().hide() $emit('edit-team')
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -45,8 +47,10 @@
color="red" color="red"
:label="$t('action.delete')" :label="$t('action.delete')"
@click.native=" @click.native="
deleteTeam() () => {
$refs.options.tippy().hide() deleteTeam()
$refs.options.tippy().hide()
}
" "
/> />
<SmartItem <SmartItem
@@ -54,8 +58,10 @@
svg="trash" svg="trash"
:label="$t('team.exit')" :label="$t('team.exit')"
@click.native=" @click.native="
exitTeam() () => {
$refs.options.tippy().hide() exitTeam()
$refs.options.tippy().hide()
}
" "
/> />
</tippy> </tippy>

View File

@@ -157,7 +157,7 @@ function getCodegenGeneralRESTInfo(
params: request.effectiveFinalParams.map((x) => ({ ...x, active: true })), params: request.effectiveFinalParams.map((x) => ({ ...x, active: true })),
method: request.method, method: request.method,
url: urlObj.origin, url: urlObj.origin,
queryString: urlObj.searchParams.toString(), queryString: `${urlObj.searchParams}`,
pathName: urlObj.pathname, pathName: urlObj.pathname,
} }
} }

View File

@@ -64,7 +64,7 @@ export const PhpCurlCodegen = {
} else { } else {
const requestObject = JSON.parse(requestBody) const requestObject = JSON.parse(requestBody)
requestBody = `"${Object.keys(requestObject) requestBody = `"${Object.keys(requestObject)
.map((key) => `${key}=${requestObject[key].toString()}`) .map((key) => `${key}=${requestObject[key]}`)
.join("&")}"` .join("&")}"`
} }
} }

View File

@@ -50,7 +50,7 @@ export default function runTestScriptWithVariables(
} catch (e: any) { } catch (e: any) {
pw._testReports.push({ pw._testReports.push({
result: "ERROR", result: "ERROR",
message: e.toString(), message: `${e}`,
styles: styles.ERROR, styles: styles.ERROR,
}) })
} }

View File

@@ -171,12 +171,12 @@ export default defineComponent({
if (workbox) { if (workbox) {
workbox.addEventListener("installed", (event: any) => { workbox.addEventListener("installed", (event: any) => {
if (event.isUpdate) { if (event.isUpdate) {
this.$toast.show(this.$t("app.new_version_found").toString(), { this.$toast.show(`${this.$t("app.new_version_found")}`, {
icon: "download_for_offline", icon: "download_for_offline",
duration: 0, duration: 0,
action: [ action: [
{ {
text: this.$t("app.reload").toString(), text: `${this.$t("app.reload")}`,
onClick: (_, toastObject) => { onClick: (_, toastObject) => {
toastObject.goAway(0) toastObject.goAway(0)
window.location.reload() window.location.reload()

View File

@@ -480,8 +480,10 @@
"title": "Teams" "title": "Teams"
}, },
"test": { "test": {
"failed": "test failed",
"javascript_code": "JavaScript Code", "javascript_code": "JavaScript Code",
"learn": "Read documentation", "learn": "Read documentation",
"passed": "test passed",
"report": "Test Report", "report": "Test Report",
"results": "Test Results", "results": "Test Results",
"script": "Script", "script": "Script",

View File

@@ -260,7 +260,6 @@ const restCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve path '${path}'. Ignoring editRequest dispatch.` `Could not resolve path '${path}'. Ignoring editRequest dispatch.`
) )
return {} return {}
} }
@@ -287,7 +286,6 @@ const restCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.` `Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.`
) )
return {} return {}
} }
@@ -312,7 +310,6 @@ const restCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve path '${path}'. Ignoring removeRequest dispatch.` `Could not resolve path '${path}'. Ignoring removeRequest dispatch.`
) )
return {} return {}
} }
@@ -364,7 +361,6 @@ const restCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve destination path '${destinationPath}'. Skipping moveRequest dispatch.` `Could not resolve destination path '${destinationPath}'. Skipping moveRequest dispatch.`
) )
return {} return {}
} }
@@ -533,7 +529,6 @@ const gqlCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve path '${path}'. Ignoring editRequest dispatch.` `Could not resolve path '${path}'. Ignoring editRequest dispatch.`
) )
return {} return {}
} }
@@ -560,7 +555,6 @@ const gqlCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.` `Could not resolve path '${path}'. Ignoring saveRequestAs dispatch.`
) )
return {} return {}
} }
@@ -585,7 +579,6 @@ const gqlCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve path '${path}'. Ignoring removeRequest dispatch.` `Could not resolve path '${path}'. Ignoring removeRequest dispatch.`
) )
return {} return {}
} }
@@ -637,7 +630,6 @@ const gqlCollectionDispatchers = defineDispatchers({
console.log( console.log(
`Could not resolve destination path '${destinationPath}'. Skipping moveRequest dispatch.` `Could not resolve destination path '${destinationPath}'. Skipping moveRequest dispatch.`
) )
return {} return {}
} }

View File

@@ -39,7 +39,6 @@ const dispatchers = defineDispatchers({
console.log( console.log(
`Ignoring possibly invalid current environment index assignment (value: ${newIndex})` `Ignoring possibly invalid current environment index assignment (value: ${newIndex})`
) )
return {} return {}
} }

View File

@@ -11,37 +11,40 @@
<SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10"> <SmartTabs styles="sticky bg-primary top-upperPrimaryStickyFold z-10">
<SmartTab <SmartTab
:id="'params'" :id="'params'"
:label="$t('tab.parameters')" :label="`${$t('tab.parameters')}`"
:selected="true" :selected="true"
:info="newActiveParamsCount$" :info="`${newActiveParamsCount$}`"
> >
<HttpParameters /> <HttpParameters />
</SmartTab> </SmartTab>
<SmartTab :id="'bodyParams'" :label="$t('tab.body')"> <SmartTab :id="'bodyParams'" :label="`${$t('tab.body')}`">
<HttpBody /> <HttpBody />
</SmartTab> </SmartTab>
<SmartTab <SmartTab
:id="'headers'" :id="'headers'"
:label="$t('tab.headers')" :label="`${$t('tab.headers')}`"
:info="newActiveHeadersCount$" :info="`${newActiveHeadersCount$}`"
> >
<HttpHeaders /> <HttpHeaders />
</SmartTab> </SmartTab>
<SmartTab :id="'authorization'" :label="$t('tab.authorization')"> <SmartTab
:id="'authorization'"
:label="`${$t('tab.authorization')}`"
>
<HttpAuthorization /> <HttpAuthorization />
</SmartTab> </SmartTab>
<SmartTab <SmartTab
:id="'preRequestScript'" :id="'preRequestScript'"
:label="$t('tab.pre_request_script')" :label="`${$t('tab.pre_request_script')}`"
> >
<HttpPreRequestScript /> <HttpPreRequestScript />
</SmartTab> </SmartTab>
<SmartTab :id="'tests'" :label="$t('tab.tests')"> <SmartTab :id="'tests'" :label="`${$t('tab.tests')}`">
<HttpTests /> <HttpTests />
</SmartTab> </SmartTab>
</SmartTabs> </SmartTabs>
@@ -60,15 +63,19 @@
> >
<aside> <aside>
<SmartTabs styles="sticky bg-primary z-10 top-0"> <SmartTabs styles="sticky bg-primary z-10 top-0">
<SmartTab :id="'history'" :label="$t('tab.history')" :selected="true"> <SmartTab
:id="'history'"
:label="`${$t('tab.history')}`"
:selected="true"
>
<History ref="historyComponent" :page="'rest'" /> <History ref="historyComponent" :page="'rest'" />
</SmartTab> </SmartTab>
<SmartTab :id="'collections'" :label="$t('tab.collections')"> <SmartTab :id="'collections'" :label="`${$t('tab.collections')}`">
<Collections /> <Collections />
</SmartTab> </SmartTab>
<SmartTab :id="'env'" :label="$t('environment.title')"> <SmartTab :id="'env'" :label="`${$t('environment.title')}`">
<Environments /> <Environments />
</SmartTab> </SmartTab>
</SmartTabs> </SmartTabs>
@@ -76,7 +83,7 @@
</Pane> </Pane>
<SmartConfirmModal <SmartConfirmModal
:show="confirmSync" :show="confirmSync"
:title="$t('confirm.sync')" :title="`${$t('confirm.sync')}`"
@hide-modal="confirmSync = false" @hide-modal="confirmSync = false"
@resolve="syncRequest" @resolve="syncRequest"
/> />
@@ -250,7 +257,7 @@ export default defineComponent({
restActiveParamsCount$.pipe( restActiveParamsCount$.pipe(
map((e) => { map((e) => {
if (e === 0) return null if (e === 0) return null
return e.toString() return `${e}`
}) })
), ),
null null
@@ -259,7 +266,7 @@ export default defineComponent({
restActiveHeadersCount$.pipe( restActiveHeadersCount$.pipe(
map((e) => { map((e) => {
if (e === 0) return null if (e === 0) return null
return e.toString() return `${e}`
}) })
), ),
null null

View File

@@ -13,7 +13,7 @@
<div class="p-8 md:col-span-2"> <div class="p-8 md:col-span-2">
<div v-if="currentUser === null"> <div v-if="currentUser === null">
<ButtonPrimary <ButtonPrimary
:label="$t('auth.login')" :label="`${$t('auth.login')}`"
@click.native="showLogin = true" @click.native="showLogin = true"
/> />
</div> </div>
@@ -333,8 +333,10 @@
)}`" )}`"
@hide-modal="confirmRemove = false" @hide-modal="confirmRemove = false"
@resolve=" @resolve="
toggleSetting('TELEMETRY_ENABLED') () => {
confirmRemove = false toggleSetting('TELEMETRY_ENABLED')
confirmRemove = false
}
" "
/> />
</div> </div>
@@ -451,7 +453,7 @@ export default defineComponent({
resetProxy() { resetProxy() {
applySetting("PROXY_URL", `https://proxy.hoppscotch.io/`) applySetting("PROXY_URL", `https://proxy.hoppscotch.io/`)
this.clearIcon = "check" this.clearIcon = "check"
this.$toast.success(this.$t("state.cleared").toString(), { this.$toast.success(`${this.$t("state.cleared")}`, {
icon: "clear_all", icon: "clear_all",
}) })
setTimeout(() => (this.clearIcon = "rotate-ccw"), 1000) setTimeout(() => (this.clearIcon = "rotate-ccw"), 1000)