Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
Merge remote-tracking branch 'origin/main' into refactor/ui
liyasthomasa3bde5797a96
diff --cc components/realtime/Mqtt.vueindex ecce3de2f,0ff047bf1..afec01f2b--- a/components/realtime/Mqtt.vue+++ b/components/realtime/Mqtt.vue@@@ -128,12 -119,11 +128,13 @@@</template><script>+import { Splitpanes, Pane } from "splitpanes"import Paho from "paho-mqtt"import debounce from "~/helpers/utils/debounce"+ import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"export default {+ components: { Splitpanes, Pane },data() {return {url: "wss://test.mosquitto.org:8081",diff --cc components/realtime/Socketio.vueindex d1cfd05ef,0ee080f0c..ca0d9314d--- a/components/realtime/Socketio.vue+++ b/components/realtime/Socketio.vue@@@ -153,9 -141,9 +153,10 @@@ import { Splitpanes, Pane } from "splitimport { io as Client } from "socket.io-client"import wildcard from "socketio-wildcard"import debounce from "~/helpers/utils/debounce"+ import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"export default {+ components: { Splitpanes, Pane },data() {return {url: "wss://main-daxrc78qyb411dls-gtw.qovery.io",diff --cc components/realtime/Sse.vueindex 941ef7a80,eebea9c36..ed6f39a3d--- a/components/realtime/Sse.vue+++ b/components/realtime/Sse.vue@@@ -52,7 -48,7 +52,8 @@@</template><script>+import { Splitpanes, Pane } from "splitpanes"+ import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"import debounce from "~/helpers/utils/debounce"export default {diff --cc components/realtime/Websocket.vueindex 254157216,f089e7c87..ae326c561--- a/components/realtime/Websocket.vue+++ b/components/realtime/Websocket.vue@@@ -168,12 -159,10 +168,13 @@@</template><script>+import { Splitpanes, Pane } from "splitpanes"+ import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"import debounce from "~/helpers/utils/debounce"+import "splitpanes/dist/splitpanes.css"export default {+ components: { Splitpanes, Pane },data() {return {connectionState: false,diff --cc components/smart/AccentModePicker.vueindex 521453818,7e73d9f1c..53abb48f5--- a/components/smart/AccentModePicker.vue+++ b/components/smart/AccentModePicker.vue@@@ -21,36 -38,37 +21,34 @@@</div></template>- <script>- import { getLocalConfig, setLocalConfig } from "~/newstore/localpersistence"+ <script lang="ts">+ import Vue from "vue"+ import {+ HoppAccentColors,+ HoppAccentColor,+ getSettingSubject,+ settingsStore,+ applySetting,+ } from "~/newstore/settings"- export default {+ export default Vue.extend({data() {return {- active: getLocalConfig("THEME_COLOR") || "green",- accentColors: [- "blue",- "green",- "teal",- "indigo",- "purple",- "orange",- "pink",- "red",- "yellow",- ],+ accentColors: HoppAccentColors,+ active: settingsStore.value.THEME_COLOR,}},- watch: {- active(color) {- setLocalConfig("THEME_COLOR", color)- },+ subscriptions() {+ return {+ active: getSettingSubject("THEME_COLOR"),+ }},methods: {- setActiveColor(color) {+ setActiveColor(color: HoppAccentColor) {document.documentElement.setAttribute("data-accent", color)- this.active = color++ applySetting("THEME_COLOR", color)},- capitalized(color: HoppAccentColor) {- return `${color.charAt(0).toUpperCase()}${color.slice(1)}`- },},- }+ })</script>diff --cc helpers/fb/index.tsindex 25566d530,9eb128b11..7b90baa17--- a/helpers/fb/index.ts+++ b/helpers/fb/index.ts@@@ -20,14 -21,20 +21,20 @@@ let initialized = falsexport function initializeFirebase() {if (!initialized) {- firebase.initializeApp(firebaseConfig)+ try {+ firebase.initializeApp(firebaseConfig)- initAuth()- initSettings()- initCollections()- initHistory()- initEnvironments()+ initAuth()+ initSettings()+ initCollections()+ initHistory()+ initEnvironments()+ initAnalytics()- initialized = true+ initialized = true+ } catch (e) {+ // initializeApp throws exception if we reinitialize+ initialized = true+ }}-}+}diff --cc lang/en-US.jsonindex 925aa778c,2156ea1b9..5f03d26a9--- a/lang/en-US.json+++ b/lang/en-US.json@@@ -342,8 -342,5 +344,9 @@@"show_sidebar": "Show sidebar","protocols": "Protocols","protocol_count": "protocol {count}",+ "share": "Share",+ "interceptor": "Interceptor",+ "profile": "Profile",- "are_you_sure_logout": "Are you sure you want to logout?"++ "are_you_sure_logout": "Are you sure you want to logout?",+ "telemetry": "Telemetry"}diff --cc layouts/default.vueindex 70f9d3503,e03c71b72..0172464c3--- a/layouts/default.vue+++ b/layouts/default.vue@@@ -64,32 -14,14 +64,29 @@@</template><script>+import { Splitpanes, Pane } from "splitpanes"+import "splitpanes/dist/splitpanes.css"-- import {- setupLocalPersistence,- getLocalConfig,- } from "~/newstore/localpersistence"+ import { setupLocalPersistence } from "~/newstore/localpersistence"import { performMigrations } from "~/helpers/migrations"import { initUserInfo } from "~/helpers/teams/BackendUserInfo"import { registerApolloAuthUpdate } from "~/helpers/apollo"import { initializeFirebase } from "~/helpers/fb"+ import { getSettingSubject } from "~/newstore/settings"export default {+ components: { Splitpanes, Pane },+ data() {+ return {+ hideNavigationPane: false,+ zenMode: false,+ hideRightPane: false,+ }+ },+ watch: {+ zenMode(zenMode) {+ this.hideNavigationPane = this.hideRightPane = zenMode+ },+ },beforeMount() {registerApolloAuthUpdate()diff --cc pages/graphql.vueindex e4fc9e687,9dc899aa2..d5d5691da--- a/pages/graphql.vue+++ b/pages/graphql.vue@@@ -455,12 -485,12 +455,13 @@@ import { Splitpanes, Pane } from "splitimport * as gql from "graphql"import { commonHeaders } from "~/helpers/headers"import { getPlatformSpecialKey } from "~/helpers/platformutils"- import { sendNetworkRequest } from "~/helpers/network"+ import { getCurrentStrategyID, sendNetworkRequest } from "~/helpers/network"import { getSettingSubject } from "~/newstore/settings"import { addGraphqlHistoryEntry } from "~/newstore/history"+ import { logHoppRequestRunToAnalytics } from "~/helpers/fb/analytics"export default {+ components: { Splitpanes, Pane },beforeRouteLeave(_to, _from, next) {this.isPollingSchema = falseif (this.timeoutSubscription) clearTimeout(this.timeoutSubscription)diff --cc pages/settings.vueindex 849e56a65,65dbecaf1..11b245f55--- a/pages/settings.vue+++ b/pages/settings.vue@@@ -1,282 -1,224 +1,299 @@@<template>- <div class="page">- <div v-if="currentBackendUser && currentBackendUser.eaInvited">- <Teams />- </div>-- <AppSection label="account">- <div class="flex flex-col">- <label>{{ $t("account") }}</label>- <div v-if="currentUser">- <button class="icon button">- <img- v-if="currentUser.photoURL"- :src="currentUser.photoURL"- class="w-6 h-6 rounded-full material-icons"- />- <i v-else class="material-icons">account_circle</i>- <span>- {{ currentUser.displayName || $t("nothing_found") }}- </span>- </button>- <br />- <button class="icon button">- <i class="material-icons">email</i>- <span>- {{ currentUser.email || $t("nothing_found") }}- </span>- </button>- <br />- <FirebaseLogout />- <p>- <SmartToggle- :on="SYNC_COLLECTIONS"- @change="toggleSettings('syncCollections', !SYNC_COLLECTIONS)"- >- {{ $t("syncCollections") + " " + $t("sync") }}- {{ SYNC_COLLECTIONS ? $t("enabled") : $t("disabled") }}- </SmartToggle>- </p>-- <p>- <SmartToggle- :on="SYNC_ENVIRONMENTS"- @change="toggleSettings('syncEnvironments', !SYNC_ENVIRONMENTS)"- >- {{ $t("syncEnvironments") + " " + $t("sync") }}- {{ SYNC_ENVIRONMENTS ? $t("enabled") : $t("disabled") }}- </SmartToggle>- </p>-- <p>- <SmartToggle- :on="SYNC_HISTORY"- @change="toggleSettings('syncHistory', !SYNC_HISTORY)"- >- {{ $t("syncHistory") + " " + $t("sync") }}- {{ SYNC_HISTORY ? $t("enabled") : $t("disabled") }}- </SmartToggle>- </p>- </div>- <div v-else>- <label>{{ $t("login_with") }}</label>- <p>- <FirebaseLogin @show-email="showEmail = true" />+ <div>+ <div class="space-y-8">+ <div class="md:grid md:grid-cols-3 md:gap-4">+ <div class="md:col-span-1 p-8">+ <h3 class="heading">+ {{ $t("account") }}+ </h3>+ <p class="mt-1 text-xs text-secondaryLight">+ Customize your account settings.</p></div>- </div>- </AppSection>-- <AppSection label="theme">- <div class="flex flex-col">- <label>{{ $t("theme") }}</label>- <SmartColorModePicker />- <SmartAccentModePicker />- <span>- <SmartToggle- :on="SCROLL_INTO_ENABLED"- @change="toggleSetting('SCROLL_INTO_ENABLED')"- >- {{ $t("scrollInto_use_toggle") }}- {{ SCROLL_INTO_ENABLED ? $t("enabled") : $t("disabled") }}- </SmartToggle>- </span>- </div>- </AppSection>-- <AppSection label="extensions">- <div class="flex flex-col">- <label>{{ $t("extensions") }}</label>- <div class="row-wrapper">- <SmartToggle- :on="EXTENSIONS_ENABLED"- @change="toggleSetting('EXTENSIONS_ENABLED')"- >- {{ $t("extensions_use_toggle") }}- </SmartToggle>+ <div class="md:col-span-2 border border-divider p-8 rounded-lg">+ <div v-if="currentUser === null">+ <ButtonPrimary label="Log in" @click.native="showLogin = true" />+ <div class="mt-4 text-xs text-secondaryLight">+ Log in to access.+ </div>+ </div>+ <div v-else class="space-y-8">+ <fieldset>+ <legend class="font-bold text-secondaryDark">User</legend>+ <div class="mt-4 space-y-4">+ <div class="flex items-start">+ <div class="flex items-center">+ <img+ v-if="currentUser.photoURL"+ :src="currentUser.photoURL"+ class="w-5 h-5 rounded-full"+ />+ <i v-else class="material-icons">account_circle</i>+ </div>+ <div class="ml-4">+ <label>+ {{ currentUser.displayName || $t("nothing_found") }}+ </label>+ <p class="mt-1 text-xs text-secondaryLight">+ This is your display name.+ </p>+ </div>+ </div>+ <div class="flex items-start">+ <div class="flex items-center">+ <i class="material-icons">email</i>+ </div>+ <div class="ml-4">+ <label>+ {{ currentUser.email || $t("nothing_found") }}+ </label>+ <p class="mt-1 text-xs text-secondaryLight">+ Your primary email address.+ </p>+ </div>+ </div>+ </div>+ </fieldset>+ <fieldset>+ <legend class="font-bold text-secondaryDark">Sync</legend>+ <div class="mt-1 text-xs text-secondaryLight">+ These settings are synced to cloud.+ </div>+ <div class="mt-4 space-y-4">+ <div class="flex items-center">+ <SmartToggle+ :on="SYNC_COLLECTIONS"+ @change="+ toggleSettings('syncCollections', !SYNC_COLLECTIONS)+ "+ >+ {{ $t("syncCollections") }}+ </SmartToggle>+ </div>+ <div class="flex items-center">+ <SmartToggle+ :on="SYNC_ENVIRONMENTS"+ @change="+ toggleSettings('syncEnvironments', !SYNC_ENVIRONMENTS)+ "+ >+ {{ $t("syncEnvironments") }}+ </SmartToggle>+ </div>+ <div class="flex items-center">+ <SmartToggle+ :on="SYNC_HISTORY"+ @change="toggleSettings('syncHistory', !SYNC_HISTORY)"+ >+ {{ $t("syncHistory") }}+ </SmartToggle>+ </div>+ </div>+ </fieldset>+ </div></div>- <p v-if="extensionVersion != null" class="info">- {{ $t("extension_version") }}: v{{ extensionVersion.major }}.{{- extensionVersion.minor- }}- </p>- <p v-else class="info">- {{ $t("extension_version") }}: {{ $t("extension_ver_not_reported") }}- </p></div>- </AppSection>- <AppSection label="proxy">- <div class="flex flex-col">- <label>{{ $t("proxy") }}</label>- <div class="row-wrapper">- <span>- <SmartToggle- :on="PROXY_ENABLED"- @change="toggleSetting('PROXY_ENABLED')"- >- {{ $t("proxy") }}- {{ PROXY_ENABLED ? $t("enabled") : $t("disabled") }}- </SmartToggle>- </span>- <a- href="https://github.com/hoppscotch/hoppscotch/wiki/Proxy"- target="_blank"- rel="noopener"- >- <button v-tooltip="$t('wiki')" class="icon button">- <i class="material-icons">help_outline</i>- </button>- </a>+ <div class="md:grid md:grid-cols-3 md:gap-4">+ <div class="md:col-span-1 p-8">+ <h3 class="heading">+ {{ $t("theme") }}+ </h3>+ <p class="mt-1 text-xs text-secondaryLight">+ Customize your application theme.+ </p></div>- <div class="row-wrapper">- <label for="url">{{ $t("url") }}</label>- <button- v-tooltip.bottom="$t('reset_default')"- class="icon button"- @click="resetProxy"- >- <i class="material-icons">{{ clearIcon }}</i>- </button>+ <div+ class="md:col-span-2 border border-divider p-8 rounded-lg space-y-8"+ >+ <fieldset>+ <legend class="font-bold text-secondaryDark">+ {{ $t("background") }}+ </legend>+ <div class="mt-1 text-xs text-secondaryLight">+ <ColorScheme placeholder="..." tag="span">+ {{+ $colorMode.preference.charAt(0).toUpperCase() ++ $colorMode.preference.slice(1)+ }}+ <span v-if="$colorMode.preference === 'system'">+ ({{ $colorMode.value }} mode detected)+ </span>+ </ColorScheme>+ </div>+ <div class="mt-4">+ <SmartColorModePicker />+ </div>+ </fieldset>+ <fieldset>+ <legend class="font-bold text-secondaryDark">+ {{ $t("color") }}+ </legend>+ <div class="mt-1 text-xs text-secondaryLight">+ {{ active.charAt(0).toUpperCase() + active.slice(1) }}+ </div>+ <div class="mt-4">+ <SmartAccentModePicker />+ </div>+ </fieldset>+ <fieldset>+ <legend class="font-bold text-secondaryDark">+ {{ $t("experiments") }}+ </legend>+ <div class="mt-1 text-xs text-secondaryLight">+ {{ $t("experiments_notice") }}+ <SmartLink+ class="link"+ to="https://github.com/hoppscotch/hoppscotch/issues/new/choose"+ blank+ >+ {{ $t("contact_us") }} </SmartLink+ >.+ </div>+ <div class="mt-4 space-y-4">+ <div class="flex items-center">+ <SmartToggle+ :on="SCROLL_INTO_ENABLED"+ @change="toggleSetting('SCROLL_INTO_ENABLED')"+ >+ {{ $t("scrollInto_use_toggle") }}+ </SmartToggle>+ </div>+ <div class="flex items-center">+ <SmartToggle+ :on="EXPERIMENTAL_URL_BAR_ENABLED"+ @change="toggleSetting('EXPERIMENTAL_URL_BAR_ENABLED')"+ >+ {{ $t("use_experimental_url_bar") }}+ </SmartToggle>+ </div>++ <div class="flex items-center">++ <SmartToggle :on="TELEMETRY_ENABLED" @change="showConfirmModal">++ {{ $t("telemetry") }}++ {{ TELEMETRY_ENABLED ? $t("enabled") : $t("disabled") }}++ </SmartToggle>++ </div>+ </div>+ </fieldset></div>- <input- id="url"- v-model="PROXY_URL"- class="input"- type="url"- :disabled="!PROXY_ENABLED"- :placeholder="$t('url')"- />- <p class="info">- {{ $t("official_proxy_hosting") }}- <br />- {{ $t("read_the") }}- <a- class="link"- href="https://github.com/hoppscotch/proxyscotch/wiki/Privacy-policy"- target="_blank"- rel="noopener"- >- {{ $t("proxy_privacy_policy") }} </a- >.- </p></div>- <!--- PROXY SETTINGS URL AND KEY- --------------- This feature is currently not finished.- <ul>- <li>- <label for="url">URL</label>- <input class="input" id="url" type="url" v-model="settings.PROXY_URL" :disabled="!settings.PROXY_ENABLED">- </li>- <li>- <label for="key">Key</label>- <input class="input" id="key" type="password" v-model="settings.PROXY_KEY" :disabled="!settings.PROXY_ENABLED" @change="applySetting('PROXY_KEY', $event)">- </li>- </ul>- -->- </AppSection>- <AppSection label="experiments">- <div class="flex flex-col">- <label>{{ $t("experiments") }}</label>- <p class="info">- {{ $t("experiments_notice") }}- <a- class="link"- href="https://github.com/hoppscotch/hoppscotch/issues/new/choose"- target="_blank"- rel="noopener noreferrer"- >{{ $t("contact_us") }}</a- >.- </p>- <div class="row-wrapper">- <SmartToggle- :on="EXPERIMENTAL_URL_BAR_ENABLED"- @change="toggleSetting('EXPERIMENTAL_URL_BAR_ENABLED')"- >- {{ $t("use_experimental_url_bar") }}- </SmartToggle>+ <div class="md:grid md:grid-cols-3 md:gap-4">+ <div class="md:col-span-1 p-8">+ <h3 class="heading">+ {{ $t("interceptor") }}+ </h3>+ <p class="mt-1 text-xs text-secondaryLight">+ Middleware between application and APIs.+ </p>+ </div>+ <div+ class="md:col-span-2 border border-divider p-8 rounded-lg space-y-8"+ >+ <fieldset>+ <legend class="font-bold text-secondaryDark">+ {{ $t("extensions") }}+ </legend>+ <div class="mt-1 text-xs text-secondaryLight">+ <span v-if="extensionVersion != null">+ {{+ `${$t("extension_version")}: v${extensionVersion.major}.${+ extensionVersion.minor+ }`+ }}+ </span>+ <span v-else>+ {{ $t("extension_version") }}:+ {{ $t("extension_ver_not_reported") }}+ </span>+ </div>+ <div class="mt-4 space-y-4">+ <div class="flex items-center">+ <SmartToggle+ :on="EXTENSIONS_ENABLED"+ @change="toggleSetting('EXTENSIONS_ENABLED')"+ >+ {{ $t("extensions_use_toggle") }}+ </SmartToggle>+ </div>+ </div>+ </fieldset>+ <fieldset>+ <legend class="font-bold text-secondaryDark">+ {{ $t("proxy") }}+ </legend>+ <div class="mt-1 text-xs text-secondaryLight">+ {{ `${$t("official_proxy_hosting")} ${$t("read_the")}` }}+ <SmartLink+ class="link"+ to="https://github.com/hoppscotch/proxyscotch/wiki/Privacy-policy"+ blank+ >+ {{ $t("proxy_privacy_policy") }} </SmartLink+ >.+ </div>+ <div class="mt-4 space-y-4">+ <div class="flex items-center">+ <SmartToggle+ :on="PROXY_ENABLED"+ @change="toggleSetting('PROXY_ENABLED')"+ />+ <label+ for="url"+ class="+ rounded-l+ ml-2+ border+ px-2+ py-1+ bg-primaryLight+ border-divider+ "+ >{{ $t("url") }}</label+ >+ <input+ id="url"+ v-model="PROXY_URL"+ class="+ flex-1+ block+ w-full+ rounded-r+ border+ px-2+ py-1+ mr-2+ border-divider+ "+ type="url"+ :disabled="!PROXY_ENABLED"+ :placeholder="$t('url')"+ />+ <ButtonSecondary+ v-tippy="{ theme: 'tooltip' }"+ :title="$t('reset_default')"+ :icon="clearIcon"+ @click.native="resetProxy"+ />+ </div>+ </div>+ </fieldset></div>- <span>- <SmartToggle :on="TELEMETRY_ENABLED" @change="showConfirmModal">- {{ $t("telemetry") }}- {{ TELEMETRY_ENABLED ? $t("enabled") : $t("disabled") }}- </SmartToggle>- </span></div>- </AppSection>+ </div>-+ <FirebaseLogin :show="showLogin" @hide-modal="showLogin = false" />+ <FirebaseEmail :show="showEmail" @hide-modal="showEmail = false" />+ <SmartConfirmModal+ :show="confirmRemove"+ :title="`${$t('are_you_sure_remove_telemetry')} ${$t(+ 'telemetry_helps_us'+ )}`"+ @hide-modal="confirmRemove = false"+ @resolve="+ toggleSetting('TELEMETRY_ENABLED')+ confirmRemove = false+ "+ /></div></template>@@@ -314,11 -256,14 +331,14 @@@ export default Vue.extend(EXTENSIONS_ENABLED: true,PROXY_ENABLED: true,- showEmail: false,-- currentBackendUser: null,currentUser: null,+ showLogin: false,++ active: getLocalConfig("THEME_COLOR") || "green",+ confirmRemove: false,++ TELEMETRY_ENABLED: null,}},subscriptions() {@@@ -339,6 -284,10 +359,8 @@@SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),SYNC_HISTORY: getSettingSubject("syncHistory"),+ TELEMETRY_ENABLED: getSettingSubject("TELEMETRY_ENABLED"),+- // Teams feature flag- currentBackendUser: currentUserInfo$,currentUser: currentUser$,}},