Skip to content

Commit aa2315c

Browse files
Merge pull request #1008 from ibi-group/fix-flex-timetable-editor
Flex: Timetable Editor: Support Flex stop times allowing multiple stop times to have the same times
2 parents facb8cc + d5b20c8 commit aa2315c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/editor/actions/editor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function getCloneProps (entityId: number, component: string, state: AppState) {
7777
patternId: newPatternId,
7878
shapeId: newShapeId,
7979
shapePoints: pattern.shapePoints.map(sp => ({...sp, shapeId: newShapeId})),
80-
patternStopAreas: pattern.stopAreas.map(area => ({...area, patternId: newPatternId})),
80+
patternStopAreas: pattern.stopAreas && pattern.stopAreas.map(area => ({...area, patternId: newPatternId})),
8181
patternLocations: pattern.patternLocations.map(pl => ({...pl, patternId: newPatternId})),
8282
patternStops: pattern.patternStops.map(ps => ({...ps, patternId: newPatternId}))
8383
}

lib/editor/selectors/timetable.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const isCellValueInvalid = (
157157
tripIds: Array<string>
158158
): ?EditorValidationIssue => {
159159
const col = columns[colIndex]
160+
const isFlexInvolved = columns.some(isFlexStopTime)
160161

161162
if (isTimeFormat(col.type)) {
162163
// FIXME: This does not yet support validating frequency start/end times.
@@ -176,7 +177,7 @@ const isCellValueInvalid = (
176177
// Ensure value is increasing over previous value
177178
// Flexible stop times (because intra zonal trips are represented by a duplicate stop time) can
178179
// include the same start and end pickup times back to back and so must avoid this check.
179-
const isInvalid = !isFlexStopTime(col) && val < previousValue
180+
const isInvalid = !isFlexInvolved && val < previousValue
180181
return isInvalid
181182
? {
182183
field: col.key,

0 commit comments

Comments
 (0)