Merge pull request #432 from liyasthomas/refactor/enhancements
chore: stick to Vue.js best practices
This commit is contained in:
@@ -44,11 +44,11 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li v-for="(folder, index) in collection.folders" :key="folder.name">
|
<li v-for="(folder, index) in collection.folders" :key="folder.name">
|
||||||
<folder
|
<folder
|
||||||
v-bind:folder="folder"
|
:folder="folder"
|
||||||
v-bind:folderIndex="index"
|
:folderIndex="index"
|
||||||
v-bind:collection-index="collectionIndex"
|
:collection-index="collectionIndex"
|
||||||
v-on:edit-folder="editFolder(collectionIndex, folder, index)"
|
@edit-folder="editFolder(collectionIndex, folder, index)"
|
||||||
v-on:edit-request="$emit('edit-request', $event)"
|
@edit-request="$emit('edit-request', $event)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li
|
<li
|
||||||
@@ -62,11 +62,11 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li v-for="(request, index) in collection.requests" :key="index">
|
<li v-for="(request, index) in collection.requests" :key="index">
|
||||||
<request
|
<request
|
||||||
v-bind:request="request"
|
:request="request"
|
||||||
v-bind:collection-index="collectionIndex"
|
:collection-index="collectionIndex"
|
||||||
v-bind:folder-index="-1"
|
:folder-index="-1"
|
||||||
v-bind:request-index="index"
|
:request-index="index"
|
||||||
v-on:edit-request="
|
@edit-request="
|
||||||
$emit('edit-request', {
|
$emit('edit-request', {
|
||||||
request,
|
request,
|
||||||
collectionIndex,
|
collectionIndex,
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
requestIndex: index
|
requestIndex: index
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
></request>
|
/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="name"
|
v-model="name"
|
||||||
v-bind:placeholder="editingCollection.name"
|
:placeholder="editingCollection.name"
|
||||||
@keyup.enter="saveCollection"
|
@keyup.enter="saveCollection"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="name"
|
v-model="name"
|
||||||
v-bind:placeholder="folder.name"
|
:placeholder="folder.name"
|
||||||
@keyup.enter="editFolder"
|
@keyup.enter="editFolder"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -34,11 +34,11 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li v-for="(request, index) in folder.requests" :key="index">
|
<li v-for="(request, index) in folder.requests" :key="index">
|
||||||
<request
|
<request
|
||||||
v-bind:request="request"
|
:request="request"
|
||||||
v-bind:collection-index="collectionIndex"
|
:collection-index="collectionIndex"
|
||||||
v-bind:folder-index="folderIndex"
|
:folder-index="folderIndex"
|
||||||
v-bind:request-index="index"
|
:request-index="index"
|
||||||
v-on:edit-request="
|
@edit-request="
|
||||||
$emit('edit-request', {
|
$emit('edit-request', {
|
||||||
request,
|
request,
|
||||||
collectionIndex,
|
collectionIndex,
|
||||||
|
|||||||
@@ -6,40 +6,40 @@ TODO:
|
|||||||
<template>
|
<template>
|
||||||
<div class="collections-wrapper">
|
<div class="collections-wrapper">
|
||||||
<addCollection
|
<addCollection
|
||||||
v-bind:show="showModalAdd"
|
:show="showModalAdd"
|
||||||
v-on:hide-modal="displayModalAdd(false)"
|
@hide-modal="displayModalAdd(false)"
|
||||||
/>
|
/>
|
||||||
<editCollection
|
<editCollection
|
||||||
v-bind:show="showModalEdit"
|
:show="showModalEdit"
|
||||||
v-bind:editingCollection="editingCollection"
|
:editingCollection="editingCollection"
|
||||||
v-bind:editingCollectionIndex="editingCollectionIndex"
|
:editingCollectionIndex="editingCollectionIndex"
|
||||||
v-on:hide-modal="displayModalEdit(false)"
|
@hide-modal="displayModalEdit(false)"
|
||||||
/>
|
/>
|
||||||
<addFolder
|
<addFolder
|
||||||
v-bind:show="showModalAddFolder"
|
:show="showModalAddFolder"
|
||||||
v-bind:collection="editingCollection"
|
:collection="editingCollection"
|
||||||
v-bind:collectionIndex="editingCollectionIndex"
|
:collectionIndex="editingCollectionIndex"
|
||||||
v-on:hide-modal="displayModalAddFolder(false)"
|
@hide-modal="displayModalAddFolder(false)"
|
||||||
/>
|
/>
|
||||||
<editFolder
|
<editFolder
|
||||||
v-bind:show="showModalEditFolder"
|
:show="showModalEditFolder"
|
||||||
v-bind:collection="editingCollection"
|
:collection="editingCollection"
|
||||||
v-bind:collectionIndex="editingCollectionIndex"
|
:collectionIndex="editingCollectionIndex"
|
||||||
v-bind:folder="editingFolder"
|
:folder="editingFolder"
|
||||||
v-bind:folderIndex="editingFolderIndex"
|
:folderIndex="editingFolderIndex"
|
||||||
v-on:hide-modal="displayModalEditFolder(false)"
|
@hide-modal="displayModalEditFolder(false)"
|
||||||
/>
|
/>
|
||||||
<editRequest
|
<editRequest
|
||||||
v-bind:show="showModalEditRequest"
|
:show="showModalEditRequest"
|
||||||
v-bind:collectionIndex="editingCollectionIndex"
|
:collectionIndex="editingCollectionIndex"
|
||||||
v-bind:folderIndex="editingFolderIndex"
|
:folderIndex="editingFolderIndex"
|
||||||
v-bind:request="editingRequest"
|
:request="editingRequest"
|
||||||
v-bind:requestIndex="editingRequestIndex"
|
:requestIndex="editingRequestIndex"
|
||||||
v-on:hide-modal="displayModalEditRequest(false)"
|
@hide-modal="displayModalEditRequest(false)"
|
||||||
/>
|
/>
|
||||||
<importExportCollections
|
<importExportCollections
|
||||||
v-bind:show="showModalImportExport"
|
:show="showModalImportExport"
|
||||||
v-on:hide-modal="displayModalImportExport(false)"
|
@hide-modal="displayModalImportExport(false)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="flex-wrap">
|
<div class="flex-wrap">
|
||||||
@@ -78,13 +78,13 @@ TODO:
|
|||||||
<ul>
|
<ul>
|
||||||
<li v-for="(collection, index) in collections" :key="collection.name">
|
<li v-for="(collection, index) in collections" :key="collection.name">
|
||||||
<collection
|
<collection
|
||||||
v-bind:collection-index="index"
|
:collection-index="index"
|
||||||
v-bind:collection="collection"
|
:collection="collection"
|
||||||
v-on:edit-collection="editCollection(collection, index)"
|
@edit-collection="editCollection(collection, index)"
|
||||||
v-on:add-folder="addFolder(collection, index)"
|
@add-folder="addFolder(collection, index)"
|
||||||
v-on:edit-folder="editFolder($event)"
|
@edit-folder="editFolder($event)"
|
||||||
v-on:edit-request="editRequest($event)"
|
@edit-request="editRequest($event)"
|
||||||
></collection>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="collections.length === 0">
|
<li v-if="collections.length === 0">
|
||||||
<label>Collections are empty</label>
|
<label>Collections are empty</label>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
type="text"
|
type="text"
|
||||||
id="selectLabel"
|
id="selectLabel"
|
||||||
v-model="requestData.name"
|
v-model="requestData.name"
|
||||||
v-bind:placeholder="defaultRequestName"
|
:placeholder="defaultRequestName"
|
||||||
@keyup.enter="saveRequestAs"
|
@keyup.enter="saveRequestAs"
|
||||||
/>
|
/>
|
||||||
<label for="selectCollection">Collection</label>
|
<label for="selectCollection">Collection</label>
|
||||||
|
|||||||
@@ -327,7 +327,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
v-bind:href="
|
:href="
|
||||||
'https://github.com/liyasthomas/postwoman/releases/tag/' +
|
'https://github.com/liyasthomas/postwoman/releases/tag/' +
|
||||||
version.name
|
version.name
|
||||||
"
|
"
|
||||||
@@ -340,7 +340,7 @@
|
|||||||
<!-- <span v-if="version.hash">
|
<!-- <span v-if="version.hash">
|
||||||
-
|
-
|
||||||
<a
|
<a
|
||||||
v-bind:href="'https://github.com/liyasthomas/postwoman/commit/' + version.hash"
|
:href="'https://github.com/liyasthomas/postwoman/commit/' + version.hash"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>{{version.hash}}</a>
|
>{{version.hash}}</a>
|
||||||
|
|||||||
@@ -685,7 +685,7 @@
|
|||||||
<history
|
<history
|
||||||
@useHistory="handleUseHistory"
|
@useHistory="handleUseHistory"
|
||||||
ref="historyComponent"
|
ref="historyComponent"
|
||||||
></history>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<input id="collection-tab" type="radio" name="side" />
|
<input id="collection-tab" type="radio" name="side" />
|
||||||
<label for="collection-tab">{{ $t("collections") }}</label>
|
<label for="collection-tab">{{ $t("collections") }}</label>
|
||||||
@@ -698,10 +698,10 @@
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<save-request-as
|
<save-request-as
|
||||||
v-bind:show="showRequestModal"
|
:show="showRequestModal"
|
||||||
v-on:hide-model="hideRequestModal"
|
@hide-model="hideRequestModal"
|
||||||
v-bind:editing-request="editRequest"
|
:editing-request="editRequest"
|
||||||
></save-request-as>
|
/>
|
||||||
|
|
||||||
<pw-modal v-if="showModal" @close="showModal = false">
|
<pw-modal v-if="showModal" @close="showModal = false">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
|
|||||||
Reference in New Issue
Block a user