Skip to content

Commit

Permalink
AV-56565 Docsearch - handle results in test Algolia
Browse files Browse the repository at this point in the history
Fix filter of records with no title

Change slash to right chevron

U+203A Single Right-Pointing Angle Quotation Mark
(instead of `>`, partly to avoid escaping it in HTML/meta tag...)
  • Loading branch information
osfameron committed Mar 6, 2024
1 parent 3e112ca commit b94d001
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
18 changes: 5 additions & 13 deletions src/js/vendor/docsearch.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@
return accum
}, {})
)
.filter((a) => a[1].title)
.sort(function (a, b) {
return a[1].title.replace(/^\./, '').localeCompare(b[1].title.replace(/^\./, ''))
})
Expand All @@ -321,20 +322,11 @@
}

function extractComponentVersionInfo (hit) {
var name, title, version
var componentVersion = hit.component_version
if (componentVersion) {
componentVersion = (Array.isArray(componentVersion) ? componentVersion[0] : componentVersion).split('@')
name = componentVersion[0]
version = componentVersion[1]
title = hit.component_title
} else {
name = hit.component
componentVersion = (hit.hierarchy.lvl0 || name).split(/ (?=\d+(?:\.|$))/)
title = componentVersion[0]
version = componentVersion[1]
return {
name: hit.component,
version: hit.cversion,
title: hit.component_title || hit.component || '',
}
return { name: name, version: version, title: title }
}

function renderFilters (components, filters) {
Expand Down
2 changes: 1 addition & 1 deletion src/partials/crumbs-meta.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Logic extracted from crumbs.hbs --}}
{{{page.component.title}}}
{{~/unless~}}
{{~/unless~}}
{{~#each page.breadcrumbs}} / {{{./content}}}{{~/each}}
{{~#each page.breadcrumbs}} {{{./content}}}{{~/each}}

0 comments on commit b94d001

Please sign in to comment.