Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Łukasz Ostafin <[email protected]>
  • Loading branch information
dew326 and lucasOsti authored Oct 31, 2023
1 parent 119c06b commit 01a5b05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const { escapeHTML } = ibexa.helpers.text;
const { highlightText } = ibexa.helpers.highlight;
const contentTypeHelper = ibexa.helpers.contentType;
const { getContentTypeIconUrl, getContentTypeName } = ibexa.helpers.contentType;
const autocompleteListNode = globalSearch.querySelector('.ibexa-global-search__autocomplete-list');
const autocompleteContentTemplateNode = globalSearch.querySelector('.ibexa-global-search__autocomplete-content-template');
const renderItem = (result, searchText) => {
Expand All @@ -28,8 +28,8 @@
const autocompleteHighlightTemplate = autocompleteListNode.dataset.templateHighlight;
const renderedTemplate = autocompleteItemTemplate
.replace('{{ contentName }}', highlightText(searchText, name, autocompleteHighlightTemplate))
.replace('{{ iconHref }}', contentTypeHelper.getContentTypeIconUrl(contentTypeIdentifier))
.replace('{{ contentTypeName }}', escapeHTML(contentTypeHelper.getContentTypeName(contentTypeIdentifier)))
.replace('{{ iconHref }}', getContentTypeIconUrl(contentTypeIdentifier))
.replace('{{ contentTypeName }}', escapeHTML(getContentTypeName(contentTypeIdentifier)))
.replaceAll('{{ contentBreadcrumbs }}', breadcrumb)
.replace('{{ contentHref }}', Routing.generate('ibexa.content.view', { contentId, locationId }));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
credentials: 'same-origin',
});
searchAbortController = new AbortController();

const { signal } = searchAbortController;

fetch(request, { signal })
Expand Down

0 comments on commit 01a5b05

Please sign in to comment.