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,67 +138,57 @@ const Scenario = () => {
138
138
>
139
139
< div className = "scenario-sidemenu" >
140
140
{ scenario && (
141
- < div className = "scenario-details " >
141
+ < div className = "scenario-top " >
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
- < button
150
- data-testid = "editScenario"
151
- className = "scenario-details-modify-button"
152
- type = "button"
153
- aria-label = { t ( 'editScenario' ) }
154
- onClick = { ( ) =>
155
- openModal (
156
- < AddAndEditScenarioModal editionMode scenario = { scenario } /> ,
157
- 'xl' ,
158
- 'no-close-modal'
159
- )
160
- }
161
- title = { t ( 'editScenario' ) }
162
- >
163
- < Pencil />
164
- </ 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
149
</ 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 >
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 >
200
162
</ div >
201
163
</ div >
164
+ < button
165
+ data-testid = "editScenario"
166
+ className = "scenario-details-modify-button update-scenario"
167
+ type = "button"
168
+ aria-label = { t ( 'editScenario' ) }
169
+ onClick = { ( ) =>
170
+ openModal (
171
+ < AddAndEditScenarioModal editionMode scenario = { scenario } /> ,
172
+ 'xl' ,
173
+ 'no-close-modal'
174
+ )
175
+ }
176
+ title = { t ( 'editScenario' ) }
177
+ >
178
+ < Pencil />
179
+ </ button >
180
+
181
+ < div className = "scenario-details-electrical-profile-set" >
182
+ { scenario . electrical_profile_set_id
183
+ ? scenario . electrical_profile_set_id
184
+ : t ( 'noElectricalProfileSet' ) }
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