From 17f826489fd02d610e185387469d3d5b84a436ec Mon Sep 17 00:00:00 2001 From: Nivedin <53208152+nivedin@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:14:16 +0530 Subject: [PATCH] feat: added developer options to copy user id token (#2204) Co-authored-by: Andrew Bastin --- .../components/app/DeveloperOptions.vue | 91 +++++++++++++++++++ .../hoppscotch-app/components/app/Footer.vue | 22 ++++- packages/hoppscotch-app/locales/en.json | 3 + 3 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 packages/hoppscotch-app/components/app/DeveloperOptions.vue diff --git a/packages/hoppscotch-app/components/app/DeveloperOptions.vue b/packages/hoppscotch-app/components/app/DeveloperOptions.vue new file mode 100644 index 000000000..a75d80ac0 --- /dev/null +++ b/packages/hoppscotch-app/components/app/DeveloperOptions.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/packages/hoppscotch-app/components/app/Footer.vue b/packages/hoppscotch-app/components/app/Footer.vue index 0c3acd548..013f9077d 100644 --- a/packages/hoppscotch-app/components/app/Footer.vue +++ b/packages/hoppscotch-app/components/app/Footer.vue @@ -144,7 +144,10 @@ blank @click.native="options.tippy().hide()" /> -
+
{{ `${t("app.name")} v${$config.clientVersion}` }}
@@ -190,6 +193,10 @@ + @@ -198,11 +205,13 @@ import { ref, watch } from "@nuxtjs/composition-api" import { defineActionHandler } from "~/helpers/actions" import { showChat } from "~/helpers/support" import { useSetting } from "~/newstore/settings" -import { useI18n } from "~/helpers/utils/composables" +import { useI18n, useReadonlyStream } from "~/helpers/utils/composables" +import { currentUser$ } from "~/helpers/fb/auth" const t = useI18n() const showShortcuts = ref(false) const showShare = ref(false) +const showDeveloperOptions = ref(false) const showSearch = ref(false) defineActionHandler("flyouts.keybinds.toggle", () => { @@ -225,6 +234,8 @@ const SIDEBAR_ON_LEFT = useSetting("SIDEBAR_ON_LEFT") const navigatorShare = !!navigator.share +const currentUser = useReadonlyStream(currentUser$, null) + watch( () => ZEN_MODE.value, () => { @@ -251,6 +262,13 @@ const chatWithUs = () => { showChat() } +const showDeveloperOptionModal = () => { + if (currentUser.value) { + showDeveloperOptions.value = true + options.value.tippy().hide() + } +} + // Template refs const tippyActions = ref(null) const documentation = ref(null) diff --git a/packages/hoppscotch-app/locales/en.json b/packages/hoppscotch-app/locales/en.json index 1121a07f7..e73b2cc1a 100644 --- a/packages/hoppscotch-app/locales/en.json +++ b/packages/hoppscotch-app/locales/en.json @@ -44,7 +44,10 @@ "chat_with_us": "Chat with us", "contact_us": "Contact us", "copy": "Copy", + "copy_user_id": "Copy User Auth Token", "documentation": "Documentation", + "developer_option": "Developer options", + "developer_option_description": "Developer tools which helps in development and maintenance of Hoppscotch.", "github": "GitHub", "help": "Help & feedback", "home": "Home",