-
Notifications
You must be signed in to change notification settings - Fork 136
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
DT-6175 part 4 #4937
DT-6175 part 4 #4937
Conversation
vesameskanen
commented
Jan 26, 2024
•
edited
Loading
edited
- Refactor Itinerary page jsx rendering by using shared code blocks, don't repeat same code again and again
- Remove duplicate query
- Shared wrapper for detail view
- Correct spinners while loading
- Correct notifiers and error messages
- Refactor planParamUtil and settings management
- Simplify
- Remove annoying ticket name comments from code
- remove if-else maze which exceeds human comprehension - put shered jsx into variables - move detail view tab wrapping to new component ItineraryTabs - remove redundant MobileItineraryWrapper
We want to keep code clean and readable, and use git for documenting change history.
All building blocks are now shared between mobile and desktop. Desktop view composition is defined in 24 code lines (was 243 lines).
Also, tune spinning for alt itinerary view
- remove strange duplicate and incorrect notifier - don't pass existing context fields as props - cleanup components
- add basic loading state because root props.loading sets lazily in refetch - define driving and biking props correctly for notifiers
app/component/ItineraryPage.js
Outdated
// show 6 bike + transit itineraries, preferably 3 of both kind. | ||
// If there is not enough of a kind, take more from the other kind |
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.
Why is this removed now?
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.
Strange. Must be some git merge thing. Restored now.
app/component/ItineraryPage.js
Outdated
this.setState({ | ||
loadingMore: reversed ? spinnerPosition.bottom : spinnerPosition.top, | ||
}); | ||
this.showScreenreaderLoadingAlert(); | ||
this.setState({ loadingMore: reversed ? 'bottom' : 'top' }); |
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.
Why do we go back to hardcoding strings here?
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.
Same as above. A bit worrying. Restored.
app/component/ItineraryPageUtils.js
Outdated
@@ -358,6 +360,8 @@ export function checkDayNight(iconId, timem, lat, lon) { | |||
return iconId; | |||
} | |||
|
|||
const streetLegModes = ['WALK', 'BICYCLE', 'CAR', 'SCOOTER']; |
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.
Spelling of these static helper variables could be STREET_LEG_MODES but not that important.
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.
done
No need to use a function returning function returning function, as amusing it is to maximize complexity. Improve names and remove duplicate parameter.