Skip to content

Conversation

@philip-cline
Copy link
Contributor

@philip-cline philip-cline commented Mar 16, 2022

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

Currently, naming a trip ID (or filling any other text field) with a number greater than the start time of the first arrival time produces a validation error in the UI since validation takes place for all columns left of the stop time. This PR adds a condition to only check columns that are not of type 'TEXT'.

The PR also adds VS code settings.json to the .gitignore file, which I hope won't be controversial.

Issue screenshot:
image

Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

I can't believe this was the fix... well done figuring it out!

.gitignore Outdated
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

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

It would be nice of the validation ignored the first few columns instead, but as written it is fine.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants