Refactor: make global variables search input case insensitive

This commit is contained in:
igorrCarvalho 2024-04-30 17:09:03 -03:00
commit 2fa7df09dc
2 changed files with 6 additions and 5 deletions

View file

@ -173,7 +173,7 @@ export default function InputComponent({
>
<Command
filter={(value, search) => {
if (value.includes(search) || value.includes("doNotFilter-"))
if (value.toLowerCase().includes(search.toLowerCase()) || value.includes("doNotFilter-"))
return 1; // ensures items arent filtered
return 0;
}}

View file

@ -41,14 +41,15 @@ export default function GlobalVariablesPage() {
useEffect(() => {
const rows:Array<{type: string | undefined; id: string;
name: string;default_fields:string | undefined}> = [];
globalVariablesEntries.forEach((e) => {
const globalVariableObj = globalVariables[e];
console.log(globalVariableObj);
globalVariablesEntries.forEach((entrie) => {
const globalVariableObj = globalVariables[entrie];
rows.push({
type: globalVariableObj.type,
id: globalVariableObj.id,
default_fields: (globalVariableObj.default_fields??[]).join(", "),
name: e,
name: entrie,
});
});
console.log(rows);