fix: save location picker indicator

This commit is contained in:
Liyas Thomas
2021-05-15 05:45:05 +00:00
committed by GitHub
parent 1b9b2ac4c9
commit 8e3ecb4c25
9 changed files with 27 additions and 33 deletions

View File

@@ -12,13 +12,7 @@
</div> </div>
<div slot="body" class="flex flex-col"> <div slot="body" class="flex flex-col">
<label for="selectLabel">{{ $t("label") }}</label> <label for="selectLabel">{{ $t("label") }}</label>
<input <input type="text" id="selectLabel" v-model="name" @keyup.enter="editFolder" />
type="text"
id="selectLabel"
v-model="name"
:placeholder="folder.name"
@keyup.enter="editFolder"
/>
</div> </div>
<div slot="footer"> <div slot="footer">
<div class="row-wrapper"> <div class="row-wrapper">

View File

@@ -2,13 +2,13 @@
<SmartModal v-if="show" @close="hideModal"> <SmartModal v-if="show" @close="hideModal">
<div slot="header"> <div slot="header">
<div class="row-wrapper"> <div class="row-wrapper">
<h3 class="title">{{ $t(mode) }}</h3> <h3 class="title">Export</h3>
<div> <div>
<button <button
class="tooltip-target icon" class="tooltip-target icon"
v-if="mode != 'import_export'" v-if="mode != 'import_export'"
@click="mode = 'import_export'" @click="mode = 'import_export'"
v-tooltip.left="$t('back')" v-tooltip.left="'Back'"
> >
<i class="material-icons">arrow_left</i> <i class="material-icons">arrow_left</i>
</button> </button>
@@ -152,7 +152,7 @@
<div v-if="mode == 'export_as_json'"> <div v-if="mode == 'export_as_json'">
<textarea v-model="collectionJson" rows="8" readonly></textarea> <textarea v-model="collectionJson" rows="8" readonly></textarea>
<div class="row-wrapper"> <div class="row-wrapper">
<span> <span class="m-2">
<button class="icon primary" @click="exportJSON" v-tooltip="$t('download_file')"> <button class="icon primary" @click="exportJSON" v-tooltip="$t('download_file')">
{{ $t("export") }} {{ $t("export") }}
</button> </button>
@@ -287,7 +287,10 @@ export default {
this.failedImport() this.failedImport()
}) })
} else { } else {
this.$store.commit("postwoman/replaceCollections", collections) this.$store.commit("postwoman/replaceCollections", {
data: collections,
flag: "rest",
})
this.fileImported() this.fileImported()
this.syncToFBCollections() this.syncToFBCollections()
} }
@@ -329,7 +332,7 @@ export default {
this.failedImport() this.failedImport()
}) })
} else { } else {
this.$store.commit("postwoman/importCollections", collections) this.$store.commit("postwoman/importCollections", { data: collections, flag: "rest" })
this.syncToFBCollections() this.syncToFBCollections()
this.fileImported() this.fileImported()
} }

View File

@@ -13,7 +13,7 @@
<i class="material-icons" v-show="!showChildren && !isFiltered">arrow_right</i> <i class="material-icons" v-show="!showChildren && !isFiltered">arrow_right</i>
<i class="material-icons" v-show="showChildren || isFiltered">arrow_drop_down</i> <i class="material-icons" v-show="showChildren || isFiltered">arrow_drop_down</i>
<i v-if="isSelected" class="text-green-400 material-icons"> check_circle </i> <i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
<i v-else class="material-icons">folder</i> <i v-else class="material-icons">folder</i>
<span>{{ collection.name }}</span> <span>{{ collection.name }}</span>

View File

@@ -67,6 +67,7 @@
:saveRequest="saveRequest" :saveRequest="saveRequest"
:collectionsType="collectionsType" :collectionsType="collectionsType"
:folder-path="`${folderPath}/${subFolderIndex}`" :folder-path="`${folderPath}/${subFolderIndex}`"
:picked="picked"
@add-folder="$emit('add-folder', $event)" @add-folder="$emit('add-folder', $event)"
@edit-folder="$emit('edit-folder', $event)" @edit-folder="$emit('edit-folder', $event)"
@edit-request="$emit('edit-request', $event)" @edit-request="$emit('edit-request', $event)"

View File

@@ -14,10 +14,9 @@
@click="!doc ? selectRequest() : {}" @click="!doc ? selectRequest() : {}"
v-tooltip="!doc ? $t('use_request') : ''" v-tooltip="!doc ? $t('use_request') : ''"
> >
<span :class="getRequestLabelColor(request.method)">{{ request.method }}</span> <i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
<i v-if="isSelected" class="material-icons"> check </i>
<span v-else :class="getRequestLabelColor(request.method)">{{ request.method }}</span>
<span>{{ request.name }}</span> <span>{{ request.name }}</span>
</button> </button>
</div> </div>

View File

@@ -126,6 +126,8 @@
</template> </template>
<script> <script>
import * as team_utils from "~/helpers/teams/utils"
export default { export default {
name: "folder", name: "folder",
props: { props: {

View File

@@ -7,9 +7,9 @@
@click="!doc ? selectRequest() : {}" @click="!doc ? selectRequest() : {}"
v-tooltip="!doc ? $t('use_request') : ''" v-tooltip="!doc ? $t('use_request') : ''"
> >
<i v-if="isSelected" class="material-icons"> check </i> <i v-if="isSelected" class="text-green-400 material-icons">check_circle</i>
<span :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>
</button> </button>
</div> </div>
@@ -102,7 +102,6 @@ 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", {

View File

@@ -1814,12 +1814,6 @@ export default {
setTimeout(() => (target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000) setTimeout(() => (target.innerHTML = '<i class="material-icons">clear_all</i>'), 1000)
}, },
saveRequest() { saveRequest() {
if (!this.checkCollections()) {
this.$toast.error(this.$t("create_collection"), {
icon: "error",
})
return
}
let urlAndPath = parseUrlAndPath(this.uri) let urlAndPath = parseUrlAndPath(this.uri)
this.editRequest = { this.editRequest = {
url: decodeURI(urlAndPath.url), url: decodeURI(urlAndPath.url),

View File

@@ -297,14 +297,16 @@ export default Vue.extend({
}, },
syncCollections(): void { syncCollections(): void {
if (fb.currentUser !== null && this.SYNC_COLLECTIONS) { if (fb.currentUser !== null && this.SYNC_COLLECTIONS) {
fb.writeCollections( if (this.$store.state.postwoman.collections)
JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)), fb.writeCollections(
"collections" JSON.parse(JSON.stringify(this.$store.state.postwoman.collections)),
) "collections"
fb.writeCollections( )
JSON.parse(JSON.stringify(this.$store.state.postwoman.collectionsGraphql)), if (this.$store.state.postwoman.collectionsGraphql)
"collectionsGraphql" fb.writeCollections(
) JSON.parse(JSON.stringify(this.$store.state.postwoman.collectionsGraphql)),
"collectionsGraphql"
)
} }
}, },
syncEnvironments(): void { syncEnvironments(): void {