Lint
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
// Do not use font-display: swap for the icon font - it looks really bad when the page
|
||||
// loads.
|
||||
font-display: block;
|
||||
src: url("~static/fonts/material-icons-v48.woff2") format("woff2");
|
||||
src: url("~static/fonts/material-icons-v52.woff2") format("woff2");
|
||||
}
|
||||
|
||||
.material-icons {
|
||||
@@ -40,9 +40,7 @@
|
||||
font-display: swap;
|
||||
src: local("Poppins Medium"), local("Poppins-Medium"),
|
||||
url("~static/fonts/poppins-v9-latin-500.woff2") format("woff2"),
|
||||
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||
url("~static/fonts/poppins-v9-latin-500.woff") format("woff");
|
||||
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||
url("~static/fonts/poppins-v9-latin-500.woff") format("woff");
|
||||
}
|
||||
|
||||
/* poppins-700 - latin */
|
||||
@@ -53,9 +51,7 @@
|
||||
font-display: swap;
|
||||
src: local("Poppins Bold"), local("Poppins-Bold"),
|
||||
url("~static/fonts/poppins-v9-latin-700.woff2") format("woff2"),
|
||||
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||
url("~static/fonts/poppins-v9-latin-700.woff") format("woff");
|
||||
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||
url("~static/fonts/poppins-v9-latin-700.woff") format("woff");
|
||||
}
|
||||
|
||||
/* roboto-mono-regular - latin */
|
||||
@@ -66,7 +62,5 @@
|
||||
font-display: swap;
|
||||
src: local("Roboto Mono"), local("RobotoMono-Regular"),
|
||||
url("~static/fonts/roboto-mono-v7-latin-regular.woff2") format("woff2"),
|
||||
/* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||
url("~static/fonts/roboto-mono-v7-latin-regular.woff") format("woff");
|
||||
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||
url("~static/fonts/roboto-mono-v7-latin-regular.woff") format("woff");
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ button {
|
||||
// justify-content: center;
|
||||
margin: 4px;
|
||||
padding: 6px 16px;
|
||||
border-radius: 20px;
|
||||
border-radius: 8px;
|
||||
background-color: var(--ac-color);
|
||||
color: var(--act-color);
|
||||
font-size: 16px;
|
||||
@@ -457,7 +457,7 @@ button {
|
||||
|
||||
fieldset {
|
||||
margin: 16px 0;
|
||||
border-radius: 16px;
|
||||
border-radius: 8px;
|
||||
background-color: var(--bg-dark-color);
|
||||
transition: all 0.2s ease-in-out;
|
||||
|
||||
@@ -814,7 +814,7 @@ ol li {
|
||||
section {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
border-radius: 16px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.toasted-container .toasted {
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as querystring from "querystring"
|
||||
* output this: 'msg1=value1&msg2=value2'
|
||||
* @param dataArguments
|
||||
*/
|
||||
const joinDataArguments = dataArguments => {
|
||||
const joinDataArguments = (dataArguments) => {
|
||||
let data = ""
|
||||
dataArguments.forEach((argument, i) => {
|
||||
if (i === 0) {
|
||||
@@ -19,7 +19,7 @@ const joinDataArguments = dataArguments => {
|
||||
return data
|
||||
}
|
||||
|
||||
const parseCurlCommand = curlCommand => {
|
||||
const parseCurlCommand = (curlCommand) => {
|
||||
let newlineFound = /\r|\n/.exec(curlCommand)
|
||||
if (newlineFound) {
|
||||
// remove newlines
|
||||
@@ -47,7 +47,7 @@ const parseCurlCommand = curlCommand => {
|
||||
}
|
||||
let headers
|
||||
|
||||
const parseHeaders = headerFieldName => {
|
||||
const parseHeaders = (headerFieldName) => {
|
||||
if (parsedArguments[headerFieldName]) {
|
||||
if (!headers) {
|
||||
headers = {}
|
||||
@@ -55,7 +55,7 @@ const parseCurlCommand = curlCommand => {
|
||||
if (!Array.isArray(parsedArguments[headerFieldName])) {
|
||||
parsedArguments[headerFieldName] = [parsedArguments[headerFieldName]]
|
||||
}
|
||||
parsedArguments[headerFieldName].forEach(header => {
|
||||
parsedArguments[headerFieldName].forEach((header) => {
|
||||
if (header.includes("Cookie")) {
|
||||
// stupid javascript tricks: closure
|
||||
cookieString = header
|
||||
@@ -95,7 +95,7 @@ const parseCurlCommand = curlCommand => {
|
||||
if (!Array.isArray(parsedArguments.F)) {
|
||||
parsedArguments.F = [parsedArguments.F]
|
||||
}
|
||||
parsedArguments.F.forEach(multipartArgument => {
|
||||
parsedArguments.F.forEach((multipartArgument) => {
|
||||
// input looks like key=value. value could be json or a file path prepended with an @
|
||||
const [key, value] = multipartArgument.split("=", 2)
|
||||
multipartUploads[key] = value
|
||||
@@ -103,7 +103,7 @@ const parseCurlCommand = curlCommand => {
|
||||
}
|
||||
if (cookieString) {
|
||||
const cookieParseOptions = {
|
||||
decode: s => s,
|
||||
decode: (s) => s,
|
||||
}
|
||||
// separate out cookie headers into separate data structure
|
||||
// note: cookie is case insensitive
|
||||
|
||||
@@ -12,7 +12,7 @@ const redirectUri = `${window.location.origin}/`
|
||||
|
||||
const sendPostRequest = async (url, params) => {
|
||||
const body = Object.keys(params)
|
||||
.map(key => `${key}=${params[key]}`)
|
||||
.map((key) => `${key}=${params[key]}`)
|
||||
.join("&")
|
||||
const options = {
|
||||
method: "post",
|
||||
@@ -38,11 +38,11 @@ const sendPostRequest = async (url, params) => {
|
||||
* @returns {Object}
|
||||
*/
|
||||
|
||||
const parseQueryString = searchQuery => {
|
||||
const parseQueryString = (searchQuery) => {
|
||||
if (searchQuery === "") {
|
||||
return {}
|
||||
}
|
||||
const segments = searchQuery.split("&").map(s => s.split("="))
|
||||
const segments = searchQuery.split("&").map((s) => s.split("="))
|
||||
const queryString = segments.reduce((obj, el) => ({ ...obj, [el[0]]: el[1] }), {})
|
||||
return queryString
|
||||
}
|
||||
@@ -53,7 +53,7 @@ const parseQueryString = searchQuery => {
|
||||
* @returns {Object}
|
||||
*/
|
||||
|
||||
const getTokenConfiguration = async endpoint => {
|
||||
const getTokenConfiguration = async (endpoint) => {
|
||||
const options = {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -81,7 +81,7 @@ const getTokenConfiguration = async endpoint => {
|
||||
const generateRandomString = () => {
|
||||
const array = new Uint32Array(28)
|
||||
window.crypto.getRandomValues(array)
|
||||
return Array.from(array, dec => `0${dec.toString(16)}`.substr(-2)).join("")
|
||||
return Array.from(array, (dec) => `0${dec.toString(16)}`.substr(-2)).join("")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,7 +90,7 @@ const generateRandomString = () => {
|
||||
* @returns {Promise<ArrayBuffer>}
|
||||
*/
|
||||
|
||||
const sha256 = plain => {
|
||||
const sha256 = (plain) => {
|
||||
const encoder = new TextEncoder()
|
||||
const data = encoder.encode(plain)
|
||||
return window.crypto.subtle.digest("SHA-256", data)
|
||||
@@ -121,7 +121,7 @@ const base64urlencode = (
|
||||
* @returns {String}
|
||||
*/
|
||||
|
||||
const pkceChallengeFromVerifier = async v => {
|
||||
const pkceChallengeFromVerifier = async (v) => {
|
||||
const hashed = await sha256(v)
|
||||
return base64urlencode(hashed)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export default () => {
|
||||
|
||||
//*** If the PWA has not been installed, show the install PWA prompt.. ***//
|
||||
let deferredPrompt = null
|
||||
window.addEventListener("beforeinstallprompt", event => {
|
||||
window.addEventListener("beforeinstallprompt", (event) => {
|
||||
deferredPrompt = event
|
||||
|
||||
// Show the install button if the prompt appeared.
|
||||
@@ -28,7 +28,7 @@ export default () => {
|
||||
})
|
||||
|
||||
// When the app is installed, remove install prompts.
|
||||
window.addEventListener("appinstalled", event => {
|
||||
window.addEventListener("appinstalled", (event) => {
|
||||
localStorage.setItem("pwaInstalled", "yes")
|
||||
pwaInstalled = true
|
||||
document.getElementById("installPWA").style.display = "none"
|
||||
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
this.$store.commit("postwoman/removeCollection", {
|
||||
collectionIndex: this.collectionIndex,
|
||||
})
|
||||
this.syncCollections();
|
||||
this.syncCollections()
|
||||
},
|
||||
editFolder(collectionIndex, folder, folderIndex) {
|
||||
this.$emit("edit-folder", { collectionIndex, folder, folderIndex })
|
||||
|
||||
@@ -80,8 +80,8 @@ export default {
|
||||
collection: collectionUpdated,
|
||||
collectionIndex: this.$props.editingCollectionIndex,
|
||||
})
|
||||
this.$emit("hide-modal");
|
||||
this.syncCollections();
|
||||
this.$emit("hide-modal")
|
||||
this.syncCollections()
|
||||
},
|
||||
hideModal() {
|
||||
this.$emit("hide-modal")
|
||||
|
||||
@@ -71,7 +71,7 @@ export default {
|
||||
folderIndex: this.$props.folderIndex,
|
||||
})
|
||||
this.hideModal()
|
||||
this.syncCollections();
|
||||
this.syncCollections()
|
||||
},
|
||||
hideModal() {
|
||||
this.$emit("hide-modal")
|
||||
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
})
|
||||
|
||||
this.hideModal()
|
||||
this.syncCollections();
|
||||
this.syncCollections()
|
||||
},
|
||||
hideModal() {
|
||||
this.$emit("hide-modal")
|
||||
|
||||
@@ -106,7 +106,7 @@ export default {
|
||||
collectionIndex: this.collectionIndex,
|
||||
folderIndex: this.folderIndex,
|
||||
})
|
||||
this.syncCollections();
|
||||
this.syncCollections()
|
||||
},
|
||||
editFolder() {
|
||||
this.$emit("edit-folder")
|
||||
|
||||
@@ -135,7 +135,8 @@ export default {
|
||||
computed: {
|
||||
collections() {
|
||||
return fb.currentUser !== null
|
||||
? fb.currentCollections : this.$store.state.postwoman.collections
|
||||
? fb.currentCollections
|
||||
: this.$store.state.postwoman.collections
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
folderIndex: this.folderIndex,
|
||||
requestIndex: this.requestIndex,
|
||||
})
|
||||
this.syncCollections();
|
||||
this.syncCollections()
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -83,7 +83,8 @@ export default {
|
||||
computed: {
|
||||
environments() {
|
||||
return fb.currentUser !== null
|
||||
? fb.currentEnvironments : this.$store.state.postwoman.environments
|
||||
? fb.currentEnvironments
|
||||
: this.$store.state.postwoman.environments
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
firebase
|
||||
.auth()
|
||||
.signOut()
|
||||
.catch(err => {
|
||||
.catch((err) => {
|
||||
self.$toast.show(err.message || err, {
|
||||
icon: "error",
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
display: inline-block;
|
||||
padding: 4px 8px;
|
||||
margin: 4px 0;
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -113,14 +113,11 @@
|
||||
</svg>
|
||||
<span>{{ $t("tweet") }}</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="navigatorShare"
|
||||
class="icon"
|
||||
@click="nativeShare"
|
||||
v-close-popover
|
||||
v-tooltip="$t('more')"
|
||||
>
|
||||
</div>
|
||||
<div v-if="navigatorShare">
|
||||
<button class="icon" @click="nativeShare" v-close-popover v-tooltip="$t('more')">
|
||||
<i class="material-icons">share</i>
|
||||
<span>Share</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 612.001 612.001"
|
||||
style="enable-background:new 0 0 612.001 612.001;"
|
||||
style="enable-background: new 0 0 612.001 612.001;"
|
||||
xml:space="preserve"
|
||||
>
|
||||
<defs id="defs11" />
|
||||
@@ -13,7 +13,7 @@
|
||||
<circle
|
||||
:fill="color"
|
||||
transform="scale(1,-1)"
|
||||
style="stroke-width:1.19531453"
|
||||
style="stroke-width: 1.19531453;"
|
||||
r="178.70923"
|
||||
cy="-501.55591"
|
||||
cx="822.40845"
|
||||
|
||||
@@ -47,8 +47,8 @@ export default {
|
||||
methods: {
|
||||
getSourcePrefix,
|
||||
},
|
||||
updated: function() {
|
||||
this.$nextTick(function() {
|
||||
updated: function () {
|
||||
this.$nextTick(function () {
|
||||
if (this.$refs.log) {
|
||||
this.$refs.log.scrollBy(0, this.$refs.log.scrollHeight + 100)
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
"pw-section": () => import("../../components/layout/section"),
|
||||
realtimeLog: () => import("./log"),
|
||||
},
|
||||
data: function() {
|
||||
data: function () {
|
||||
return {
|
||||
url: "wss://test.mosquitto.org:8081",
|
||||
client: null,
|
||||
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
return this.$store.state.postwoman.settings.THEME_ACE_EDITOR || DEFAULT_THEME
|
||||
},
|
||||
|
||||
provideLinting: debounce(function(code) {
|
||||
provideLinting: debounce(function (code) {
|
||||
if (this.lang === "json") {
|
||||
try {
|
||||
jsonParse(code)
|
||||
|
||||
@@ -194,14 +194,14 @@ export default {
|
||||
|
||||
return (
|
||||
this.source
|
||||
.filter(entry => {
|
||||
.filter((entry) => {
|
||||
return (
|
||||
entry.toLowerCase().startsWith(input.toLowerCase()) &&
|
||||
input.toLowerCase() !== entry.toLowerCase()
|
||||
)
|
||||
})
|
||||
// Cut off the part that's already been typed.
|
||||
.map(entry => entry.substring(this.selectionStart))
|
||||
.map((entry) => entry.substring(this.selectionStart))
|
||||
// We only want the top 6 suggestions.
|
||||
.slice(0, 6)
|
||||
)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
padding: 16px;
|
||||
transition: all 0.2s ease;
|
||||
background-color: var(--bg-color);
|
||||
border-radius: 16px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0px 16px 70px rgba(0, 0, 0, 0.5);
|
||||
max-height: calc(100vh - 128px);
|
||||
max-width: 720px;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="tabs-wrapper">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li v-for="tab in tabs" :class="{ 'is-active': tab.isActive }">
|
||||
<li v-for="(tab, index) in tabs" :class="{ 'is-active': tab.isActive }" :key="index">
|
||||
<a :href="tab.href" @click="selectTab(tab)">
|
||||
<i v-if="tab.icon" class="material-icons">
|
||||
{{ tab.icon }}
|
||||
@@ -45,7 +45,7 @@
|
||||
justify-content: center;
|
||||
padding: 8px 16px;
|
||||
color: var(--fg-light-color);
|
||||
border-radius: 4px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
|
||||
.material-icons {
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
selectTab({ id }) {
|
||||
this.tabs.forEach(tab => {
|
||||
this.tabs.forEach((tab) => {
|
||||
tab.isActive = tab.id == id
|
||||
})
|
||||
},
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function runTestScriptWithVariables(script, variables) {
|
||||
// run pre-request script within this function so that it has access to the pw object.
|
||||
new Function("pw", script)(pw)
|
||||
//
|
||||
const testReports = pw._testReports.map(item => {
|
||||
const testReports = pw._testReports.map((item) => {
|
||||
if (item.result) {
|
||||
item.styles = styles[item.result]
|
||||
} else {
|
||||
@@ -64,7 +64,7 @@ class Expectation {
|
||||
this.expectValue = expectValue
|
||||
this.not = _not || new Expectation(this.expectValue, true, _testReports)
|
||||
this._testReports = _testReports // this values is used within Test.it, which wraps Expectation and passes _testReports value.
|
||||
this._satisfies = function(expectValue, targetValue) {
|
||||
this._satisfies = function (expectValue, targetValue) {
|
||||
// Used for testing if two values match the expectation, which could be === OR !==, depending on if not
|
||||
// was used. Expectation#_satisfies prevents the need to have an if(this.not) branch in every test method.
|
||||
// Signature is _satisfies([expectValue,] targetValue): if only one argument is given, it is assumed the targetValue, and expectValue is set to this.expectValue
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// NOTE : Don't use lambda functions as this doesn't get bound properly in them, use the 'function (args) {}' format
|
||||
const debounce = (func, delay) => {
|
||||
let inDebounce
|
||||
return function() {
|
||||
return function () {
|
||||
const context = this
|
||||
const args = arguments
|
||||
clearTimeout(inDebounce)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default function({ route, redirect }) {
|
||||
export default function ({ route, redirect }) {
|
||||
if (route.fullPath !== "/") {
|
||||
return redirect("/")
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
static/fonts/material-icons-v52.woff2
Normal file
BIN
static/fonts/material-icons-v52.woff2
Normal file
Binary file not shown.
@@ -9,7 +9,7 @@ export default {
|
||||
|
||||
setCollapsedSection({ theme }, value) {
|
||||
theme.collapsedSections.includes(value)
|
||||
? (theme.collapsedSections = theme.collapsedSections.filter(section => section !== value))
|
||||
? (theme.collapsedSections = theme.collapsedSections.filter((section) => section !== value))
|
||||
: theme.collapsedSections.push(value)
|
||||
},
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
describe("Visit Home", () => {
|
||||
it('Have a page title with "Postwoman"', () => {
|
||||
cy.visit("/", { retryOnStatusCodeFailure: true })
|
||||
.get("title")
|
||||
.should("contain", "Postwoman")
|
||||
cy.visit("/", { retryOnStatusCodeFailure: true }).get("title").should("contain", "Postwoman")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,13 +3,13 @@ describe("Authentication", () => {
|
||||
cy.visit(`?&auth=Basic Auth&httpUser=foo&httpPassword=bar`, { retryOnStatusCodeFailure: true })
|
||||
.get('input[name="http_basic_user"]', { timeout: 500 })
|
||||
.invoke("val")
|
||||
.then(user => {
|
||||
.then((user) => {
|
||||
expect(user === "foo").to.equal(true)
|
||||
})
|
||||
|
||||
.get('input[name="http_basic_passwd"]')
|
||||
.invoke("val")
|
||||
.then(pass => {
|
||||
.then((pass) => {
|
||||
expect(pass === "bar").to.equal(true)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -18,7 +18,7 @@ describe("Proxy enabled - external request", () => {
|
||||
.click()
|
||||
.get("#response-details-wrapper", { timeout: 24000 })
|
||||
.should("be.visible")
|
||||
.should($wrapper => {
|
||||
.should(($wrapper) => {
|
||||
expect($wrapper).to.contain("Hello World")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,14 +6,9 @@
|
||||
* @param { String } method The fake request method
|
||||
*/
|
||||
Cypress.Commands.add("seedAndVisit", (seedData, path = "/", method = "GET") => {
|
||||
cy.server()
|
||||
.route(method, "https://api.thecatapi.com/", `fixture:${seedData}`)
|
||||
.as("load")
|
||||
cy.server().route(method, "https://api.thecatapi.com/", `fixture:${seedData}`).as("load")
|
||||
|
||||
cy.visit(path)
|
||||
.get("#send")
|
||||
.click()
|
||||
.wait("@load")
|
||||
cy.visit(path).get("#send").click().wait("@load")
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -21,7 +16,7 @@ Cypress.Commands.add("seedAndVisit", (seedData, path = "/", method = "GET") => {
|
||||
* This function will enable the proxy and navigate back to a given path
|
||||
* @param { String } goBackPath The page go back
|
||||
*/
|
||||
Cypress.Commands.add("enableProxy", goBackPath => {
|
||||
Cypress.Commands.add("enableProxy", (goBackPath) => {
|
||||
cy.visit("/settings")
|
||||
.get("#proxy")
|
||||
.find(".toggle")
|
||||
|
||||
Reference in New Issue
Block a user