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 <Command
filter={(value, search) => { 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 1; // ensures items arent filtered
return 0; return 0;
}} }}

View file

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