chore: lint
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
src: url('~assets/fonts/Material_Icons-400-fallback1.woff2') format('woff2');
|
src: url('~assets/fonts/Material_Icons-400-fallback1.woff2') format('woff2');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* devanagari */
|
/* devanagari */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-400-devanagari2.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-400-devanagari2.woff2') format('woff2');
|
||||||
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -24,6 +26,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-400-latin-ext3.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-400-latin-ext3.woff2') format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin */
|
/* latin */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -33,6 +36,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-400-latin4.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-400-latin4.woff2') format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* devanagari */
|
/* devanagari */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -42,6 +46,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-500-devanagari5.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-500-devanagari5.woff2') format('woff2');
|
||||||
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -51,6 +56,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-500-latin-ext6.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-500-latin-ext6.woff2') format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin */
|
/* latin */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -60,6 +66,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-500-latin7.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-500-latin7.woff2') format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* devanagari */
|
/* devanagari */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -69,6 +76,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-600-devanagari8.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-600-devanagari8.woff2') format('woff2');
|
||||||
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -78,6 +86,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-600-latin-ext9.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-600-latin-ext9.woff2') format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin */
|
/* latin */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -87,6 +96,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-600-latin10.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-600-latin10.woff2') format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* devanagari */
|
/* devanagari */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -96,6 +106,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-700-devanagari11.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-700-devanagari11.woff2') format('woff2');
|
||||||
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -105,6 +116,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-700-latin-ext12.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-700-latin-ext12.woff2') format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin */
|
/* latin */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -114,6 +126,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-700-latin13.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-700-latin13.woff2') format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* devanagari */
|
/* devanagari */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -123,6 +136,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-800-devanagari14.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-800-devanagari14.woff2') format('woff2');
|
||||||
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
unicode-range: U+0900-097F, U+1CD0-1CF6, U+1CF8-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -132,6 +146,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-800-latin-ext15.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-800-latin-ext15.woff2') format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin */
|
/* latin */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Poppins';
|
font-family: 'Poppins';
|
||||||
@@ -141,6 +156,7 @@
|
|||||||
src: url('~assets/fonts/Poppins-800-latin16.woff2') format('woff2');
|
src: url('~assets/fonts/Poppins-800-latin16.woff2') format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cyrillic-ext */
|
/* cyrillic-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto Mono';
|
font-family: 'Roboto Mono';
|
||||||
@@ -150,6 +166,7 @@
|
|||||||
src: url('~assets/fonts/Roboto_Mono-400-cyrillic-ext17.woff2') format('woff2');
|
src: url('~assets/fonts/Roboto_Mono-400-cyrillic-ext17.woff2') format('woff2');
|
||||||
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cyrillic */
|
/* cyrillic */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto Mono';
|
font-family: 'Roboto Mono';
|
||||||
@@ -159,6 +176,7 @@
|
|||||||
src: url('~assets/fonts/Roboto_Mono-400-cyrillic18.woff2') format('woff2');
|
src: url('~assets/fonts/Roboto_Mono-400-cyrillic18.woff2') format('woff2');
|
||||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* greek */
|
/* greek */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto Mono';
|
font-family: 'Roboto Mono';
|
||||||
@@ -168,6 +186,7 @@
|
|||||||
src: url('~assets/fonts/Roboto_Mono-400-greek19.woff2') format('woff2');
|
src: url('~assets/fonts/Roboto_Mono-400-greek19.woff2') format('woff2');
|
||||||
unicode-range: U+0370-03FF;
|
unicode-range: U+0370-03FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vietnamese */
|
/* vietnamese */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto Mono';
|
font-family: 'Roboto Mono';
|
||||||
@@ -177,6 +196,7 @@
|
|||||||
src: url('~assets/fonts/Roboto_Mono-400-vietnamese20.woff2') format('woff2');
|
src: url('~assets/fonts/Roboto_Mono-400-vietnamese20.woff2') format('woff2');
|
||||||
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto Mono';
|
font-family: 'Roboto Mono';
|
||||||
@@ -186,6 +206,7 @@
|
|||||||
src: url('~assets/fonts/Roboto_Mono-400-latin-ext21.woff2') format('woff2');
|
src: url('~assets/fonts/Roboto_Mono-400-latin-ext21.woff2') format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* latin */
|
/* latin */
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto Mono';
|
font-family: 'Roboto Mono';
|
||||||
|
|||||||
@@ -22,7 +22,18 @@
|
|||||||
href="https://appwrite.io/?utm_source=hoppscotch&utm_medium=banner&utm_campaign=hello"
|
href="https://appwrite.io/?utm_source=hoppscotch&utm_medium=banner&utm_campaign=hello"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
class="inline-flex items-center px-4 py-2 mx-4 font-mono text-sm rounded-md bg-bgDarkColor hide-on-small-screen"
|
class="
|
||||||
|
inline-flex
|
||||||
|
items-center
|
||||||
|
px-4
|
||||||
|
py-2
|
||||||
|
mx-4
|
||||||
|
font-mono
|
||||||
|
text-sm
|
||||||
|
rounded-md
|
||||||
|
bg-bgDarkColor
|
||||||
|
hide-on-small-screen
|
||||||
|
"
|
||||||
>
|
>
|
||||||
Appwrite - Open-Source Backend as a Service
|
Appwrite - Open-Source Backend as a Service
|
||||||
<img class="w-8 ml-2" src="~assets/images/appwrite-icon.svg" alt="Appwrite" />
|
<img class="w-8 ml-2" src="~assets/images/appwrite-icon.svg" alt="Appwrite" />
|
||||||
@@ -301,8 +312,7 @@ export default {
|
|||||||
navigator
|
navigator
|
||||||
.share({
|
.share({
|
||||||
title: "Hoppscotch",
|
title: "Hoppscotch",
|
||||||
text:
|
text: "Hoppscotch • Open source API development ecosystem - Helps you create requests faster, saving precious time on development.",
|
||||||
"Hoppscotch • Open source API development ecosystem - Helps you create requests faster, saving precious time on development.",
|
|
||||||
url: "https://hoppscotch.io",
|
url: "https://hoppscotch.io",
|
||||||
})
|
})
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
|
|||||||
@@ -162,7 +162,13 @@ export default {
|
|||||||
this._keyListener = function (e) {
|
this._keyListener = function (e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.showModalAdd = this.showModalEdit = this.showModalImportExport = this.showModalAddFolder = this.showModalEditFolder = this.showModalEditRequest = false
|
this.showModalAdd =
|
||||||
|
this.showModalEdit =
|
||||||
|
this.showModalImportExport =
|
||||||
|
this.showModalAddFolder =
|
||||||
|
this.showModalEditFolder =
|
||||||
|
this.showModalEditRequest =
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", this._keyListener.bind(this))
|
document.addEventListener("keydown", this._keyListener.bind(this))
|
||||||
|
|||||||
@@ -275,7 +275,13 @@ export default {
|
|||||||
this._keyListener = function (e) {
|
this._keyListener = function (e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.showModalAdd = this.showModalEdit = this.showModalImportExport = this.showModalAddFolder = this.showModalEditFolder = this.showModalEditRequest = false
|
this.showModalAdd =
|
||||||
|
this.showModalEdit =
|
||||||
|
this.showModalImportExport =
|
||||||
|
this.showModalAddFolder =
|
||||||
|
this.showModalEditFolder =
|
||||||
|
this.showModalEditRequest =
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", this._keyListener.bind(this))
|
document.addEventListener("keydown", this._keyListener.bind(this))
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ export default {
|
|||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
picked: {
|
picked: {
|
||||||
pickedType: "my-collection",
|
pickedType: "my-collection",
|
||||||
|
|
||||||
collectionIndex: this.collectionIndex,
|
collectionIndex: this.collectionIndex,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ export default {
|
|||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
picked: {
|
picked: {
|
||||||
pickedType: "my-folder",
|
pickedType: "my-folder",
|
||||||
|
|
||||||
collectionIndex: this.collectionIndex,
|
collectionIndex: this.collectionIndex,
|
||||||
folderName: this.folder.name,
|
folderName: this.folder.name,
|
||||||
folderPath: this.folderPath,
|
folderPath: this.folderPath,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
@click="!doc ? selectRequest() : {}"
|
@click="!doc ? selectRequest() : {}"
|
||||||
v-tooltip="!doc ? $t('use_request') : ''"
|
v-tooltip="!doc ? $t('use_request') : ''"
|
||||||
>
|
>
|
||||||
<i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
|
<i v-if="isSelected" class="mx-3 text-green-400 material-icons">check_circle</i>
|
||||||
|
|
||||||
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
||||||
<span>{{ request.name }}</span>
|
<span>{{ request.name }}</span>
|
||||||
@@ -104,7 +104,6 @@ export default {
|
|||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
picked: {
|
picked: {
|
||||||
pickedType: "my-request",
|
pickedType: "my-request",
|
||||||
|
|
||||||
collectionIndex: this.collectionIndex,
|
collectionIndex: this.collectionIndex,
|
||||||
folderPath: this.folderPath,
|
folderPath: this.folderPath,
|
||||||
folderName: this.folderName,
|
folderName: this.folderName,
|
||||||
|
|||||||
@@ -183,7 +183,6 @@ export default {
|
|||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
picked: {
|
picked: {
|
||||||
pickedType: "teams-collection",
|
pickedType: "teams-collection",
|
||||||
|
|
||||||
collectionID: this.collection.id,
|
collectionID: this.collection.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -193,7 +192,6 @@ export default {
|
|||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
picked: {
|
picked: {
|
||||||
pickedType: "teams-collection",
|
pickedType: "teams-collection",
|
||||||
|
|
||||||
collectionID: this.collection.id,
|
collectionID: this.collection.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ export default {
|
|||||||
this.$emit("select", {
|
this.$emit("select", {
|
||||||
picked: {
|
picked: {
|
||||||
pickedType: "teams-folder",
|
pickedType: "teams-folder",
|
||||||
|
|
||||||
folderID: this.folder.id,
|
folderID: this.folder.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
@click="!doc ? selectRequest() : {}"
|
@click="!doc ? selectRequest() : {}"
|
||||||
v-tooltip="!doc ? $t('use_request') : ''"
|
v-tooltip="!doc ? $t('use_request') : ''"
|
||||||
>
|
>
|
||||||
<i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
|
<i v-if="isSelected" class="mx-3 text-green-400 material-icons">check_circle</i>
|
||||||
|
|
||||||
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
|
||||||
<span>{{ request.name }}</span>
|
<span>{{ request.name }}</span>
|
||||||
@@ -102,6 +102,7 @@ export default {
|
|||||||
requestID: this.requestIndex,
|
requestID: this.requestIndex,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
else this.$store.commit("postwoman/selectRequest", { request: this.request })
|
||||||
},
|
},
|
||||||
removeRequest() {
|
removeRequest() {
|
||||||
this.$emit("remove-request", {
|
this.$emit("remove-request", {
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export default {
|
|||||||
},
|
},
|
||||||
subscriptions() {
|
subscriptions() {
|
||||||
return {
|
return {
|
||||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -30,7 +30,14 @@
|
|||||||
<ul
|
<ul
|
||||||
v-for="(variable, index) in this.editingEnvCopy.variables"
|
v-for="(variable, index) in this.editingEnvCopy.variables"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
class="
|
||||||
|
border-b border-dashed
|
||||||
|
divide-y
|
||||||
|
md:divide-x
|
||||||
|
border-brdColor
|
||||||
|
divide-dashed divide-brdColor
|
||||||
|
md:divide-y-0
|
||||||
|
"
|
||||||
:class="{ 'border-t': index == 0 }"
|
:class="{ 'border-t': index == 0 }"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
@@ -118,7 +125,7 @@ export default {
|
|||||||
},
|
},
|
||||||
subscriptions() {
|
subscriptions() {
|
||||||
return {
|
return {
|
||||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export default {
|
|||||||
},
|
},
|
||||||
subscriptions() {
|
subscriptions() {
|
||||||
return {
|
return {
|
||||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export default {
|
|||||||
},
|
},
|
||||||
subscriptions() {
|
subscriptions() {
|
||||||
return {
|
return {
|
||||||
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments")
|
SYNC_ENVIRONMENTS: getSettingSubject("syncEnvironments"),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -17,7 +17,18 @@
|
|||||||
{{ gqlField.description }}
|
{{ gqlField.description }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="inline-block px-4 py-2 my-2 text-sm font-bold text-black bg-yellow-200 rounded-lg field-deprecated"
|
class="
|
||||||
|
inline-block
|
||||||
|
px-4
|
||||||
|
py-2
|
||||||
|
my-2
|
||||||
|
text-sm
|
||||||
|
font-bold
|
||||||
|
text-black
|
||||||
|
bg-yellow-200
|
||||||
|
rounded-lg
|
||||||
|
field-deprecated
|
||||||
|
"
|
||||||
v-if="gqlField.isDeprecated"
|
v-if="gqlField.isDeprecated"
|
||||||
>
|
>
|
||||||
{{ $t("deprecated") }}
|
{{ $t("deprecated") }}
|
||||||
|
|||||||
@@ -19,7 +19,14 @@
|
|||||||
<ul
|
<ul
|
||||||
v-for="(param, index) in bodyParams"
|
v-for="(param, index) in bodyParams"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
class="
|
||||||
|
border-b border-dashed
|
||||||
|
divide-y
|
||||||
|
md:divide-x
|
||||||
|
border-brdColor
|
||||||
|
divide-dashed divide-brdColor
|
||||||
|
md:divide-y-0
|
||||||
|
"
|
||||||
:class="{ 'border-t': index == 0 }"
|
:class="{ 'border-t': index == 0 }"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
@@ -148,8 +155,10 @@ export default {
|
|||||||
this.$emit("set-route-query-state")
|
this.$emit("set-route-query-state")
|
||||||
},
|
},
|
||||||
removeRequestBodyParam(index) {
|
removeRequestBodyParam(index) {
|
||||||
const paramArr = this.$store.state.request.bodyParams
|
const paramArr = this.$store.state.request.bodyParams.filter(
|
||||||
.filter((item, itemIndex) => itemIndex !== index && (item.hasOwnProperty("active") ? item.active == true : true))
|
(item, itemIndex) =>
|
||||||
|
itemIndex !== index && (item.hasOwnProperty("active") ? item.active == true : true)
|
||||||
|
)
|
||||||
this.setRawParams(paramArr)
|
this.setRawParams(paramArr)
|
||||||
this.$emit("remove-request-body-param", index)
|
this.$emit("remove-request-body-param", index)
|
||||||
},
|
},
|
||||||
@@ -179,14 +188,14 @@ export default {
|
|||||||
index,
|
index,
|
||||||
value: event.target.value,
|
value: event.target.value,
|
||||||
})
|
})
|
||||||
let paramArr = this.$store.state.request.bodyParams
|
let paramArr = this.$store.state.request.bodyParams.filter((item) =>
|
||||||
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
item.hasOwnProperty("active") ? item.active == true : true
|
||||||
|
)
|
||||||
|
|
||||||
this.setRawParams(paramArr)
|
this.setRawParams(paramArr)
|
||||||
},
|
},
|
||||||
toggleActive(index, param) {
|
toggleActive(index, param) {
|
||||||
let paramArr = this.$store.state.request.bodyParams
|
let paramArr = this.$store.state.request.bodyParams.filter((item, itemIndex) => {
|
||||||
.filter((item, itemIndex) => {
|
|
||||||
if (index === itemIndex) {
|
if (index === itemIndex) {
|
||||||
return !param.active
|
return !param.active
|
||||||
} else {
|
} else {
|
||||||
@@ -196,22 +205,22 @@ export default {
|
|||||||
|
|
||||||
this.setRawParams(paramArr)
|
this.setRawParams(paramArr)
|
||||||
|
|
||||||
this.$store.commit('setActiveBodyParams', {
|
this.$store.commit("setActiveBodyParams", {
|
||||||
index,
|
index,
|
||||||
value: param.hasOwnProperty('active') ? !param.active : false,
|
value: param.hasOwnProperty("active") ? !param.active : false,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setRawParams(filteredParamArr) {
|
setRawParams(filteredParamArr) {
|
||||||
let rawParams = {}
|
let rawParams = {}
|
||||||
filteredParamArr.forEach(_param=>{
|
filteredParamArr.forEach((_param) => {
|
||||||
rawParams = {
|
rawParams = {
|
||||||
...rawParams,
|
...rawParams,
|
||||||
[_param.key]:_param.value
|
[_param.key]: _param.value,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const rawParamsStr = JSON.stringify(rawParams, null, 2)
|
const rawParamsStr = JSON.stringify(rawParams, null, 2)
|
||||||
this.$store.commit("setState", { value: rawParamsStr, attribute: "rawParams" })
|
this.$store.commit("setState", { value: rawParamsStr, attribute: "rawParams" })
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
contentType() {
|
contentType() {
|
||||||
|
|||||||
@@ -19,7 +19,14 @@
|
|||||||
<ul
|
<ul
|
||||||
v-for="(header, index) in headers"
|
v-for="(header, index) in headers"
|
||||||
:key="`${header.value}_${index}`"
|
:key="`${header.value}_${index}`"
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
class="
|
||||||
|
border-b border-dashed
|
||||||
|
divide-y
|
||||||
|
md:divide-x
|
||||||
|
border-brdColor
|
||||||
|
divide-dashed divide-brdColor
|
||||||
|
md:divide-y-0
|
||||||
|
"
|
||||||
:class="{ 'border-t': index == 0 }"
|
:class="{ 'border-t': index == 0 }"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -19,7 +19,14 @@
|
|||||||
<ul
|
<ul
|
||||||
v-for="(param, index) in params"
|
v-for="(param, index) in params"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
class="
|
||||||
|
border-b border-dashed
|
||||||
|
divide-y
|
||||||
|
md:divide-x
|
||||||
|
border-brdColor
|
||||||
|
divide-dashed divide-brdColor
|
||||||
|
md:divide-y-0
|
||||||
|
"
|
||||||
:class="{ 'border-t': index == 0 }"
|
:class="{ 'border-t': index == 0 }"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -71,7 +71,14 @@
|
|||||||
<ul
|
<ul
|
||||||
v-for="(input, index) of communication.inputs"
|
v-for="(input, index) of communication.inputs"
|
||||||
:key="`input-${index}`"
|
:key="`input-${index}`"
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
class="
|
||||||
|
border-b border-dashed
|
||||||
|
divide-y
|
||||||
|
md:divide-x
|
||||||
|
border-brdColor
|
||||||
|
divide-dashed divide-brdColor
|
||||||
|
md:divide-y-0
|
||||||
|
"
|
||||||
:class="{ 'border-t': index == 0 }"
|
:class="{ 'border-t': index == 0 }"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -15,7 +15,20 @@
|
|||||||
v-for="(color, index) of accentColors"
|
v-for="(color, index) of accentColors"
|
||||||
:key="`color-${index}`"
|
:key="`color-${index}`"
|
||||||
v-tooltip="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
|
v-tooltip="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
|
||||||
class="inline-flex items-center justify-center p-3 m-2 transition duration-150 ease-in-out bg-transparent rounded-full cursor-pointer hover:shadow-none"
|
class="
|
||||||
|
inline-flex
|
||||||
|
items-center
|
||||||
|
justify-center
|
||||||
|
p-3
|
||||||
|
m-2
|
||||||
|
transition
|
||||||
|
duration-150
|
||||||
|
ease-in-out
|
||||||
|
bg-transparent
|
||||||
|
rounded-full
|
||||||
|
cursor-pointer
|
||||||
|
hover:shadow-none
|
||||||
|
"
|
||||||
:class="[`text-${color}-400`, { 'bg-actColor': color === active }]"
|
:class="[`text-${color}-400`, { 'bg-actColor': color === active }]"
|
||||||
@click="setActiveColor(color)"
|
@click="setActiveColor(color)"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -176,9 +176,8 @@ export default {
|
|||||||
break
|
break
|
||||||
|
|
||||||
case "Tab":
|
case "Tab":
|
||||||
let activeSuggestion = this.suggestions[
|
let activeSuggestion =
|
||||||
this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0
|
this.suggestions[this.currentSuggestionIndex >= 0 ? this.currentSuggestionIndex : 0]
|
||||||
]
|
|
||||||
|
|
||||||
if (!activeSuggestion) {
|
if (!activeSuggestion) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -14,7 +14,23 @@
|
|||||||
v-for="(color, index) of colors"
|
v-for="(color, index) of colors"
|
||||||
:key="`color-${index}`"
|
:key="`color-${index}`"
|
||||||
v-tooltip="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
|
v-tooltip="`${color.charAt(0).toUpperCase()}${color.slice(1)}`"
|
||||||
class="inline-flex items-center justify-center p-3 m-2 transition duration-150 ease-in-out bg-transparent rounded-full cursor-pointer border-collapseer-2 text-fgLightColor hover:text-fgColor hover:shadow-none"
|
class="
|
||||||
|
inline-flex
|
||||||
|
items-center
|
||||||
|
justify-center
|
||||||
|
p-3
|
||||||
|
m-2
|
||||||
|
transition
|
||||||
|
duration-150
|
||||||
|
ease-in-out
|
||||||
|
bg-transparent
|
||||||
|
rounded-full
|
||||||
|
cursor-pointer
|
||||||
|
border-collapseer-2
|
||||||
|
text-fgLightColor
|
||||||
|
hover:text-fgColor
|
||||||
|
hover:shadow-none
|
||||||
|
"
|
||||||
:class="[
|
:class="[
|
||||||
{ 'bg-actColor': color === $colorMode.preference },
|
{ 'bg-actColor': color === $colorMode.preference },
|
||||||
{ 'text-acColor hover:text-acColor': color === $colorMode.value },
|
{ 'text-acColor hover:text-acColor': color === $colorMode.value },
|
||||||
|
|||||||
@@ -6,12 +6,8 @@ import { settingsStore, applySetting } from "~/newstore/settings"
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function performMigrations(): void {
|
export function performMigrations(): void {
|
||||||
|
|
||||||
// Migrate old default proxy URL to the new proxy URL (if not set / overridden)
|
// Migrate old default proxy URL to the new proxy URL (if not set / overridden)
|
||||||
if (
|
if (settingsStore.value.PROXY_URL === "https://hoppscotch.apollosoftware.xyz/") {
|
||||||
settingsStore.value.PROXY_URL === "https://hoppscotch.apollosoftware.xyz/"
|
|
||||||
) {
|
|
||||||
applySetting("PROXY_URL", "https://proxy.hoppscotch.io/")
|
applySetting("PROXY_URL", "https://proxy.hoppscotch.io/")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,8 +98,9 @@ export function defineGQLLanguageMode(ace) {
|
|||||||
(aceRequire, exports) => {
|
(aceRequire, exports) => {
|
||||||
const oop = aceRequire("ace/lib/oop")
|
const oop = aceRequire("ace/lib/oop")
|
||||||
const TextMode = aceRequire("ace/mode/text").Mode
|
const TextMode = aceRequire("ace/mode/text").Mode
|
||||||
const GQLQueryTextHighlightRules = aceRequire("ace/mode/gql-query-highlight")
|
const GQLQueryTextHighlightRules = aceRequire(
|
||||||
.GQLQueryTextHighlightRules
|
"ace/mode/gql-query-highlight"
|
||||||
|
).GQLQueryTextHighlightRules
|
||||||
const FoldMode = aceRequire("ace/mode/folding/cstyle").FoldMode
|
const FoldMode = aceRequire("ace/mode/folding/cstyle").FoldMode
|
||||||
|
|
||||||
const Mode = function () {
|
const Mode = function () {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
* Defines how a Teams request is represented in TeamCollectionAdapter
|
* Defines how a Teams request is represented in TeamCollectionAdapter
|
||||||
*/
|
*/
|
||||||
export interface TeamRequest {
|
export interface TeamRequest {
|
||||||
id: string;
|
id: string
|
||||||
collectionID: string;
|
collectionID: string
|
||||||
title: string;
|
title: string
|
||||||
request: any;
|
request: any
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ import { map } from "rxjs/operators"
|
|||||||
import assign from "lodash/assign"
|
import assign from "lodash/assign"
|
||||||
import clone from "lodash/clone"
|
import clone from "lodash/clone"
|
||||||
|
|
||||||
|
type Dispatch<
|
||||||
type Dispatch<StoreType, DispatchersType extends Dispatchers<StoreType>, K extends keyof DispatchersType> = {
|
StoreType,
|
||||||
dispatcher: K & string,
|
DispatchersType extends Dispatchers<StoreType>,
|
||||||
|
K extends keyof DispatchersType
|
||||||
|
> = {
|
||||||
|
dispatcher: K & string
|
||||||
payload: any
|
payload: any
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,7 +17,6 @@ export type Dispatchers<StoreType> = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class DispatchingStore<StoreType, DispatchersType extends Dispatchers<StoreType>> {
|
export default class DispatchingStore<StoreType, DispatchersType extends Dispatchers<StoreType>> {
|
||||||
|
|
||||||
#state$: BehaviorSubject<StoreType>
|
#state$: BehaviorSubject<StoreType>
|
||||||
#dispatchers: Dispatchers<StoreType>
|
#dispatchers: Dispatchers<StoreType>
|
||||||
#dispatches$: Subject<Dispatch<StoreType, DispatchersType, keyof DispatchersType>> = new Subject()
|
#dispatches$: Subject<Dispatch<StoreType, DispatchersType, keyof DispatchersType>> = new Subject()
|
||||||
@@ -24,11 +26,8 @@ export default class DispatchingStore<StoreType, DispatchersType extends Dispatc
|
|||||||
this.#dispatchers = dispatchers
|
this.#dispatchers = dispatchers
|
||||||
|
|
||||||
this.#dispatches$
|
this.#dispatches$
|
||||||
.pipe(
|
.pipe(map(({ dispatcher, payload }) => this.#dispatchers[dispatcher](this.value, payload)))
|
||||||
map(
|
.subscribe((val) => {
|
||||||
({ dispatcher, payload }) => this.#dispatchers[dispatcher](this.value, payload)
|
|
||||||
)
|
|
||||||
).subscribe(val => {
|
|
||||||
const data = clone(this.value)
|
const data = clone(this.value)
|
||||||
assign(data, val)
|
assign(data, val)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import isEqual from "lodash/isEqual"
|
|||||||
import DispatchingStore from "~/newstore/DispatchingStore"
|
import DispatchingStore from "~/newstore/DispatchingStore"
|
||||||
|
|
||||||
describe("DispatchingStore", () => {
|
describe("DispatchingStore", () => {
|
||||||
|
|
||||||
test("'subject$' property properly returns an BehaviorSubject", () => {
|
test("'subject$' property properly returns an BehaviorSubject", () => {
|
||||||
const store = new DispatchingStore({}, {})
|
const store = new DispatchingStore({}, {})
|
||||||
|
|
||||||
@@ -28,22 +27,25 @@ describe("DispatchingStore", () => {
|
|||||||
expect(() => {
|
expect(() => {
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "non-existent",
|
dispatcher: "non-existent",
|
||||||
payload: {}
|
payload: {},
|
||||||
})
|
})
|
||||||
}).toThrow()
|
}).toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
test("valid dispatcher calls run without throwing", () => {
|
test("valid dispatcher calls run without throwing", () => {
|
||||||
const store = new DispatchingStore({}, {
|
const store = new DispatchingStore(
|
||||||
|
{},
|
||||||
|
{
|
||||||
testDispatcher(_currentValue, _payload) {
|
testDispatcher(_currentValue, _payload) {
|
||||||
// Nothing here
|
// Nothing here
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
)
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: {}
|
payload: {},
|
||||||
})
|
})
|
||||||
}).not.toThrow()
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
@@ -52,14 +54,17 @@ describe("DispatchingStore", () => {
|
|||||||
const dispatchFn = jest.fn().mockReturnValue({})
|
const dispatchFn = jest.fn().mockReturnValue({})
|
||||||
const dontCallDispatchFn = jest.fn().mockReturnValue({})
|
const dontCallDispatchFn = jest.fn().mockReturnValue({})
|
||||||
|
|
||||||
const store = new DispatchingStore({}, {
|
const store = new DispatchingStore(
|
||||||
|
{},
|
||||||
|
{
|
||||||
testDispatcher: dispatchFn,
|
testDispatcher: dispatchFn,
|
||||||
dontCallDispatcher: dontCallDispatchFn
|
dontCallDispatcher: dontCallDispatchFn,
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: {}
|
payload: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(dispatchFn).toHaveBeenCalledTimes(1)
|
expect(dispatchFn).toHaveBeenCalledTimes(1)
|
||||||
@@ -73,12 +78,12 @@ describe("DispatchingStore", () => {
|
|||||||
const testDispatchFn = jest.fn().mockReturnValue({})
|
const testDispatchFn = jest.fn().mockReturnValue({})
|
||||||
|
|
||||||
const store = new DispatchingStore(testInitValue, {
|
const store = new DispatchingStore(testInitValue, {
|
||||||
testDispatcher: testDispatchFn
|
testDispatcher: testDispatchFn,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: testPayload
|
payload: testPayload,
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(testDispatchFn).toHaveBeenCalledWith(testInitValue, testPayload)
|
expect(testDispatchFn).toHaveBeenCalledWith(testInitValue, testPayload)
|
||||||
@@ -91,12 +96,12 @@ describe("DispatchingStore", () => {
|
|||||||
const testDispatchFn = jest.fn().mockReturnValue(testDispatchReturnVal)
|
const testDispatchFn = jest.fn().mockReturnValue(testDispatchReturnVal)
|
||||||
|
|
||||||
const store = new DispatchingStore(testInitValue, {
|
const store = new DispatchingStore(testInitValue, {
|
||||||
testDispatcher: testDispatchFn
|
testDispatcher: testDispatchFn,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: {} // Payload doesn't matter because the function is mocked
|
payload: {}, // Payload doesn't matter because the function is mocked
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(store.value).toEqual(testDispatchReturnVal)
|
expect(store.value).toEqual(testDispatchReturnVal)
|
||||||
@@ -109,47 +114,47 @@ describe("DispatchingStore", () => {
|
|||||||
const testDispatchFn = jest.fn().mockReturnValue(testDispatchReturnVal)
|
const testDispatchFn = jest.fn().mockReturnValue(testDispatchReturnVal)
|
||||||
|
|
||||||
const store = new DispatchingStore(testInitValue, {
|
const store = new DispatchingStore(testInitValue, {
|
||||||
testDispatcher: testDispatchFn
|
testDispatcher: testDispatchFn,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: {}
|
payload: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(store.value).toEqual({
|
expect(store.value).toEqual({
|
||||||
name: "bob",
|
name: "bob",
|
||||||
age: 25
|
age: 25,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test("emits the current store value to the new subscribers", done => {
|
test("emits the current store value to the new subscribers", (done) => {
|
||||||
const testInitValue = { name: "bob" }
|
const testInitValue = { name: "bob" }
|
||||||
|
|
||||||
const testDispatchFn = jest.fn().mockReturnValue({})
|
const testDispatchFn = jest.fn().mockReturnValue({})
|
||||||
|
|
||||||
const store = new DispatchingStore(testInitValue, {
|
const store = new DispatchingStore(testInitValue, {
|
||||||
testDispatcher: testDispatchFn
|
testDispatcher: testDispatchFn,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.subject$.subscribe(value => {
|
store.subject$.subscribe((value) => {
|
||||||
if (value === testInitValue) {
|
if (value === testInitValue) {
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
test("emits the dispatched store value to the subscribers", done => {
|
test("emits the dispatched store value to the subscribers", (done) => {
|
||||||
const testInitValue = { name: "bob" }
|
const testInitValue = { name: "bob" }
|
||||||
const testDispatchReturnVal = { age: 25 }
|
const testDispatchReturnVal = { age: 25 }
|
||||||
|
|
||||||
const testDispatchFn = jest.fn().mockReturnValue(testDispatchReturnVal)
|
const testDispatchFn = jest.fn().mockReturnValue(testDispatchReturnVal)
|
||||||
|
|
||||||
const store = new DispatchingStore(testInitValue, {
|
const store = new DispatchingStore(testInitValue, {
|
||||||
testDispatcher: testDispatchFn
|
testDispatcher: testDispatchFn,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.subject$.subscribe(value => {
|
store.subject$.subscribe((value) => {
|
||||||
if (isEqual(value, { name: "bob", age: 25 })) {
|
if (isEqual(value, { name: "bob", age: 25 })) {
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
@@ -157,7 +162,7 @@ describe("DispatchingStore", () => {
|
|||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: {}
|
payload: {},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -168,10 +173,10 @@ describe("DispatchingStore", () => {
|
|||||||
const testDispatchFn = jest.fn().mockReturnValue({})
|
const testDispatchFn = jest.fn().mockReturnValue({})
|
||||||
|
|
||||||
const store = new DispatchingStore(testInitValue, {
|
const store = new DispatchingStore(testInitValue, {
|
||||||
testDispatcher: testDispatchFn
|
testDispatcher: testDispatchFn,
|
||||||
})
|
})
|
||||||
|
|
||||||
store.dispatches$.subscribe(value => {
|
store.dispatches$.subscribe((value) => {
|
||||||
if (isEqual(value, { dispatcher: "testDispatcher", payload: testPayload })) {
|
if (isEqual(value, { dispatcher: "testDispatcher", payload: testPayload })) {
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
@@ -179,7 +184,7 @@ describe("DispatchingStore", () => {
|
|||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
dispatcher: "testDispatcher",
|
dispatcher: "testDispatcher",
|
||||||
payload: {}
|
payload: {},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -25,9 +25,7 @@ function setupSettingsPersistence() {
|
|||||||
bulkApplySettings(settingsData)
|
bulkApplySettings(settingsData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settingsStore.subject$.subscribe((settings) => {
|
||||||
settingsStore.subject$
|
|
||||||
.subscribe(settings => {
|
|
||||||
window.localStorage.setItem("settings", JSON.stringify(settings))
|
window.localStorage.setItem("settings", JSON.stringify(settings))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import type { Dispatchers } from "./DispatchingStore"
|
|||||||
import { Observable } from "rxjs"
|
import { Observable } from "rxjs"
|
||||||
import type { KeysMatching } from "~/types/ts-utils"
|
import type { KeysMatching } from "~/types/ts-utils"
|
||||||
|
|
||||||
|
|
||||||
export const defaultSettings = {
|
export const defaultSettings = {
|
||||||
syncCollections: true,
|
syncCollections: true,
|
||||||
syncHistory: true,
|
syncHistory: true,
|
||||||
@@ -21,8 +20,8 @@ export const defaultSettings = {
|
|||||||
auth: true,
|
auth: true,
|
||||||
httpUser: true,
|
httpUser: true,
|
||||||
httpPassword: true,
|
httpPassword: true,
|
||||||
bearerToken: true
|
bearerToken: true,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SettingsType = typeof defaultSettings
|
export type SettingsType = typeof defaultSettings
|
||||||
@@ -44,7 +43,10 @@ const dispatchers: Dispatchers<SettingsType> = {
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
applySetting<K extends keyof SettingsType>(_currentState: SettingsType, { settingKey, value }: { settingKey: K, value: SettingsType[K] }) {
|
applySetting<K extends keyof SettingsType>(
|
||||||
|
_currentState: SettingsType,
|
||||||
|
{ settingKey, value }: { settingKey: K; value: SettingsType[K] }
|
||||||
|
) {
|
||||||
if (!validKeys.includes(settingKey)) {
|
if (!validKeys.includes(settingKey)) {
|
||||||
console.log(`Ignoring non-existent setting key '${settingKey}' assignment`)
|
console.log(`Ignoring non-existent setting key '${settingKey}' assignment`)
|
||||||
return {}
|
return {}
|
||||||
@@ -54,20 +56,21 @@ const dispatchers: Dispatchers<SettingsType> = {
|
|||||||
result[settingKey] = value
|
result[settingKey] = value
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export const settingsStore = new DispatchingStore(defaultSettings, dispatchers)
|
export const settingsStore = new DispatchingStore(defaultSettings, dispatchers)
|
||||||
|
|
||||||
export function getSettingSubject<K extends keyof SettingsType>(settingKey: K): Observable<SettingsType[K]> {
|
export function getSettingSubject<K extends keyof SettingsType>(
|
||||||
|
settingKey: K
|
||||||
|
): Observable<SettingsType[K]> {
|
||||||
return settingsStore.subject$.pipe(pluck(settingKey), distinctUntilChanged())
|
return settingsStore.subject$.pipe(pluck(settingKey), distinctUntilChanged())
|
||||||
}
|
}
|
||||||
|
|
||||||
export function bulkApplySettings(settingsObj: Partial<SettingsType>) {
|
export function bulkApplySettings(settingsObj: Partial<SettingsType>) {
|
||||||
settingsStore.dispatch({
|
settingsStore.dispatch({
|
||||||
dispatcher: "bulkApplySettings",
|
dispatcher: "bulkApplySettings",
|
||||||
payload: settingsObj
|
payload: settingsObj,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,8 +78,8 @@ export function toggleSetting(settingKey: KeysMatching<SettingsType, boolean>) {
|
|||||||
settingsStore.dispatch({
|
settingsStore.dispatch({
|
||||||
dispatcher: "toggleSetting",
|
dispatcher: "toggleSetting",
|
||||||
payload: {
|
payload: {
|
||||||
settingKey
|
settingKey,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +88,7 @@ export function applySetting<K extends keyof SettingsType>(settingKey: K, value:
|
|||||||
dispatcher: "applySetting",
|
dispatcher: "applySetting",
|
||||||
payload: {
|
payload: {
|
||||||
settingKey,
|
settingKey,
|
||||||
value
|
value,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,14 @@
|
|||||||
<ul
|
<ul
|
||||||
v-for="(header, index) in headers"
|
v-for="(header, index) in headers"
|
||||||
:key="`${header.value}_${index}`"
|
:key="`${header.value}_${index}`"
|
||||||
class="border-b border-dashed divide-y md:divide-x border-brdColor divide-dashed divide-brdColor md:divide-y-0"
|
class="
|
||||||
|
border-b border-dashed
|
||||||
|
divide-y
|
||||||
|
md:divide-x
|
||||||
|
border-brdColor
|
||||||
|
divide-dashed divide-brdColor
|
||||||
|
md:divide-y-0
|
||||||
|
"
|
||||||
:class="{ 'border-t': index == 0 }"
|
:class="{ 'border-t': index == 0 }"
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1992,7 +1992,12 @@ export default {
|
|||||||
}
|
}
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.showCurlImportModal = this.showTokenListModal = this.showTokenRequestList = this.showSaveRequestModal = this.showCodegenModal = false
|
this.showCurlImportModal =
|
||||||
|
this.showTokenListModal =
|
||||||
|
this.showTokenRequestList =
|
||||||
|
this.showSaveRequestModal =
|
||||||
|
this.showCodegenModal =
|
||||||
|
false
|
||||||
}
|
}
|
||||||
if ((e.key === "g" || e.key === "G") && e.altKey) {
|
if ((e.key === "g" || e.key === "G") && e.altKey) {
|
||||||
this.method = "GET"
|
this.method = "GET"
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import Vue from "vue"
|
import Vue from "vue"
|
||||||
import VueApollo from "vue-apollo"
|
import VueApollo from "vue-apollo"
|
||||||
import { apolloClient } from "~/helpers/apollo";
|
import { apolloClient } from "~/helpers/apollo"
|
||||||
|
|
||||||
const vueApolloProvider = new VueApollo({
|
const vueApolloProvider = new VueApollo({
|
||||||
defaultClient: apolloClient as any
|
defaultClient: apolloClient as any,
|
||||||
});
|
})
|
||||||
|
|
||||||
Vue.use(VueApollo);
|
Vue.use(VueApollo)
|
||||||
|
|
||||||
export default (ctx: any) => {
|
export default (ctx: any) => {
|
||||||
const { app } = ctx
|
const { app } = ctx
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
** Docs: https://tailwindcss.com/docs/configuration
|
** Docs: https://tailwindcss.com/docs/configuration
|
||||||
** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
|
** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import colors from "tailwindcss/colors"
|
import colors from "tailwindcss/colors"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
2
types/pw-ext-hook.d.ts
vendored
2
types/pw-ext-hook.d.ts
vendored
@@ -15,7 +15,7 @@ interface PWExtensionResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface PWExtensionHook {
|
interface PWExtensionHook {
|
||||||
getVersion: () => { major: number, minor: number }
|
getVersion: () => { major: number; minor: number }
|
||||||
sendRequest: (req: PWExtensionRequestInfo) => Promise<PWExtensionResponse>
|
sendRequest: (req: PWExtensionRequestInfo) => Promise<PWExtensionResponse>
|
||||||
cancelRunningRequest: () => void
|
cancelRunningRequest: () => void
|
||||||
}
|
}
|
||||||
|
|||||||
2
types/ts-utils.d.ts
vendored
2
types/ts-utils.d.ts
vendored
@@ -1 +1 @@
|
|||||||
export type KeysMatching<T, V> = {[K in keyof T]-?: T[K] extends V ? K : never}[keyof T];
|
export type KeysMatching<T, V> = { [K in keyof T]-?: T[K] extends V ? K : never }[keyof T]
|
||||||
|
|||||||
2
vue-shim.d.ts
vendored
2
vue-shim.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
declare module "*.vue" {
|
declare module "*.vue" {
|
||||||
import Vue from 'vue'
|
import Vue from "vue"
|
||||||
export default Vue
|
export default Vue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user