Skip to content

Commit

Permalink
search: add ARO search support
Browse files Browse the repository at this point in the history
* Adds ARO specific search support.
* Fixes incorrect message when no search results are returned.
* Fixes search filtering for mixed case version strings used as filters
  (e.g. OKD 'Latest' previously excluding results with lower-case
  `latest` in the URL, thus returning no results)

Signed-off-by: Jiri Fiala <[email protected]>
  • Loading branch information
jiri-fiala committed Jan 24, 2020
1 parent 0ee1ef1 commit 4a06d2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _javascripts/hc-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function hcSearchCategory(label, version) {
si: 0,
q: query.val(),
label: label,
urlFilter: (typeof version === "undefined" || version == "Branch Build") ? "" : (" url:*\\/" + version + "\\/*")
urlFilter: (typeof version === "undefined" || version == "Branch Build") ? "" : (" url:*\\/" + version.toLowerCase() + "\\/*")
};
modalSearch.show();
hcsearch(searchParams);
Expand Down Expand Up @@ -65,7 +65,7 @@ function hcsearch(searchParams) {
$("#hc-search-result").append("<p><strong>An error occured while retrieving search results. Please try again later.</strong></p>");
hcSearchIndicator.hide();
}
if (hcsearchresults.response.result) {
if (!$.isEmptyObject(hcsearchresults.response.result)) {
// if there are any results
$(hcsearchresults.response.result).each(function () {
var row = '<div class="search-result-item"><a href="' + this.url +
Expand Down
3 changes: 2 additions & 1 deletion _templates/_page_openshift.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@
'openshift-origin': ['docs_origin', version],
'openshift-dedicated': ['docs_dedicated', version],
'openshift-online': ['docs_online', version],
'openshift-enterprise': ['docs_cp', version]
'openshift-enterprise': ['docs_cp', version],
'openshift-aro' : ['docs_aro']
};

distros[dk] ? hcSearchCategory.apply(null, distros[dk]) : hcSearchCategory("docs");
Expand Down

0 comments on commit 4a06d2a

Please sign in to comment.