diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index fa6da19e2..5f2c988fa 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -33,7 +33,7 @@ jobs: run: tsc --noEmit - name: Build App - run: NODE_OPTIONS=--max-old-space-size=3072 yarn build:test + run: NODE_OPTIONS=--max-old-space-size=4096 yarn build:test shell: bash env: VITE_PORT: ${{ vars.VITE_PORT }} diff --git a/src/components/item/form/AppForm.tsx b/src/components/item/form/AppForm.tsx index ade4c4f1a..53bad6e03 100644 --- a/src/components/item/form/AppForm.tsx +++ b/src/components/item/form/AppForm.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { ChangeEventHandler, useState } from 'react'; import { ArrowBack } from '@mui/icons-material'; import { Alert, Stack, TextField } from '@mui/material'; @@ -14,17 +14,20 @@ import { CUSTOM_APP_URL_ID } from '@/config/selectors'; import { useBuilderTranslation } from '../../../config/i18n'; import { hooks } from '../../../config/queryClient'; import { BUILDER } from '../../../langs/constants'; +import addNewImage from '../../../resources/addNew.png'; import { buildAppExtra } from '../../../utils/itemExtra'; import NameForm from './NameForm'; type AppGridProps = { currentUrl: string; handleSelection: (value: null | { name: string; url: string }) => void; + searchQuery?: string; }; const AppGrid = ({ currentUrl, handleSelection, + searchQuery, }: AppGridProps): JSX.Element | JSX.Element[] => { const { useApps } = hooks; const { data, isLoading } = useApps(); @@ -32,9 +35,17 @@ const AppGrid = ({ const { t: translateBuilder } = useBuilderTranslation(); if (data) { + // filter out with search query + let dataToShow = searchQuery + ? data.filter((d) => + d.name.toLowerCase().includes(searchQuery.toLowerCase()), + ) + : data; + dataToShow = dataToShow.sortBy((d) => d.name); + return ( <> - {data.map((ele) => ( + {dataToShow.map((ele) => ( { const { t: translateBuilder } = useBuilderTranslation(); const [isCustomApp, setIsCustomApp] = useState(false); + const [searchQuery, setSearchQuery] = useState(''); + + const searchAnApp: ChangeEventHandler< + HTMLInputElement | HTMLTextAreaElement + > = (e) => { + setSearchQuery(e.target.value); + }; + const handleAppSelection = ( newValue: null | { url: string; name: string }, ) => { @@ -147,19 +166,36 @@ const AppForm = ({ onChange, updatedProperties = {} }: Props): JSX.Element => { /> ) : ( - - - + - + + + + + )} diff --git a/src/components/item/form/NameForm.tsx b/src/components/item/form/NameForm.tsx index 8b86b3ec1..b6781b566 100644 --- a/src/components/item/form/NameForm.tsx +++ b/src/components/item/form/NameForm.tsx @@ -24,8 +24,6 @@ const NameForm = ({ const handleNameInput = (event: ChangeEvent<{ value: string }>) => { setChanges({ name: event.target.value }); }; - // eslint-disable-next-line no-console - console.log('name input', updatedProperties?.name ?? item?.name); return ( - - - - {name ?? } - - - {description ?? } - - + + + + {name} + + + + + + {name ?? } + + + {description ?? } + + + + ); const AppCardWrapper = (props: Props): JSX.Element => ( - +