track history panel filterText in historyStore

This commit is contained in:
Ahmed Awan
2023-04-24 16:30:58 -04:00
parent 0656f1e266
commit cebcc54019
5 changed files with 14 additions and 7 deletions
@@ -22,7 +22,7 @@
<div class="dropdown-menu" aria-labelledby="dataset-dropdown">
<a class="dropdown-item" href="#" @click.prevent="showDataset">
<span class="fa fa-eye fa-fw mr-1" />
<span>Switch to History containing dataset</span>
<span>Show in History containing dataset</span>
</a>
<a class="dropdown-item" href="#" @click.prevent="copyDataset">
<span class="fa fa-copy fa-fw mr-1" />
@@ -92,7 +92,7 @@
v-if="expandDataset"
:dataset="item"
:writable="writable"
:show-highlight="isHistoryItem"
:show-highlight="(isHistoryItem && filterable) || addHighlightBtn"
:item-urls="itemUrls"
@edit="onEdit"
@toggleHighlights="toggleHighlights" />
@@ -125,6 +125,7 @@ export default {
props: {
writable: { type: Boolean, default: true },
expandDataset: { type: Boolean, required: true },
addHighlightBtn: { type: Boolean, default: false },
highlight: { type: String, default: null },
id: { type: Number, required: true },
isDataset: { type: Boolean, default: true },
@@ -55,7 +55,7 @@
<b-button
v-if="showHighlight"
class="highlight-btn px-1"
title="Show Inputs for this item"
title="Show Related Items"
size="sm"
variant="link"
@click.stop="onHighlight">
@@ -4,6 +4,7 @@
<div v-else>
<ContentItem
:id="item.hid"
add-highlight-btn
is-history-item
:item="item"
:name="item.name"
@@ -252,7 +252,7 @@ export default {
storeFilterText() {
const { currentFilterText } = storeToRefs(useHistoryStore());
return currentFilterText.value;
}
},
},
watch: {
queryKey() {
@@ -268,8 +268,13 @@ export default {
filter(newVal) {
this.filterText = newVal;
},
storeFilterText(newVal, oldVal) {
if (this.filterable && newVal !== oldVal) {
filterText(newVal) {
if (this.filterable) {
this.setCurrentFilterText(newVal);
}
},
storeFilterText(newVal) {
if (this.filterable) {
this.filterText = newVal;
}
},
@@ -284,7 +289,7 @@ export default {
await this.loadHistoryItems();
},
methods: {
...mapActions(useHistoryStore, ["loadHistoryById"]),
...mapActions(useHistoryStore, ["loadHistoryById", "setCurrentFilterText"]),
...mapActions(useHistoryItemsStore, ["fetchHistoryItems"]),
getHighlight(item) {
if (this.filterText.includes("related:" + item.hid)) {