Merge pull request #1723 from s-r-x/fix/broken-gql-col-req-edit
This commit is contained in:
@@ -197,6 +197,10 @@ export default Vue.extend({
|
|||||||
this.showChildren = !this.showChildren
|
this.showChildren = !this.showChildren
|
||||||
},
|
},
|
||||||
removeCollection() {
|
removeCollection() {
|
||||||
|
// Cancel pick if picked collection is deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "gql-my-collection" && this.picked.collectionIndex === this.collectionIndex) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
removeGraphqlCollection(this.collectionIndex)
|
removeGraphqlCollection(this.collectionIndex)
|
||||||
|
|
||||||
this.$toast.error(this.$t("deleted").toString(), {
|
this.$toast.error(this.$t("deleted").toString(), {
|
||||||
|
|||||||
@@ -181,6 +181,11 @@ export default Vue.extend({
|
|||||||
this.showChildren = !this.showChildren
|
this.showChildren = !this.showChildren
|
||||||
},
|
},
|
||||||
removeFolder() {
|
removeFolder() {
|
||||||
|
// Cancel pick if the picked folder is deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "gql-my-folder" && this.picked.folderPath === this.folderPath) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
|
|
||||||
removeGraphqlFolder(this.folderPath)
|
removeGraphqlFolder(this.folderPath)
|
||||||
this.$toast.error(this.$t("deleted").toString(), {
|
this.$toast.error(this.$t("deleted").toString(), {
|
||||||
icon: "delete",
|
icon: "delete",
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ export default Vue.extend({
|
|||||||
dataTransfer.setData("requestIndex", this.requestIndex)
|
dataTransfer.setData("requestIndex", this.requestIndex)
|
||||||
},
|
},
|
||||||
removeRequest() {
|
removeRequest() {
|
||||||
|
// Cancel pick if the picked request is deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "gql-my-request" && this.picked.folderPath === this.folderPath && this.picked.requestIndex === this.requestIndex) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
|
|
||||||
removeGraphqlRequest(this.folderPath, this.requestIndex)
|
removeGraphqlRequest(this.folderPath, this.requestIndex)
|
||||||
this.$toast.error(this.$t("deleted").toString(), {
|
this.$toast.error(this.$t("deleted").toString(), {
|
||||||
icon: "delete",
|
icon: "delete",
|
||||||
|
|||||||
@@ -224,7 +224,9 @@ export default {
|
|||||||
folderName,
|
folderName,
|
||||||
request,
|
request,
|
||||||
requestIndex,
|
requestIndex,
|
||||||
|
folderPath,
|
||||||
} = payload
|
} = payload
|
||||||
|
this.$data.editingFolderPath = folderPath
|
||||||
this.$data.editingCollectionIndex = collectionIndex
|
this.$data.editingCollectionIndex = collectionIndex
|
||||||
this.$data.editingFolderIndex = folderIndex
|
this.$data.editingFolderIndex = folderIndex
|
||||||
this.$data.editingFolderName = folderName
|
this.$data.editingFolderName = folderName
|
||||||
|
|||||||
@@ -531,12 +531,22 @@ export default {
|
|||||||
},
|
},
|
||||||
removeCollection({ collectionsType, collectionIndex, collectionID }) {
|
removeCollection({ collectionsType, collectionIndex, collectionID }) {
|
||||||
if (collectionsType.type === "my-collections") {
|
if (collectionsType.type === "my-collections") {
|
||||||
|
// Cancel pick if picked collection is deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "my-collection" && this.picked.collectionIndex === collectionIndex) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
|
|
||||||
removeRESTCollection(collectionIndex)
|
removeRESTCollection(collectionIndex)
|
||||||
|
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t("deleted"), {
|
||||||
icon: "delete",
|
icon: "delete",
|
||||||
})
|
})
|
||||||
} else if (collectionsType.type === "team-collections") {
|
} else if (collectionsType.type === "team-collections") {
|
||||||
|
// Cancel pick if picked collection is deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "teams-collection" && this.picked.collectionID === collectionID) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
|
|
||||||
if (collectionsType.selectedTeam.myRole !== "VIEWER") {
|
if (collectionsType.selectedTeam.myRole !== "VIEWER") {
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
@@ -569,12 +579,30 @@ export default {
|
|||||||
},
|
},
|
||||||
removeRequest({ requestIndex, folderPath }) {
|
removeRequest({ requestIndex, folderPath }) {
|
||||||
if (this.collectionsType.type === "my-collections") {
|
if (this.collectionsType.type === "my-collections") {
|
||||||
|
// Cancel pick if the picked item is being deleted
|
||||||
|
if (
|
||||||
|
this.picked &&
|
||||||
|
this.picked.pickedType === "my-request" &&
|
||||||
|
this.picked.folderPath === folderPath &&
|
||||||
|
this.picked.requestIndex === requestIndex
|
||||||
|
) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
removeRESTRequest(folderPath, requestIndex)
|
removeRESTRequest(folderPath, requestIndex)
|
||||||
|
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t("deleted"), {
|
||||||
icon: "delete",
|
icon: "delete",
|
||||||
})
|
})
|
||||||
} else if (this.collectionsType.type === "team-collections") {
|
} else if (this.collectionsType.type === "team-collections") {
|
||||||
|
// Cancel pick if the picked item is being deleted
|
||||||
|
if (
|
||||||
|
this.picked &&
|
||||||
|
this.picked.pickedType === "teams-request" &&
|
||||||
|
this.picked.requestID === requestIndex
|
||||||
|
) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
|
|
||||||
teamUtils
|
teamUtils
|
||||||
.deleteRequest(this.$apollo, requestIndex)
|
.deleteRequest(this.$apollo, requestIndex)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@@ -193,6 +193,11 @@ export default {
|
|||||||
this.showChildren = !this.showChildren
|
this.showChildren = !this.showChildren
|
||||||
},
|
},
|
||||||
removeFolder() {
|
removeFolder() {
|
||||||
|
// TODO: Bubble it up ?
|
||||||
|
// Cancel pick if picked folder was deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "my-folder" && this.picked.folderPath === this.folderPath) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
removeRESTFolder(this.folderPath)
|
removeRESTFolder(this.folderPath)
|
||||||
|
|
||||||
this.$toast.error(this.$t("deleted"), {
|
this.$toast.error(this.$t("deleted"), {
|
||||||
@@ -206,6 +211,16 @@ export default {
|
|||||||
moveRESTRequest(folderPath, requestIndex, this.folderPath)
|
moveRESTRequest(folderPath, requestIndex, this.folderPath)
|
||||||
},
|
},
|
||||||
removeRequest({ requestIndex }) {
|
removeRequest({ requestIndex }) {
|
||||||
|
// TODO: Bubble it up to root ?
|
||||||
|
// Cancel pick if the picked item is being deleted
|
||||||
|
if (
|
||||||
|
this.picked &&
|
||||||
|
this.picked.pickedType === "my-request" &&
|
||||||
|
this.picked.folderPath === this.folderPath &&
|
||||||
|
this.picked.requestIndex === requestIndex
|
||||||
|
) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
removeRESTRequest(this.folderPath, requestIndex)
|
removeRESTRequest(this.folderPath, requestIndex)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -189,6 +189,11 @@ export default {
|
|||||||
},
|
},
|
||||||
removeFolder() {
|
removeFolder() {
|
||||||
if (this.collectionsType.selectedTeam.myRole !== "VIEWER") {
|
if (this.collectionsType.selectedTeam.myRole !== "VIEWER") {
|
||||||
|
// Cancel pick if picked collection folder was deleted
|
||||||
|
if (this.picked && this.picked.pickedType === "teams-folder" && this.picked.folderID === this.folder.id) {
|
||||||
|
this.$emit("select", { picked: null })
|
||||||
|
}
|
||||||
|
|
||||||
teamUtils
|
teamUtils
|
||||||
.deleteCollection(this.$apollo, this.folder.id)
|
.deleteCollection(this.$apollo, this.folder.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user