From cf782d26306c25a2f64abcd5bd77f1df0f614d92 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 19 Oct 2023 15:41:50 -0500 Subject: [PATCH 1/4] Fix `HistoryPanel` filter reactivity with deletions/undeletions --- .../History/CurrentHistory/HistoryPanel.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryPanel.vue b/client/src/components/History/CurrentHistory/HistoryPanel.vue index 37462b9bf3a0..fa981e021666 100644 --- a/client/src/components/History/CurrentHistory/HistoryPanel.vue +++ b/client/src/components/History/CurrentHistory/HistoryPanel.vue @@ -206,6 +206,7 @@ export default { operationRunning: null, operationError: null, querySelectionBreak: false, + itemsLoaded: [], }; }, computed: { @@ -234,10 +235,6 @@ export default { isProcessing() { return this.operationRunning >= this.history.update_time; }, - /** @returns {Array} */ - itemsLoaded() { - return this.getHistoryItems(this.historyId, this.filterText); - }, /** @returns {Date} */ lastChecked() { const { getLastCheckedTime } = storeToRefs(useHistoryItemsStore()); @@ -346,7 +343,6 @@ export default { try { await this.fetchHistoryItems(this.historyId, this.filterText, this.offset); this.searchError = null; - this.loading = false; } catch (error) { if (error.response && error.response.data && error.response.data.err_msg) { console.debug("HistoryPanel - Load items error:", error.response.data.err_msg); @@ -354,6 +350,15 @@ export default { } else { console.debug("HistoryPanel - Load items error.", error); } + } finally { + this.itemsLoaded = this.getHistoryItems(this.historyId, this.filterText); + if (this.invisible) { + this.itemsLoaded.forEach((item) => { + if (this.invisible[item.hid]) { + Vue.set(this.invisible, item.hid, false); + } + }); + } this.loading = false; } }, From d44934f1c59c98dc5b676cc6b736c2bd8c6a9cf1 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 19 Oct 2023 17:27:28 -0500 Subject: [PATCH 2/4] fix deletetion/undeletion reactivity with `FormDisplay` data input --- client/src/components/Form/FormDisplay.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Form/FormDisplay.vue b/client/src/components/Form/FormDisplay.vue index 7be091692819..9d7f86e684d8 100644 --- a/client/src/components/Form/FormDisplay.vue +++ b/client/src/components/Form/FormDisplay.vue @@ -104,7 +104,7 @@ export default { visitInputs(this.formInputs, (input, name) => { const newValue = newAttributes[name]; if (newValue != undefined) { - input.attributes = newValue; + Vue.set(input, "attributes", newValue); } }); this.onChangeForm(); From 38e50499db9d16a01a6c28eda295b4eeadebbbcd Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 19 Oct 2023 18:17:04 -0500 Subject: [PATCH 3/4] content items wait until latest payload to show input/output highlight --- .../History/CurrentHistory/HistoryPanel.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryPanel.vue b/client/src/components/History/CurrentHistory/HistoryPanel.vue index fa981e021666..282c8a22ca17 100644 --- a/client/src/components/History/CurrentHistory/HistoryPanel.vue +++ b/client/src/components/History/CurrentHistory/HistoryPanel.vue @@ -320,13 +320,15 @@ export default { ...mapActions(useHistoryItemsStore, ["fetchHistoryItems"]), getHighlight(item) { const highlightsKey = FilterClass.getFilterValue(this.filterText, "related"); - if (highlightsKey == item.hid) { - return "active"; - } else if (highlightsKey) { - if (item.hid > highlightsKey) { - return "output"; - } else { - return "input"; + if (!this.loading) { + if (highlightsKey == item.hid) { + return "active"; + } else if (highlightsKey) { + if (item.hid > highlightsKey) { + return "output"; + } else { + return "input"; + } } } else { return null; From 6e2b77111c88989726f0fdbd53866947030e6efb Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Mon, 23 Oct 2023 11:21:16 -0500 Subject: [PATCH 4/4] turn `itemsLoaded` back to computed to fix selenium --- .../History/CurrentHistory/HistoryPanel.vue | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryPanel.vue b/client/src/components/History/CurrentHistory/HistoryPanel.vue index 282c8a22ca17..aacb558c2443 100644 --- a/client/src/components/History/CurrentHistory/HistoryPanel.vue +++ b/client/src/components/History/CurrentHistory/HistoryPanel.vue @@ -206,7 +206,6 @@ export default { operationRunning: null, operationError: null, querySelectionBreak: false, - itemsLoaded: [], }; }, computed: { @@ -235,6 +234,10 @@ export default { isProcessing() { return this.operationRunning >= this.history.update_time; }, + /** @returns {Array} */ + itemsLoaded() { + return this.getHistoryItems(this.historyId, this.filterText); + }, /** @returns {Date} */ lastChecked() { const { getLastCheckedTime } = storeToRefs(useHistoryItemsStore()); @@ -307,6 +310,15 @@ export default { historyUpdateTime() { this.loadHistoryItems(); }, + itemsLoaded(newItems) { + if (this.invisible) { + newItems.forEach((item) => { + if (this.invisible[item.hid]) { + Vue.set(this.invisible, item.hid, false); + } + }); + } + }, }, async mounted() { // `filterable` here indicates if this is the current history panel @@ -353,14 +365,6 @@ export default { console.debug("HistoryPanel - Load items error.", error); } } finally { - this.itemsLoaded = this.getHistoryItems(this.historyId, this.filterText); - if (this.invisible) { - this.itemsLoaded.forEach((item) => { - if (this.invisible[item.hid]) { - Vue.set(this.invisible, item.hid, false); - } - }); - } this.loading = false; } },