-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Elevator Closures list #2288
Conversation
201dd6f
to
b290119
Compare
@@ -38,7 +38,7 @@ defmodule Screens.V2.ScreenData.Parameters do | |||
}, | |||
elevator_v2: %Static{ | |||
candidate_generator: CandidateGenerator.Elevator, | |||
refresh_rate: 30 | |||
refresh_rate: 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, is our "persistent" component logic actually tied to the data refresh rate? That seems less than ideal, but maybe just a refactoring opportunity to keep in mind for the future. (Suppose your screen consists almost entirely of a paging component, and you expect it to normally have at least two pages: it can only "really" refresh once all the paging is done, so you're doing at least twice as many data refreshes as you need to.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does currently, yes, and I just felt like it would be too far out of scope to adjust it here. Given that data refreshes are built into the framework, we may need to get around it by preventing it from refreshing at this level and adding data fetches to the widget component itself. Then where we call onFinish()
currently could be replaced by that fetch.
393a468
to
8b4c7d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good! A few more minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple (really one) small comments, but I say this looks ready to go!
}) do | ||
facility = Enum.find_value(entities, fn %{facility: facility} -> facility end) | ||
|
||
%{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we've defined ElevatorClosures.Closure
we could use it here instead of a plain map.
|> Map.fetch!(parent_station_id) | ||
|> Enum.map(&RoutePill.serialize_icon/1) | ||
|
||
%{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, with ElevatorClosures.Station
.
@digitalcora Just want to point out that I also tweaked the CSS so it uses compatible features. As of last night, the office screen now renders how we expect it to: |
This PR adds a simple list view of elevator closures throughout the system. It works very similarly to Pre-Fares except all dynamic paging is done on the client. The way I handled paging was to generate the pages before React drew anything on the screen and then switch to rendering these pages once it is done. This appears seamless and looks like it loads like any other screen. After all pages have been rendered, it executes a callback that tells React it is ready to replace it's data in the next refresh. The way I did this in code feels a little messy so please do suggest improvements.