feat(filename): added filename in download functional (#4329)

Co-authored-by: Dmitry Mukovkin <d.mukovkin@cft.ru>
Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
Dmitry
2024-09-19 19:53:40 +07:00
committed by GitHub
parent 875e2fae97
commit 5a06e52389
15 changed files with 56 additions and 46 deletions

View File

@@ -259,5 +259,11 @@ const filteredCodegenDefinitions = computed(() => {
})
const { copyIcon, copyResponse } = useCopyResponse(requestCode)
const { downloadIcon, downloadResponse } = useDownloadResponse("", requestCode)
const { downloadIcon, downloadResponse } = useDownloadResponse(
"",
requestCode,
t("filename.codegen", {
request_name: request.value.name,
})
)
</script>

View File

@@ -26,12 +26,6 @@
:icon="IconWrapText"
@click.prevent="toggleNestedSetting('WRAP_LINES', 'importCurl')"
/>
<HoppButtonSecondary
v-tippy="{ theme: 'tooltip', allowHTML: true }"
:title="t('action.download_file')"
:icon="downloadIcon"
@click="downloadResponse"
/>
<HoppButtonSecondary
v-tippy="{ theme: 'tooltip', allowHTML: true }"
:title="t('action.copy')"
@@ -84,10 +78,7 @@ import { useCodemirror } from "@composables/codemirror"
import { useI18n } from "@composables/i18n"
import { useToast } from "@composables/toast"
import { parseCurlToHoppRESTReq } from "~/helpers/curl"
import {
useCopyResponse,
useDownloadResponse,
} from "~/composables/lens-actions"
import { useCopyResponse } from "~/composables/lens-actions"
import IconWrapText from "~icons/lucide/wrap-text"
import IconClipboard from "~icons/lucide/clipboard"
@@ -183,7 +174,6 @@ const handlePaste = async () => {
}
const { copyIcon, copyResponse } = useCopyResponse(curl)
const { downloadIcon, downloadResponse } = useDownloadResponse("", curl)
const clearContent = () => {
curl.value = ""