From c482ed6e688cb9e5105aa0d686613c8ad81905fb Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Fri, 16 Oct 2020 13:39:02 +0200 Subject: Explicit fallback in searchbar (#1559) --- .../base/frontend/src/main/components/search/searchResultRow.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'plugins/base/frontend/src/main/components/search/searchResultRow.tsx') diff --git a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx index 5910eec4..b9dbf482 100644 --- a/plugins/base/frontend/src/main/components/search/searchResultRow.tsx +++ b/plugins/base/frontend/src/main/components/search/searchResultRow.tsx @@ -1,5 +1,5 @@ import React from "react"; -import {OptionWithSearchResult, SearchProps, SearchRank} from "./types"; +import {OptionWithSearchResult, SearchProps} from "./types"; import _ from "lodash"; type HighlighterProps = { @@ -11,10 +11,7 @@ const Highlighter: React.FC = ({label}: HighlighterProps) => { } export const signatureFromSearchResult = (searchResult: OptionWithSearchResult): string => { - if(searchResult.rank == SearchRank.SearchKeyMatch){ - return searchResult.name.replace(searchResult.searchKey, searchResult.highlight) - } - return searchResult.highlight + return searchResult.name.replace(searchResult.searchKeys[searchResult.rank], searchResult.highlight) } export const SearchResultRow: React.FC = ({searchResult}: SearchProps) => { -- cgit