1
1
import { useState , useEffect } from 'react' ;
2
2
3
- import { ChevronLeft , ChevronRight , Eye , EyeClosed , Pencil } from '@osrd-project/ui-icons' ;
3
+ import { ChevronLeft , ChevronRight , Pencil } from '@osrd-project/ui-icons' ;
4
4
import cx from 'classnames' ;
5
5
import { useTranslation } from 'react-i18next' ;
6
6
import { GiElectric } from 'react-icons/gi' ;
@@ -138,17 +138,31 @@ const Scenario = () => {
138
138
>
139
139
< div className = "scenario-sidemenu" >
140
140
{ scenario && (
141
- < div className = "scenario-details" >
141
+ < div >
142
142
< div className = "scenario-details-name" >
143
143
< span
144
144
className = "flex-grow-1 scenario-name text-truncate"
145
145
title = { scenario . name }
146
146
>
147
147
{ scenario . name }
148
148
</ span >
149
+ </ div >
150
+
151
+ < div className = "scenario-description-collapsed" >
152
+ < div className = "scenario-details-description" > { scenario . description } </ div >
153
+ < div >
154
+ < button
155
+ type = "button"
156
+ className = "scenario-details-modify-button"
157
+ aria-label = { t ( 'toggleTimetable' ) }
158
+ onClick = { ( ) => setCollapsedTimetable ( true ) }
159
+ >
160
+ < ChevronLeft />
161
+ </ button >
162
+ </ div >
149
163
< button
150
164
data-testid = "editScenario"
151
- className = "scenario-details-modify-button"
165
+ className = "scenario-details-modify-button update-scenario "
152
166
type = "button"
153
167
aria-label = { t ( 'editScenario' ) }
154
168
onClick = { ( ) =>
@@ -162,43 +176,19 @@ const Scenario = () => {
162
176
>
163
177
< Pencil />
164
178
</ button >
165
- < button
166
- type = "button"
167
- className = "scenario-details-modify-button"
168
- onClick = { ( ) => setTrainsWithDetails ( ! trainsWithDetails ) }
169
- title = { t ( 'displayTrainsWithDetails' ) }
170
- >
171
- { trainsWithDetails ? < EyeClosed /> : < Eye /> }
172
- </ button >
173
- < button
174
- type = "button"
175
- className = "scenario-details-modify-button"
176
- aria-label = { t ( 'toggleTimetable' ) }
177
- onClick = { ( ) => setCollapsedTimetable ( true ) }
178
- >
179
- < ChevronLeft />
180
- </ button >
181
179
</ div >
182
- < div className = "row" >
183
- < div className = "col-md-6" >
184
- < div className = "scenario-details-infra-name" >
185
- < img src = { infraLogo } alt = "Infra logo" className = "infra-logo mr-2" />
186
- { infra && < InfraLoadingState infra = { infra } /> }
187
- < span className = "scenario-infra-name" > { scenario . infra_name } </ span >
188
- < small className = "ml-auto text-muted" > ID { scenario . infra_id } </ small >
189
- </ div >
190
- </ div >
191
- < div className = "col-md-6" >
192
- < div className = "scenario-details-electrical-profile-set" >
193
- < span className = "mr-2" >
194
- < GiElectric />
195
- </ span >
196
- { scenario . electrical_profile_set_id
197
- ? scenario . electrical_profile_set_id
198
- : t ( 'noElectricalProfileSet' ) }
199
- </ div >
200
- </ div >
180
+
181
+ < div className = "scenario-details-electrical-profile-set" >
182
+ { scenario . electrical_profile_set_id
183
+ ? scenario . electrical_profile_set_id
184
+ : t ( 'noElectricalProfileSet' ) }
201
185
</ div >
186
+
187
+ < div className = "scenario-details-infra-name" >
188
+ { t ( 'infrastructure' ) } : { infra && < InfraLoadingState infra = { infra } /> }
189
+ { scenario . infra_name } | ID { scenario . infra_id }
190
+ </ div >
191
+
202
192
{ infra &&
203
193
infra . state === 'TRANSIENT_ERROR' &&
204
194
( reloadCount <= 5 ? (
@@ -215,7 +205,6 @@ const Scenario = () => {
215
205
{ t ( 'errorMessages.hardErrorInfra' ) }
216
206
</ div >
217
207
) }
218
- < div className = "scenario-details-description" > { scenario . description } </ div >
219
208
</ div >
220
209
) }
221
210
< MicroMacroSwitch isMacro = { isMacro } setIsMacro = { toggleMicroMacroButton } />
0 commit comments