diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue')
-rw-r--r-- | app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue b/app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue index e2909333d74..0c4abc14494 100644 --- a/app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue +++ b/app/assets/javascripts/filtered_search/components/recent_searches_dropdown_content.vue @@ -20,8 +20,18 @@ export default { }, }, computed: { + /** + * Both Epic and Roadmap pages share same recents store + * and with https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36421 + * Roadmap started using `GlFilteredSearch` which is not compatible + * with string tokens stored in recents, so this is a temporary + * fix by ignoring non-string recents while in Epic page. + */ + compatibleItems() { + return this.items.filter(item => typeof item === 'string'); + }, processedItems() { - return this.items.map(item => { + return this.compatibleItems.map(item => { const { tokens, searchToken } = FilteredSearchTokenizer.processTokens( item, this.allowedKeys, @@ -41,7 +51,7 @@ export default { }); }, hasItems() { - return this.items.length > 0; + return this.compatibleItems.length > 0; }, }, methods: { @@ -84,9 +94,7 @@ export default { <span class="value">{{ token.suffix }}</span> </span> </span> - <span class="filtered-search-history-dropdown-search-token"> - {{ item.searchToken }} - </span> + <span class="filtered-search-history-dropdown-search-token">{{ item.searchToken }}</span> </button> </li> <li class="divider"></li> |