From 61e82bb2480bc062178ae9629b20893d993606b6 Mon Sep 17 00:00:00 2001 From: Arunima22 Date: Tue, 26 Nov 2024 04:43:14 +0530 Subject: [PATCH 1/4] Implemented Method to check page --- .../ImportFromChannels/SearchResultsList.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue index 1135991555..d457d3c320 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue @@ -191,6 +191,7 @@ fetch() { this.loading = true; this.loadFailed = false; + this.checkPageToLoad(); this.fetchResultsDebounced(); this.loadSavedSearches(); }, @@ -225,6 +226,20 @@ toggleSelected(node) { this.$emit('change_selected', { nodes: [node], isSelected: !this.isSelected(node) }); }, + checkPageToLoad() { + if (this.prevSearchTerm !== this.currentSearchTerm) { + this.prevSearchTerm = this.currentSearchTerm; + if (this.$route.query.page !== "1") { + this.$router.push({ + ...this.$route, + query: { + ...this.$route.query, + page: 1, + }, + }); + } + } + }, }, $trs: { searchResultsCount: @@ -239,4 +254,4 @@ - + \ No newline at end of file From 6864036a3d73a76fa363e8570c1e31882fdcbf44 Mon Sep 17 00:00:00 2001 From: Arunima22 Date: Tue, 26 Nov 2024 20:25:35 +0530 Subject: [PATCH 2/4] Added Page=1 in the route.query when a new search term is introduced --- .../views/ImportFromChannels/SearchOrBrowseWindow.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue index 55f348f138..00a371c620 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue @@ -178,6 +178,7 @@ ...this.$route.query, ...(this.isBrowsing ? { languages: this.languageFromChannelList } : {}), last: this.$route.query.last || this.$route.path, + page: 1 }, }); this.languageFromChannelList = null; From 414cf5d3ad5c00b60b744ccf3a256a5dccc4c97e Mon Sep 17 00:00:00 2001 From: Arunima22 Date: Tue, 26 Nov 2024 20:27:49 +0530 Subject: [PATCH 3/4] Removed method checkPageToLoad --- .../ImportFromChannels/SearchResultsList.vue | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue index d457d3c320..6a5bf036d8 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchResultsList.vue @@ -191,7 +191,6 @@ fetch() { this.loading = true; this.loadFailed = false; - this.checkPageToLoad(); this.fetchResultsDebounced(); this.loadSavedSearches(); }, @@ -226,20 +225,6 @@ toggleSelected(node) { this.$emit('change_selected', { nodes: [node], isSelected: !this.isSelected(node) }); }, - checkPageToLoad() { - if (this.prevSearchTerm !== this.currentSearchTerm) { - this.prevSearchTerm = this.currentSearchTerm; - if (this.$route.query.page !== "1") { - this.$router.push({ - ...this.$route, - query: { - ...this.$route.query, - page: 1, - }, - }); - } - } - }, }, $trs: { searchResultsCount: From 783d230edde15ce0bb45aac9bcdeee6509231219 Mon Sep 17 00:00:00 2001 From: Arunima22 Date: Sun, 8 Dec 2024 19:21:51 +0530 Subject: [PATCH 4/4] formatting done --- .../views/ImportFromChannels/SearchOrBrowseWindow.vue | 2 +- .../contentcuration/frontend/shared/views/Pagination.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue index 00a371c620..c4637da638 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue @@ -178,7 +178,7 @@ ...this.$route.query, ...(this.isBrowsing ? { languages: this.languageFromChannelList } : {}), last: this.$route.query.last || this.$route.path, - page: 1 + page: 1, }, }); this.languageFromChannelList = null; diff --git a/contentcuration/contentcuration/frontend/shared/views/Pagination.vue b/contentcuration/contentcuration/frontend/shared/views/Pagination.vue index 23cd7589f1..0e74c26a68 100644 --- a/contentcuration/contentcuration/frontend/shared/views/Pagination.vue +++ b/contentcuration/contentcuration/frontend/shared/views/Pagination.vue @@ -37,4 +37,4 @@ }, }; - + \ No newline at end of file