From 527e520a17c28fd55ababf8d676db855c02c2a59 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 22:50:23 +0530 Subject: [PATCH 01/28] pushing to browser history --- docs/common/DocsPageTemplate/SideNav/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 8a66d9619..7b0ef7330 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -81,6 +81,8 @@ filterText(newValue) { if (window) { window.sessionStorage.setItem('nav-filter', newValue); + //Pushing filter state to the browser history + const browse = newValue ? `?search=$(encodeURIcomponent(newValue))` : window.location.pathname; } }, }, From 4a4b00a93a843429fec10cd3053e9aca70de6e36 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 22:54:02 +0530 Subject: [PATCH 02/28] update index.vue --- docs/common/DocsPageTemplate/SideNav/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 7b0ef7330..baf1f70b7 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -83,6 +83,7 @@ window.sessionStorage.setItem('nav-filter', newValue); //Pushing filter state to the browser history const browse = newValue ? `?search=$(encodeURIcomponent(newValue))` : window.location.pathname; + window.history.pushState({ filterText: newvalue}),'',browse); } }, }, From e8b38ca858e4a18325885322b9f671a48e220228 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 22:56:22 +0530 Subject: [PATCH 03/28] javascript check --- docs/common/DocsPageTemplate/SideNav/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index baf1f70b7..a9beee57d 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -82,8 +82,8 @@ if (window) { window.sessionStorage.setItem('nav-filter', newValue); //Pushing filter state to the browser history - const browse = newValue ? `?search=$(encodeURIcomponent(newValue))` : window.location.pathname; - window.history.pushState({ filterText: newvalue}),'',browse); + const url = newValue ? `?search=${encodeURIComponent(newValue)}` : window.location.pathname; + window.history.pushState({ filterText: newValue },'',url); } }, }, From 98917278087cbe5818f720a5105609eec1b9e2ee Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 23:02:48 +0530 Subject: [PATCH 04/28] Restoring filter state when a user navigates back --- docs/common/DocsPageTemplate/SideNav/index.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index a9beee57d..da231a908 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -41,6 +41,7 @@ import NavSectionList from './NavSectionList'; import { termList, matches } from '~/common/DocsFilter/utils'; import tableOfContents from '~/tableOfContents.js'; +import events from '../../../../lib/keen/helpers/events'; export default { name: 'SideNav', @@ -94,6 +95,14 @@ this.filterText = filterText; } this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); + //Restoring filter state when a user nagigates back + window.addEventListener('popstate',(event => { + if (event.state && 'filterText' in event.state) { + this.filterText =event.state.filterText; + } + } + } + })) } // don't show the nav until the state is set this.loaded = true; From 4b894c8de490fac5f82b2318263330f9ae1a1881 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 23:07:08 +0530 Subject: [PATCH 05/28] Update vue.index --- docs/common/DocsPageTemplate/SideNav/index.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index da231a908..dd0e565d6 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -95,15 +95,17 @@ import events from '../../../../lib/keen/helpers/events'; this.filterText = filterText; } this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); - //Restoring filter state when a user nagigates back + + //Restoring filter state when a user navigates back window.addEventListener('popstate',(event => { if (event.state && 'filterText' in event.state) { this.filterText =event.state.filterText; - } + }else { + this,filterText='';//Reset it back } + }) + } - })) - } // don't show the nav until the state is set this.loaded = true; }, From 6cd0f279fe78f3775f874d1111095ba7bc0a2dc4 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 23:13:25 +0530 Subject: [PATCH 06/28] javascript test --- docs/common/DocsPageTemplate/SideNav/index.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index dd0e565d6..61733b894 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -97,16 +97,15 @@ import events from '../../../../lib/keen/helpers/events'; this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); //Restoring filter state when a user navigates back - window.addEventListener('popstate',(event => { + window.addEventListener('popstate',(event) => { if (event.state && 'filterText' in event.state) { - this.filterText =event.state.filterText; - }else { - this,filterText='';//Reset it back + this.filterText = event.state.filterText; + } else { + this.filterText='';//Reset if no filterText is in state } - }) - - } - // don't show the nav until the state is set + }); + } + // don't show the nav until the state is set this.loaded = true; }, methods: { From c279c0774d852cba3a227e8ab55ef07a037f4380 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 23:16:02 +0530 Subject: [PATCH 07/28] event to events --- docs/common/DocsPageTemplate/SideNav/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 61733b894..7d4f0d57a 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -97,9 +97,9 @@ import events from '../../../../lib/keen/helpers/events'; this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); //Restoring filter state when a user navigates back - window.addEventListener('popstate',(event) => { - if (event.state && 'filterText' in event.state) { - this.filterText = event.state.filterText; + window.addEventListener('popstate',(events) => { + if (events.state && 'filterText' in event.state) { + this.filterText = events.state.filterText; } else { this.filterText='';//Reset if no filterText is in state } From 61a3421f3372ea5bd5e49b6b04610bc54d5af8bd Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 23:16:31 +0530 Subject: [PATCH 08/28] revert the commit --- docs/common/DocsPageTemplate/SideNav/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 7d4f0d57a..61733b894 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -97,9 +97,9 @@ import events from '../../../../lib/keen/helpers/events'; this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); //Restoring filter state when a user navigates back - window.addEventListener('popstate',(events) => { - if (events.state && 'filterText' in event.state) { - this.filterText = events.state.filterText; + window.addEventListener('popstate',(event) => { + if (event.state && 'filterText' in event.state) { + this.filterText = event.state.filterText; } else { this.filterText='';//Reset if no filterText is in state } From 70153097074816c7bd8aa0c9d5e53944d0c52e47 Mon Sep 17 00:00:00 2001 From: RONAK Date: Tue, 26 Nov 2024 23:52:36 +0530 Subject: [PATCH 09/28] Update index.vue --- docs/common/DocsPageTemplate/SideNav/index.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 61733b894..0acd11b0e 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -40,8 +40,7 @@ import throttle from 'lodash/throttle'; import NavSectionList from './NavSectionList'; import { termList, matches } from '~/common/DocsFilter/utils'; - import tableOfContents from '~/tableOfContents.js'; -import events from '../../../../lib/keen/helpers/events'; + import tableOfContents from '~/tableOfContents.js' export default { name: 'SideNav', From d7c6326cb753514d045a2a3b584baf35c0498e83 Mon Sep 17 00:00:00 2001 From: RONAK Date: Thu, 28 Nov 2024 10:53:05 +0530 Subject: [PATCH 10/28] from search to filter --- docs/common/DocsPageTemplate/SideNav/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 0acd11b0e..0f6a5a341 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -82,7 +82,7 @@ if (window) { window.sessionStorage.setItem('nav-filter', newValue); //Pushing filter state to the browser history - const url = newValue ? `?search=${encodeURIComponent(newValue)}` : window.location.pathname; + const url = newValue ? `?filter=${encodeURIComponent(newValue)}` : window.location.pathname; window.history.pushState({ filterText: newValue },'',url); } }, From d7ae230b0aba7b8916745332056c0f467fe1c785 Mon Sep 17 00:00:00 2001 From: RONAK Date: Thu, 28 Nov 2024 10:54:04 +0530 Subject: [PATCH 11/28] The URL perfecting --- docs/common/DocsPageTemplate/SideNav/index.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 0f6a5a341..480412e0b 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -100,7 +100,11 @@ if (event.state && 'filterText' in event.state) { this.filterText = event.state.filterText; } else { + //Reset the search bar if no filter in the URL + if (window.location.pathname === '/' && !window.location.search) { this.filterText='';//Reset if no filterText is in state + + } }); } From ab763d5ded39cdf0c613d002994a2fd2b1cb39bf Mon Sep 17 00:00:00 2001 From: RONAK Date: Thu, 28 Nov 2024 11:10:11 +0530 Subject: [PATCH 12/28] Revert "The URL perfecting" This reverts commit 7ee60495104dd3e7e7b4a6010e2225d53e983d55. --- docs/common/DocsPageTemplate/SideNav/index.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 480412e0b..0f6a5a341 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -100,11 +100,7 @@ if (event.state && 'filterText' in event.state) { this.filterText = event.state.filterText; } else { - //Reset the search bar if no filter in the URL - if (window.location.pathname === '/' && !window.location.search) { this.filterText='';//Reset if no filterText is in state - - } }); } From 903687ddf640fd24e86a0a3626cbc122928d2d1a Mon Sep 17 00:00:00 2001 From: RONAK Date: Sun, 1 Dec 2024 00:09:27 +0530 Subject: [PATCH 13/28] Updating watch for URL fix --- docs/common/DocsPageTemplate/SideNav/index.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 0f6a5a341..d05c5b12d 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -81,9 +81,13 @@ filterText(newValue) { if (window) { window.sessionStorage.setItem('nav-filter', newValue); - //Pushing filter state to the browser history - const url = newValue ? `?filter=${encodeURIComponent(newValue)}` : window.location.pathname; - window.history.pushState({ filterText: newValue },'',url); + //Clear the filter query when filtertext is empty + if (!newValue) { + this.$router.replace({ path: this.$route.path,query: {} }); + }else { + //else ,update the filter query param + this.$router.push({ path: this.$route.path, query: { ...this.$route.query, filter: newValue}}); + } } }, }, From d1d60456aa59dedde4c5105b2a21fdc3720690f2 Mon Sep 17 00:00:00 2001 From: RONAK Date: Sun, 1 Dec 2024 00:12:53 +0530 Subject: [PATCH 14/28] Spacing and linting --- docs/common/DocsPageTemplate/SideNav/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index d05c5b12d..e00ff1980 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -83,8 +83,8 @@ window.sessionStorage.setItem('nav-filter', newValue); //Clear the filter query when filtertext is empty if (!newValue) { - this.$router.replace({ path: this.$route.path,query: {} }); - }else { + this.$router.replace({ path: this.$route.path, query: {} }); + } else { //else ,update the filter query param this.$router.push({ path: this.$route.path, query: { ...this.$route.query, filter: newValue}}); } From 6455c37e7a4b1177a3487e2152e8f3051469bc7e Mon Sep 17 00:00:00 2001 From: RONAK Date: Sun, 1 Dec 2024 14:46:09 +0530 Subject: [PATCH 15/28] lint-test --- docs/common/DocsPageTemplate/SideNav/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index e00ff1980..2418933da 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -40,7 +40,7 @@ import throttle from 'lodash/throttle'; import NavSectionList from './NavSectionList'; import { termList, matches } from '~/common/DocsFilter/utils'; - import tableOfContents from '~/tableOfContents.js' + import tableOfContents from '~/tableOfContents.js'; export default { name: 'SideNav', @@ -82,12 +82,12 @@ if (window) { window.sessionStorage.setItem('nav-filter', newValue); //Clear the filter query when filtertext is empty - if (!newValue) { + if (!newValue) { this.$router.replace({ path: this.$route.path, query: {} }); - } else { + } else { //else ,update the filter query param this.$router.push({ path: this.$route.path, query: { ...this.$route.query, filter: newValue}}); - } + } } }, }, @@ -108,7 +108,7 @@ } }); } - // don't show the nav until the state is set + // don't show the nav until the state is set this.loaded = true; }, methods: { From 37e82d8cc69eded0d5fd489da3d1ad50754f4483 Mon Sep 17 00:00:00 2001 From: RONAK Date: Wed, 4 Dec 2024 16:04:16 +0530 Subject: [PATCH 16/28] Removing previous handlers --- docs/common/DocsPageTemplate/SideNav/index.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 2418933da..0ee5d5e47 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -80,7 +80,6 @@ watch: { filterText(newValue) { if (window) { - window.sessionStorage.setItem('nav-filter', newValue); //Clear the filter query when filtertext is empty if (!newValue) { this.$router.replace({ path: this.$route.path, query: {} }); @@ -93,10 +92,7 @@ }, mounted() { if (window) { - const filterText = window.sessionStorage.getItem('nav-filter'); - if (filterText) { - this.filterText = filterText; - } + this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); //Restoring filter state when a user navigates back From 25597c278e97f9d7b3fa48a86dc24bf1275b6f44 Mon Sep 17 00:00:00 2001 From: RONAK Date: Thu, 5 Dec 2024 23:23:04 +0530 Subject: [PATCH 17/28] Pushing filter as query --- .../common/DocsPageTemplate/SideNav/index.vue | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 0ee5d5e47..15364465d 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -41,7 +41,7 @@ import NavSectionList from './NavSectionList'; import { termList, matches } from '~/common/DocsFilter/utils'; import tableOfContents from '~/tableOfContents.js'; - + export default { name: 'SideNav', components: { @@ -90,23 +90,30 @@ } }, }, - mounted() { - if (window) { + mounted() { + if (window) { + const { filter } = this.$route.query; + // Set filterText from the query parameter if it exists + if (filter) { + this.filterText = filter; + } + this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); + // Restoring filter state when a user navigates back + window.addEventListener('popstate', (event) => { + if (event.state && 'filterText' in event.state) { + this.filterText = event.state.filterText; + } else { + this.filterText = ''; // Reset if no filterText is in state - this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); - - //Restoring filter state when a user navigates back - window.addEventListener('popstate',(event) => { - if (event.state && 'filterText' in event.state) { - this.filterText = event.state.filterText; - } else { - this.filterText='';//Reset if no filterText is in state - } - }); } - // don't show the nav until the state is set - this.loaded = true; - }, + }); + + } + +// Don't show the nav until the state is set + this.loaded = true; +}, + methods: { throttleHandleScroll: throttle(function handleScroll() { window.sessionStorage.setItem('nav-scroll', this.$refs.links.scrollTop); From bb03df0208e9399faf5093197e420825d6c14ec1 Mon Sep 17 00:00:00 2001 From: RONAK Date: Fri, 6 Dec 2024 23:20:45 +0530 Subject: [PATCH 18/28] Adding debounceUpdate --- docs/common/DocsPageTemplate/SideNav/index.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 15364465d..46cc9ad3d 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -41,6 +41,7 @@ import NavSectionList from './NavSectionList'; import { termList, matches } from '~/common/DocsFilter/utils'; import tableOfContents from '~/tableOfContents.js'; + import debounce from 'lodash/debounce'; export default { name: 'SideNav', @@ -51,6 +52,7 @@ return { filterText: '', loaded: false, + debounceUpdateQuery: null, }; }, computed: { @@ -87,6 +89,7 @@ //else ,update the filter query param this.$router.push({ path: this.$route.path, query: { ...this.$route.query, filter: newValue}}); } + this.debouncedUpdateQuery(newValue); } }, }, From 31df5128440b28e809d569bfb53e43c1034a5c29 Mon Sep 17 00:00:00 2001 From: RONAK Date: Fri, 6 Dec 2024 23:28:05 +0530 Subject: [PATCH 19/28] Adding debounce under mounted() --- .../common/DocsPageTemplate/SideNav/index.vue | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 46cc9ad3d..2637061af 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -85,39 +85,45 @@ //Clear the filter query when filtertext is empty if (!newValue) { this.$router.replace({ path: this.$route.path, query: {} }); - } else { + } + else { //else ,update the filter query param this.$router.push({ path: this.$route.path, query: { ...this.$route.query, filter: newValue}}); } this.debouncedUpdateQuery(newValue); } - }, + } }, mounted() { - if (window) { + if (window) { const { filter } = this.$route.query; - // Set filterText from the query parameter if it exists + // Set filterText from the query parameter if it exists if (filter) { this.filterText = filter; } this.$refs.links.scrollTop = window.sessionStorage.getItem('nav-scroll'); - // Restoring filter state when a user navigates back - window.addEventListener('popstate', (event) => { - if (event.state && 'filterText' in event.state) { - this.filterText = event.state.filterText; - } else { - this.filterText = ''; // Reset if no filterText is in state - + // Restoring filter state when a user navigates back + window.addEventListener('popstate', (event) => { + if (event.state && 'filterText' in event.state) { + this.filterText = event.state.filterText; + } else { + this.filterText = ''; // Reset if no filterText is in state + } + }); + // Create debounced function for updating the query + this.debouncedUpdateQuery = debounce((newValue) => { + if (newValue) { + this.$router.push({ path: this.$route.path, query: { ...this.$route.query, filter: newValue } }); + } + else { + this.$router.push({ path: this.$route.path, query: {} }); } - }); - - } - -// Don't show the nav until the state is set + }, 2000); // 2-second debounce delay + } + // Don't show the nav until the state is set this.loaded = true; }, - - methods: { + methods: { throttleHandleScroll: throttle(function handleScroll() { window.sessionStorage.setItem('nav-scroll', this.$refs.links.scrollTop); }, 100), From 4217eb08fd6254f8b4a973f931eab95a1a3952eb Mon Sep 17 00:00:00 2001 From: RONAK Date: Wed, 11 Dec 2024 20:13:37 +0530 Subject: [PATCH 20/28] Preserving the query when the button is clicked --- docs/common/DocsPageTemplate/SideNav/index.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 2637061af..422b6c3bf 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -120,6 +120,20 @@ } }, 2000); // 2-second debounce delay } + + // Modify navigation links to preserve the filter query + this.$nextTick(() => { + this.$refs.links.querySelectorAll('a').forEach((link) => { + link.addEventListener('click', (event) => { + event.preventDefault(); + const href = new URL(link.href); + this.$router.push({ + path: href.pathname, + query: { ...this.$route.query } // Add existing query params to the new path + }); + }); + }); + }); // Don't show the nav until the state is set this.loaded = true; }, From df406a88998571dbe8c4ec329622ed241d529d3b Mon Sep 17 00:00:00 2001 From: RONAK Date: Fri, 13 Dec 2024 12:30:38 +0530 Subject: [PATCH 21/28] Lint -fix (ubuntu version) --- .../common/DocsPageTemplate/SideNav/index.vue | 111 +++++++++--------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/docs/common/DocsPageTemplate/SideNav/index.vue b/docs/common/DocsPageTemplate/SideNav/index.vue index 422b6c3bf..77e5f164b 100644 --- a/docs/common/DocsPageTemplate/SideNav/index.vue +++ b/docs/common/DocsPageTemplate/SideNav/index.vue @@ -38,11 +38,11 @@ From bfb797344a6eea0403277adef8ff3d44b406e42e Mon Sep 17 00:00:00 2001 From: RONAK Date: Mon, 16 Dec 2024 13:26:21 +0530 Subject: [PATCH 25/28] yarn lint-fix --- docs/common/DocsLibraryLink.vue | 17 ++++++++--------- .../common/DocsPageTemplate/SideNav/NavLink.vue | 16 ++++++++-------- docs/common/DocsPageTemplate/SideNav/index.vue | 13 ------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/docs/common/DocsLibraryLink.vue b/docs/common/DocsLibraryLink.vue index ac72c79d0..830e8527c 100644 --- a/docs/common/DocsLibraryLink.vue +++ b/docs/common/DocsLibraryLink.vue @@ -1,6 +1,6 @@