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
duplicate identifier for requests fixed (#1346)
Hari Narayanan57627367f564
diff --git a/components/collections/save-request-as.vue b/components/collections/save-request-as.vueindex c61d61f9c..72e05d3f7 100644--- a/components/collections/save-request-as.vue+++ b/components/collections/save-request-as.vue@@ -17,12 +17,11 @@<div slot="body"><ul><li>- <label for="selectLabel">{{ $t("label") }}</label>+ <label for="selectLabel">{{ $t("token_req_name") }}</label><inputtype="text"id="selectLabel"v-model="requestData.name"- :placeholder="defaultRequestName"@keyup.enter="saveRequestAs"/><label for="selectCollection">{{ $t("collection") }}</label>@@ -89,7 +88,7 @@ export default {},data() {return {- defaultRequestName: "My Request",+ defaultRequestName: "Untitled Request",requestData: {name: undefined,collectionIndex: undefined,@@ -108,8 +107,8 @@ export default {"requestData.folderName": function resetRequestIndex() {this.$data.requestData.requestIndex = undefined},- editingRequest({ label }) {- this.defaultRequestName = label || "My Request"+ editingRequest({ name }) {+ this.$data.requestData.name = name || this.$data.defaultRequestName},},computed: {@@ -168,10 +167,16 @@ export default {})return}+ if (this.$data.requestData.name.length === 0) {+ this.$toast.error(this.$t("empty_req_name"), {+ icon: "error",+ })+ return+ }const requestUpdated = {...this.$props.editingRequest,- name: this.$data.requestData.name || this.$data.defaultRequestName,+ name: this.$data.requestData.name,collection: this.$data.requestData.collectionIndex,}diff --git a/components/layout/history.vue b/components/layout/history.vueindex f835feb36..6cb51d6d0 100644--- a/components/layout/history.vue+++ b/components/layout/history.vue@@ -23,11 +23,11 @@</button><li><input- :aria-label="$t('label')"+ :aria-label="$t('token_req_name')"type="text"readonly- :value="entry.label"- :placeholder="$t('no_label')"+ :value="entry.name"+ :placeholder="$t('empty_req_name')"class="bg-color"/></li>diff --git a/lang/en-US.json b/lang/en-US.jsonindex 13c682d2f..4d46e9675 100644--- a/lang/en-US.json+++ b/lang/en-US.json@@ -103,6 +103,7 @@"manage_token_req": "Manage Token Request","use_token_req": "Use Token Request","token_req_name": "Request Name",+ "empty_req_name": "Empty Request Name","token_req_details": "Request Details","token_name": "Token Name","oidc_discovery_url": "OIDC Discovery URL",@@ -294,4 +295,4 @@"experiments": "Experiments","experiments_notice": "This is a collection of experiments we're working on that might turn out to be useful, fun, both, or neither. They're not final and may not be stable, so if something overly weird happens, don't panic. Just turn the dang thing off. Jokes aside, ","use_experimental_url_bar": "Use experimental URL bar with environment highlighting"-}+}\ No newline at end of filediff --git a/pages/index.vue b/pages/index.vueindex 7da4760de..0c4b66a75 100644--- a/pages/index.vue+++ b/pages/index.vue@@ -178,14 +178,8 @@</li></ul><div class="blue">- <label for="label">{{ $t("label") }}</label>- <input- id="label"- name="label"- type="text"- v-model="label"- :placeholder="$t('optional')"- />+ <label for="name">{{ $t("token_req_name") }}</label>+ <input id="name" name="name" type="text" v-model="name" /></div><divclass="blue"@@ -1461,7 +1455,7 @@ export default {this.testsEnabled = truethis.testScript = newValue.testScript}- this.label = newValue.label+ this.name = newValue.name},editingRequest(newValue) {this.editRequest = newValue@@ -1528,12 +1522,12 @@ export default {this.$store.commit("setState", { value, attribute: "path" })},},- label: {+ name: {get() {- return this.$store.state.request.label+ return this.$store.state.request.name},set(value) {- this.$store.commit("setState", { value, attribute: "label" })+ this.$store.commit("setState", { value, attribute: "name" })},},auth: {@@ -1739,7 +1733,7 @@ export default {return this.$store.state.postwoman.editingRequest},requestName() {- return this.label+ return this.name},statusCategory() {return findStatusGroup(this.response.status)@@ -1878,7 +1872,7 @@ export default {})},handleUseHistory(entry) {- this.label = entry.label+ this.name = entry.namethis.method = entry.methodthis.uri = entry.url + entry.paththis.url = entry.url@@ -2021,7 +2015,7 @@ export default {this.response.body = payload.data// Addition of an entry to the history component.const entry = {- label: this.requestName,+ name: this.requestName,status: this.response.status,date: new Date().toLocaleDateString(),time: new Date().toLocaleTimeString(),@@ -2076,7 +2070,7 @@ export default {this.response.body = error.response.data// Addition of an entry to the history component.const entry = {- label: this.requestName,+ name: this.requestName,status: this.response.status,date: new Date().toLocaleDateString(),time: new Date().toLocaleTimeString(),@@ -2427,7 +2421,7 @@ export default {this.url = "https://httpbin.org"this.path = "/get"this.uri = this.url + this.path- this.label = ""+ this.name = "Untitled request"this.bodyParams = []this.rawParams = "{}"this.files = []@@ -2480,7 +2474,7 @@ export default {requestType: this.requestType,preRequestScript: this.showPreRequestScript == true ? this.preRequestScript : null,testScript: this.testsEnabled == true ? this.testScript : null,- label: this.requestName,+ name: this.requestName,}if (this.selectedRequest.url) {this.editRequest = Object.assign({}, this.selectedRequest, this.editRequest)@@ -2701,7 +2695,7 @@ export default {if (Object.keys(this.$route.query).length) this.setRouteQueries(this.$route.query)this.$watch((vm) => [- vm.label,+ vm.name,vm.method,vm.url,vm.auth,diff --git a/store/state.js b/store/state.jsindex dc08fea1e..2718ea823 100644--- a/store/state.js+++ b/store/state.js@@ -1,10 +1,10 @@export default () => ({request: {+ name: "Untitled request",method: "GET",uri: "",url: "https://httpbin.org",path: "/get",- label: "",auth: "None",httpUser: "",httpPassword: "",