From f49c2138de37af2923cda16a7d0dcac77ac52e02 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Wed, 21 Oct 2020 12:20:32 +0530 Subject: [PATCH] Lint + ES6 --- assets/scss/styles.scss | 36 ++++-- components/collections/add-folder.vue | 15 +-- components/collections/collection.vue | 41 ++++--- components/collections/folder.vue | 42 +++---- .../collections/import-export-collections.vue | 35 +++--- components/collections/index.vue | 2 +- components/collections/request.vue | 34 +++--- components/collections/save-request-as.vue | 19 ++-- components/environments/edit-environment.vue | 8 +- .../import-export-environment.vue | 16 ++- components/firebase/feeds.vue | 4 +- components/graphql/type.vue | 4 +- components/layout/history.vue | 4 +- components/layout/pw-header.vue | 6 - .../lenses/renderers/HTMLLensRenderer.vue | 1 + .../lenses/renderers/ImageLensRenderer.vue | 11 +- .../lenses/renderers/RawLensRenderer.vue | 1 + .../lenses/renderers/XMLLensRenderer.vue | 1 + components/realtime/log.vue | 2 +- components/realtime/mqtt.vue | 2 +- components/ui/ace-editor.vue | 2 +- components/ui/autocomplete.vue | 7 +- nuxt.config.js | 107 ++++++++++-------- pages/index.vue | 2 +- store/postwoman.js | 73 +++++++----- 25 files changed, 263 insertions(+), 212 deletions(-) diff --git a/assets/scss/styles.scss b/assets/scss/styles.scss index 90c98aea8..c3ddab7fa 100644 --- a/assets/scss/styles.scss +++ b/assets/scss/styles.scss @@ -8,6 +8,7 @@ $responsiveWidth: 768px; :root { @apply antialiased; + font-variant-ligatures: common-ligatures; } @@ -54,6 +55,7 @@ body { @apply transition; @apply ease-in-out; @apply duration-200; + -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; } @@ -211,6 +213,7 @@ hr { .tooltip-arrow { @apply mt-0; @apply mb-0; + border-width: 5px 5px 0 5px; border-left-color: transparent !important; border-right-color: transparent !important; @@ -226,6 +229,7 @@ hr { .tooltip-arrow { @apply mt-0; @apply mb-0; + border-width: 0 5px 5px 5px; border-left-color: transparent !important; border-right-color: transparent !important; @@ -241,6 +245,7 @@ hr { .tooltip-arrow { @apply ml-0; @apply mr-0; + border-width: 5px 5px 5px 0; border-left-color: transparent !important; border-top-color: transparent !important; @@ -256,6 +261,7 @@ hr { .tooltip-arrow { @apply ml-0; @apply mr-0; + border-width: 5px 0 5px 5px; border-top-color: transparent !important; border-right-color: transparent !important; @@ -278,11 +284,14 @@ hr { @apply rounded-lg; @apply overflow-auto; @apply shadow-lg; + max-height: 256px; button { @apply flex-1; @apply m-0; + @apply justify-start; + @apply text-left; } div { @@ -290,11 +299,6 @@ hr { @apply items-stretch; @apply flex-col; } - - button { - @apply justify-start; - @apply text-left; - } } .popover-arrow { @@ -362,6 +366,7 @@ button { @apply text-actColor; @apply fill-current; @apply outline-none; + box-shadow: inset 0 0 0 2px var(--fg-color); } @@ -423,6 +428,7 @@ button { @apply tracking-normal; @apply whitespace-no-wrap; @apply antialiased; + word-wrap: normal; direction: ltr; text-rendering: optimizeLegibility; @@ -481,6 +487,7 @@ code { @apply select-text; @apply resize-y; @apply outline-none; + width: calc(100% - 16px); &:not([readonly]):not(.ace_editor):hover, @@ -493,6 +500,7 @@ code { .method { @apply cursor-pointer; @apply uppercase; + min-width: 128px; &:hover, @@ -530,11 +538,12 @@ pre { @apply w-full; } - &:after { + &::after { @apply inline-block; @apply absolute; @apply pointer-events-none; @apply font-icon; + content: "\e313"; top: 16px; right: 16px; @@ -544,6 +553,7 @@ pre { select { @apply cursor-pointer; @apply appearance-none; + height: 40px; &::-ms-expand { @@ -563,7 +573,7 @@ input[type="checkbox"] { @apply align-middle; @apply cursor-pointer; - &:before { + &::before { @apply border; @apply border-fgColor; @apply rounded-lg; @@ -574,6 +584,7 @@ input[type="checkbox"] { @apply transition; @apply ease-in-out; @apply duration-200; + content: "\2714"; height: 16px; width: 16px; @@ -581,7 +592,7 @@ input[type="checkbox"] { } } - &:checked + label:before { + &:checked + label::before { @apply bg-acColor; @apply border-acColor; @apply text-actColor; @@ -616,6 +627,7 @@ ol { @apply flex; @apply p-0; @apply list-none; + margin: 4px 0 4px; ul, @@ -684,6 +696,7 @@ ol li { textarea { @apply m-0; @apply w-full; + line-height: 1; } @@ -708,6 +721,7 @@ ol li { @apply ease-in-out; @apply duration-200; @apply shadow-lg; + bottom: 86px; left: 50%; z-index: 10001; @@ -753,6 +767,7 @@ section { @apply flex; @apply order-2; @apply ml-4; + width: 33%; } @@ -807,16 +822,17 @@ section { @apply text-sm; @apply rounded-lg; @apply shadow-lg; + padding: 16px !important; .action { @apply bg-gray-50; @apply text-gray-900; @apply rounded-lg; + @apply font-bold; + text-transform: none !important; padding: 12px 16px !important; - // font-weight: 500 !important; - @apply font-bold; font-size: 16px !important; margin: 0 !important; margin-left: 8px !important; diff --git a/components/collections/add-folder.vue b/components/collections/add-folder.vue index 28aca4a0d..588239074 100644 --- a/components/collections/add-folder.vue +++ b/components/collections/add-folder.vue @@ -45,6 +45,7 @@ diff --git a/components/collections/import-export-collections.vue b/components/collections/import-export-collections.vue index cbab58714..20d583c90 100644 --- a/components/collections/import-export-collections.vue +++ b/components/collections/import-export-collections.vue @@ -108,8 +108,8 @@ export default { }, replaceWithJSON() { let reader = new FileReader() - reader.onload = (event) => { - let content = event.target.result + reader.onload = ({ target }) => { + let content = target.result let collections = JSON.parse(content) if (collections[0]) { let [name, folders, requests] = Object.keys(collections[0]) @@ -130,8 +130,8 @@ export default { }, importFromJSON() { let reader = new FileReader() - reader.onload = (event) => { - let content = event.target.result + reader.onload = ({ target }) => { + let content = target.result let collections = JSON.parse(content) if (collections[0]) { let [name, folders, requests] = Object.keys(collections[0]) @@ -191,24 +191,23 @@ export default { icon: "error", }) }, - parsePostmanCollection(collection) { - let postwomanCollection = - { - name: "", - folders: [], - requests: [], - } + parsePostmanCollection({ info, name, item }) { + let postwomanCollection = { + name: "", + folders: [], + requests: [], + } - postwomanCollection.name = collection.info ? collection.info.name : collection.name + postwomanCollection.name = info ? info.name : name - if (collection.item && collection.item.length > 0) { - for (let collectionItem of collection.item) { + if (item && item.length > 0) { + for (let collectionItem of item) { if (collectionItem.request) { - if (postwomanCollection.hasOwnProperty('folders')) { - postwomanCollection.name = collection.info ? collection.info.name : collection.name + if (postwomanCollection.hasOwnProperty("folders")) { + postwomanCollection.name = info ? info.name : name postwomanCollection.requests.push(this.parsePostmanRequest(collectionItem)) } else { - postwomanCollection.name = collection.name ? collection.name : "" + postwomanCollection.name = name ? name : "" postwomanCollection.requests.push(this.parsePostmanRequest(collectionItem)) } } else if (this.hasFolder(collectionItem)) { @@ -295,7 +294,7 @@ export default { return pwRequest }, hasFolder(item) { - return item.hasOwnProperty('item') + return item.hasOwnProperty("item") }, }, } diff --git a/components/collections/index.vue b/components/collections/index.vue index 9406983e5..b7b583358 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -119,7 +119,7 @@ export default { editingCollection: undefined, editingCollectionIndex: undefined, editingFolder: undefined, - editingFolderName:undefined, + editingFolderName: undefined, editingFolderIndex: undefined, editingRequest: undefined, editingRequestIndex: undefined, diff --git a/components/collections/request.vue b/components/collections/request.vue index c302cb452..b2b5e50d8 100644 --- a/components/collections/request.vue +++ b/components/collections/request.vue @@ -4,8 +4,8 @@ draggable="true" @dragstart="dragStart" @dragover.stop - @dragleave="dragging=false" - @dragend="dragging=false" + @dragleave="dragging = false" + @dragend="dragging = false" >