-
Notifications
You must be signed in to change notification settings - Fork 55
Mobile batch results #339
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
Mobile batch results #339
Conversation
I marked this PR as blocked pending #337. |
@@ -71,6 +73,9 @@ const components = { | |||
? BatchRoutingPanel | |||
: DefaultMainPanel, | |||
MapWindows: isCallTakerModuleEnabled ? CallTakerWindows : null, | |||
MobileResultsScreen: isBatchRoutingEnabled |
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.
Add this component as a required component in the comment about the creation of the components
variable.
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.
Updated in e802be6.
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.
Approved pending resolution of 1 comment
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.
I think a few things might need some work, but this is headed in the right direction!
constructor () { | ||
super() | ||
this.state = { | ||
itineraryExpanded: false, |
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.
I'm not sure if it should be in this PR, but I'd like this itin expanded item to perhaps be moved to a UI query param. Might require some changes to the desktop view as well.
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.
I went ahead and added a URL parameter ui_itineraryView
in 3edc3d4 to replace passing props around to track the map expanded state.
// Set up two separate renderings of the map according to mapExpanded, | ||
// so that the map is properly sized and itineraries fit under either conditions. | ||
// (Otherwise, if just the narrative is added/removed, the map doesn't resize properly.) | ||
? this.renderMap() |
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.
Is it possible to have this transition be animated (transition animation to expand the map div and possibly remove the refresh on the map tiles and have a smoother zoom to itinerary)? I find the current approach kind of jarring.
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.
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.
I think you would have to reload the tiles anyway after expanding/collapsing the map because the zoom and fit would be different in either case.
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.
…eg as a prop to ItineraryBody c Both files were not passing setActiveLeg as a prop so I imported where necessary and passed in the prop. fix #338
The previous commit had a line of unused code. 338
Codecov Report
@@ Coverage Diff @@
## dev #339 +/- ##
========================================
- Coverage 9.78% 8.09% -1.69%
========================================
Files 115 193 +78
Lines 4078 7201 +3123
Branches 1077 1807 +730
========================================
+ Hits 399 583 +184
- Misses 3191 5712 +2521
- Partials 488 906 +418
Continue to review full report at Codecov.
|
@binh-dam-ibigroup I'm not sure if this is from recent changes, but when viewing a leg on the map and then clicking "Expand map" it momentarily flashes the list of options: Screen.Recording.2021-04-09.at.11.12.03.AM.mov |
Ugh side effect. Fixed in af9f653. |
activeStep: activeSearch && activeSearch.activeStep, | ||
errors: getResponsesWithErrors(state.otp), | ||
filter: state.otp.filter, |
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.
I'm not sure if this is needed any longer?
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.
Thanks, updated in 3f138bb.
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.
Looks pretty good! Just one comment on the filter
prop. Let's wait for @evansiroky's review to merge on Monday.
class BatchMobileResultsScreen extends Component { | ||
state = { | ||
// Holds the previous split view state | ||
previousSplitView: null |
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 this state property is always used in conjunction with a prop from the overall store, it might be cleaner to move this into the overall application state and also make the toggleMapExpanded
handler be an action. That way, this component can become a purely presentational component. This recommendation is non-blocking.
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.
Thanks, this simplies the UI component a good bit (43fef77).
_handleClick = () => { | ||
const { clearActiveSearch, setItineraryView, setMobileScreen } = this.props | ||
|
||
// Reset itinerary view state to show the list of results *before* clearing the search. | ||
// (Otherwise, if the map is expanded, the search is not cleared.) | ||
setItineraryView(uiActions.ItineraryView.LIST) | ||
clearActiveSearch() | ||
setMobileScreen(uiActions.MobileScreens.SEARCH_FORM) | ||
} |
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 would simplify this component a fair amount if this method were converted into a connected action. This comment in non-blocking.
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.
Thanks for the suggestion, updated in 43fef77.
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.
Just two non-blocking recommendations for improvement.
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR displays the list of itinerary options in mobile views when batch routing is enabled.
This PR builds upon #337. Behind the scenes, the code that renders headers and error screen is shared between the existing and new mobile result view and extracted into
itstheir own components.Also: A new
ui_itineraryView
URL parameter is added to reflect the itinerary expanded state, right now it is available only for mobile batch results.EDIT: Also fix #348.
Screenshot:
