chore: merge hoppscotch/staging into self-hosted/main

This commit is contained in:
Andrew Bastin
2023-04-04 21:12:21 +05:30
4 changed files with 70 additions and 58 deletions

View File

@@ -55,3 +55,6 @@ VITE_BACKEND_GQL_URL=http://localhost:3170/graphql
VITE_BACKEND_WS_URL=wss://localhost:3170/graphql VITE_BACKEND_WS_URL=wss://localhost:3170/graphql
VITE_BACKEND_API_URL=http://localhost:3170/v1 VITE_BACKEND_API_URL=http://localhost:3170/v1
# Terms Of Service And Privacy Policy Links (Optional)
VITE_APP_TOS_LINK=https://docs.hoppscotch.io/terms
VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/privacy

View File

@@ -1185,7 +1185,7 @@ const onRemoveRequest = () => {
}) })
if (possibleTab) { if (possibleTab) {
possibleTab.value.document.saveContext = undefined possibleTab.value.document.saveContext = null
possibleTab.value.document.isDirty = true possibleTab.value.document.isDirty = true
} }
} }

View File

@@ -76,18 +76,21 @@
</div> </div>
</template> </template>
<template #footer> <template #footer>
<div v-if="mode === 'sign-in'" class="text-secondaryLight text-tiny"> <div
v-if="mode === 'sign-in' && tosLink && privacyPolicyLink"
class="text-secondaryLight text-tiny"
>
By signing in, you are agreeing to our By signing in, you are agreeing to our
<HoppSmartAnchor <HoppSmartAnchor
class="link" class="link"
to="https://docs.hoppscotch.io/terms" :to="tosLink"
blank blank
label="Terms of Service" label="Terms of Service"
/> />
and and
<HoppSmartAnchor <HoppSmartAnchor
class="link" class="link"
to="https://docs.hoppscotch.io/privacy" :to="privacyPolicyLink"
blank blank
label="Privacy Policy" label="Privacy Policy"
/> />
@@ -141,6 +144,9 @@ export default defineComponent({
setup() { setup() {
const { subscribeToStream } = useStreamSubscriber() const { subscribeToStream } = useStreamSubscriber()
const tosLink = import.meta.env.VITE_APP_TOS_LINK
const privacyPolicyLink = import.meta.env.VITE_APP_PRIVACY_POLICY_LINK
return { return {
subscribeToStream, subscribeToStream,
t: useI18n(), t: useI18n(),
@@ -150,6 +156,8 @@ export default defineComponent({
IconEmail, IconEmail,
IconMicrosoft, IconMicrosoft,
IconArrowLeft, IconArrowLeft,
tosLink,
privacyPolicyLink,
} }
}, },
data() { data() {

View File

@@ -1,59 +1,60 @@
<template> <template>
<AppPaneLayout layout-id="http"> <div>
<template #primary> <AppPaneLayout layout-id="http">
<HoppSmartWindows <template #primary>
v-if="currentTabID" <HoppSmartWindows
:id="'rest_windows'" v-if="currentTabID"
v-model="currentTabID" :id="'rest_windows'"
@remove-tab="removeTab" v-model="currentTabID"
@add-tab="addNewTab" @remove-tab="removeTab"
@sort="sortTabs" @add-tab="addNewTab"
> @sort="sortTabs"
<HoppSmartWindow
v-for="tab in tabs"
:id="tab.id"
:key="tab.id"
:label="tab.document.request.name"
:is-removable="tabs.length > 1"
> >
<template #tabhead> <HoppSmartWindow
<span v-for="tab in tabs"
class="font-semibold truncate text-tiny w-10" :id="tab.id"
:class="getMethodLabelColorClassOf(tab.document.request)" :key="tab.id"
> :label="tab.document.request.name"
{{ tab.document.request.method }} :is-removable="tabs.length > 1"
</span> >
<span class="text-green-600 mr-1" v-if="tab.document.isDirty"> <template #tabhead>
<span
</span> class="font-semibold truncate text-tiny w-10"
<span class="truncate flex-1"> :class="getMethodLabelColorClassOf(tab.document.request)"
{{ tab.document.request.name }} >
</span> {{ tab.document.request.method }}
</template> </span>
<span class="text-green-600 mr-1" v-if="tab.document.isDirty">
<HttpRequestTab
:model-value="tab" </span>
@update:model-value="onTabUpdate" <span class="truncate flex-1">
/> {{ tab.document.request.name }}
</HoppSmartWindow> </span>
</HoppSmartWindows> </template>
</template> <HttpRequestTab
<template #sidebar> :model-value="tab"
<HttpSidebar /> @update:model-value="onTabUpdate"
</template> />
</AppPaneLayout> </HoppSmartWindow>
<HoppSmartConfirmModal </HoppSmartWindows>
:show="confirmingCloseForTabID !== null" </template>
:confirm="t('modal.close_unsaved_tab')" <template #sidebar>
:title="t('confirm.save_unsaved_tab')" <HttpSidebar />
@hide-modal="onCloseConfirmSaveTab" </template>
@resolve="onResolveConfirmSaveTab" </AppPaneLayout>
/> <HoppSmartConfirmModal
<CollectionsSaveRequest :show="confirmingCloseForTabID !== null"
:show="savingRequest" :confirm="t('modal.close_unsaved_tab')"
:mode="'rest'" :title="t('confirm.save_unsaved_tab')"
@hide-modal="onSaveModalClose" @hide-modal="onCloseConfirmSaveTab"
/> @resolve="onResolveConfirmSaveTab"
/>
<CollectionsSaveRequest
:show="savingRequest"
:mode="'rest'"
@hide-modal="onSaveModalClose"
/>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>