Skip to content

Commit f2254a1

Browse files
committed
front: remove opScheduleTimeType props from StdcmOpScheduleProps
Signed-off-by: Clara Ni <[email protected]>
1 parent bc8b353 commit f2254a1

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

front/src/applications/stdcm/components/StdcmForm/StdcmDestination.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const StdcmDestination = ({ disabled = false }: StdcmConfigCardProps) => {
4343
<StdcmOpSchedule
4444
pathStep={destination}
4545
opTimingData={destinationArrival}
46-
opScheduleTimeType={destination.arrivalType}
4746
disabled={disabled}
4847
opId="destination-arrival"
4948
/>

front/src/applications/stdcm/components/StdcmForm/StdcmOpSchedule.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type { ArrivalTimeTypes, ScheduleConstraint } from '../../types';
1616
type StdcmOpScheduleProps = {
1717
disabled: boolean;
1818
pathStep: Extract<StdcmPathStep, { isVia: false }>;
19-
opScheduleTimeType: ArrivalTimeTypes;
2019
opTimingData?: {
2120
date: Date;
2221
arrivalDate: string;
@@ -38,7 +37,6 @@ const StdcmOpSchedule = ({
3837
disabled,
3938
pathStep,
4039
opTimingData,
41-
opScheduleTimeType,
4240
opId,
4341
isOrigin = false,
4442
}: StdcmOpScheduleProps) => {
@@ -113,22 +111,22 @@ const StdcmOpSchedule = ({
113111
if (
114112
(!isArrivalDateInSearchTimeWindow(arrivalDate, searchDatetimeWindow) ||
115113
!opTimingData?.arrivalDate) &&
116-
opScheduleTimeType === 'preciseTime'
114+
pathStep.arrivalType === 'preciseTime'
117115
) {
118116
onArrivalChange({
119117
date: defaultDate(searchDatetimeWindow?.begin),
120118
hours: arrivalTimeHours || 0,
121119
minutes: arrivalTimeMinutes || 0,
122120
});
123121
}
124-
}, [searchDatetimeWindow, opScheduleTimeType]);
122+
}, [searchDatetimeWindow, pathStep.arrivalType]);
125123

126124
return (
127125
<>
128126
<div className="arrival-type-select">
129127
<Select
130128
id={`select-${opId}`}
131-
value={opScheduleTimeType}
129+
value={pathStep.arrivalType}
132130
onChange={(e) => {
133131
if (e) {
134132
onArrivalTypeChange(e as ArrivalTimeTypes);
@@ -143,7 +141,7 @@ const StdcmOpSchedule = ({
143141
disabled={disabled}
144142
/>
145143
</div>
146-
{opScheduleTimeType === 'preciseTime' && (
144+
{pathStep.arrivalType === 'preciseTime' && (
147145
<div className="schedule">
148146
<DatePicker
149147
inputProps={{

front/src/applications/stdcm/components/StdcmForm/StdcmOrigin.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const StdcmOrigin = ({ disabled = false }: StdcmConfigCardProps) => {
4242
<StdcmOpSchedule
4343
pathStep={origin}
4444
opTimingData={originArrival}
45-
opScheduleTimeType={origin.arrivalType}
4645
disabled={disabled}
4746
opId="origin-arrival"
4847
isOrigin

0 commit comments

Comments
 (0)