chore: add doc button if response is null
This commit is contained in:
@@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<HttpResponse :document="tab.document" />
|
<HttpResponse :document="tab.document" :is-embed="true" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="relative flex flex-1 flex-col">
|
<div class="relative flex flex-1 flex-col">
|
||||||
<HttpResponseMeta :response="doc.response" />
|
<HttpResponseMeta :response="doc.response" :is-embed="isEmbed" />
|
||||||
<LensesResponseBodyRenderer
|
<LensesResponseBodyRenderer
|
||||||
v-if="!loading && hasResponse"
|
v-if="!loading && hasResponse"
|
||||||
v-model:document="doc"
|
v-model:document="doc"
|
||||||
@@ -15,6 +15,7 @@ import { HoppRESTDocument } from "~/helpers/rest/document"
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
document: HoppRESTDocument
|
document: HoppRESTDocument
|
||||||
|
isEmbed: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
@@ -2,8 +2,20 @@
|
|||||||
<div
|
<div
|
||||||
class="sticky top-0 z-10 flex flex-shrink-0 items-center justify-center overflow-auto overflow-x-auto whitespace-nowrap bg-primary p-4"
|
class="sticky top-0 z-10 flex flex-shrink-0 items-center justify-center overflow-auto overflow-x-auto whitespace-nowrap bg-primary p-4"
|
||||||
>
|
>
|
||||||
<AppShortcutsPrompt v-if="response == null" class="flex-1" />
|
<AppShortcutsPrompt v-if="response == null && !isEmbed" class="flex-1" />
|
||||||
<div v-else class="flex flex-1 flex-col">
|
|
||||||
|
<div v-if="response == null && isEmbed">
|
||||||
|
<HoppButtonSecondary
|
||||||
|
:label="`${t('app.documentation')}`"
|
||||||
|
to="https://docs.hoppscotch.io/documentation/features/rest-api-testing#response"
|
||||||
|
:icon="IconExternalLink"
|
||||||
|
blank
|
||||||
|
outline
|
||||||
|
reverse
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="response" class="flex flex-1 flex-col">
|
||||||
<div
|
<div
|
||||||
v-if="response.type === 'loading'"
|
v-if="response.type === 'loading'"
|
||||||
class="flex flex-col items-center justify-center"
|
class="flex flex-col items-center justify-center"
|
||||||
@@ -105,6 +117,7 @@ import { getStatusCodeReasonPhrase } from "~/helpers/utils/statusCodes"
|
|||||||
import { useService } from "dioc/vue"
|
import { useService } from "dioc/vue"
|
||||||
import { InspectionService } from "~/services/inspection"
|
import { InspectionService } from "~/services/inspection"
|
||||||
import { RESTTabService } from "~/services/tab/rest"
|
import { RESTTabService } from "~/services/tab/rest"
|
||||||
|
import IconExternalLink from "~icons/lucide/external-link"
|
||||||
|
|
||||||
const t = useI18n()
|
const t = useI18n()
|
||||||
const colorMode = useColorMode()
|
const colorMode = useColorMode()
|
||||||
@@ -112,6 +125,7 @@ const tabs = useService(RESTTabService)
|
|||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
response: HoppRESTResponse | null | undefined
|
response: HoppRESTResponse | null | undefined
|
||||||
|
isEmbed?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user