1
1
import { ChevronLeft , Pencil } from '@osrd-project/ui-icons' ;
2
2
import { useTranslation } from 'react-i18next' ;
3
- import { GiElectric } from 'react-icons/gi' ;
4
3
5
4
import InfraLoadingState from 'applications/operationalStudies/components/Scenario/InfraLoadingState' ;
6
- import infraLogo from 'assets/pictures/components/tracks.svg' ;
7
5
import type { InfraWithState , ScenarioResponse } from 'common/api/osrdEditoastApi' ;
8
6
import { useModal } from 'common/BootstrapSNCF/ModalSNCF' ;
9
7
import AddAndEditScenarioModal from 'modules/scenario/components/AddOrEditScenarioModal' ;
@@ -25,14 +23,30 @@ const ScenarioDescription = ({
25
23
const { openModal } = useModal ( ) ;
26
24
27
25
return (
28
- < div className = "scenario-details" >
26
+ < div >
29
27
< div className = "scenario-details-name" >
30
28
< span className = "flex-grow-1 scenario-name text-truncate" title = { scenario . name } >
31
29
{ scenario . name }
32
30
</ span >
31
+ </ div >
32
+
33
+ < div className = "scenario-description" >
34
+ { scenario . description && (
35
+ < div className = "scenario-details-description" > { scenario . description } </ div >
36
+ ) }
37
+ < div className = "flex justify-end" >
38
+ < button
39
+ type = "button"
40
+ className = "scenario-collapse-button"
41
+ aria-label = { t ( 'toggleTimetable' ) }
42
+ onClick = { ( ) => collapseTimetable ( ) }
43
+ >
44
+ < ChevronLeft />
45
+ </ button >
46
+ </ div >
33
47
< button
34
48
data-testid = "editScenario"
35
- className = "scenario-details-modify-button "
49
+ className = "update-scenario "
36
50
type = "button"
37
51
aria-label = { t ( 'editScenario' ) }
38
52
onClick = { ( ) =>
@@ -46,34 +60,17 @@ const ScenarioDescription = ({
46
60
>
47
61
< Pencil />
48
62
</ button >
49
- < button
50
- type = "button"
51
- className = "scenario-details-modify-button"
52
- aria-label = { t ( 'toggleTimetable' ) }
53
- onClick = { ( ) => collapseTimetable ( ) }
54
- >
55
- < ChevronLeft />
56
- </ button >
57
63
</ div >
58
- < div className = "row" >
59
- < div className = "col-md-6" >
60
- < div className = "scenario-details-infra-name" >
61
- < img src = { infraLogo } alt = "Infra logo" className = "infra-logo mr-2" />
62
- { infra && < InfraLoadingState infra = { infra } /> }
63
- < span className = "scenario-infra-name" > { scenario . infra_name } </ span >
64
- < small className = "ml-auto text-muted" > ID { scenario . infra_id } </ small >
65
- </ div >
66
- </ div >
67
- < div className = "col-md-6" >
68
- < div className = "scenario-details-electrical-profile-set" >
69
- < span className = "mr-2" >
70
- < GiElectric />
71
- </ span >
72
- { scenario . electrical_profile_set_id
73
- ? scenario . electrical_profile_set_id
74
- : t ( 'noElectricalProfileSet' ) }
75
- </ div >
76
- </ div >
64
+ < div className = "scenario-details-electrical-profile-set" >
65
+ { scenario . electrical_profile_set_id
66
+ ? scenario . electrical_profile_set_id
67
+ : t ( 'noElectricalProfileSet' ) }
68
+ </ div >
69
+
70
+ < div className = "scenario-details-infra-name" >
71
+ { t ( 'infrastructure' ) } : { infra && < InfraLoadingState infra = { infra } /> }
72
+ < span className = "scenario-infra-name" > { scenario . infra_name } </ span > | ID{ ' ' }
73
+ { scenario . infra_id }
77
74
</ div >
78
75
{ infra &&
79
76
infra . state === 'TRANSIENT_ERROR' &&
@@ -89,7 +86,6 @@ const ScenarioDescription = ({
89
86
{ infra && infra . state === 'ERROR' && (
90
87
< div className = "scenario-details-infra-error mt-1" > { t ( 'errorMessages.hardErrorInfra' ) } </ div >
91
88
) }
92
- < div className = "scenario-details-description" > { scenario . description } </ div >
93
89
</ div >
94
90
) ;
95
91
} ;
0 commit comments