From b94d0010214c78eb0469854034b1f407d6ee6a0a Mon Sep 17 00:00:00 2001 From: Hakim Cassimally Date: Mon, 19 Feb 2024 17:50:27 +0000 Subject: [PATCH] AV-56565 Docsearch - handle results in test Algolia 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...) --- src/js/vendor/docsearch.bundle.js | 18 +++++------------- src/partials/crumbs-meta.hbs | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/js/vendor/docsearch.bundle.js b/src/js/vendor/docsearch.bundle.js index eb637ab2..655f0ad0 100644 --- a/src/js/vendor/docsearch.bundle.js +++ b/src/js/vendor/docsearch.bundle.js @@ -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(/^\./, '')) }) @@ -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) { diff --git a/src/partials/crumbs-meta.hbs b/src/partials/crumbs-meta.hbs index 780b67e1..d9366662 100644 --- a/src/partials/crumbs-meta.hbs +++ b/src/partials/crumbs-meta.hbs @@ -5,4 +5,4 @@ Logic extracted from crumbs.hbs --}} {{{page.component.title}}} {{~/unless~}} {{~/unless~}} -{{~#each page.breadcrumbs}} / {{{./content}}}{{~/each}} \ No newline at end of file +{{~#each page.breadcrumbs}} › {{{./content}}}{{~/each}} \ No newline at end of file