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

Remove OTP1 Stop Time Filtering #994

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ exports[`components > viewers > stop viewer should render countdown times after
>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:20:1:04"
pattern={
Object {
"desc": "20 to Gresham Transit Center (TriMet:8199) from Beaverton Transit Center (TriMet:9978) express",
Expand Down Expand Up @@ -3924,6 +3925,7 @@ exports[`components > viewers > stop viewer should render countdown times for st
</p>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:20:1:04"
pattern={
Object {
"desc": "20 to Gresham Transit Center (TriMet:8199) from Beaverton Transit Center (TriMet:9978) express",
Expand Down Expand Up @@ -6031,6 +6033,7 @@ exports[`components > viewers > stop viewer should render times after midnight w
</p>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:20:1:04"
pattern={
Object {
"desc": "20 to Gresham Transit Center (TriMet:8199) from Beaverton Transit Center (TriMet:9978) express",
Expand Down Expand Up @@ -9803,6 +9806,7 @@ exports[`components > viewers > stop viewer should render with OTP transit index
</p>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:20:1:04"
pattern={
Object {
"desc": "20 to Gresham Transit Center (TriMet:8199) from Beaverton Transit Center (TriMet:9978) express",
Expand Down Expand Up @@ -10642,6 +10646,7 @@ exports[`components > viewers > stop viewer should render with OTP transit index
</p>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:94:0:04"
pattern={
Object {
"desc": "94 to SW Railroad & Washington (TriMet:3670) from W Burnside & SW 8th (TriMet:715)",
Expand Down Expand Up @@ -11467,6 +11472,7 @@ exports[`components > viewers > stop viewer should render with OTP transit index
</injectIntl(PatternRow)>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:94:0:02"
pattern={
Object {
"desc": "94 to SW Pacific Hwy & Durham (TriMet:8644) from W Burnside & SW 8th (TriMet:715)",
Expand Down Expand Up @@ -12184,6 +12190,7 @@ exports[`components > viewers > stop viewer should render with OTP transit index
</injectIntl(PatternRow)>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:36:0:04"
pattern={
Object {
"desc": "36 to Tualatin Park & Ride (TriMet:7879) from W Burnside & SW 8th (TriMet:715)",
Expand Down Expand Up @@ -16861,6 +16868,7 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
</p>
<injectIntl(PatternRow)
homeTimezone="America/Los_Angeles"
key="TriMet:20:1:04"
pattern={
Object {
"desc": "20 to Gresham Transit Center (TriMet:8199) from Beaverton Transit Center (TriMet:9978) express",
Expand Down
1 change: 1 addition & 0 deletions lib/components/viewers/live-stop-times.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class LiveStopTimes extends Component<Props, State> {
this.renderDay(homeTimezone, time.day, now)}
<PatternRow
homeTimezone={homeTimezone}
key={pattern.id}
miles-grant-ibigroup marked this conversation as resolved.
Show resolved Hide resolved
pattern={pattern}
route={{
...route,
Expand Down
5 changes: 1 addition & 4 deletions lib/util/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,8 @@ export function getStopTimesByPattern(stopData) {
times: []
}
}
// Exclude the last stop, as the stop viewer doesn't show arrival times to a terminus stop.
const filteredTimes = times.filter(excludeLastStop)
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup Sep 12, 2023

Choose a reason for hiding this comment

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

This change results in the display of arrival times (in addition to departures) at terminal stops. Per our discussion, this is not desired.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't replicate this. Do you have any examples?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok never mind I can see it on some bus routes where the last stop of one pattern is not identical to the first stop of another. Looking at the behavior I am not against that


stopTimesByPattern[id].times =
stopTimesByPattern[id].times.concat(filteredTimes)
stopTimesByPattern[id].times = stopTimesByPattern[id].times.concat(times)
})
}
return stopTimesByPattern
Expand Down