Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex: Timetable Editor: Support Flex stop times allowing multiple stop times to have the same times #1008

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/editor/actions/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function getCloneProps (entityId: number, component: string, state: AppState) {
patternId: newPatternId,
shapeId: newShapeId,
shapePoints: pattern.shapePoints.map(sp => ({...sp, shapeId: newShapeId})),
patternStopAreas: pattern.stopAreas.map(area => ({...area, patternId: newPatternId})),
patternStopAreas: pattern.stopAreas && pattern.stopAreas.map(area => ({...area, patternId: newPatternId})),
patternLocations: pattern.patternLocations.map(pl => ({...pl, patternId: newPatternId})),
patternStops: pattern.patternStops.map(ps => ({...ps, patternId: newPatternId}))
}
Expand Down
3 changes: 2 additions & 1 deletion lib/editor/selectors/timetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const isCellValueInvalid = (
tripIds: Array<string>
): ?EditorValidationIssue => {
const col = columns[colIndex]
const isFlexInvolved = columns.some(isFlexStopTime)

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