From 0d9c95632cba0932fa354c48ffaf194ffff7c2c9 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Fri, 16 Feb 2024 14:34:10 -0500 Subject: [PATCH 1/2] allow stop times with same times for flex --- lib/editor/selectors/timetable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/editor/selectors/timetable.js b/lib/editor/selectors/timetable.js index 643a9b7a5..9b6b9c5a3 100644 --- a/lib/editor/selectors/timetable.js +++ b/lib/editor/selectors/timetable.js @@ -157,6 +157,7 @@ const isCellValueInvalid = ( tripIds: Array ): ?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. @@ -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, From d5b20c8cec37deae91394d56b496168e7e0379aa Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Tue, 20 Feb 2024 12:25:57 -0500 Subject: [PATCH 2/2] prevent crash --- lib/editor/actions/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/editor/actions/editor.js b/lib/editor/actions/editor.js index aa1250b74..cd3c15c58 100644 --- a/lib/editor/actions/editor.js +++ b/lib/editor/actions/editor.js @@ -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})) }