From f6bf9438b90c514c7e15a7c4473b0c5c8a9218ca Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 10 Oct 2023 01:45:35 +0200 Subject: [PATCH] Several improvements for the `Execute` panel. --- .../src/components/panels/Execute/Index.vue | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/panels/Execute/Index.vue b/platypush/backend/http/webapp/src/components/panels/Execute/Index.vue index d7cd999783..b1eac15798 100644 --- a/platypush/backend/http/webapp/src/components/panels/Execute/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Execute/Index.vue @@ -21,7 +21,8 @@
@@ -58,8 +59,7 @@
@@ -202,7 +202,6 @@ export default { running: false, docLoading: false, structuredInput: true, - actionChanged: false, selectedDoc: undefined, selectedAttr: undefined, selectedAttrDoc: undefined, @@ -256,20 +255,23 @@ export default { } const self = this - autocomplete(this.$refs.actionName, Object.keys(this.actions).sort(), (_, value) => { - this.action.name = value - self.updateAction() - }) + autocomplete( + this.$refs.actionName, + Object.keys(this.actions).sort(), (_, value) => self.updateAction(value) + ) }, - async updateAction() { - if (!(this.action.name in this.actions)) + async updateAction(actionName) { + this.action.name = actionName + if (!(this.action.name in this.actions)) { this.selectedDoc = undefined - - if (!this.actionChanged || !(this.action.name in this.actions)) + this.resetAttrDoc() return + } + this.resetAttrDoc() this.docLoading = true + try { this.action = { ...this.actions[this.action.name], @@ -295,7 +297,6 @@ export default { this.actionDocsCache[this.action.name] = {} this.actionDocsCache[this.action.name].html = this.selectedDoc - this.actionChanged = false this.response = undefined this.error = undefined }, @@ -497,8 +498,11 @@ export default { + +