@@ -4,16 +4,14 @@ import { Position } from 'geojson';
4
4
import bbox from '@turf/bbox' ;
5
5
import { useTranslation } from 'react-i18next' ;
6
6
import { compact , isEqual } from 'lodash' ;
7
- import { BiCheckCircle , BiXCircle , BiErrorCircle } from 'react-icons/bi ' ;
7
+ import { GoAlert , GoCheckCircle , GoStop } from 'react-icons/go ' ;
8
8
9
9
import { setFailure } from 'reducers/main' ;
10
10
11
11
import { ArrayElement } from 'utils/types' ;
12
12
import { conditionalStringConcat , formatKmValue } from 'utils/strings' ;
13
- import { lengthFromLineCoordinates } from 'utils/geometry' ;
14
13
15
14
import { Path , PathQuery , osrdEditoastApi } from 'common/api/osrdEditoastApi' ;
16
- import { useModal } from 'common/BootstrapSNCF/ModalSNCF' ;
17
15
import { PointOnMap } from 'applications/operationalStudies/consts' ;
18
16
19
17
import {
@@ -31,8 +29,6 @@ import {
31
29
getPathfindingID ,
32
30
getGeojson ,
33
31
} from 'reducers/osrdconf/selectors' ;
34
-
35
- import ModalPathJSONDetail from 'modules/trainschedule/components/ManageTrainSchedule/Itinerary/ModalPathJSONDetail' ;
36
32
import infraLogo from 'assets/pictures/components/tracks.svg' ;
37
33
import InfraLoadingState from 'applications/operationalStudies/components/Scenario/InfraLoadingState' ;
38
34
import { Spinner } from '../Loader' ;
@@ -265,7 +261,6 @@ function Pathfinding({ zoomToFeature }: PathfindingProps) {
265
261
const { t } = useTranslation ( [ 'operationalStudies/manageTrainSchedule' ] ) ;
266
262
const [ pathfindingRequest , setPathfindingRequest ] =
267
263
useState < ReturnType < typeof postPathfinding > > ( ) ;
268
- const { openModal } = useModal ( ) ;
269
264
const dispatch = useDispatch ( ) ;
270
265
const infraID = useSelector ( getInfraID , isEqual ) ;
271
266
const origin = useSelector ( getOrigin , isEqual ) ;
@@ -345,7 +340,7 @@ function Pathfinding({ zoomToFeature }: PathfindingProps) {
345
340
const displayInfraSoftError = ( ) => (
346
341
< div className = "content pathfinding-error my-2" >
347
342
< span className = "lead" >
348
- < BiXCircle />
343
+ < GoStop />
349
344
</ span >
350
345
{ reloadCount <= 5 ? (
351
346
< span className = "flex-grow-1" > { t ( 'errorMessages.unableToLoadInfra' , { reloadCount } ) } </ span >
@@ -358,7 +353,7 @@ function Pathfinding({ zoomToFeature }: PathfindingProps) {
358
353
const displayInfraHardError = ( ) => (
359
354
< div className = "content pathfinding-error my-2" >
360
355
< span className = "lead" >
361
- < BiXCircle />
356
+ < GoStop />
362
357
</ span >
363
358
< span className = "flex-grow-1" > { t ( 'errorMessages.hardErrorInfra' ) } </ span >
364
359
</ div >
@@ -475,17 +470,6 @@ function Pathfinding({ zoomToFeature }: PathfindingProps) {
475
470
}
476
471
} , [ origin , destination , rollingStockID ] ) ;
477
472
478
- const pathDetailsToggleButton = (
479
- < button
480
- type = "button"
481
- onClick = { ( ) => openModal ( < ModalPathJSONDetail /> , 'lg' ) }
482
- className = "btn btn-link details"
483
- data-testid = "result-pathfinding-distance"
484
- >
485
- { formatKmValue ( lengthFromLineCoordinates ( geojson ?. geographic ?. coordinates ) ) }
486
- </ button >
487
- ) ;
488
-
489
473
const loaderPathfindingInProgress = (
490
474
< div className = "pathfinding-in-progress" >
491
475
< div className = "pathfinding-in-progress-card" >
@@ -543,18 +527,20 @@ function Pathfinding({ zoomToFeature }: PathfindingProps) {
543
527
{ pathfindingState . done && ! pathfindingState . error && (
544
528
< div className = "content pathfinding-done" >
545
529
< span className = "lead" >
546
- < BiCheckCircle />
530
+ < GoCheckCircle />
547
531
</ span >
548
532
< span className = "flex-grow-1" > { t ( 'pathfindingDone' ) } </ span >
549
- { pathDetailsToggleButton }
533
+ < small className = "text-secondary" >
534
+ { geojson ?. length && formatKmValue ( geojson ?. length / 1000 , 3 ) }
535
+ </ small >
550
536
</ div >
551
537
) }
552
538
{ pathfindingState . error && (
553
539
< div
554
540
className = { `content pathfinding-error ${ infra && infra . state !== 'CACHED' && 'mt-2' } ` }
555
541
>
556
542
< span className = "lead" >
557
- < BiXCircle />
543
+ < GoStop />
558
544
</ span >
559
545
< span className = "flex-grow-1" >
560
546
{ t ( 'pathfindingError' , { errorMessage : t ( pathfindingState . error ) } ) }
@@ -564,7 +550,7 @@ function Pathfinding({ zoomToFeature }: PathfindingProps) {
564
550
{ pathfindingState . missingParam && (
565
551
< div className = "content missing-params" >
566
552
< span className = "lead" >
567
- < BiErrorCircle />
553
+ < GoAlert />
568
554
</ span >
569
555
< span className = "flex-grow-1" >
570
556
{ t ( 'pathfindingMissingParams' , { missingElements } ) }
0 commit comments