Skip to content

Commit b5d4237

Browse files
authored
Merge pull request #772 from ibi-group/fix-timetable-validation
Fix timetable previous stop time checks from checking text columns.
2 parents a93ea0e + 896ebe0 commit b5d4237

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ env.yml-original
2828
.env
2929
!configurations/test/env.yml
3030
scripts/*client.json
31+
32+
# Vs code settings
33+
.vscode/

lib/editor/selectors/timetable.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import objectPath from 'object-path'
44

55
import { getAbbreviatedStopName, getTableById } from '../util/gtfs'
66
import { isTimeFormat } from '../util/timetable'
7-
87
import type {
98
GtfsStop,
109
Pattern,
1110
TimetableColumn,
1211
Trip
1312
} from '../../types'
14-
1513
import type { AppState } from '../../types/reducers'
1614
import type { EditorValidationIssue } from '../util/validation'
1715

@@ -152,7 +150,7 @@ const isCellValueInvalid = (
152150
let previousValue = null
153151
let previousIndex = colIndex - 1
154152
// Find previous stop time
155-
while (previousValue === null && previousIndex >= 0) {
153+
while (previousValue === null && previousIndex >= 0 && (columns[previousIndex].type === 'ARRIVAL_TIME' || columns[previousIndex].type === 'DEPARTURE_TIME')) {
156154
const previousCol = columns[previousIndex]
157155
previousValue = previousCol && row && objectPath.get(row, previousCol.key)
158156
previousIndex--

0 commit comments

Comments
 (0)