-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add scooter stop fallback message #767
base: next
Are you sure you want to change the base?
Conversation
|
@hbruch Could you please define a condition for exactly when should we use the fallback message? The easiest case (which the original ticket mentioned) is when there is no |
Why not only show " station". Maybe we have to decide per network, if station.name is useful to display |
<div className="selected-stop-header">{stop.name}</div> | ||
<div className="selected-stop-header"> | ||
{!stop.name || stop.networks[0] === 'tier_REUTLINGEN' ? ( | ||
<FormattedMessage |
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.
We should not use network specific code here. Is there a way to deduce the vehicleType from the stop and use a vehicleType specific message?
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 used this solution because originally the popup should show the name
of the actual stop - but in case of this network, the name
is an incomprehensible number code. If we'd use any other condition, this process will change. Should we refactor this anyway and do not use the name
(not at any stop popup) but display a message based on the vehicle type?
@@ -19,6 +19,10 @@ BikeRentalStationPageMapContainer.propTypes = { | |||
lat: PropTypes.number.isRequired, | |||
lon: PropTypes.number.isRequired, | |||
name: PropTypes.string, | |||
networks: PropTypes.oneOfType([ | |||
PropTypes.string, |
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.
When will networks be string, when array?
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's always a string array. When it has only one element, it can be handled as a string.
ae2cc89
to
4976661
Compare
Depending on #774. Needs refactoring after the merge of that. |
Proposed Changes
networks
propertystation.networks
ifstation.name
is not given or if the network istier-reutlingen
Pull Request Check List
Review
Closes #760