Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah German <sgerman@gitlab.com>2023-07-24 23:33:09 +0300
committerSarah German <sgerman@gitlab.com>2023-07-24 23:33:09 +0300
commitb5a96b1a9f6fb2b124d30a3b6e95eed927497c87 (patch)
treeeb147f46b4587f8516177657e36a473fef5354f7
parent93dcff7070af15b94ce1b07324bee7d506034d23 (diff)
Fix versioned search redirect for versions 15.11+
-rw-r--r--content/frontend/search/components/version_search.vue7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/frontend/search/components/version_search.vue b/content/frontend/search/components/version_search.vue
index 174e6a3e..5dae0c46 100644
--- a/content/frontend/search/components/version_search.vue
+++ b/content/frontend/search/components/version_search.vue
@@ -64,9 +64,14 @@ export default {
methods: {
searchArchivedVersion() {
if (this.selectedVersion !== SELECT_DEFAULT_TEXT) {
+ // In 15.11, the search query string changed from "query" to "q".
+ // This logic can be removed when 15.x sites are retired (18.0 release).
+ const versionNumber = Number(this.selectedVersion);
+ const queryParam = versionNumber < 16.0 && versionNumber !== 15.11 ? 'query' : 'q';
+
window.location.href = `https://archives.docs.gitlab.com/${
this.selectedVersion
- }/search/?query=${encodeURI(this.query)}`;
+ }/search/?${queryParam}=${encodeURI(this.query)}`;
this.selectedVersion = SELECT_DEFAULT_TEXT;
}