summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
index 97b4ceda033..3988b3814f9 100644
--- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
+++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
@@ -286,6 +286,7 @@ export default {
handleFilterSubmit() {
const filterTokens = uniqueTokens(this.filterValue);
this.filterValue = filterTokens;
+
if (this.recentSearchesStorageKey) {
this.recentSearchesPromise
.then(() => {
@@ -302,6 +303,17 @@ export default {
this.blurSearchInput();
this.$emit('onFilter', this.removeQuotesEnclosure(filterTokens));
},
+ historyTokenOptionTitle(historyToken) {
+ const tokenOption = this.tokens
+ .find(token => token.type === historyToken.type)
+ ?.options?.find(option => option.value === historyToken.value.data);
+
+ if (!tokenOption?.title) {
+ return historyToken.value.data;
+ }
+
+ return tokenOption.title;
+ },
},
};
</script>
@@ -333,7 +345,7 @@ export default {
<span v-if="tokenTitles[token.type]"
>{{ tokenTitles[token.type] }} :{{ token.value.operator }}</span
>
- <strong>{{ tokenSymbols[token.type] }}{{ token.value.data }}</strong>
+ <strong>{{ tokenSymbols[token.type] }}{{ historyTokenOptionTitle(token) }}</strong>
</span>
</template>
</template>