Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: rename variable from French to English #7893

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const RollingStockEditor = () => {
const {
filteredRollingStockList,
filters,
searchMateriel,
searchRollingStock,
toggleFilter,
searchIsLoading,
resetFilters,
Expand Down Expand Up @@ -173,7 +173,7 @@ const RollingStockEditor = () => {
<SearchRollingStock
filteredRollingStockList={filteredRollingStockList}
filters={filters}
searchMateriel={searchMateriel}
searchRollingStock={searchRollingStock}
toggleFilter={toggleFilter}
hasWhiteBackground
/>
Expand Down
8 changes: 4 additions & 4 deletions front/src/applications/stdcmV2/components/StdcmConsist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => {

const { rollingStock } = useStoreDataForRollingStockSelector();

const { filters, searchMateriel, filteredRollingStockList } = useFilterRollingStock();
const { filters, searchRollingStock, filteredRollingStockList } = useFilterRollingStock();

const getLabel = (rs: LightRollingStockWithLiveries) => {
let res = '';
Expand All @@ -67,7 +67,7 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => {
};

const onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
searchMateriel(e.target.value);
searchRollingStock(e.target.value);
};

const onInputOnBlur = () => {
Expand All @@ -84,9 +84,9 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => {

useEffect(() => {
if (rollingStock) {
searchMateriel(getLabel(rollingStock));
searchRollingStock(getLabel(rollingStock));
} else {
searchMateriel('');
searchRollingStock('');
}
}, [rollingStock]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, searchRollingStock, toggleFilter, searchIsLoading } =
useFilterRollingStock();

useEffect(() => {
Expand Down Expand Up @@ -64,7 +64,7 @@ function RollingStockModal({ ref2scroll }: RollingStockModal) {
<SearchRollingStock
filteredRollingStockList={filteredRollingStockList}
filters={filters}
searchMateriel={searchMateriel}
searchRollingStock={searchRollingStock}
toggleFilter={toggleFilter}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { RollingStockFilters } from 'modules/rollingStock/hooks/useFilterRo

type SearchRollingStockProps = {
filteredRollingStockList: LightRollingStockWithLiveries[];
searchMateriel: (value: string) => void;
searchRollingStock: (value: string) => void;
toggleFilter: (filter: 'elec' | 'thermal' | 'locked' | 'notLocked') => void;
filters: RollingStockFilters;
hasWhiteBackground?: boolean;
Expand All @@ -22,7 +22,7 @@ type SearchRollingStockProps = {
const SearchRollingStock = ({
filteredRollingStockList,
filters,
searchMateriel,
searchRollingStock,
toggleFilter,
hasWhiteBackground,
}: SearchRollingStockProps) => {
Expand All @@ -35,7 +35,7 @@ const SearchRollingStock = ({
id="searchfilter"
type="text"
value={filters.text}
onChange={(e) => searchMateriel(e.target.value)}
onChange={(e) => searchRollingStock(e.target.value)}
placeholder={t('translation:common.search')}
noMargin
unit={<Search />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function useFilterRollingStock() {
const [filteredRollingStockList, setFilteredRollingStockList] =
useState<LightRollingStockWithLiveries[]>(allRollingStocks);

const searchMateriel = (value: string) => {
const searchRollingStock = (value: string) => {
setFilters({ ...filters, text: value.toLowerCase() });
setSearchIsLoading(true);
};
Expand Down Expand Up @@ -180,7 +180,7 @@ export default function useFilterRollingStock() {
filters,
searchIsLoading,
resetFilters,
searchMateriel,
searchRollingStock,
toggleFilter,
};
}
Loading