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: disable bulk edit entries with //

liyasthomasb9fa254ab5f0
diff --git a/components/http/Headers.vue b/components/http/Headers.vue
index 4b793a03a..e4f21d9a2 100644
--- a/components/http/Headers.vue
+++ b/components/http/Headers.vue
@@ -224,13 +224,11 @@ export default defineComponent({
watch(bulkHeaders, () => {
try {
- const transformation = bulkHeaders.value.split("\n").map((item) => {
- return {
- key: item.substr(0, item.indexOf(":")).trim(),
- value: item.substr(item.indexOf(":") + 1).trim(),
- active: true,
- }
- })
+ const transformation = bulkHeaders.value.split("\n").map((item) => ({
+ key: item.substr(0, item.indexOf(":")).trim(),
+ value: item.substr(item.indexOf(":") + 1).trim(),
+ active: !item.trim().startsWith("//"),
+ }))
setRESTHeaders(transformation)
} catch (e) {
$toast.error(t("error.something_went_wrong").toString(), {
diff --git a/components/http/Parameters.vue b/components/http/Parameters.vue
index acfc41c1a..f0fe323da 100644
--- a/components/http/Parameters.vue
+++ b/components/http/Parameters.vue
@@ -232,13 +232,11 @@ export default defineComponent({
watch(bulkParams, () => {
try {
- const transformation = bulkParams.value.split("\n").map((item) => {
- return {
- key: item.substr(0, item.indexOf(":")).trim(),
- value: item.substr(item.indexOf(":") + 1).trim(),
- active: true,
- }
- })
+ const transformation = bulkParams.value.split("\n").map((item) => ({
+ key: item.substr(0, item.indexOf(":")).trim(),
+ value: item.substr(item.indexOf(":") + 1).trim(),
+ active: !item.trim().startsWith("//"),
+ }))
setRESTParams(transformation)
} catch (e) {
$toast.error(t("error.something_went_wrong").toString(), {
diff --git a/locales/en.json b/locales/en.json
index e2b1110ff..a8f11b80c 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -404,7 +404,7 @@
},
"state": {
"bulk_mode": "Bulk edit",
- "bulk_mode_placeholder": "Entries are separated by newline\nKeys and values are separated by :",
+ "bulk_mode_placeholder": "Entries are separated by newline\nKeys and values are separated by :\nPrepend // to any row you want to add but keep disabled",
"cleared": "Cleared",
"connected": "Connected",
"connected_to": "Connected to {name}",