Skip to content

Conversation

@binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Dec 22, 2020

This PR is in response to #292 (comment) and does the following refactors:

  • Moves the code to draw a status label from utils/viewer into a new BaseStatusLabel component.
  • Refactors code for determining on-time/late/... trip status common to BaseStatusLabel and RealTimeTimeColumn.
  • Simplifies RealTimeTimeColumn render code.

Copy link
Member

@landonreed landonreed left a comment

Choose a reason for hiding this comment

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

This generally looks pretty good, but there were some opportunities for encapsulating this logic a bit more into the label component. I was having trouble expressing, so I just made a PR: #296.

@landonreed landonreed removed their assignment Jan 5, 2021
Comment on lines +177 to +186
if (delaySeconds > 60) {
// late departure
return REALTIME_STATUS.LATE
} else if (delaySeconds < -60) {
// early departure
return REALTIME_STATUS.EARLY
} else {
// on-time departure
return REALTIME_STATUS.ON_TIME
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider basing this PR off of #305 and then refactor this function so that it uses the configurable on-time threshold.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, since #305 was introduced after the latest commit here, I think it might be unfair to request this. Therefore, I'm going to merge this and make #305 dependent on this.

@evansiroky evansiroky merged commit 724e979 into dev Jan 26, 2021
evansiroky added a commit that referenced this pull request Jan 26, 2021
This refactors so that changes from #294 are included.
@evansiroky evansiroky mentioned this pull request Mar 31, 2021
@github-actions
Copy link
Contributor

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@binh-dam-ibigroup binh-dam-ibigroup deleted the trip-status-label branch December 18, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants