Skip to content

Commit

Permalink
Merge pull request #16889 from ahmedhamidawan/history_items_invisible…
Browse files Browse the repository at this point in the history
…_delete_bug

[23.1] Fix History item deletion/undeletion reactivity with filter and `ToolForm` input field
  • Loading branch information
dannon authored Oct 24, 2023
2 parents 3dd88a4 + 6e2b771 commit bdbcd72
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Form/FormDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
27 changes: 19 additions & 8 deletions client/src/components/History/CurrentHistory/HistoryPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,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
Expand All @@ -323,13 +332,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;
Expand All @@ -346,14 +357,14 @@ 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);
this.searchError = error.response.data;
} else {
console.debug("HistoryPanel - Load items error.", error);
}
} finally {
this.loading = false;
}
},
Expand Down

0 comments on commit bdbcd72

Please sign in to comment.