- 
                Notifications
    You must be signed in to change notification settings 
- Fork 60
front: fix track_name on timetable for imported train #13771
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
base: dev
Are you sure you want to change the base?
Conversation
| CC'ing @Synar since she's worked on tracks in the output table. | 
aa5044e    to
    99ccfeb      
    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.
Nice!
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.
Good job!
fe84184    to
    79f0ede      
    Compare
  
    Signed-off-by: aschantraine <[email protected]>
79f0ede    to
    bee6d0e      
    Compare
  
    Signed-off-by: aschantraine <[email protected]>
| return ( | ||
| trackSections[trackReference.track_id]?.extensions?.sncf?.track_name ?? trackReference.track_id | ||
| ); | ||
| return trackSections[trackReference.track_id]?.extensions?.sncf?.track_name ?? '?'; | 
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.
Nit: in general I prefer to handle formatting concerns (in other words, how unknown/missing values should be presented to the user) in the JSX template rather than storing it in the trackName field.
Hm, that said, we already use undefined to mean "unspecified", so we'd need another value to mean "specified but not found". null wouldn't be very explicit and would be easy to confuse with undefined…
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.
So, what do you suggest ?  Since it’s going to change soon, maybe we should keep track_reference.id after all ?
Updates the
getTrackReferenceLabelfunction to accepttrackSectionsand use the SNCF extension'strack_nameinstead of the track ID when available, falling back to "?" otherwise.