This commit is contained in:
Andrew Bastin
2021-05-29 22:43:05 -04:00
parent fe8bbc6cc8
commit 9ad22e2600
6 changed files with 44 additions and 22 deletions

View File

@@ -196,7 +196,7 @@ export default {
mode: "import_export", mode: "import_export",
mySelectedCollectionID: undefined, mySelectedCollectionID: undefined,
collectionJson: "", collectionJson: "",
fb fb,
} }
}, },
subscriptions() { subscriptions() {

View File

@@ -58,7 +58,12 @@
<script> <script>
import { getSettingSubject } from "~/newstore/settings" import { getSettingSubject } from "~/newstore/settings"
import * as teamUtils from "~/helpers/teams/utils" import * as teamUtils from "~/helpers/teams/utils"
import { saveRESTRequestAs, editRESTRequest, editGraphqlRequest, saveGraphqlRequestAs } from "~/newstore/collections" import {
saveRESTRequestAs,
editRESTRequest,
editGraphqlRequest,
saveGraphqlRequestAs,
} from "~/newstore/collections"
export default { export default {
props: { props: {
@@ -204,7 +209,11 @@ export default {
this.picked.collectionID this.picked.collectionID
) )
} else if (this.picked.pickedType === "gql-my-request") { } else if (this.picked.pickedType === "gql-my-request") {
editGraphqlRequest(this.picked.folderPath, this.picked.requestIndex, requestUpdated) editGraphqlRequest(
this.picked.folderPath,
this.picked.requestIndex,
requestUpdated
)
} else if (this.picked.pickedType === "gql-my-folder") { } else if (this.picked.pickedType === "gql-my-folder") {
saveGraphqlRequestAs(this.picked.folderPath, requestUpdated) saveGraphqlRequestAs(this.picked.folderPath, requestUpdated)
} else if (this.picked.pickedType === "gql-my-collection") { } else if (this.picked.pickedType === "gql-my-collection") {

View File

@@ -170,18 +170,20 @@ export default Vue.extend({
}, },
computed: { computed: {
isSelected(): boolean { isSelected(): boolean {
return this.picked && return (
this.picked &&
this.picked.pickedType === "gql-my-collection" && this.picked.pickedType === "gql-my-collection" &&
this.picked.collectionIndex === this.collectionIndex this.picked.collectionIndex === this.collectionIndex
} )
},
}, },
methods: { methods: {
pick() { pick() {
this.$emit("select", { this.$emit("select", {
picked: { picked: {
pickedType: "gql-my-collection", pickedType: "gql-my-collection",
collectionIndex: this.collectionIndex collectionIndex: this.collectionIndex,
} },
}) })
}, },
toggleShowChildren() { toggleShowChildren() {

View File

@@ -156,18 +156,20 @@ export default Vue.extend({
}, },
computed: { computed: {
isSelected(): boolean { isSelected(): boolean {
return this.picked && return (
this.picked.pickedType === "gql-my-folder" && this.picked &&
this.picked.pickedType === "gql-my-folder" &&
this.picked.folderPath === this.folderPath this.picked.folderPath === this.folderPath
} )
},
}, },
methods: { methods: {
pick() { pick() {
this.$emit('select', { this.$emit("select", {
picked: { picked: {
pickedType: "gql-my-folder", pickedType: "gql-my-folder",
folderPath: this.folderPath folderPath: this.folderPath,
} },
}) })
}, },
toggleShowChildren() { toggleShowChildren() {

View File

@@ -17,7 +17,6 @@
class="icon" class="icon"
@click="!doc ? selectRequest() : {}" @click="!doc ? selectRequest() : {}"
> >
<i v-if="isSelected" class="mx-3 text-green-400 material-icons" <i v-if="isSelected" class="mx-3 text-green-400 material-icons"
>check_circle</i >check_circle</i
> >
@@ -88,20 +87,22 @@ export default Vue.extend({
}, },
computed: { computed: {
isSelected(): boolean { isSelected(): boolean {
return this.picked && return (
this.picked &&
this.picked.pickedType === "gql-my-request" && this.picked.pickedType === "gql-my-request" &&
this.picked.folderPath === this.folderPath && this.picked.folderPath === this.folderPath &&
this.picked.requestIndex === this.requestIndex this.picked.requestIndex === this.requestIndex
} )
},
}, },
methods: { methods: {
pick() { pick() {
this.$emit('select', { this.$emit("select", {
picked: { picked: {
pickedType: "gql-my-request", pickedType: "gql-my-request",
folderPath: this.folderPath, folderPath: this.folderPath,
requestIndex: this.requestIndex requestIndex: this.requestIndex,
} },
}) })
}, },
selectRequest() { selectRequest() {

View File

@@ -50,11 +50,19 @@
@hide-modal="displayModalImportExport(false)" @hide-modal="displayModalImportExport(false)"
/> />
<div class="border-b row-wrapper border-brdColor"> <div class="border-b row-wrapper border-brdColor">
<button v-if="showCollActions" class="icon" @click="displayModalAdd(true)"> <button
v-if="showCollActions"
class="icon"
@click="displayModalAdd(true)"
>
<i class="material-icons">add</i> <i class="material-icons">add</i>
<span>{{ $t("new") }}</span> <span>{{ $t("new") }}</span>
</button> </button>
<button v-if="showCollActions" class="icon" @click="displayModalImportExport(true)"> <button
v-if="showCollActions"
class="icon"
@click="displayModalImportExport(true)"
>
{{ $t("import_export") }} {{ $t("import_export") }}
</button> </button>
</div> </div>
@@ -104,7 +112,7 @@ export default {
doc: { type: Boolean, default: false }, doc: { type: Boolean, default: false },
picked: { type: Object, default: null }, picked: { type: Object, default: null },
// Whether to show the 'New' and 'Import/Export' actions // Whether to show the 'New' and 'Import/Export' actions
showCollActions: { type: Boolean, default: true } showCollActions: { type: Boolean, default: true },
}, },
data() { data() {
return { return {