Set search as case-insensitive for authentication steps (#23406)

Closes #21989
This commit is contained in:
osorionicolas 2023-09-22 10:41:32 +02:00 committed by GitHub
parent b031aba429
commit 949fb47326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,16 +90,16 @@ export const AddStepModal = ({ name, type, onSelect }: AddStepModalProps) => {
[],
);
const page = useMemo(
() =>
localeSort(providers ?? [], mapByKey("displayName"))
.filter(
(p) =>
p.displayName?.includes(search) || p.description?.includes(search),
)
.slice(first, first + max + 1),
[providers, search, first, max],
);
const page = useMemo(() => {
const normalizedSearch = search.trim().toLowerCase();
return localeSort(providers ?? [], mapByKey("displayName"))
.filter(
({ displayName, description }) =>
displayName?.toLowerCase().includes(normalizedSearch) ||
description?.toLowerCase().includes(normalizedSearch),
)
.slice(first, first + max + 1);
}, [providers, search, first, max]);
return (
<Modal