From 6fe5c48e96617b5a201e2ce5bb7df0e8359f9f23 Mon Sep 17 00:00:00 2001 From: Himanshu Kapoor Date: Tue, 2 Jul 2024 16:43:05 +0200 Subject: [PATCH] Remove wiki sidebar limit Remove the limit of 15 items in the wiki sidebar Changelog: changed --- .../wikis/components/wiki_sidebar_entries.vue | 26 ++------ locale/gitlab.pot | 3 - .../components/wiki_sidebar_entries_spec.js | 66 ++++++------------- ...user_views_wiki_sidebar_shared_examples.rb | 13 ---- 4 files changed, 26 insertions(+), 82 deletions(-) diff --git a/app/assets/javascripts/pages/shared/wikis/components/wiki_sidebar_entries.vue b/app/assets/javascripts/pages/shared/wikis/components/wiki_sidebar_entries.vue index 2964d70c18b015..0a125a663cbfa4 100644 --- a/app/assets/javascripts/pages/shared/wikis/components/wiki_sidebar_entries.vue +++ b/app/assets/javascripts/pages/shared/wikis/components/wiki_sidebar_entries.vue @@ -4,8 +4,6 @@ import axios from '~/lib/utils/axios_utils'; import { sidebarEntriesToTree } from '../utils'; import WikiSidebarEntry from './wiki_sidebar_entry.vue'; -const SIDEBAR_LIMIT = 15; - export default { components: { WikiSidebarEntry, @@ -26,18 +24,12 @@ export default { }; }, - computed: { - countExceedsSidebarLimit() { - return this.totalCount > this.$options.SIDEBAR_LIMIT && !this.searchTerm; - }, - }, - watch: { async searchTerm() { this.entries = sidebarEntriesToTree( - this.allEntries - .filter((entry) => entry.title.toLowerCase().includes(this.searchTerm.toLowerCase())) - .slice(0, SIDEBAR_LIMIT), + this.allEntries.filter((entry) => + entry.title.toLowerCase().includes(this.searchTerm.toLowerCase()), + ), ); }, }, @@ -49,11 +41,10 @@ export default { entries = entries.filter((entry) => entry.slug !== '_sidebar'); - this.entries = sidebarEntriesToTree(entries.slice(0, SIDEBAR_LIMIT)); + this.entries = sidebarEntriesToTree(entries); this.totalCount = entries.length; this.allEntries = entries; }, - SIDEBAR_LIMIT, };