From 06fb86e7554a451d643254e3733408ac89c97f52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Fiala?= Date: Thu, 14 Nov 2019 14:36:47 +0100 Subject: [PATCH] templates: pass OSO version when searching * Passes OSO version [starter|pro] to the URL filter to get relevant (v3/v4) results * Updates the search endpoint Signed-off-by: Jiri Fiala --- _javascripts/hc-search.js | 2 +- _templates/_page_openshift.html.erb | 2 +- ...ch_online.html => _search_online.html.erb} | 2 +- search-commercial.html | 70 ++++++++++++++++--- 4 files changed, 65 insertions(+), 11 deletions(-) rename _templates/{_search_online.html => _search_online.html.erb} (84%) diff --git a/_javascripts/hc-search.js b/_javascripts/hc-search.js index e15010a964..bf5db7afb5 100644 --- a/_javascripts/hc-search.js +++ b/_javascripts/hc-search.js @@ -51,7 +51,7 @@ function hcsearch(searchParams) { var hcSearchResult = $("#hc-search-results"); // the "searchprovider" is to return a JSON response in the expected format - var searchprovider = "https://help.openshift.com/search/search_custom.php"; + var searchprovider = "https://search.help.openshift.com/json"; var searchReq = { "q" : searchParams.q + searchParams.urlFilter, "l" : searchParams.label, "si" : searchParams.si } // q = query, l = label diff --git a/_templates/_page_openshift.html.erb b/_templates/_page_openshift.html.erb index 5c2b7b52f9..eea234e47f 100644 --- a/_templates/_page_openshift.html.erb +++ b/_templates/_page_openshift.html.erb @@ -139,7 +139,7 @@ var distros = { 'openshift-origin': ['docs_origin', version], 'openshift-dedicated': ['docs_dedicated', version], - 'openshift-online': ['docs_online'], + 'openshift-online': ['docs_online', version], 'openshift-enterprise': ['docs_cp', version] }; diff --git a/_templates/_search_online.html b/_templates/_search_online.html.erb similarity index 84% rename from _templates/_search_online.html rename to _templates/_search_online.html.erb index e3e88ac266..125f9ac8e0 100644 --- a/_templates/_search_online.html +++ b/_templates/_search_online.html.erb @@ -11,5 +11,5 @@ diff --git a/search-commercial.html b/search-commercial.html index 9e6bb4a871..1173a129a3 100644 --- a/search-commercial.html +++ b/search-commercial.html @@ -181,14 +181,68 @@ height="0" width="0" style="display:none;visibility:hidden">