Commit 6d27f72 1 parent 5456f71 commit 6d27f72 Copy full SHA for 6d27f72
File tree 3 files changed +8
-10
lines changed
front/src/modules/trainschedule/components/Timetable
3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import {
33
33
34
34
import PacedTrainItem from './PacedTrain/PacedTrainItem' ;
35
35
import TimetableToolbar from './TimetableToolbar' ;
36
- import TimetableTrainCard from './TimetableTrainCard ' ;
36
+ import TrainScheduleItem from './TrainScheduleItem ' ;
37
37
import type { PacedTrainWithResult , TimetableItemResult , TrainScheduleWithDetails } from './types' ;
38
38
39
39
type TimetableProps = {
@@ -95,9 +95,7 @@ const Timetable = ({
95
95
const handleSelectTimetableItem = useCallback (
96
96
( id : TimetableItemId ) => {
97
97
const itemType = isTrainSchedule ( id ) ? 'trainScheduleIds' : 'pacedTrainIds' ;
98
-
99
- // TODO Paced train : Adapt this to handle paced trains in issue https://github.com/OpenRailAssociation/osrd/issues/10615
100
- const currentSelectedTrainIds = [ ...selectedTimetableItemIds [ itemType ] ] ;
98
+ const currentSelectedTrainIds : TimetableItemId [ ] = selectedTimetableItemIds [ itemType ] ;
101
99
const index = currentSelectedTrainIds . indexOf ( id as TrainScheduleId ) ;
102
100
103
101
if ( index === - 1 ) {
@@ -218,7 +216,7 @@ const Timetable = ({
218
216
{ /* TODO Paced train : Adapt this to handle paced trains in issue
219
217
https://github.com/OpenRailAssociation/osrd/issues/10615 */ }
220
218
{ isTrainSchedule ( timetableItem . id ) ? (
221
- < TimetableTrainCard
219
+ < TrainScheduleItem
222
220
isInSelection = { selectedTimetableItemIds . trainScheduleIds . includes (
223
221
timetableItem . id
224
222
) }
Original file line number Diff line number Diff line change @@ -102,7 +102,6 @@ const TimetableToolbar = ({
102
102
if ( displayedTimetableItems . length === [ ...trainScheduleIds , ...pacedTrainIds ] . length ) {
103
103
setSelectedTimetableItemIds ( { trainScheduleIds : [ ] , pacedTrainIds : [ ] } ) ;
104
104
} else {
105
- // TODO Paced train : Adapt this to handle delete paced trains in issue https://github.com/OpenRailAssociation/osrd/issues/10615
106
105
const timetableItemsDisplayed = displayedTimetableItems . reduce (
107
106
( acc , { id } ) => {
108
107
if ( isTrainSchedule ( id ) ) {
@@ -241,6 +240,7 @@ const TimetableToolbar = ({
241
240
label = { t ( 'timetable.export' ) }
242
241
title = { t ( 'timetable.exportSelection' ) }
243
242
type = "button"
243
+ // TODO PACED TRAIN: https://github.com/OpenRailAssociation/osrd/issues/10614
244
244
onClick = { ( ) => exportTrainSchedules ( trainScheduleIds ) }
245
245
/>
246
246
</ div >
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import {
30
30
import TimetableItemActions from './TimetableItemActions' ;
31
31
import type { TrainScheduleWithDetails } from './types' ;
32
32
33
- type TimetableTrainCardProps = {
33
+ type TrainScheduleItemProps = {
34
34
isInSelection : boolean ;
35
35
train : TrainScheduleWithDetails ;
36
36
isSelected : boolean ;
@@ -46,7 +46,7 @@ type TimetableTrainCardProps = {
46
46
const formatFullDate = ( d : Date ) => dayjs ( d ) . format ( 'D/MM/YYYY HH:mm:ss' ) ;
47
47
const formatDateHours = ( d : Date ) => dayjs ( d ) . format ( 'HH:mm' ) ;
48
48
49
- const TimetableTrainCard = ( {
49
+ const TrainScheduleItem = ( {
50
50
isInSelection,
51
51
train,
52
52
isSelected,
@@ -57,7 +57,7 @@ const TimetableTrainCard = ({
57
57
projectionPathIsUsed,
58
58
dtoImport,
59
59
selectTrainToEdit,
60
- } : TimetableTrainCardProps ) => {
60
+ } : TrainScheduleItemProps ) => {
61
61
const { t } = useTranslation ( [ 'operationalStudies/scenario' ] ) ;
62
62
const dispatch = useAppDispatch ( ) ;
63
63
@@ -278,4 +278,4 @@ const TimetableTrainCard = ({
278
278
) ;
279
279
} ;
280
280
281
- export default React . memo ( TimetableTrainCard ) ;
281
+ export default React . memo ( TrainScheduleItem ) ;
You can’t perform that action at this time.
0 commit comments