From e2e721b1146d1a3bef09e267dc7ca04fa5cc2d41 Mon Sep 17 00:00:00 2001 From: Theo Macron Date: Wed, 1 Apr 2026 14:21:44 +0200 Subject: [PATCH] front: handle occurences in times stops table name Signed-off-by: Theo Macron --- .../operationalStudies/hooks/useSimulationResults.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/front/src/applications/operationalStudies/hooks/useSimulationResults.ts b/front/src/applications/operationalStudies/hooks/useSimulationResults.ts index 52fb8c9d590..5f2a4e2bcd3 100644 --- a/front/src/applications/operationalStudies/hooks/useSimulationResults.ts +++ b/front/src/applications/operationalStudies/hooks/useSimulationResults.ts @@ -10,6 +10,7 @@ import { extractOccurrenceDetailsFromPacedTrain, findExceptionWithOccurrenceId, computeIndexedOccurrenceStartTime, + getOccurrenceTrainName, } from 'modules/timetableItem/helpers/pacedTrain'; import useSelectedTimetableItem from 'modules/timetableItem/hooks/useSelectedTimetableItem'; import type { Train } from 'reducers/osrdconf/types'; @@ -67,6 +68,11 @@ const useSimulationResults = (): { ...(exception ? extractOccurrenceDetailsFromPacedTrain(timetableItem, exception) : {}), // overwrite start_time from extractOccurrenceDetailsFromPacedTrain start_time: startTime, + // overwrite train_name to reflect the occurrence name + train_name: getOccurrenceTrainName( + { ...timetableItem, paced: timetableItem.paced }, + selectedTrainId + ), id: selectedTrainId, }; }, [selectedTrainId, timetableItem]);