From 7049636975d8afea1886c8357067ddb4ebfea538 Mon Sep 17 00:00:00 2001 From: Ian Turner Date: Sun, 30 Jun 2024 07:01:51 +0200 Subject: [PATCH] front: rename variable from French to English --- .../rollingStockEditor/views/RollingStockEditor.tsx | 4 ++-- .../src/applications/stdcmV2/components/StdcmConsist.tsx | 8 ++++---- .../components/RollingStockSelector/RollingStockModal.tsx | 4 ++-- .../RollingStockSelector/SearchRollingStock.tsx | 6 +++--- .../modules/rollingStock/hooks/useFilterRollingStock.tsx | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/front/src/applications/rollingStockEditor/views/RollingStockEditor.tsx b/front/src/applications/rollingStockEditor/views/RollingStockEditor.tsx index 52c09c9e07b..d2fc8585aaa 100644 --- a/front/src/applications/rollingStockEditor/views/RollingStockEditor.tsx +++ b/front/src/applications/rollingStockEditor/views/RollingStockEditor.tsx @@ -35,7 +35,7 @@ const RollingStockEditor = () => { const { filteredRollingStockList, filters, - searchMateriel, + searchStock, toggleFilter, searchIsLoading, resetFilters, @@ -173,7 +173,7 @@ const RollingStockEditor = () => { diff --git a/front/src/applications/stdcmV2/components/StdcmConsist.tsx b/front/src/applications/stdcmV2/components/StdcmConsist.tsx index 2f95d945e30..a4d5d77e7ef 100644 --- a/front/src/applications/stdcmV2/components/StdcmConsist.tsx +++ b/front/src/applications/stdcmV2/components/StdcmConsist.tsx @@ -47,7 +47,7 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => { const { rollingStock } = useStoreDataForRollingStockSelector(); - const { filters, searchMateriel, filteredRollingStockList } = useFilterRollingStock(); + const { filters, searchMaterial, filteredRollingStockList } = useFilterRollingStock(); const getLabel = (rs: LightRollingStockWithLiveries) => { let res = ''; @@ -67,7 +67,7 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => { }; const onInputChange = (e: React.ChangeEvent) => { - searchMateriel(e.target.value); + searchMaterial(e.target.value); }; const onInputOnBlur = () => { @@ -84,9 +84,9 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => { useEffect(() => { if (rollingStock) { - searchMateriel(getLabel(rollingStock)); + searchMaterial(getLabel(rollingStock)); } else { - searchMateriel(''); + searchMaterial(''); } }, [rollingStock]); diff --git a/front/src/modules/rollingStock/components/RollingStockSelector/RollingStockModal.tsx b/front/src/modules/rollingStock/components/RollingStockSelector/RollingStockModal.tsx index 78f164acf79..734127fbc00 100644 --- a/front/src/modules/rollingStock/components/RollingStockSelector/RollingStockModal.tsx +++ b/front/src/modules/rollingStock/components/RollingStockSelector/RollingStockModal.tsx @@ -22,7 +22,7 @@ function RollingStockModal({ ref2scroll }: RollingStockModal) { const [openRollingStockCardId, setOpenRollingStockCardId] = useState(rollingStockID); const { closeModal } = useContext(ModalContext); - const { filteredRollingStockList, filters, searchMateriel, toggleFilter, searchIsLoading } = + const { filteredRollingStockList, filters, searchMaterial, toggleFilter, searchIsLoading } = useFilterRollingStock(); useEffect(() => { @@ -64,7 +64,7 @@ function RollingStockModal({ ref2scroll }: RollingStockModal) { diff --git a/front/src/modules/rollingStock/components/RollingStockSelector/SearchRollingStock.tsx b/front/src/modules/rollingStock/components/RollingStockSelector/SearchRollingStock.tsx index a3fce71886a..a6677fc9337 100644 --- a/front/src/modules/rollingStock/components/RollingStockSelector/SearchRollingStock.tsx +++ b/front/src/modules/rollingStock/components/RollingStockSelector/SearchRollingStock.tsx @@ -13,7 +13,7 @@ import type { RollingStockFilters } from 'modules/rollingStock/hooks/useFilterRo type SearchRollingStockProps = { filteredRollingStockList: LightRollingStockWithLiveries[]; - searchMateriel: (value: string) => void; + searchMaterial: (value: string) => void; toggleFilter: (filter: 'elec' | 'thermal' | 'locked' | 'notLocked') => void; filters: RollingStockFilters; hasWhiteBackground?: boolean; @@ -22,7 +22,7 @@ type SearchRollingStockProps = { const SearchRollingStock = ({ filteredRollingStockList, filters, - searchMateriel, + searchMaterial, toggleFilter, hasWhiteBackground, }: SearchRollingStockProps) => { @@ -35,7 +35,7 @@ const SearchRollingStock = ({ id="searchfilter" type="text" value={filters.text} - onChange={(e) => searchMateriel(e.target.value)} + onChange={(e) => searchMaterial(e.target.value)} placeholder={t('translation:common.search')} noMargin unit={} diff --git a/front/src/modules/rollingStock/hooks/useFilterRollingStock.tsx b/front/src/modules/rollingStock/hooks/useFilterRollingStock.tsx index 4b19ead6adf..42185903231 100644 --- a/front/src/modules/rollingStock/hooks/useFilterRollingStock.tsx +++ b/front/src/modules/rollingStock/hooks/useFilterRollingStock.tsx @@ -141,7 +141,7 @@ export default function useFilterRollingStock() { const [filteredRollingStockList, setFilteredRollingStockList] = useState(allRollingStocks); - const searchMateriel = (value: string) => { + const searchStock = (value: string) => { setFilters({ ...filters, text: value.toLowerCase() }); setSearchIsLoading(true); }; @@ -180,7 +180,7 @@ export default function useFilterRollingStock() { filters, searchIsLoading, resetFilters, - searchMateriel, + searchStock, toggleFilter, }; }