Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ env.yml-original
.env
!configurations/test/env.yml
scripts/*client.json

# Vs code settings
.vscode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit I'd add a trailing slash here to make it clear it's a folder!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit could be a great marvel character, you may want to trademark that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in da2ba04

4 changes: 1 addition & 3 deletions lib/editor/selectors/timetable.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import objectPath from 'object-path'

import { getAbbreviatedStopName, getTableById } from '../util/gtfs'
import { isTimeFormat } from '../util/timetable'

import type {
GtfsStop,
Pattern,
TimetableColumn,
Trip
} from '../../types'

import type { AppState } from '../../types/reducers'
import type { EditorValidationIssue } from '../util/validation'

Expand Down Expand Up @@ -152,7 +150,7 @@ const isCellValueInvalid = (
let previousValue = null
let previousIndex = colIndex - 1
// Find previous stop time
while (previousValue === null && previousIndex >= 0) {
while (previousValue === null && previousIndex >= 0 && columns[previousIndex].type !== 'TEXT') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering whether we should check whether the previous column index is the last column index for non-stop-time trip data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, I changed the condition to only be if the type is ARRIVAL_TIME or DEPARTURE_TIME in 896ebe0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you'd prefer I guess we could find the index of the first stop time column and check based on that, but this seems simpler

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you did using ARRIVAL_TIME or DEPARTURE_TIME is good too!

const previousCol = columns[previousIndex]
previousValue = previousCol && row && objectPath.get(row, previousCol.key)
previousIndex--
Expand Down