@@ -45,7 +45,6 @@ const StcdmResults = ({
45
45
showStatusBanner,
46
46
} : StcdmResultsProps ) => {
47
47
const infraId = useInfraID ( ) ;
48
-
49
48
const { t } = useTranslation ( 'stdcm' , { keyPrefix : 'simulation.results' } ) ;
50
49
const { stdcmName } = useDeploymentSettings ( ) ;
51
50
@@ -89,103 +88,107 @@ const StcdmResults = ({
89
88
onSelectSimulation = { onSelectSimulation }
90
89
retainedSimulationIndex = { retainedSimulationIndex }
91
90
/>
92
- < div className = "simulation-results" >
93
- { hasSimulationResults && ! hasConflictResults ? (
94
- < div className = "results-and-sheet" >
95
- < StcdmResultsTable
96
- stdcmData = { outputs . results }
97
- consist = { selectedSimulation . inputs . consist }
98
- isSimulationRetained = { isSelectedSimulationRetained }
99
- operationalPointsList = { operationalPointsList }
100
- simulationIndex = { selectedSimulation . index }
101
- />
102
- { isSelectedSimulationRetained && (
103
- < div className = "get-simulation" >
104
- < div className = "download-simulation" >
105
- < PDFDownloadLink
106
- document = {
107
- < SimulationReportSheet
108
- stdcmLinkedTrains = { selectedSimulation . inputs . linkedTrains }
109
- stdcmData = { outputs . results }
110
- consist = { selectedSimulation . inputs . consist }
111
- simulationReportSheetNumber = { simulationReportSheetNumber }
112
- operationalPointsList = { operationalPointsList }
113
- />
114
- }
115
- fileName = { `${ stdcmName } -${ simulationReportSheetNumber } .pdf` }
116
- >
91
+ { outputs && (
92
+ < >
93
+ < div className = "simulation-results" >
94
+ { hasSimulationResults && ! hasConflictResults ? (
95
+ < div className = "results-and-sheet" >
96
+ < StcdmResultsTable
97
+ stdcmData = { outputs . results }
98
+ consist = { selectedSimulation . inputs . consist }
99
+ isSimulationRetained = { isSelectedSimulationRetained }
100
+ operationalPointsList = { operationalPointsList }
101
+ simulationIndex = { selectedSimulation . index }
102
+ />
103
+ { isSelectedSimulationRetained && (
104
+ < div className = "get-simulation" >
105
+ < div className = "download-simulation" >
106
+ < PDFDownloadLink
107
+ document = {
108
+ < SimulationReportSheet
109
+ stdcmLinkedTrains = { selectedSimulation . inputs . linkedTrains }
110
+ stdcmData = { outputs . results }
111
+ consist = { selectedSimulation . inputs . consist }
112
+ simulationReportSheetNumber = { simulationReportSheetNumber }
113
+ operationalPointsList = { operationalPointsList }
114
+ />
115
+ }
116
+ fileName = { `${ stdcmName } -${ simulationReportSheetNumber } .pdf` }
117
+ >
118
+ < Button
119
+ data-testid = "download-simulation-button"
120
+ label = { t ( 'downloadSimulationSheet' ) }
121
+ onClick = { ( ) => { } }
122
+ />
123
+ </ PDFDownloadLink >
124
+ </ div >
125
+ < div className = "gesico-text" > { t ( 'gesicoRequest' ) } </ div >
126
+ </ div >
127
+ ) }
128
+ { retainedSimulationIndex !== undefined && buttonsVisible && (
129
+ < div className = "start-new-query" >
130
+ < Button
131
+ data-testid = "start-new-query-button"
132
+ variant = "Primary"
133
+ label = { t ( 'startNewQuery' ) }
134
+ onClick = { onStartNewQuery }
135
+ />
117
136
< Button
118
- data-testid = "download-simulation-button"
119
- label = { t ( 'downloadSimulationSheet' ) }
120
- onClick = { ( ) => { } }
137
+ className = "start-new-query-with-data"
138
+ data-testid = "start-new-query-with-data-button"
139
+ variant = "Normal"
140
+ label = { t ( 'startNewQueryFromCurrent' ) }
141
+ onClick = { onStartNewQueryWithData }
121
142
/>
122
- </ PDFDownloadLink >
123
- </ div >
124
- < div className = "gesico-text" > { t ( 'gesicoRequest' ) } </ div >
143
+ </ div >
144
+ ) }
125
145
</ div >
126
- ) }
127
- { retainedSimulationIndex !== undefined && buttonsVisible && (
128
- < div className = "start-new-query" >
129
- < Button
130
- data-testid = "start-new-query-button"
131
- variant = "Primary"
132
- label = { t ( 'startNewQuery' ) }
133
- onClick = { onStartNewQuery }
134
- />
135
- < Button
136
- className = "start-new-query-with-data"
137
- data-testid = "start-new-query-with-data-button"
138
- variant = "Normal"
139
- label = { t ( 'startNewQueryFromCurrent' ) }
140
- onClick = { onStartNewQueryWithData }
141
- />
146
+ ) : (
147
+ < div className = "simulation-failure" >
148
+ < span className = "title" > { t ( 'notFound' ) } </ span >
149
+ < span className = "change-criteria" > { t ( 'conflictsTitle' ) } </ span >
150
+
151
+ { trackConflicts . length > 0 && (
152
+ < ul >
153
+ { trackConflicts . map ( ( message , index ) => (
154
+ < li key = { index } >
155
+ < span >
156
+ < Trans > • { message } </ Trans >
157
+ </ span >
158
+ </ li >
159
+ ) ) }
160
+ </ ul >
161
+ ) }
162
+
163
+ { trackConflicts . length > 0 && workConflicts . length > 0 && < br /> }
164
+
165
+ { workConflicts . length > 0 && (
166
+ < ul >
167
+ { workConflicts . map ( ( message , index ) => (
168
+ < li key = { index } >
169
+ < span >
170
+ < Trans > • { message } </ Trans >
171
+ </ span >
172
+ </ li >
173
+ ) ) }
174
+ </ ul >
175
+ ) }
176
+ < span > { t ( 'changeSearchCriteria' ) } </ span >
142
177
</ div >
143
178
) }
179
+ < div className = "osrd-config-item-container osrd-config-item-container-map map-results" >
180
+ < DefaultBaseMap
181
+ mapId = "stdcm-map-result"
182
+ infraId = { infraId }
183
+ geometry = { outputs ?. pathProperties ?. geometry }
184
+ pathStepMarkers = { markersInfo }
185
+ isFeasible = { ! hasConflictResults }
186
+ />
187
+ </ div >
144
188
</ div >
145
- ) : (
146
- < div className = "simulation-failure" >
147
- < span className = "title" > { t ( 'notFound' ) } </ span >
148
- < span className = "change-criteria" > { t ( 'conflictsTitle' ) } </ span >
149
-
150
- { trackConflicts . length > 0 && (
151
- < ul >
152
- { trackConflicts . map ( ( message , index ) => (
153
- < li key = { index } >
154
- < span >
155
- < Trans > • { message } </ Trans >
156
- </ span >
157
- </ li >
158
- ) ) }
159
- </ ul >
160
- ) }
161
-
162
- { trackConflicts . length > 0 && workConflicts . length > 0 && < br /> }
163
-
164
- { workConflicts . length > 0 && (
165
- < ul >
166
- { workConflicts . map ( ( message , index ) => (
167
- < li key = { index } >
168
- < span >
169
- < Trans > • { message } </ Trans >
170
- </ span >
171
- </ li >
172
- ) ) }
173
- </ ul >
174
- ) }
175
- < span > { t ( 'changeSearchCriteria' ) } </ span >
176
- </ div >
177
- ) }
178
- < div className = "osrd-config-item-container osrd-config-item-container-map map-results" >
179
- < DefaultBaseMap
180
- mapId = "stdcm-map-result"
181
- infraId = { infraId }
182
- geometry = { outputs ?. pathProperties ?. geometry }
183
- pathStepMarkers = { markersInfo }
184
- isFeasible = { ! hasConflictResults }
185
- />
186
- </ div >
187
- </ div >
188
- { isDebugMode && < StdcmDebugResults simulationOutputs = { outputs } /> }
189
+ { isDebugMode && < StdcmDebugResults simulationOutputs = { outputs } /> }
190
+ </ >
191
+ ) }
189
192
</ >
190
193
) ;
191
194
} ;
0 commit comments