From 8ae91ba774e7fb052d884c25a082c3ffa7b73de7 Mon Sep 17 00:00:00 2001 From: Theo Macron Date: Fri, 30 Aug 2024 16:35:06 +0200 Subject: [PATCH] front: add stop type selector in stdcm --- front/public/locales/en/stdcm.json | 6 +++ front/public/locales/fr/stdcm.json | 6 +++ .../stdcmV2/components/StdcmStopType.tsx | 33 ++++++++++++++++ .../stdcmV2/components/StdcmVias.tsx | 38 ++++++++++++++++--- front/src/applications/stdcmV2/types.ts | 6 +++ front/src/reducers/osrdconf/types.ts | 3 +- 6 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 front/src/applications/stdcmV2/components/StdcmStopType.tsx diff --git a/front/public/locales/en/stdcm.json b/front/public/locales/en/stdcm.json index cd1e8f267af..13a1ab22bad 100644 --- a/front/public/locales/en/stdcm.json +++ b/front/public/locales/en/stdcm.json @@ -77,8 +77,14 @@ "origin": "Origin", "preciseTime": "precise time", "stopFor": "Minimum stop time", + "stopType": { + "driverSwitch": "driver switch", + "passageTime":"passage time", + "serviceStop": "service stop" + }, "time": "Time", "tolerance": "Tolerance", + "type": "Type", "vias": "Intermediate OP" } } diff --git a/front/public/locales/fr/stdcm.json b/front/public/locales/fr/stdcm.json index 5e4363ff9bd..0d5888f8cc5 100644 --- a/front/public/locales/fr/stdcm.json +++ b/front/public/locales/fr/stdcm.json @@ -77,8 +77,14 @@ "origin": "Origine", "preciseTime": "horaire précis", "stopFor": "Temps d'arrêt minimum", + "stopType": { + "driverSwitch": "relève conducteur", + "passageTime":"passage", + "serviceStop": "arrêt de service" + }, "time": "Heure", "tolerance": "Tolérance", + "type": "Type", "vias": "PR intermédiaire" } } diff --git a/front/src/applications/stdcmV2/components/StdcmStopType.tsx b/front/src/applications/stdcmV2/components/StdcmStopType.tsx new file mode 100644 index 00000000000..edbe6a1f910 --- /dev/null +++ b/front/src/applications/stdcmV2/components/StdcmStopType.tsx @@ -0,0 +1,33 @@ +import { Select } from '@osrd-project/ui-core'; +import { useTranslation } from 'react-i18next'; + +import type { StdcmStopTypes } from '../types'; + +type StdcmStopTypeProps = { + stopTypes: StdcmStopTypes; + onStdcmStopTypesChange: (arrivalType: StdcmStopTypes) => void; +}; + +const StdcmStopType = ({ stopTypes, onStdcmStopTypesChange }: StdcmStopTypeProps) => { + const { t } = useTranslation('stdcm'); + + return ( +
+