From f100fb5db6b284d78a993438dbea3e5d8778cfa3 Mon Sep 17 00:00:00 2001 From: Clara Ni Date: Thu, 12 Dec 2024 15:47:10 +0100 Subject: [PATCH] front: display simulation results only if a train is selected or get data is ready Signed-off-by: Clara Ni --- .../views/SimulationResults.tsx | 143 +++++++++--------- 1 file changed, 75 insertions(+), 68 deletions(-) diff --git a/front/src/applications/operationalStudies/views/SimulationResults.tsx b/front/src/applications/operationalStudies/views/SimulationResults.tsx index 91cbcfd0282..5d9205ba243 100644 --- a/front/src/applications/operationalStudies/views/SimulationResults.tsx +++ b/front/src/applications/operationalStudies/views/SimulationResults.tsx @@ -116,6 +116,10 @@ const SimulationResults = ({ } }, [extViewport]); + if (!selectedTrainSchedule && !projectionData) { + return null; + } + return (
{/* SIMULATION : STICKY BAR */} @@ -184,78 +188,81 @@ const SimulationResults = ({
- {/* TRAIN : SPACE SPEED CHART */} - {selectedTrainRollingStock && trainSimulation && pathProperties && selectedTrainSchedule && ( -
-
- + {/* TRAIN : SPACE SPEED CHART */} + {selectedTrainRollingStock && trainSimulation && pathProperties && ( +
+
+ +
+
+ )} + + {/* SIMULATION : MAP */} +
+
-
- )} - - {/* SIMULATION : MAP */} -
- -
- {/* TIME STOPS TABLE */} -
-

{t('timetableOutput')}

- -
+ {/* TIME STOPS TABLE */} +
+

{t('timetableOutput')}

+ +
- {/* SIMULATION EXPORT BUTTONS */} - {selectedTrainSchedule && - trainSimulation && - pathProperties && - selectedTrainRollingStock && - operationalPoints && - path && - infraId && ( - - )} + {/* SIMULATION EXPORT BUTTONS */} + {trainSimulation && + pathProperties && + selectedTrainRollingStock && + operationalPoints && + path && + infraId && ( + + )} + + )}
); };