diff --git a/front/public/locales/en/operationalStudies/manageTrainSchedule.json b/front/public/locales/en/operationalStudies/manageTrainSchedule.json index 906a7cf24a4..3face466847 100644 --- a/front/public/locales/en/operationalStudies/manageTrainSchedule.json +++ b/front/public/locales/en/operationalStudies/manageTrainSchedule.json @@ -140,6 +140,7 @@ "trainScheduleName": "Number, name", "trainScheduleStep": "Increment step", "trainUpdated": "Updated train", + "unavailableDistance": "Unavailable distance", "updateTrainSchedule": "Edit train", "usingElectricalProfiles": "Use electrical profiles", "via": "Via", diff --git a/front/public/locales/fr/operationalStudies/manageTrainSchedule.json b/front/public/locales/fr/operationalStudies/manageTrainSchedule.json index 2abf40ec2f2..6aadd386395 100644 --- a/front/public/locales/fr/operationalStudies/manageTrainSchedule.json +++ b/front/public/locales/fr/operationalStudies/manageTrainSchedule.json @@ -141,6 +141,7 @@ "trainScheduleName": "Numéro, nom", "trainScheduleStep": "Pas d'incrément", "trainUpdated": "Train modifié", + "unavailableDistance": "Distance indisponible", "updateTrainSchedule": "Modifier le train", "usingElectricalProfiles": "Utiliser les profils électriques", "via": "Étape", diff --git a/front/src/modules/pathfinding/components/Itinerary/DisplayItinerary/v2/ViasV2.tsx b/front/src/modules/pathfinding/components/Itinerary/DisplayItinerary/v2/ViasV2.tsx index a73ecb64762..ad07b932977 100644 --- a/front/src/modules/pathfinding/components/Itinerary/DisplayItinerary/v2/ViasV2.tsx +++ b/front/src/modules/pathfinding/components/Itinerary/DisplayItinerary/v2/ViasV2.tsx @@ -4,6 +4,7 @@ import { XCircle } from '@osrd-project/ui-icons'; import cx from 'classnames'; import type { Position } from 'geojson'; import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd'; +import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { useOsrdConfActions, useOsrdConfSelectors } from 'common/osrdContext'; @@ -18,6 +19,7 @@ type DisplayViasV2Props = { }; const ViasV2 = ({ zoomToFeaturePoint, shouldManageStopDuration }: DisplayViasV2Props) => { + const { t } = useTranslation('operationalStudies/manageTrainSchedule'); const { getViasV2 } = useOsrdConfSelectors(); const dispatch = useAppDispatch(); const vias = useSelector(getViasV2()); @@ -61,7 +63,7 @@ const ViasV2 = ({ zoomToFeaturePoint, shouldManageStopDuration }: DisplayViasV2P > {index + 1} - {`${via.name || `KM ${via.positionOnPath && (Math.round(via.positionOnPath) / 1000000).toFixed(3)}`}`} + {`${via.name || (via.positionOnPath && `KM ${(Math.round(via.positionOnPath) / 1000000).toFixed(3)}`) || t('unavailableDistance')}`} {via.ch && {via.ch}} {'uic' in via && ( diff --git a/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/RenderPopup.tsx b/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/RenderPopup.tsx index 8440c4e8e6d..b5bc9e0a7b2 100644 --- a/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/RenderPopup.tsx +++ b/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/RenderPopup.tsx @@ -29,11 +29,13 @@ type RenderPopupProps = { }; function RenderPopup({ pathProperties }: RenderPopupProps) { - const { getFeatureInfoClick, getInfraID } = useOsrdConfSelectors(); + const { getFeatureInfoClick, getInfraID, getOriginV2, getDestinationV2 } = useOsrdConfSelectors(); const osrdConfActions = useOsrdConfActions(); const { t } = useTranslation(['operationalStudies/manageTrainSchedule']); const featureInfoClick: FeatureInfoClickType = useSelector(getFeatureInfoClick); const infraId = useSelector(getInfraID); + const origin = useSelector(getOriginV2); + const destination = useSelector(getDestinationV2); const [trackOffset, setTrackOffset] = useState(0); @@ -127,14 +129,18 @@ function RenderPopup({ pathProperties }: RenderPopupProps) { {t('origin')} - + {origin && destination && ( + + )}