Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

feat: context menu for secondary actions in collection, environment and team components - #2005

liyasthomas75e34feabf83
diff --git a/packages/hoppscotch-app/components/collections/graphql/Collection.vue b/packages/hoppscotch-app/components/collections/graphql/Collection.vue
index d0fa4c3ab..8506f3fd3 100644
--- a/packages/hoppscotch-app/components/collections/graphql/Collection.vue
+++ b/packages/hoppscotch-app/components/collections/graphql/Collection.vue
@@ -8,6 +8,7 @@
@drop="dragging = false"
@dragleave="dragging = false"
@dragend="dragging = false"
+ @contextmenu.prevent="$refs.options.tippy().show()"
>
<span
class="cursor-pointer flex px-4 items-center justify-center"
diff --git a/packages/hoppscotch-app/components/collections/graphql/Folder.vue b/packages/hoppscotch-app/components/collections/graphql/Folder.vue
index 2089d4df8..ce7806ec8 100644
--- a/packages/hoppscotch-app/components/collections/graphql/Folder.vue
+++ b/packages/hoppscotch-app/components/collections/graphql/Folder.vue
@@ -8,6 +8,7 @@
@drop="dragging = false"
@dragleave="dragging = false"
@dragend="dragging = false"
+ @contextmenu.prevent="$refs.options.tippy().show()"
>
<span
class="cursor-pointer flex px-4 items-center justify-center"
diff --git a/packages/hoppscotch-app/components/collections/graphql/Request.vue b/packages/hoppscotch-app/components/collections/graphql/Request.vue
index 9a5d9f5f5..7316ce465 100644
--- a/packages/hoppscotch-app/components/collections/graphql/Request.vue
+++ b/packages/hoppscotch-app/components/collections/graphql/Request.vue
@@ -7,6 +7,7 @@
@dragover.stop
@dragleave="dragging = false"
@dragend="dragging = false"
+ @contextmenu.prevent="$refs.options.tippy().show()"
>
<span
class="cursor-pointer flex px-2 w-16 items-center justify-center truncate"
diff --git a/packages/hoppscotch-app/components/collections/my/Collection.vue b/packages/hoppscotch-app/components/collections/my/Collection.vue
index b18e5cfe3..f6287e870 100644
--- a/packages/hoppscotch-app/components/collections/my/Collection.vue
+++ b/packages/hoppscotch-app/components/collections/my/Collection.vue
@@ -8,6 +8,7 @@
@drop="dragging = false"
@dragleave="dragging = false"
@dragend="dragging = false"
+ @contextmenu.prevent="$refs.options.tippy().show()"
>
<span
class="cursor-pointer flex px-4 items-center justify-center"
diff --git a/packages/hoppscotch-app/components/collections/my/Folder.vue b/packages/hoppscotch-app/components/collections/my/Folder.vue
index 79e290f24..e4b9e18e7 100644
--- a/packages/hoppscotch-app/components/collections/my/Folder.vue
+++ b/packages/hoppscotch-app/components/collections/my/Folder.vue
@@ -8,6 +8,7 @@
@drop="dragging = false"
@dragleave="dragging = false"
@dragend="dragging = false"
+ @contextmenu.prevent="$refs.options.tippy().show()"
>
<span
class="cursor-pointer flex px-4 items-center justify-center"
diff --git a/packages/hoppscotch-app/components/collections/my/Request.vue b/packages/hoppscotch-app/components/collections/my/Request.vue
index 5e82377d5..be1568bbd 100644
--- a/packages/hoppscotch-app/components/collections/my/Request.vue
+++ b/packages/hoppscotch-app/components/collections/my/Request.vue
@@ -7,6 +7,7 @@
@dragover.stop
@dragleave="dragging = false"
@dragend="dragging = false"
+ @contextmenu.prevent="$refs.options.tippy().show()"
>
<span
class="cursor-pointer flex px-2 w-16 items-center justify-center truncate"
diff --git a/packages/hoppscotch-app/components/collections/teams/Collection.vue b/packages/hoppscotch-app/components/collections/teams/Collection.vue
index f5ab526e6..d9c75f546 100644
--- a/packages/hoppscotch-app/components/collections/teams/Collection.vue
+++ b/packages/hoppscotch-app/components/collections/teams/Collection.vue
@@ -1,6 +1,9 @@
<template>
<div class="flex flex-col">
- <div class="flex items-stretch group">
+ <div
+ class="flex items-stretch group"
+ @contextmenu.prevent="$refs.options.tippy().show()"
+ >
<span
class="cursor-pointer flex px-4 items-center justify-center"
@click="toggleShowChildren()"
diff --git a/packages/hoppscotch-app/components/collections/teams/Folder.vue b/packages/hoppscotch-app/components/collections/teams/Folder.vue
index f74266f39..02a1dfff0 100644
--- a/packages/hoppscotch-app/components/collections/teams/Folder.vue
+++ b/packages/hoppscotch-app/components/collections/teams/Folder.vue
@@ -1,6 +1,9 @@
<template>
<div class="flex flex-col">
- <div class="flex items-stretch group">
+ <div
+ class="flex items-stretch group"
+ @contextmenu.prevent="$refs.options.tippy().show()"
+ >
<span
class="cursor-pointer flex px-4 items-center justify-center"
@click="toggleShowChildren()"
diff --git a/packages/hoppscotch-app/components/collections/teams/Request.vue b/packages/hoppscotch-app/components/collections/teams/Request.vue
index 0139af257..3811ea439 100644
--- a/packages/hoppscotch-app/components/collections/teams/Request.vue
+++ b/packages/hoppscotch-app/components/collections/teams/Request.vue
@@ -1,6 +1,9 @@
<template>
<div class="flex flex-col">
- <div class="flex items-stretch group">
+ <div
+ class="flex items-stretch group"
+ @contextmenu.prevent="$refs.options.tippy().show()"
+ >
<span
class="cursor-pointer flex px-2 w-16 items-center justify-center truncate"
:class="getRequestLabelColor(request.method)"
diff --git a/packages/hoppscotch-app/components/environments/Environment.vue b/packages/hoppscotch-app/components/environments/Environment.vue
index b9b804202..866bd7b09 100644
--- a/packages/hoppscotch-app/components/environments/Environment.vue
+++ b/packages/hoppscotch-app/components/environments/Environment.vue
@@ -1,5 +1,8 @@
<template>
- <div class="flex items-stretch group">
+ <div
+ class="flex items-stretch group"
+ @contextmenu.prevent="$refs.options.tippy().show()"
+ >
<span
class="cursor-pointer flex px-4 items-center justify-center"
@click="$emit('edit-environment')"
diff --git a/packages/hoppscotch-app/components/teams/Team.vue b/packages/hoppscotch-app/components/teams/Team.vue
index 5317d46d8..9e7190cdd 100644
--- a/packages/hoppscotch-app/components/teams/Team.vue
+++ b/packages/hoppscotch-app/components/teams/Team.vue
@@ -1,5 +1,8 @@
<template>
- <div class="border border-divider rounded flex flex-col flex-1">
+ <div
+ class="border border-divider rounded flex flex-col flex-1"
+ @contextmenu.prevent="!compact ? $refs.options.tippy().show() : null"
+ >
<div
class="flex flex-1 items-start"
:class="