app: Trie les suggestions par importance
This commit is contained in:
parent
0df46ac942
commit
1767738167
|
@ -186,7 +186,10 @@ const TermInput = ({terms, availableTerms, setTerms}) =>
|
|||
{suggestion.alias.length >= 1 ? (
|
||||
<span
|
||||
className="TermInput_suggestionAlias"
|
||||
title={`Alias du terme : ${suggestion.alias.join(', ')}`}
|
||||
title={
|
||||
'Alias du terme : '
|
||||
+ suggestion.alias.join(', ')
|
||||
}
|
||||
>
|
||||
{suggestion.alias.join(', ')}
|
||||
</span>
|
||||
|
|
|
@ -65,8 +65,6 @@ export const filterTerms = (search, terms) =>
|
|||
// Normalisation des mots recherchés
|
||||
const needle = normalizeName(search);
|
||||
|
||||
console.log(needle);
|
||||
|
||||
return terms.filter(term =>
|
||||
{
|
||||
// Normalisation du nom et des alias du terme
|
||||
|
@ -79,5 +77,5 @@ export const filterTerms = (search, terms) =>
|
|||
word.startsWith(item)
|
||||
)
|
||||
);
|
||||
});
|
||||
}).sort((term1, term2) => term2.weight - term1.weight);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue